Code

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