1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.50)
4 AC_INIT(inkscape, 0.45+devel)
5 dnl N.B. After 0.40, please change to `0.40+cvs' instead of `0.41cvs'.
6 dnl Rationale: (i) placate simple version comparison software such as
7 dnl `dpkg --compare-versions'. (ii) We don't always know what the next
8 dnl version is going to be called until about the time we release it
9 dnl (whereas we always know what the previous version was called).
10 AC_CANONICAL_HOST
11 AC_CONFIG_SRCDIR(src/main.cpp)
12 AM_INIT_AUTOMAKE
14 AC_ARG_ENABLE([lsb], AS_HELP_STRING([--enable-lsb], [LSB-compatible build configuration]), [
15 prefix=/opt/inkscape
16 PATH="/opt/lsb/bin:$PATH"
17 CC=lsbcc
18 CXX=lsbc++
19 export CC CXX
20 ])
22 AM_CONFIG_HEADER(config.h)
24 AC_PROG_INTLTOOL(0.22)
26 AC_LANG(C++)
27 AC_ISC_POSIX
28 AC_PROG_CXX
29 AM_PROG_CC_STDC
30 AM_PROG_AS
31 AC_HEADER_STDC
33 dnl These next few lines are needed only while libcroco is in our source tree.
34 AC_PROG_CC
35 AM_PROG_CC_C_O
36 AC_MSG_NOTICE([Testing -Wno-pointer-sign])
37 if test "$GCC" = "yes"; then
38 # Enable some warnings from gcc.
40 AC_LANG_PUSH(C)
41 # -Wno-pointer-sign is probably new in gcc 4.0; certainly it isn't accepted
42 # by gcc 2.95.
43 ink_svd_CFLAGS="$CFLAGS"
44 CFLAGS="-Wno-pointer-sign $CFLAGS"
45 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), AC_MSG_NOTICE([ compiler supports -Wno-pointer-sign]), CFLAGS="$ink_svd_CFLAGS")
46 CFLAGS="-Wall -Wformat-security -W -D_FORTIFY_SOURCE=2 $CFLAGS"
47 AC_LANG_POP
48 fi
50 dnl Honor aclocal flags
51 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
53 AC_PROG_RANLIB
55 dnl Verify our GCC version
56 if test "x$GXX" = "xyes"; then
57 AC_MSG_CHECKING([GNU compiler version])
59 # Don't pass CXXFLAGS to the following CXX command as some
60 # of them can't be specified along with '-v'.
61 cc_version=["`$CXX -v 2>&1 </dev/null |grep 'gcc version' |\
62 sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"]
64 AC_MSG_RESULT([$cc_version])
66 # Some version numbers
67 cc_vers_major=`echo $cc_version | cut -f1 -d.`
68 cc_vers_minor=`echo $cc_version | cut -f2 -d.`
69 cc_vers_patch=`echo $cc_version | cut -f3 -d.`
70 test -n "$cc_vers_major" || cc_vers_major=0
71 test -n "$cc_vers_minor" || cc_vers_minor=0
72 test -n "$cc_vers_patch" || cc_vers_patch=0
73 cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch`
75 if test $cc_vers_major -lt 3; then
76 AC_MSG_ERROR([gcc >= 3.0 is needed to compile inkscape])
77 fi
78 fi
80 dnl ******************************
81 dnl Gettext stuff
82 dnl ******************************
83 GETTEXT_PACKAGE="AC_PACKAGE_NAME"
84 AC_SUBST(GETTEXT_PACKAGE)
85 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Translation domain used])
86 dnl Add the languages which your application supports here.
87 ALL_LINGUAS="am az be bg bn ca cs da de dz el en_AU en_CA en_GB en_US@piglatin eo es_MX es et eu fi fr ga gl he hr hu id it ja km ko lt mk mn nb ne nl nn pa pl pt_BR pt ro ru rw sk sl sq sr@Latn sr sv th tr uk vi zh_CN zh_TW"
88 AM_GLIB_GNU_GETTEXT
90 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
91 if test "x$PKG_CONFIG" = "xno"; then
92 AC_MSG_ERROR(You have to install pkg-config to compile inkscape.)
93 fi
95 dnl Find msgfmt. Without this, po/Makefile fails to set MSGFMT on some platforms.
96 AC_PATH_PROG(MSGFMT, msgfmt, msgfmt)
97 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
99 dnl ******************************
100 dnl Check for libpng
101 dnl ******************************
102 AC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no)], png_ok=no, -lz -lm)
103 if test "x$png_ok" != "xyes"; then
104 AC_MSG_ERROR([libpng >= 1.2 is needed to compile inkscape])
105 fi
107 dnl Handle possible dlopen requirement for libgc
108 dnl Isn't this internal to something in autoconf? Couldn't find it...
109 AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen],
110 [lt_cv_dlopen="dlopen"],
111 [AC_CHECK_LIB([dl], [dlopen],
112 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
113 [AC_CHECK_LIB([svld], [dlopen],
114 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
115 [AC_CHECK_LIB([dld], [dld_link],
116 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
117 ])
118 ])
119 ])
120 ])
122 AC_CHECK_HEADERS([gc.h gc/gc.h],
123 [
124 # To test for the different required libs, I have to
125 # overcome autoconf's caching system, so I change the
126 # desired function name. They're all in libgc.
127 # The "break" will exit from the top level
128 # AC_CHECK_HEADERS.
129 gc_libs=""
130 AC_CHECK_LIB(gc, GC_init,
131 [gc_ok=yes;
132 LIBS="-lgc $gc_libs $LIBS";
133 break], [gc_ok=no], [$gc_libs])
134 gc_libs="-lpthread"
135 AC_CHECK_LIB(gc, GC_malloc,
136 [gc_ok=yes;
137 LIBS="-lgc $gc_libs $LIBS";
138 break], [gc_ok=no], [$gc_libs])
139 gc_libs="$lt_cv_dlopen_libs"
140 AC_CHECK_LIB(gc, GC_realloc,
141 [gc_ok=yes;
142 LIBS="-lgc $gc_libs $LIBS";
143 break], [gc_ok=no], [$gc_libs])
144 gc_libs="-lpthread $lt_cv_dlopen_libs"
145 AC_CHECK_LIB(gc, GC_free,
146 [gc_ok=yes;
147 LIBS="-lgc $gc_libs $LIBS";
148 break], [gc_ok=no], [$gc_libs])
149 break],
150 [gc_ok=no])
151 if test "x$gc_ok" = "xyes"; then
152 AC_MSG_CHECKING([libgc version 6.4+])
153 AC_RUN_IFELSE(
154 [AC_LANG_SOURCE([[
155 #ifdef HAVE_GC_GC_H
156 # include <gc/gc.h>
157 #else
158 # include <gc.h>
159 #endif
160 #include <stdio.h>
161 extern unsigned GC_version;
162 int main(void){
163 unsigned min = ((6 << 16) | (4 << 8) | 0);
164 printf("%d.%d.%d ",GC_version >> 16, (GC_version >> 8) & 0xFF, GC_version & 0xFF);
165 if (GC_version>=min) return 0;
166 return 1;
167 }]])],
168 [gc_ok=yes],
169 [gc_ok=no]
170 )
171 AC_MSG_RESULT([$gc_ok])
172 fi
173 if test "x$gc_ok" != "xyes"; then
174 AC_MSG_ERROR([libgc (the Boehm Conservative Collector) 6.4+, is needed to compile inkscape -- http://www.hpl.hp.com/personal/Hans_Boehm/gc])
175 fi
177 dnl This check is to get a FIONREAD definition on Solaris 8
178 AC_CHECK_HEADERS([sys/filio.h])
181 AC_CHECK_HEADERS([malloc.h])
182 AC_CHECK_FUNCS([mallinfo], [
183 AC_CHECK_MEMBERS([struct mallinfo.usmblks,
184 struct mallinfo.fsmblks,
185 struct mallinfo.uordblks,
186 struct mallinfo.fordblks,
187 struct mallinfo.hblkhd],,,
188 [#include <malloc.h>])
189 ])
191 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
192 if test "x$FREETYPE_CONFIG" = "xno"; then
193 AC_MSG_ERROR([Cannot find freetype-config])
194 fi
195 FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
196 FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
197 AC_SUBST(FREETYPE_CFLAGS)
198 AC_SUBST(FREETYPE_LIBS)
200 dnl ******************************
201 dnl Win32
202 dnl ******************************
203 AC_MSG_CHECKING([for Win32 platform])
204 case "$host" in
205 *-*-mingw*)
206 platform_win32=yes
207 INKSCAPE_CFLAGS="$INKSCAPE_CFLAGS -mms-bitfields -DLIBXML_STATIC"
208 ;;
209 *)
210 platform_win32=no
211 ;;
212 esac
213 AC_MSG_RESULT([$platform_win32])
214 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
216 AC_MSG_CHECKING([for Solaris 2.8 platform])
217 case "$host" in
218 *-solaris2.8)
219 platform_solaris_2_8=yes
220 CFLAGS="$CFLAGS -DSOLARIS_2_8"
221 CXXFLAGS="$CXXFLAGS -DSOLARIS_2_8"
222 ;;
223 *)
224 platform_solaris_2_8=no
225 ;;
226 esac
227 AC_MSG_RESULT([$platform_solaris_2_8])
228 AM_CONDITIONAL(PLATFORM_SOLARIS_2_8, test "$platform_solaris_2_8" = "yes")
230 dnl ******************************
231 dnl Xft checking
232 dnl ******************************
234 AC_ARG_WITH(xft,
235 AC_HELP_STRING([--with-xft], [use xft scalable font database (default is auto)]),
236 [with_xft=$withval], [with_xft=auto])
238 if test "x$with_xft" != "xno" ; then
239 dnl Test fontconfig package
240 PKG_CHECK_MODULES(XFT, xft, xft_ok=yes, xft_ok=no)
241 if test "x$xft_ok" != "xyes"; then
242 dnl test xft package
243 PKG_CHECK_MODULES(XFT, fontconfig, xft_ok=yes, xft_ok=no)
244 if test "x$xft_ok" != "xyes"; then
245 dnl Have to test xft presence
246 AC_CHECK_HEADER(X11/Xft/Xft.h, xft_ok=yes, xft_ok=no)
247 if test "x$xft_ok" != "xyes"; then
248 dnl No xft found
249 if test "x$with_xft" = "xyes"; then
250 dnl Xft was explicitly asked, so stop
251 AC_MSG_ERROR([--with-xft was specified, but appropriate development packages could not be found])
252 fi
253 else
254 dnl Working Xft1
255 XFT_LIBS="-L/usr/X11R6/lib -lXft "
256 fi
257 fi
258 fi
259 else
260 dnl Asked to ignore xft
261 xft_ok=no
262 fi
264 AC_SUBST(XFT_CFLAGS)
265 AC_SUBST(XFT_LIBS)
267 AM_CONDITIONAL(USE_XFT, test "x$xft_ok" = "xyes")
268 if test "x$xft_ok" = "xyes"; then
269 AC_DEFINE(WITH_XFT, 1, [Use Xft font database])
270 fi
272 dnl ******************************
273 dnl pangoft2 for xft
274 dnl ******************************
276 if test "x$xft_ok" = "xyes"; then
277 PKG_CHECK_MODULES(PANGOFT2, pangoft2, pango_ok=yes, pango_ok=no)
278 if test "x$pango_ok" = "xyes"; then
279 XFT_LIBS="$XFT_LIBS $PANGOFT2_LIBS"
280 fi
281 fi
283 dnl ******************************
284 dnl GnomePrint checking
285 dnl ******************************
287 AC_ARG_WITH(gnome-print,
288 AC_HELP_STRING([--with-gnome-print], [use gnome print font database and spooler frontend]),
289 [with_gp=$withval], [with_gp=auto])
291 if test "x$with_gp" = "xyes"; then
292 dnl Have to test gnome-print presence
293 PKG_CHECK_MODULES(GNOME_PRINT, libgnomeprint-2.2 >= 1.116.0 libgnomeprintui-2.2 >= 1.116.0, gp=yes, gp=no)
294 if test "x$gp" != "xyes"; then
295 dnl No gnome-print found
296 if test "x$with_gp" = "xyes"; then
297 dnl Gnome-print was explicitly asked, so stop
298 AC_MSG_ERROR([--with-gnome-print was specified, but appropriate libgnomeprint development packages could not be found])
299 else
300 # gp is no, tell us for the log file
301 AC_MSG_RESULT($gp)
302 fi
303 fi
304 else
305 dnl Asked to ignore gnome-print
306 gp=no
307 fi
309 AC_SUBST(GNOME_PRINT_CFLAGS)
310 AC_SUBST(GNOME_PRINT_LIBS)
312 AM_CONDITIONAL(USE_GNOME_PRINT, test "x$gp" = "xyes")
313 if test "x$gp" = "xyes"; then
314 AC_DEFINE(WITH_GNOME_PRINT, 1, [Use gnome print font database and spooler frontend])
315 fi
317 dnl ******************************
318 dnl gnome vfs checking
319 dnl ******************************
321 AC_ARG_WITH(gnome-vfs,
322 AC_HELP_STRING([--with-gnome-vfs], [use gnome vfs for loading files]),
323 [with_gnome_vfs=$withval], [with_gnome_vfs=auto])
325 if test "x$with_gnome_vfs" = "xno"; then
326 dnl Asked to ignore gnome-vfs
327 gnome_vfs=no
328 else
329 dnl Have to test gnome-vfs presence
330 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.0, gnome_vfs=yes, gnome_vfs=no)
331 if test "x$gnome_vfs" != "xyes"; then
332 dnl No gnome-vfs found
333 if test "x$with_gnome_vfs" = "xyes"; then
334 dnl Gnome-VFS was explicitly asked for, so stop
335 AC_MSG_ERROR([--with-gnome-vfs was specified, but appropriate libgnomevfs development packages could not be found])
336 else
337 # gnome-vfs is no, tell us for the log file
338 AC_MSG_RESULT($gnome_vfs)
339 fi
340 fi
341 fi
343 AM_CONDITIONAL(USE_GNOME_VFS, test "x$gnome_vfs" = "xyes")
344 if test "x$gnome_vfs" = "xyes"; then
345 AC_DEFINE(WITH_GNOME_VFS, 1, [Use gnome vfs file load functionality])
346 fi
348 AC_SUBST(GNOME_VFS_CFLAGS)
349 AC_SUBST(GNOME_VFS_LIBS)
351 dnl ******************************
352 dnl libinkjar checking
353 dnl ******************************
355 AC_ARG_WITH(inkjar,
356 AC_HELP_STRING([--without-inkjar], [disable openoffice files (SVG jars)]),[with_ij=$withval], [with_ij=yes])
358 if test "x$with_ij" = "xyes"; then
359 AC_DEFINE(WITH_INKJAR, 1, [enable openoffice files (SVG jars)])
360 AC_C_BIGENDIAN
361 AC_CHECK_HEADERS(zlib.h)
362 ij=yes
363 else
364 ij=no
365 fi
366 AM_CONDITIONAL(INKJAR, test "$with_ij" = "yes")
368 ink_spell_pkg=
369 if pkg-config --exists gtkspell-2.0; then
370 ink_spell_pkg=gtkspell-2.0
371 AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])
372 fi
374 dnl ******************************
375 dnl PERL checking
376 dnl ******************************
378 AC_MSG_CHECKING(for Perl development environment)
379 AC_ARG_WITH(perl,
380 AC_HELP_STRING([--with-perl], [use Perl for embedded scripting (EXPERIMENTAL)]),
381 [with_perl=$withval], [with_perl=skipped])
383 if test "x$with_perl" = "xyes"; then
384 checkPERL_CFLAGS=`perl -MExtUtils::Embed -e perl_inc 2>/dev/null`
385 if test "$?" -gt "0"; then
386 with_perl="no"
387 else
388 checkPERL_LIBS=`perl -MExtUtils::Embed -e ldopts 2>/dev/null`
389 if test "$?" -gt "0"; then
390 with_perl="no"
391 else
392 with_perl="yes"
393 fi
394 fi
395 fi
396 AC_MSG_RESULT([$with_perl])
397 if test "x$with_perl" = "xyes"; then
398 # Test that we actually have the perl libraries installed
399 oldCFLAGS="$CFLAGS"
400 oldLIBS="$LIBS"
401 CFLAGS="$CFLAGS $checkPERL_CFLAGS"
402 LIBS="$LIBS $checkPERL_LIBS"
403 AC_CHECK_FUNC([perl_parse],[
404 PERL_CFLAGS="$checkPERL_CFLAGS"
405 PERL_LIBS="$checkPERL_LIBS"
406 AC_DEFINE(WITH_PERL, 1, [use Perl for embedded scripting])
407 ],[
408 with_perl="no"
409 ])
410 CFLAGS="$oldCFLAGS"
411 LIBS="$oldLIBS"
412 fi
413 AM_CONDITIONAL(WITH_PERL, test "x$with_perl" = "xyes")
414 AC_SUBST(PERL_CFLAGS)
415 AC_SUBST(PERL_LIBS)
417 dnl ******************************
418 dnl Python checking
419 dnl ******************************
421 AC_MSG_CHECKING(for Python development environment)
422 AC_ARG_WITH(python,
423 AC_HELP_STRING([--with-python], [use Python for embedded scripting (EXPERIMENTAL)]),
424 [with_python=$withval], [with_python=skipped])
426 if test "x$with_python" = "xyes"; then
427 checkPYTHON_CFLAGS=`python -c "import distutils.sysconfig ; print '-I%s' % distutils.sysconfig.get_config_var('INCLUDEPY')" 2>/dev/null`
428 if test "$?" -gt "0"; then
429 with_python="no"
430 else
431 checkPYTHON_LIBS=`python -c "import distutils.sysconfig ; print '%s/%s %s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LDLIBRARY'),distutils.sysconfig.get_config_var('LIBS'))" 2>/dev/null`
432 if test "$?" -gt "0"; then
433 with_python="no"
434 else
435 with_python="yes"
436 fi
437 fi
438 fi
439 AC_MSG_RESULT([$with_python])
440 if test "x$with_python" = "xyes"; then
441 # Test that we actually have the python libraries installed
442 oldCFLAGS="$CFLAGS"
443 oldLIBS="$LIBS"
444 CFLAGS="$CFLAGS $checkPYTHON_CFLAGS"
445 LIBS="$LIBS $checkPYTHON_LIBS"
446 AC_CHECK_FUNC([Py_Initialize],[
447 PYTHON_CFLAGS="$checkPYTHON_CFLAGS"
448 PYTHON_LIBS="$checkPYTHON_LIBS"
449 AC_DEFINE(WITH_PYTHON, 1, [use Python for embedded scripting])
450 ],[
451 with_python="no"
452 ])
453 CFLAGS="$oldCFLAGS"
454 LIBS="$oldLIBS"
455 fi
456 AM_CONDITIONAL(WITH_PYTHON, test "x$with_python" = "xyes")
457 AC_SUBST(PYTHON_CFLAGS)
458 AC_SUBST(PYTHON_LIBS)
460 dnl ******************************
461 dnl LittleCms checking
462 dnl ******************************
464 AC_ARG_ENABLE(lcms,
465 AC_HELP_STRING([--enable-lcms], [enable LittleCms for color management]),
466 [enable_lcms=$enableval], [enable_lcms=yes])
468 if test "x$enable_lcms" = "xno"; then
469 dnl Asked to ignore LittleCms
470 lcms=no
471 else
472 dnl Have to test LittleCms presence
473 PKG_CHECK_MODULES(LCMS, lcms >= 1.13, lcms=yes, lcms=no)
474 if test "x$lcms" != "xyes"; then
475 dnl No lcms found
476 if test "x$enable_lcms" = "xyes"; then
477 dnl LittleCms was explicitly asked for, so stop
478 AC_MSG_ERROR([--enable-lcms was specified, but appropriate LittleCms development packages could not be found])
479 else
480 # lcms is no, tell us for the log file
481 AC_MSG_RESULT($lcms)
482 fi
483 else
484 dnl Working lcms
485 LCMS_LIBS="-llcms "
486 fi
487 fi
489 if test "x$lcms" = "xyes"; then
490 LIBS="$LIBS $LCMS_LIBS"
491 AC_DEFINE(ENABLE_LCMS, 1, [Use LittleCms color management])
492 fi
493 AM_CONDITIONAL(USE_LCMS, test "x$lcms" = "xyes")
494 AC_SUBST(LCMS_CFLAGS)
495 AC_SUBST(LCMS_LIBS)
497 dnl ******************************
498 dnl Inkboard dependency checking
499 dnl ******************************
501 with_inkboard="no"
502 with_inkboard_ssl="no"
504 INKBOARD_CFLAGS=""
506 AC_ARG_ENABLE(inkboard,
507 AS_HELP_STRING([--enable-inkboard], [enable Inkboard online whiteboard facility (disabled by default)]),
508 with_inkboard=$enableval,with_inkboard=no)
510 if test "x$with_inkboard" = "xyes"; then
511 with_inkboard="yes"
512 AC_DEFINE(WITH_INKBOARD,1,[Build in Inkboard support])
514 dnl Test for OpenSSL
515 PKG_CHECK_MODULES(INKBOARD, openssl, with_inkboard_ssl=yes, with_inkboard_ssl=no)
516 if test "x$with_inkboard_ssl" = "xyes"; then
517 dnl OpenSSL found; enable SSL support in Pedro
518 INKBOARD_CFLAGS="$INKBOARD_CFLAGS -DHAVE_SSL"
519 RELAYTOOL([ssl], INKBOARD_LIBS, INKBOARD_CFLAGS, [inkboard_weak=yes])
520 RELAYTOOL([crypto], INKBOARD_LIBS, INKBOARD_CFLAGS, [inkboard_weak=yes])
521 AC_DEFINE(WITH_INKBOARD_SSL,1,[Build in SSL support for Inkboard])
522 fi
523 else
524 with_inkboard="no"
525 fi
527 AM_CONDITIONAL(WITH_INKBOARD, test "x$with_inkboard" = "xyes")
528 AC_SUBST(INKBOARD_LIBS)
529 AC_SUBST(INKBOARD_CFLAGS)
531 dnl ******************************
532 dnl Unconditional dependencies
533 dnl ******************************
535 dnl sigc++-2.0 >= 2.0.12: using "visit_each" not available in 2.0.10
536 if test $cc_vers_major -gt 3; then
537 min_sigc_version=2.0.12
538 else
539 min_sigc_version=2.0.11
540 fi
541 PKG_CHECK_MODULES(INKSCAPE, gdkmm-2.4 glibmm-2.4 gtkmm-2.4 gtk+-2.0 >= 2.8.0 libxml-2.0 >= 2.6.11 libxslt >= 1.0.15 cairo sigc++-2.0 >= $min_sigc_version $ink_spell_pkg gthread-2.0 >= 2.0 libpng >= 1.2)
543 PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, cairo_pdf=yes, cairo_pdf=no)
544 if test "x$cairo_pdf" = "xyes"; then
545 AC_DEFINE(HAVE_CAIRO_PDF, 1, [Whether the Cairo PDF backend is available])
546 fi
548 PKG_CHECK_MODULES(GTK_UNIX_PRINT, gtk+-unix-print-2.0, gtk_unix_print=yes, gtk_unix_print=no)
549 if test "x$gtk_unix_print" = "xyes"; then
550 AC_DEFINE(HAVE_GTK_UNIX_PRINT, 1, [Whether the GTK Unix printing backend is available])
551 fi
553 dnl Shouldn't we test for libpng and libz?
554 INKSCAPE_LIBS="$INKSCAPE_LIBS -lpng -lz"
556 AC_CHECK_HEADER(popt.h,
557 [INKSCAPE_LIBS="$INKSCAPE_LIBS -lpopt"],
558 AC_MSG_ERROR([libpopt is required]))
560 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
561 sp_save_LIBS=$LIBS
562 LIBS="$LIBS $INKSCAPE_LIBS"
563 AC_CHECK_FUNCS(bind_textdomain_codeset)
564 dnl Check for gtk_window_fullscreen in gtk (>= 2.2)
565 AC_CHECK_FUNCS(gtk_window_set_default_icon_from_file)
566 AC_CHECK_FUNCS(gtk_window_fullscreen)
567 LIBS=$sp_save_LIBS
570 dnl Check for binary relocation support
571 dnl Hongli Lai <h.lai@chello.nl>
573 AC_ARG_ENABLE(binreloc,
574 [ --enable-binreloc compile with binary relocation support],
575 enable_binreloc=$enableval,enable_binreloc=no)
577 AC_MSG_CHECKING(whether binary relocation support should be enabled)
578 if test "$enable_binreloc" = "yes"; then
579 AC_MSG_RESULT(yes)
580 AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
581 if test -e /proc/self/maps; then
582 AC_MSG_RESULT(yes)
583 else
584 AC_MSG_RESULT(no)
585 AC_MSG_ERROR(/proc/self/maps is not available. Binary relocation cannot be enabled.)
586 enable_binreloc="no"
587 fi
589 elif test "$enable_binreloc" = "auto"; then
590 AC_MSG_RESULT(yes when available)
591 AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
592 if test -e /proc/self/maps; then
593 AC_MSG_RESULT(yes)
594 enable_binreloc=yes
596 AC_MSG_CHECKING(whether everything is installed to the same prefix)
597 if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
598 "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
599 "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
600 then
601 AC_MSG_RESULT(yes)
602 else
603 AC_MSG_RESULT(no)
604 AC_MSG_NOTICE(Binary relocation support will be disabled.)
605 enable_binreloc=no
606 fi
608 else
609 AC_MSG_RESULT(no)
610 enable_binreloc=no
611 fi
613 elif test "$enable_binreloc" = "no"; then
614 AC_MSG_RESULT(no)
615 else
616 AC_MSG_RESULT(no (unknown value "$enable_binreloc"))
617 enable_binreloc=no
618 fi
619 AC_DEFINE(BR_PTHREADS,[0],[Use binreloc thread support?])
620 if test "$enable_binreloc" = "yes"; then
621 AC_DEFINE(ENABLE_BINRELOC,,[Use AutoPackage?])
622 fi
624 AC_ARG_ENABLE(osxapp,
625 [ --enable-osxapp compile with OSX .app data dir paths],
626 enable_osxapp=$enableval,enable_osxapp=no)
627 if test "$enable_osxapp" = "yes"; then
628 AC_DEFINE(ENABLE_OSX_APP_LOCATIONS,,[Build with OSX .app data dir paths?])
629 fi
631 dnl ******************************
632 dnl Reported by autoscan
633 dnl ******************************
634 AC_CHECK_FUNCS(pow)
635 # if we did not find pow(), see if it's in libm.
636 if test x"$ac_cv_func_pow" = x"no" ; then
637 AC_CHECK_LIB(m,pow)
638 fi
639 AC_CHECK_FUNCS(sqrt)
640 AC_CHECK_FUNCS(floor)
641 AC_CHECK_FUNCS(gettimeofday)
642 AC_CHECK_FUNCS(memmove)
643 AC_CHECK_FUNCS(memset)
644 AC_CHECK_FUNCS(mkdir)
645 AC_CHECK_FUNCS(strncasecmp)
646 AC_CHECK_FUNCS(strpbrk)
647 AC_CHECK_FUNCS(strrchr)
648 AC_CHECK_FUNCS(strspn)
649 AC_CHECK_FUNCS(strstr)
650 AC_CHECK_FUNCS(strtoul)
651 AC_CHECK_FUNCS(fpsetmask)
652 AC_CHECK_FUNCS(ecvt)
653 AC_CHECK_HEADERS(ieeefp.h)
654 AC_CHECK_HEADERS(fcntl.h)
655 AC_CHECK_HEADERS(libintl.h)
656 AC_CHECK_HEADERS(stddef.h)
657 AC_CHECK_HEADERS(sys/time.h)
658 AC_FUNC_STAT
659 AC_FUNC_STRFTIME
660 AC_FUNC_STRTOD
661 AC_HEADER_STAT
662 AC_HEADER_TIME
663 AC_STRUCT_TM
664 AC_TYPE_MODE_T
665 AC_TYPE_SIGNAL
667 dnl Work around broken gcc 3.3 (seen on OSX) where "ENABLE_NLS" isn't
668 dnl set correctly because the gettext function isn't noticed.
669 if test "$ac_cv_header_libintl_h" = "yes" &&
670 test "$ac_cv_func_bind_textdomain_codeset" = "yes" &&
671 test "$gt_cv_func_have_gettext" != "yes"; then
672 AC_DEFINE(ENABLE_NLS)
673 fi
675 dnl ******************************
676 dnl Compilation warnings
677 dnl ******************************
678 if test "$GXX" = "yes"; then
679 # Enable some warnings from g++.
681 # Rationale: a number of bugs in inkscape have been fixed by enabling g++
682 # warnings and addressing the produced warnings. Usually the committing
683 # developer is the best person to address the warnings.
685 ink_svd_CXXFLAGS="$CXXFLAGS"
686 CXXFLAGS="-Wno-unused-parameter $CXXFLAGS"
687 # -Wno-unused-parameter isn't accepted by gcc 2.95.
688 AC_COMPILE_IFELSE([int dummy;
689 ], , CXXFLAGS="-Wno-unused $ink_svd_CXXFLAGS",)
690 # Note: At least one bug has been caught from unused parameter warnings,
691 # so it might be worth trying not to disable it.
692 # One way of selectively disabling the warnings (i.e. only where the
693 # programmer deliberately isn't using the parameter, e.g. for a callback)
694 # is to remove the parameter name (leaving just its type), as is done
695 # in src/seltrans.cpp:sp_seltrans_handle_event; this indicates that the
696 # programmer deliberately has an unused parameter (e.g. because it's used
697 # as a callback or similar function pointer use).
699 CXXFLAGS="-Wall -Wformat-security -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -D_FORTIFY_SOURCE=2 $CXXFLAGS"
701 dnl Test for arch-specific situations.
702 case "$host_cpu" in
703 mips|mipsel)
704 dnl Symbol tables can get too large: this uses alternate tables
705 dnl See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=283476
706 CXXFLAGS="$CXXFLAGS -Wa,-xgot"
707 CFLAGS="$CFLAGS -Wa,-xgot"
708 ;;
709 esac
710 fi
712 AC_DEFINE(WITH_MODULES, 1, [Use experimental module support])
714 dnl ******************************
715 dnl libinkscape
716 dnl ******************************
717 dnl
718 dnl AC_ARG_ENABLE(libinkscape, AC_HELP_STRING([--enable-libinkscape], [Compile dynamic library (experimental)]), [splib=$enableval], [splib=no])
719 dnl
720 dnl AM_CONDITIONAL(ENABLE_LIBINKSCAPE, test "x$splib" != "xno")
721 dnl
723 AC_SUBST(INKSCAPE_CFLAGS)
724 AC_SUBST(INKSCAPE_LIBS)
726 #
727 # Checks to see if we should compile in MMX support (there will be
728 # a runtime test when the code is actually run to see if it should
729 # be used - this just checks if we can compile it.)
730 #
731 # This code is partially taken from Mesa
732 #
733 dnl Let people disable the MMX optimization
734 AC_ARG_ENABLE(mmx, [ --disable-mmx Don't use MMX optimization [default=auto]], enable_mmx="$enableval", enable_mmx=auto)
736 AC_MSG_CHECKING(for x86 platform)
737 case $host_cpu in
738 i386|i486|i586|i686|i786|k6|k7)
739 use_x86_asm=yes
740 ;;
741 *)
742 use_x86_asm=no
743 esac
744 AC_MSG_RESULT($use_x86_asm)
746 dnl Are we going to use MMX extensions
747 use_mmx_asm=no
749 AC_MSG_CHECKING(compiler support for MMX)
751 if test x$enable_mmx = xauto ; then
752 if test $use_x86_asm = yes; then
753 save_ac_ext=$ac_ext
754 ac_ext=S
756 cp $srcdir/src/libnr/nr_mmx_R8G8B8A8_P_R8G8B8A8_P_A8_RGBAP.S conftest.S
757 if AC_TRY_EVAL(ac_compile); then
758 use_mmx_asm=yes
759 fi
760 dnl rm -f conftest.[oS]
762 ac_ext=$save_ac_ext
763 fi
765 dnl Enforce usage of MMX extensions
766 elif test x$enable_mmx = xyes ; then
767 use_mmx_asm=yes
768 else
769 use_mmx_asm=no
770 fi
772 if test $use_mmx_asm = yes; then
773 AC_DEFINE(WITH_MMX, 1, [Use MMX optimizations, if CPU supports it])
774 AC_MSG_RESULT(yes)
775 else
776 AC_MSG_RESULT(no)
777 fi
779 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
781 dnl Figure out where the datadir actually is
782 dnl http://autoconf-archive.cryp.to/ac_define_dir.html
783 prefix_NONE=
784 exec_prefix_NONE=
785 test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
786 test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
787 dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
788 dnl refers to ${prefix}. Thus we have to use `eval' twice.
789 eval runtime_datadir="${datadir}"
790 eval runtime_datadir="${runtime_datadir}"
791 test "$prefix_NONE" && prefix=NONE
792 test "$exec_prefix_NONE" && exec_prefix=NONE
794 inkscape_sharedir="${runtime_datadir}/${PACKAGE_NAME}"
796 dnl Define our data paths for config.h
797 AC_SUBST(INKSCAPE_DATADIR)
798 AC_DEFINE_UNQUOTED([INKSCAPE_DATADIR], "${runtime_datadir}",
799 [Base data directory -- only path-prefix.h should use it!])
800 AC_SUBST(PACKAGE_LOCALE_DIR)
801 AC_DEFINE_UNQUOTED([PACKAGE_LOCALE_DIR], "${runtime_datadir}/locale",
802 [Localization directory])
803 AC_SUBST(INKSCAPE_LIBDIR)
804 AC_DEFINE_UNQUOTED([INKSCAPE_LIBDIR], "${prefix}/lib",
805 [Base library directory -- only path-prefix.h should use it!])
807 dnl Have to add module makefiles (lauris)
809 AC_CONFIG_FILES([
810 Makefile
811 src/Makefile
812 src/check-header-compile
813 src/algorithms/makefile
814 src/application/makefile
815 src/debug/makefile
816 src/dialogs/makefile
817 src/display/makefile
818 src/dom/makefile
819 src/extension/implementation/makefile
820 src/extension/internal/makefile
821 src/extension/makefile
822 src/extension/script/makefile
823 src/helper/makefile
824 src/inkjar/makefile
825 src/io/makefile
826 src/libcroco/makefile
827 src/libnr/makefile
828 src/libnrtype/makefile
829 src/libavoid/makefile
830 src/livarot/makefile
831 src/pedro/makefile
832 src/jabber_whiteboard/makefile
833 src/removeoverlap/makefile
834 src/svg/makefile
835 src/trace/makefile
836 src/traits/makefile
837 src/ui/cache/makefile
838 src/ui/dialog/makefile
839 src/ui/makefile
840 src/ui/view/makefile
841 src/ui/widget/makefile
842 src/utest/makefile
843 src/util/makefile
844 src/widgets/makefile
845 src/xml/makefile
846 doc/Makefile
847 po/Makefile.in
848 share/Makefile
849 share/clipart/Makefile
850 share/examples/Makefile
851 share/extensions/Makefile
852 share/extensions/Barcode/Makefile
853 share/fonts/Makefile
854 share/gradients/Makefile
855 share/icons/Makefile
856 share/keys/Makefile
857 share/markers/Makefile
858 share/palettes/Makefile
859 share/patterns/Makefile
860 share/screens/Makefile
861 share/templates/Makefile
862 share/tutorials/Makefile
863 share/ui/Makefile
864 packaging/autopackage/default.apspec
865 inkscape.spec
866 Info.plist
867 inkview.1
868 ])
870 AH_BOTTOM([
873 ])
875 AC_OUTPUT
877 echo "
878 Configuration:
880 Source code location: ${srcdir}
881 Destination path prefix: ${prefix}
882 Compiler: ${CXX}
883 CPPFLAGS: ${CPPFLAGS}
884 CXXFLAGS: ${CXXFLAGS}
885 CFLAGS: ${CFLAGS}
886 LDFLAGS: ${LDFLAGS}
888 Use Xft font database: ${xft_ok}
889 Use gnome-vfs: ${gnome_vfs}
890 Use openoffice files: ${ij}
891 Use MMX optimizations: ${use_mmx_asm}
892 Use relocation support: ${enable_binreloc}
893 Internal Python: ${with_python}
894 Internal Perl: ${with_perl}
895 Enable LittleCms: ${enable_lcms}
896 Enable Inkboard: ${with_inkboard}
897 Enable SSL in Inkboard: ${with_inkboard_ssl}
898 "