~inkscape.dev/inkscape/RELEASE_0_40_BRANCH

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.50)
AC_INIT(inkscape, 0.40)
dnl N.B. After 0.40, please change to `0.40+cvs' instead of `0.41cvs'.
dnl Rationale: (i) placate simple version comparison software such as
dnl `dpkg --compare-versions'.  (ii) We don't always know what the next
dnl version is going to be called until about the time we release it
dnl (whereas we always know what the previous version was called).
AC_CANONICAL_HOST
AC_CONFIG_SRCDIR(src/main.cpp)
AM_INIT_AUTOMAKE

AM_CONFIG_HEADER(config.h)

AC_PROG_INTLTOOL(0.22)

AC_LANG(C++)
AC_ISC_POSIX
AC_PROG_CXX
AM_PROG_CC_STDC
AM_PROG_AS
AC_HEADER_STDC

dnl Honor aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

dnl RANLIB is outdated now
dnl AC_PROG_RANLIB
AM_PROG_LIBTOOL

dnl Verify our GCC version
if test "x$GXX" = "xyes"; then
	AC_MSG_CHECKING([GNU compiler version])

	cc_version=["`$CXX $CXXFLAGS -v 2>&1 </dev/null |grep 'gcc version' |\
		sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"]

	AC_MSG_RESULT([$cc_version])

	# Some version numbers
	cc_vers_major=`echo $cc_version | cut -f1 -d.`
	cc_vers_minor=`echo $cc_version | cut -f2 -d.`
	cc_vers_patch=`echo $cc_version | cut -f3 -d.`
	test -n "$cc_vers_major" || cc_vers_major=0
	test -n "$cc_vers_minor" || cc_vers_minor=0
	test -n "$cc_vers_patch" || cc_vers_patch=0
	cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch`

	if test $cc_vers_major -lt 3; then
		AC_MSG_ERROR([gcc >= 3.0 is needed to compile inkscape])
	fi
fi

dnl ******************************
dnl Gettext stuff
dnl ******************************
GETTEXT_PACKAGE="$PACKAGE_NAME"
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Translation domain used])
dnl Add the languages which your application supports here.
ALL_LINGUAS="am az be ca cs da de el es es_MX et fr ga gl hu it ja nb nl nn ru sk sl sr sr@Latn sv tr uk pl pt_BR pt zh_CN"
AM_GLIB_GNU_GETTEXT

AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
	AC_MSG_ERROR(You have to install pkg-config to compile inkscape.)
fi

AC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no)], png_ok=no, -lz -lm)
if test "x$png_ok" != "xyes"; then
	AC_MSG_ERROR([libpng >= 1.2 is needed to compile inkscape])
fi

AC_CHECK_LIB(gc, GC_malloc, [AC_CHECK_HEADERS([gc.h gc/gc.h], [gc_ok=yes; break], gc_ok=no)], gc_ok=no, -lpthread -ldl)
if test "x$gc_ok" != "xyes"; then
	AC_MSG_ERROR([libgc (the Boehm Conservative Collector), is needed to compile inkscape])
fi
LIBS="$LIBS -lgc"

AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
if test "x$FREETYPE_CONFIG" = "xno"; then
	AC_MSG_ERROR([Cannot find freetype-config])
fi
FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
AC_SUBST(FREETYPE_CFLAGS)
AC_SUBST(FREETYPE_LIBS)

dnl ******************************
dnl Win32
dnl ******************************
AC_MSG_CHECKING([for Win32 platform])
case "$host" in
  *-*-mingw*)
    platform_win32=yes
    INKSCAPE_CFLAGS="$INKSCAPE_CFLAGS -mms-bitfields -DLIBXML_STATIC"
    ;;
  *)
    platform_win32=no
    ;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")

dnl ******************************
dnl Xft checking
dnl ******************************

AC_ARG_WITH(xft,
            AC_HELP_STRING([--with-xft], [use xft scalable font database (default is auto)]),
            [with_xft=$withval], [with_xft=auto])

if test "x$with_xft" != "xno" ; then
	dnl Test fontconfig package
	PKG_CHECK_MODULES(XFT, xft, xft_ok=yes, xft_ok=no)
	if test "x$xft_ok" != "xyes"; then
		dnl test xft package
		PKG_CHECK_MODULES(XFT, fontconfig, xft_ok=yes, xft_ok=no)
		if test "x$xft_ok" != "xyes"; then
			dnl Have to test xft presence
			AC_CHECK_HEADER(X11/Xft/Xft.h, xft_ok=yes, xft_ok=no)
			if test "x$xft_ok" != "xyes"; then
				dnl No xft found
				if test "x$with_xft" = "xyes"; then
					dnl Xft was explicitly asked, so stop
					AC_MSG_ERROR([--with-xft was specified, but appropriate development packages could not be found])
				fi
			else
				dnl Working Xft1
				XFT_LIBS="-L/usr/X11R6/lib -lXft "
			fi
		fi
	fi
else
	dnl Asked to ignore xft
	xft_ok=no
fi

AC_SUBST(XFT_CFLAGS)
AC_SUBST(XFT_LIBS)

AM_CONDITIONAL(USE_XFT, test "x$xft_ok" = "xyes")
if test "x$xft_ok" = "xyes"; then
	AC_DEFINE(WITH_XFT, 1, [Use Xft font database])
fi

dnl ******************************
dnl pangoft2 for xft
dnl ******************************

if test "x$xft_ok" = "xyes"; then
	PKG_CHECK_MODULES(PANGOFT2, pangoft2, pango_ok=yes, pango_ok=no)
	if test "x$pango_ok" = "xyes"; then
		XFT_LIBS="$XFT_LIBS $PANGOFT2_LIBS"
	fi
fi

dnl ******************************
dnl GnomePrint checking
dnl ******************************

AC_ARG_WITH(gnome-print,
            AC_HELP_STRING([--with-gnome-print], [use gnome print font database and spooler frontend]),
            [with_gp=$withval], [with_gp=auto])

if test "x$with_gp" = "xyes"; then
	dnl Have to test gnome-print presence
	PKG_CHECK_MODULES(GNOME_PRINT, libgnomeprint-2.2 >= 1.116.0  libgnomeprintui-2.2 >= 1.116.0, gp=yes, gp=no)
	if test "x$gp" != "xyes"; then
		dnl No gnome-print found
		if test "x$with_gp" = "xyes"; then
			dnl Gnome-print was explicitly asked, so stop
			AC_MSG_ERROR([--with-gnome-print was specified, but appropriate libgnomeprint development packages could not found])
		else 
			# gp is no, tell us for the log file 
			AC_MSG_RESULT($gp)
		fi
	fi
else
	dnl Asked to ignore gnome-print
	gp=no
fi

AC_SUBST(GNOME_PRINT_CFLAGS)
AC_SUBST(GNOME_PRINT_LIBS)

AM_CONDITIONAL(USE_GNOME_PRINT, test "x$gp" = "xyes")
if test "x$gp" = "xyes"; then
	AC_DEFINE(WITH_GNOME_PRINT, 1, [Use gnome print font database and spooler frontend])
fi

dnl ******************************
dnl libinkjar checking
dnl ******************************

AC_ARG_WITH(inkjar,
	AC_HELP_STRING([--without-inkjar], [disable openoffice files (SVG jars)]),[with_ij=$withval], [with_ij=yes])

if test "x$with_ij" = "xyes"; then
	AC_DEFINE(WITH_INKJAR, 1, [enable openoffice files (SVG jars)])
	AC_C_BIGENDIAN
	AC_CHECK_HEADERS(zlib.h)
	ij=yes
else
	ij=no
fi
AM_CONDITIONAL(INKJAR, test "$with_ij" = "yes")

ink_spell_pkg=
if pkg-config --exists gtkspell-2.0; then
	ink_spell_pkg=gtkspell-2.0
	AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])
fi

dnl ******************************
dnl   Unconditional dependencies
dnl ******************************

PKG_CHECK_MODULES(INKSCAPE, gtk+-2.0 >= 2.4.0  libxml-2.0 >= 2-2.4.24  sigc++-2.0 >= 2.0.3  gtkmm-2.4  $ink_spell_pkg)

dnl Shouldn't we test for libpng and libz?
INKSCAPE_LIBS="$INKSCAPE_LIBS -lpng -lz"

AC_CHECK_HEADER(popt.h,
		[INKSCAPE_LIBS="$INKSCAPE_LIBS -lpopt"],
		AC_MSG_ERROR([libpopt is required]))

dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
sp_save_LIBS=$LIBS
LIBS="$LIBS $INKSCAPE_LIBS"
AC_CHECK_FUNCS(bind_textdomain_codeset)
dnl Check for gtk_window_fullscreen in gtk (>= 2.2)
AC_CHECK_FUNCS(gtk_window_set_default_icon_from_file)
AC_CHECK_FUNCS(gtk_window_fullscreen)
LIBS=$sp_save_LIBS


dnl Check for binary relocation support
dnl Hongli Lai <h.lai@chello.nl>

AC_ARG_ENABLE(binreloc,
       [  --enable-binreloc       compile with binary relocation support
                          (default=enable when available)],
       enable_binreloc=$enableval,enable_binreloc=no)

AC_MSG_CHECKING(whether binary relocation support should be enabled)
if test "$enable_binreloc" = "yes"; then
       AC_MSG_RESULT(yes)
       AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
       if test -e /proc/self/maps; then
               AC_MSG_RESULT(yes)
       else
               AC_MSG_RESULT(no)
               AC_MSG_ERROR(/proc/self/maps is not available. Binary relocation cannot be enabled.)
               enable_binreloc="no"
       fi

elif test "$enable_binreloc" = "auto"; then
       AC_MSG_RESULT(yes when available)
       AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
       if test -e /proc/self/maps; then
               AC_MSG_RESULT(yes)
               enable_binreloc=yes

               AC_MSG_CHECKING(whether everything is installed to the same prefix)
               if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
                       "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
                       "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
               then
                       AC_MSG_RESULT(yes)
               else
                       AC_MSG_RESULT(no)
                       AC_MSG_NOTICE(Binary relocation support will be disabled.)
                       enable_binreloc=no
               fi

       else
               AC_MSG_RESULT(no)
               enable_binreloc=no
       fi

elif test "$enable_binreloc" = "no"; then
       AC_MSG_RESULT(no)
else
       AC_MSG_RESULT(no (unknown value "$enable_binreloc"))
       enable_binreloc=no
fi
AC_DEFINE(BR_PTHREADS,[0],[Use binreloc thread support?])
if test "$enable_binreloc" = "yes"; then
   AC_DEFINE(ENABLE_BINRELOC,,[Use AutoPackage?])
fi

dnl ******************************
dnl   Reported by autoscan
dnl ******************************
AC_CHECK_FUNCS(floor)
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_FUNCS(memmove)
AC_CHECK_FUNCS(memset)
AC_CHECK_FUNCS(mkdir)
AC_CHECK_FUNCS(pow)
AC_CHECK_FUNCS(sqrt)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(strpbrk)
AC_CHECK_FUNCS(strrchr)
AC_CHECK_FUNCS(strspn)
AC_CHECK_FUNCS(strstr)
AC_CHECK_FUNCS(strtoul)
AC_CHECK_FUNCS(fpsetmask)
AC_CHECK_FUNCS(ecvt)
AC_CHECK_HEADERS(ieeefp.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(libintl.h)
AC_CHECK_HEADERS(stddef.h)
AC_CHECK_HEADERS(sys/time.h)
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_HEADER_STAT
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_MODE_T
AC_TYPE_SIGNAL

dnl Work around broken gcc 3.3 (seen on OSX) where "ENABLE_NLS" isn't
dnl set correctly because the gettext function isn't noticed.
if test "$ac_cv_header_libintl_h" = "yes" &&
   test "$ac_cv_func_bind_textdomain_codeset" = "yes"  &&
   test "$gt_cv_func_have_gettext" != "yes"; then
    AC_DEFINE(ENABLE_NLS)
fi

dnl ******************************
dnl   Compilation warnings
dnl ******************************
if test "$GCC" = "yes"; then
  # Enable some warnings from g++.

  # Rationale: a number of bugs in inkscape have been fixed by enabling g++
  # warnings and addressing the produced warnings.  Usually the committing
  # developer is the best person to address the warnings.

  CFLAGS="-Wall -W $CFLAGS"

  ink_svd_CXXFLAGS="$CXXFLAGS"
  CXXFLAGS="-Wno-unused-parameter $CXXFLAGS"
  # -Wno-unused-parameter isn't accepted by gcc 2.95.
  AC_COMPILE_IFELSE([int dummy;
], , CXXFLAGS="-Wno-unused $ink_svd_CXXFLAGS",)
  # Note: At least one bug has been caught from unused parameter warnings,
  # so it might be worth trying not to disable it.
  # One way of selectively disabling the warnings (i.e. only where the
  # programmer deliberately isn't using the parameter, e.g. for a callback)
  # is to remove the parameter name (leaving just its type), as is done
  # in src/seltrans.cpp:sp_seltrans_handle_event; this indicates that the
  # programmer deliberately has an unused parameter (e.g. because it's used
  # as a callback or similar function pointer use).

  CXXFLAGS="-Wall -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch  $CXXFLAGS"
fi

dnl ******************************
dnl   Plugin Support
dnl ******************************
dnl
dnl UPDATE: This is unconditional now (Lauris)
dnl
dnl AC_ARG_WITH(modules, AC_HELP_STRING([--with-modules], [Compile with plugin support (experimental)]), [mod=$withval], [mod=yes])
dnl
dnl AM_CONDITIONAL(USE_MODULES, test "x$mod" = "xyes")
dnl if test "x$mod" = "xyes"; then
dnl 	AC_DEFINE(WITH_MODULES, 1, [Use experimental module support])
dnl fi

AC_DEFINE(WITH_MODULES, 1, [Use experimental module support])

dnl ******************************
dnl   libinkscape
dnl ******************************
dnl
dnl AC_ARG_ENABLE(libinkscape, AC_HELP_STRING([--enable-libinkscape], [Compile dynamic library (experimental)]), [splib=$enableval], [splib=no])
dnl
dnl AM_CONDITIONAL(ENABLE_LIBINKSCAPE, test "x$splib" != "xno")
dnl

AC_SUBST(INKSCAPE_CFLAGS)
AC_SUBST(INKSCAPE_LIBS)

#
# Checks to see if we should compile in MMX support (there will be
# a runtime test when the code is actually run to see if it should
# be used - this just checks if we can compile it.)
#
# This code is partially taken from Mesa
#
dnl Let people disable the MMX optimization
AC_ARG_ENABLE(mmx, [  --disable-mmx     Don't use MMX optimization [default=auto]], enable_mmx="$enableval", enable_mmx=auto)

AC_MSG_CHECKING(for x86 platform)
case $host_cpu in
  i386|i486|i586|i686|i786|k6|k7)
    use_x86_asm=yes
    ;;
  *)
    use_x86_asm=no
esac
AC_MSG_RESULT($use_x86_asm)

dnl Are we going to use MMX extensions
use_mmx_asm=no

AC_MSG_CHECKING(compiler support for MMX)

if test x$enable_mmx = xauto ; then
  if test $use_x86_asm = yes; then
    save_ac_ext=$ac_ext
    ac_ext=S
    
    cp $srcdir/src/libnr/nr_mmx_R8G8B8A8_P_R8G8B8A8_P_A8_RGBAP.S conftest.S
    if AC_TRY_EVAL(ac_compile); then
        use_mmx_asm=yes
    fi
    dnl rm -f conftest.[oS]

    ac_ext=$save_ac_ext
  fi

dnl Enforce usage of MMX extensions
elif test x$enable_mmx = xyes ; then
    use_mmx_asm=yes
else
    use_mmx_asm=no
fi

if test $use_mmx_asm = yes; then
	AC_DEFINE(WITH_MMX, 1, [Use MMX optimizations, if CPU supports it])
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT(no)
fi

AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)

dnl Override the default g_ascii_strtod
AC_DEFINE(g_ascii_strtod, fixed_g_ascii_strtod, [Pre-1.107 gstrfuncs.c version of g_ascii_strtod is broken])

dnl Figure out where the datadir actually is
if test "x${datadir}" = 'x${prefix}/share'; then
  if test "x${prefix}" = "xNONE"; then
    runtime_datadir="${ac_default_prefix}/share"
  else
    runtime_datadir="${prefix}/share"
  fi
else
  runtime_datadir="${datadir}"
fi

inkscape_sharedir="${runtime_datadir}/${PACKAGE_NAME}"

dnl Define our data paths for config.h
AC_SUBST(INKSCAPE_DATADIR)
AC_DEFINE_UNQUOTED([INKSCAPE_DATADIR], "${runtime_datadir}",
					[Base data directory -- only path-prefix.h should use it!])
AC_SUBST(PACKAGE_LOCALE_DIR)
AC_DEFINE_UNQUOTED([PACKAGE_LOCALE_DIR], "${runtime_datadir}/locale",
					[Localization directory])
AC_SUBST(INKSCAPE_LIBDIR)
AC_DEFINE_UNQUOTED([INKSCAPE_LIBDIR], "${prefix}/lib",
					[Base library directory -- only path-prefix.h should use it!])

dnl Have to add module makefiles (lauris)

AC_CONFIG_FILES([
Makefile
src/Makefile
src/check-header-compile
src/dialogs/makefile
src/display/makefile
src/extension/makefile
src/extension/implementation/makefile
src/extension/internal/makefile
src/helper/makefile
src/inkjar/makefile
src/libnr/makefile
src/libnrtype/makefile
src/livarot/makefile
src/svg/makefile
src/utest/makefile
src/widgets/makefile
src/xml/makefile
src/traits/makefile
src/algorithms/makefile
src/util/makefile
src/trace/makefile
doc/Makefile
po/Makefile.in
share/Makefile
share/clipart/Makefile
share/examples/Makefile
share/extensions/Makefile
share/fonts/Makefile
share/gradients/Makefile
share/icons/Makefile
share/keyboards/Makefile
share/markers/Makefile
share/palettes/Makefile
share/patterns/Makefile
share/screens/Makefile
share/templates/Makefile
share/tutorials/Makefile
inkscape.spec
inkview.1
])

AH_BOTTOM([


])

AC_OUTPUT

echo "
Configuration:

        Source code location:     ${srcdir}
        Destination path prefix:  ${prefix}
        Compiler:                 ${CXX}
        CPPFLAGS:                 ${CPPFLAGS}
        CXXFLAGS:                 ${CXXFLAGS}
        LDFLAGS:                  ${LDFLAGS}

        Use Xft font database:    ${xft_ok}
        Use gnome-print:          ${gp}
        Use openoffice files:     ${ij}
        Use MMX optimizations:    ${use_mmx_asm}
        Use relocation support:   ${enable_binreloc}
"