Code

r17648@shi: ted | 2008-01-14 23:31:32 -0800
[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+0.46pre0)
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([dist-zip dist-bzip2 tar-pax])
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 br ca ca@valencia 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
284 dnl ******************************
285 dnl gnome vfs checking
286 dnl ******************************
288 AC_ARG_WITH(gnome-vfs,
289         AC_HELP_STRING([--with-gnome-vfs], [use gnome vfs for loading files]),
290         [with_gnome_vfs=$withval], [with_gnome_vfs=auto])
292 if test "x$with_gnome_vfs" = "xno"; then
293         dnl Asked to ignore gnome-vfs
294         gnome_vfs=no
295 else
296         dnl Have to test gnome-vfs presence
297         PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.0, gnome_vfs=yes, gnome_vfs=no)
298         if test "x$gnome_vfs" != "xyes"; then
299                 dnl No gnome-vfs found
300                 if test "x$with_gnome_vfs" = "xyes"; then
301                         dnl Gnome-VFS was explicitly asked for, so stop
302                         AC_MSG_ERROR([--with-gnome-vfs was specified, but appropriate libgnomevfs development packages could not be found])
303                 else
304                         # gnome-vfs is no, tell us for the log file
305                         AC_MSG_RESULT($gnome_vfs)
306                 fi
307         fi
308 fi
310 AM_CONDITIONAL(USE_GNOME_VFS, test "x$gnome_vfs" = "xyes")
311 if test "x$gnome_vfs" = "xyes"; then
312         AC_DEFINE(WITH_GNOME_VFS, 1, [Use gnome vfs file load functionality])
313 fi
315 AC_SUBST(GNOME_VFS_CFLAGS)
316 AC_SUBST(GNOME_VFS_LIBS)
318 dnl ******************************
319 dnl libinkjar checking
320 dnl ******************************
322 AC_ARG_WITH(inkjar,
323         AC_HELP_STRING([--without-inkjar], [disable openoffice files (SVG jars)]),[with_ij=$withval], [with_ij=yes])
325 if test "x$with_ij" = "xyes"; then
326         AC_DEFINE(WITH_INKJAR, 1, [enable openoffice files (SVG jars)])
327         AC_C_BIGENDIAN
328         AC_CHECK_HEADERS(zlib.h)
329         ij=yes
330 else
331         ij=no
332 fi
333 AM_CONDITIONAL(INKJAR, test "$with_ij" = "yes")
335 ink_spell_pkg=
336 if pkg-config --exists gtkspell-2.0; then
337         ink_spell_pkg=gtkspell-2.0
338         AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])
339 fi
341 dnl ******************************
342 dnl PERL checking
343 dnl ******************************
345 AC_MSG_CHECKING(for Perl development environment)
346 AC_ARG_WITH(perl,
347             AC_HELP_STRING([--with-perl], [use Perl for embedded scripting (EXPERIMENTAL)]),
348             [with_perl=$withval], [with_perl=skipped])
350 if test "x$with_perl" = "xyes"; then
351     checkPERL_CFLAGS=`perl -MExtUtils::Embed -e perl_inc 2>/dev/null`
352     if test "$?" -gt "0"; then
353         with_perl="no"
354     else
355         checkPERL_LIBS=`perl -MExtUtils::Embed -e ldopts 2>/dev/null`
356         if test "$?" -gt "0"; then
357             with_perl="no"
358         else
359             with_perl="yes"
360         fi
361     fi
362 fi
363 AC_MSG_RESULT([$with_perl])
364 if test "x$with_perl" = "xyes"; then
365     # Test that we actually have the perl libraries installed
366     oldCFLAGS="$CFLAGS"
367     oldLIBS="$LIBS"
368     CFLAGS="$CFLAGS $checkPERL_CFLAGS"
369     LIBS="$LIBS $checkPERL_LIBS"
370     AC_CHECK_FUNC([perl_parse],[
371         PERL_CFLAGS="$checkPERL_CFLAGS"
372         PERL_LIBS="$checkPERL_LIBS"
373         AC_DEFINE(WITH_PERL, 1, [use Perl for embedded scripting])
374         ],[
375         with_perl="no"
376         ])
377     CFLAGS="$oldCFLAGS"
378     LIBS="$oldLIBS"
379 fi
380 AM_CONDITIONAL(WITH_PERL, test "x$with_perl" = "xyes")
381 AC_SUBST(PERL_CFLAGS)
382 AC_SUBST(PERL_LIBS)
384 dnl ******************************
385 dnl Python checking
386 dnl ******************************
388 AC_MSG_CHECKING(for Python development environment)
389 AC_ARG_WITH(python,
390             AC_HELP_STRING([--with-python], [use Python for embedded scripting (EXPERIMENTAL)]),
391             [with_python=$withval], [with_python=skipped])
393 if test "x$with_python" = "xyes"; then
394     checkPYTHON_CFLAGS=`python -c "import distutils.sysconfig ; print '-I%s' % distutils.sysconfig.get_config_var('INCLUDEPY')" 2>/dev/null`
395     if test "$?" -gt "0"; then
396         with_python="no"
397     else
398         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`
399         if test "$?" -gt "0"; then
400             with_python="no"
401         else
402             with_python="yes"
403         fi
404     fi
405 fi
406 AC_MSG_RESULT([$with_python])
407 if test "x$with_python" = "xyes"; then
408     # Test that we actually have the python libraries installed
409     oldCFLAGS="$CFLAGS"
410     oldLIBS="$LIBS"
411     CFLAGS="$CFLAGS $checkPYTHON_CFLAGS"
412     LIBS="$LIBS $checkPYTHON_LIBS"
413     AC_CHECK_FUNC([Py_Initialize],[
414         PYTHON_CFLAGS="$checkPYTHON_CFLAGS"
415         PYTHON_LIBS="$checkPYTHON_LIBS"
416         AC_DEFINE(WITH_PYTHON, 1, [use Python for embedded scripting])
417         ],[
418         with_python="no"
419         ])
420     CFLAGS="$oldCFLAGS"
421     LIBS="$oldLIBS"
422 fi
423 AM_CONDITIONAL(WITH_PYTHON, test "x$with_python" = "xyes")
424 AC_SUBST(PYTHON_CFLAGS)
425 AC_SUBST(PYTHON_LIBS)
427 dnl ******************************
428 dnl LittleCms checking
429 dnl ******************************
431 AC_ARG_ENABLE(lcms,
432         AC_HELP_STRING([--enable-lcms], [enable LittleCms for color management]),
433         [enable_lcms=$enableval], [enable_lcms=yes])
435 if test "x$enable_lcms" = "xno"; then
436         dnl Asked to ignore LittleCms
437         lcms=no
438 else
439         dnl Have to test LittleCms presence
440         PKG_CHECK_MODULES(LCMS, lcms >= 1.13, lcms=yes, lcms=no)
441         if test "x$lcms" != "xyes"; then
442                 dnl No lcms found
443                 if test "x$enable_lcms" = "xyes"; then
444                         dnl LittleCms was explicitly asked for, so stop
445                         AC_MSG_ERROR([--enable-lcms was specified, but appropriate LittleCms development packages could not be found])
446                 else
447                         # lcms is no, tell us for the log file
448                         AC_MSG_RESULT($lcms)
449                 fi
450         else
451                 dnl Working lcms
452                 LCMS_LIBS="-llcms "
453         fi
454 fi
456 if test "x$lcms" = "xyes"; then
457         LIBS="$LIBS $LCMS_LIBS"
458         AC_DEFINE(ENABLE_LCMS, 1, [Use LittleCms color management])
459 fi
460 AM_CONDITIONAL(USE_LCMS, test "x$lcms" = "xyes")
461 AC_SUBST(LCMS_CFLAGS)
462 AC_SUBST(LCMS_LIBS)
464 dnl ******************************
465 dnl Libpoppler checking
466 dnl ******************************
468 AC_ARG_ENABLE(poppler-cairo,
469         AC_HELP_STRING([--enable-poppler-cairo], [Enable libpoppler-cairo for rendering PDF preview]),
470         [enable_poppler_cairo=$enableval], [enable_poppler_cairo=yes])
472 POPPLER_CFLAGS=""
473 PKG_CHECK_MODULES(POPPLER, poppler >= 0.5.9, poppler=yes, poppler=no)
475 if test "x$poppler" = "xyes"; then
476         dnl Working libpoppler
477         POPPLER_LIBS="-lpoppler "
478         dnl Have to test libpoppler-glib presence
479         PKG_CHECK_MODULES(POPPLER_GLIB, poppler-glib >= 0.5.9, poppler_glib=yes, poppler_glib=no)
480         if test "x$poppler_glib" = "xyes"; then
481                 dnl Working libpoppler-glib found
482                 dnl Check whether the Cairo SVG backend is available
483                 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, cairo_svg=yes, cairo_svg=no)
484                 if test "x$cairo_svg" = "xyes"; then
485                         POPPLER_LIBS="$POPPLER_LIBS -lpoppler-glib "
486                 fi
487         fi
488         if test "x$enable_poppler_cairo" = "xyes"; then
489                 dnl Have to test libpoppler-cairo presence for PDF preview
490                 dnl AC_CHECK_HEADER(Magick++.h, magick_ok=yes, magick_ok=no)
491                 PKG_CHECK_MODULES(POPPLER_CAIRO, poppler-cairo >= 0.5.9, poppler_cairo=yes, poppler_cairo=no)
492                 if test "x$poppler_glib" = "xyes" -a "x$poppler_cairo" = "xyes" -a \
493                         "x$cairo_svg" = "xno"
494                 then
495                         POPPLER_LIBS="$POPPLER_LIBS -lpoppler-glib "
496                 fi
497         fi
498 fi
500 if test "x$poppler" = "xyes"; then
501         LIBS="$LIBS $POPPLER_LIBS"
502         AC_DEFINE(HAVE_POPPLER, 1, [Use libpoppler for direct PDF import])
503 fi
504 if test "x$poppler_cairo" = "xyes" -a "x$poppler_glib" = "xyes"; then
505         AC_DEFINE(HAVE_POPPLER_CAIRO, 1, [Use libpoppler-cairo for rendering PDF preview])
506 fi
507 if test "x$poppler_glib" = "xyes" -a "x$cairo_svg" = "xyes"; then
508         AC_DEFINE(HAVE_POPPLER_GLIB, 1, [Use libpoppler-glib and Cairo-SVG for PDF import])
509 fi
510 AC_SUBST(POPPLER_CFLAGS)
511 AC_SUBST(POPPLER_LIBS)
513 dnl ******************************
514 dnl Inkboard dependency checking
515 dnl ******************************
517 with_inkboard="no"
518 with_inkboard_ssl="no"
520 INKBOARD_CFLAGS=""
522 AC_ARG_ENABLE(inkboard,
523                 AS_HELP_STRING([--enable-inkboard], [enable Inkboard online whiteboard facility (disabled by default)]),
524        with_inkboard=$enableval,with_inkboard=no)
526 if test "x$with_inkboard" = "xyes"; then
527                 with_inkboard="yes"
528                 AC_DEFINE(WITH_INKBOARD,1,[Build in Inkboard support])
529                 
530                 dnl Test for OpenSSL
531                 PKG_CHECK_MODULES(INKBOARD, openssl, with_inkboard_ssl=yes, with_inkboard_ssl=no)
532                 if test "x$with_inkboard_ssl" = "xyes"; then
533                         dnl OpenSSL found; enable SSL support in Pedro
534                         INKBOARD_CFLAGS="$INKBOARD_CFLAGS -DHAVE_SSL"
535                         RELAYTOOL([ssl], INKBOARD_LIBS, INKBOARD_CFLAGS, [inkboard_weak=yes])
536                         RELAYTOOL([crypto], INKBOARD_LIBS, INKBOARD_CFLAGS, [inkboard_weak=yes])
537                         AC_DEFINE(WITH_INKBOARD_SSL,1,[Build in SSL support for Inkboard])
538                 fi
539 else
540         with_inkboard="no"
541 fi
543 AM_CONDITIONAL(WITH_INKBOARD, test "x$with_inkboard" = "xyes")
544 AC_SUBST(INKBOARD_LIBS)
545 AC_SUBST(INKBOARD_CFLAGS)
547 dnl ******************************
548 dnl Check for libwpg for extension
549 dnl ******************************
551 PKG_CHECK_MODULES(LIBWPG, libwpg-0.1 libwpg-stream-0.1, with_libwpg=yes, with_libwpg=no)
552 if test "x$with_libwpg" = "xyes"; then
553         AC_DEFINE(WITH_LIBWPG,1,[Build in libwpg])
554 fi
555 AM_CONDITIONAL(WITH_LIBWPG, test "x$with_libwpg" = "xyes")
557 AC_SUBST(LIBWPG_LIBS)
558 AC_SUBST(LIBWPG_CFLAGS)
560 dnl ******************************
561 dnl Check for ImageMagick Magick++ 
562 dnl ******************************
564 AC_CHECK_LIB(Magick++, InitializeMagick, [AC_CHECK_HEADER(Magick++.h, magick_ok=yes, magick_ok=no)], magick_ok=no, -llcms -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lz -lpthread -lm -lpthread)
566 if test "x$magick_ok" = "xyes"; then
567         AC_CHECK_PROG(MAGICKPP_CONFIG, Magick++-config, yes, no)
568         if test "x$MAGICKPP_CONFIG" = "xyes"; then
569                 IMAGEMAGICK_LIBS=`Magick++-config --libs`
570                 AC_SUBST(IMAGEMAGICK_LIBS)
571                 AC_DEFINE(WITH_IMAGE_MAGICK,1,[Image Magick++ support for bitmap effects])
572         fi
573 fi
575 AM_CONDITIONAL(USE_IMAGE_MAGICK, test "x$magick_ok" = "xyes")
577 dnl ******************************
578 dnl   Unconditional dependencies
579 dnl ******************************
581 dnl sigc++-2.0 >= 2.0.12: using "visit_each" not available in 2.0.10
582 if test $cc_vers_major -gt 3; then
583   min_sigc_version=2.0.12
584 else
585   min_sigc_version=2.0.11
586 fi
587 PKG_CHECK_MODULES(INKSCAPE, gdkmm-2.4  glibmm-2.4  gtkmm-2.4 >= 2.10.0  gtk+-2.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)
589 # Check for Apple Mac OS X Carbon framework
590 carbon_ok=no
591 AC_MSG_CHECKING([for Mac OS X Carbon support])
592 AC_TRY_CPP([
593 #include <Carbon/Carbon.h>
594 #include <CoreServices/CoreServices.h>
595 ], carbon_ok=yes)
596 AC_MSG_RESULT($carbon_ok)
597 if test "x$carbon_ok" = "xyes"; then
598   AC_DEFINE(HAVE_CARBON, 1, [define to 1 if Carbon is available])
599   CARBON_LDFLAGS="-framework Carbon"
600   AC_SUBST(CARBON_LDFLAGS)
601 fi
602 AM_CONDITIONAL(HAVE_CARBON, test "x$carbon_ok" = "xyes")
604 # Check for some boost header files
605 AC_CHECK_HEADERS([boost/concept_check.hpp], [], AC_MSG_ERROR([You need the boost package (e.g. libboost-dev)]))
607 PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, cairo_pdf=yes, cairo_pdf=no)
608 if test "x$cairo_pdf" = "xyes"; then
609   AC_DEFINE(HAVE_CAIRO_PDF, 1, [Whether the Cairo PDF backend is available])
610 fi
612 dnl Shouldn't we test for libpng and libz?
613 INKSCAPE_LIBS="$INKSCAPE_LIBS -lpng -lz"
615 AC_CHECK_HEADER(popt.h,
616                 [INKSCAPE_LIBS="$INKSCAPE_LIBS -lpopt"],
617                 AC_MSG_ERROR([libpopt is required]))
619 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
620 sp_save_LIBS=$LIBS
621 LIBS="$LIBS $INKSCAPE_LIBS"
622 AC_CHECK_FUNCS(bind_textdomain_codeset)
623 dnl Check for gtk_window_fullscreen in gtk (>= 2.2)
624 AC_CHECK_FUNCS(gtk_window_set_default_icon_from_file)
625 AC_CHECK_FUNCS(gtk_window_fullscreen)
626 LIBS=$sp_save_LIBS
629 dnl Check for binary relocation support
630 dnl Hongli Lai <h.lai@chello.nl>
632 AC_ARG_ENABLE(binreloc,
633        [  --enable-binreloc       compile with binary relocation support],
634        enable_binreloc=$enableval,enable_binreloc=no)
636 AC_MSG_CHECKING(whether binary relocation support should be enabled)
637 if test "$enable_binreloc" = "yes"; then
638        AC_MSG_RESULT(yes)
639        AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
640        if test -e /proc/self/maps; then
641                AC_MSG_RESULT(yes)
642        else
643                AC_MSG_RESULT(no)
644                AC_MSG_ERROR(/proc/self/maps is not available. Binary relocation cannot be enabled.)
645                enable_binreloc="no"
646        fi
648 elif test "$enable_binreloc" = "auto"; then
649        AC_MSG_RESULT(yes when available)
650        AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
651        if test -e /proc/self/maps; then
652                AC_MSG_RESULT(yes)
653                enable_binreloc=yes
655                AC_MSG_CHECKING(whether everything is installed to the same prefix)
656                if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
657                        "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
658                        "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
659                then
660                        AC_MSG_RESULT(yes)
661                else
662                        AC_MSG_RESULT(no)
663                        AC_MSG_NOTICE(Binary relocation support will be disabled.)
664                        enable_binreloc=no
665                fi
667        else
668                AC_MSG_RESULT(no)
669                enable_binreloc=no
670        fi
672 elif test "$enable_binreloc" = "no"; then
673        AC_MSG_RESULT(no)
674 else
675        AC_MSG_RESULT(no (unknown value "$enable_binreloc"))
676        enable_binreloc=no
677 fi
678 AC_DEFINE(BR_PTHREADS,[0],[Use binreloc thread support?])
679 if test "$enable_binreloc" = "yes"; then
680    AC_DEFINE(ENABLE_BINRELOC,,[Use AutoPackage?])
681 fi
683 AC_ARG_ENABLE(osxapp,
684        [  --enable-osxapp         compile with OSX .app data dir paths],
685        enable_osxapp=$enableval,enable_osxapp=no)
686 if test "$enable_osxapp" = "yes"; then
687    AC_DEFINE(ENABLE_OSX_APP_LOCATIONS,,[Build with OSX .app data dir paths?])
688 fi
690 dnl ******************************
691 dnl   Reported by autoscan
692 dnl ******************************
693 AC_CHECK_FUNCS(pow)
694 # if we did not find pow(), see if it's in libm.
695 if test x"$ac_cv_func_pow" = x"no" ; then
696         AC_CHECK_LIB(m,pow)
697 fi
698 AC_CHECK_FUNCS(sqrt)
699 AC_CHECK_FUNCS(floor)
700 AC_CHECK_FUNCS(gettimeofday)
701 AC_CHECK_FUNCS(memmove)
702 AC_CHECK_FUNCS(memset)
703 AC_CHECK_FUNCS(mkdir)
704 AC_CHECK_FUNCS(strncasecmp)
705 AC_CHECK_FUNCS(strpbrk)
706 AC_CHECK_FUNCS(strrchr)
707 AC_CHECK_FUNCS(strspn)
708 AC_CHECK_FUNCS(strstr)
709 AC_CHECK_FUNCS(strtoul)
710 AC_CHECK_FUNCS(fpsetmask)
711 AC_CHECK_FUNCS(ecvt)
712 AC_CHECK_HEADERS(ieeefp.h)
713 AC_CHECK_HEADERS(fcntl.h)
714 AC_CHECK_HEADERS(libintl.h)
715 AC_CHECK_HEADERS(stddef.h)
716 AC_CHECK_HEADERS(sys/time.h)
717 AC_FUNC_STAT
718 AC_FUNC_STRFTIME
719 AC_FUNC_STRTOD
720 AC_HEADER_STAT
721 AC_HEADER_TIME
722 AC_STRUCT_TM
723 AC_TYPE_MODE_T
724 AC_TYPE_SIGNAL
726 dnl Work around broken gcc 3.3 (seen on OSX) where "ENABLE_NLS" isn't
727 dnl set correctly because the gettext function isn't noticed.
728 if test "$ac_cv_header_libintl_h" = "yes" &&
729    test "$ac_cv_func_bind_textdomain_codeset" = "yes"  &&
730    test "$gt_cv_func_have_gettext" != "yes"; then
731     AC_DEFINE(ENABLE_NLS)
732 fi
734 dnl ******************************
735 dnl   Compilation warnings
736 dnl ******************************
737 if test "$GXX" = "yes"; then
738   # Enable some warnings from g++.
740   # Rationale: a number of bugs in inkscape have been fixed by enabling g++
741   # warnings and addressing the produced warnings.  Usually the committing
742   # developer is the best person to address the warnings.
744   ink_svd_CXXFLAGS="$CXXFLAGS"
745   CXXFLAGS="-Wno-unused-parameter $CXXFLAGS"
746   # -Wno-unused-parameter isn't accepted by gcc 2.95.
747   AC_COMPILE_IFELSE([int dummy;
748 ], , CXXFLAGS="-Wno-unused $ink_svd_CXXFLAGS",)
749   # Note: At least one bug has been caught from unused parameter warnings,
750   # so it might be worth trying not to disable it.
751   # One way of selectively disabling the warnings (i.e. only where the
752   # programmer deliberately isn't using the parameter, e.g. for a callback)
753   # is to remove the parameter name (leaving just its type), as is done
754   # in src/seltrans.cpp:sp_seltrans_handle_event; this indicates that the
755   # programmer deliberately has an unused parameter (e.g. because it's used
756   # as a callback or similar function pointer use).
758   CXXFLAGS="-Wall -Wformat-security -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -D_FORTIFY_SOURCE=2 $CXXFLAGS"
760   dnl Test for arch-specific situations.
761   case "$host_cpu" in
762     mips|mipsel)
763       dnl Symbol tables can get too large: this uses alternate tables
764       dnl See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=283476
765       CXXFLAGS="$CXXFLAGS -Wa,-xgot"
766       CFLAGS="$CFLAGS -Wa,-xgot"
767       ;;
768   esac
769 fi
771 AC_DEFINE(WITH_MODULES, 1, [Use experimental module support])
773 dnl ******************************
774 dnl   libinkscape
775 dnl ******************************
776 dnl
777 dnl AC_ARG_ENABLE(libinkscape, AC_HELP_STRING([--enable-libinkscape], [Compile dynamic library (experimental)]), [splib=$enableval], [splib=no])
778 dnl
779 dnl AM_CONDITIONAL(ENABLE_LIBINKSCAPE, test "x$splib" != "xno")
780 dnl
782 AC_SUBST(INKSCAPE_CFLAGS)
783 AC_SUBST(INKSCAPE_LIBS)
786 # Checks to see if we should compile in MMX support (there will be
787 # a runtime test when the code is actually run to see if it should
788 # be used - this just checks if we can compile it.)
790 # This code is partially taken from Mesa
792 dnl Let people disable the MMX optimization
793 AC_ARG_ENABLE(mmx, [  --disable-mmx     Don't use MMX optimization [default=auto]], enable_mmx="$enableval", enable_mmx=auto)
795 AC_MSG_CHECKING(for x86 platform)
796 case $host_cpu in
797   i386|i486|i586|i686|i786|k6|k7)
798     use_x86_asm=yes
799     ;;
800   *)
801     use_x86_asm=no
802 esac
803 AC_MSG_RESULT($use_x86_asm)
805 dnl Are we going to use MMX extensions
806 use_mmx_asm=no
808 AC_MSG_CHECKING(compiler support for MMX)
810 if test x$enable_mmx = xauto ; then
811   if test $use_x86_asm = yes; then
812     save_ac_ext=$ac_ext
813     ac_ext=S
814     
815     cp $srcdir/src/libnr/nr_mmx_R8G8B8A8_P_R8G8B8A8_P_A8_RGBAP.S conftest.S
816     if AC_TRY_EVAL(ac_compile); then
817         use_mmx_asm=yes
818     fi
819     dnl rm -f conftest.[oS]
821     ac_ext=$save_ac_ext
822   fi
824 dnl Enforce usage of MMX extensions
825 elif test x$enable_mmx = xyes ; then
826     use_mmx_asm=yes
827 else
828     use_mmx_asm=no
829 fi
831 if test $use_mmx_asm = yes; then
832         AC_DEFINE(WITH_MMX, 1, [Use MMX optimizations, if CPU supports it])
833         AC_MSG_RESULT(yes)
834 else
835         AC_MSG_RESULT(no)
836 fi
838 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
840 dnl Figure out where the datadir actually is
841 dnl http://autoconf-archive.cryp.to/ac_define_dir.html
842 prefix_NONE=
843 exec_prefix_NONE=
844 test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
845 test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
846 dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
847 dnl refers to ${prefix}.  Thus we have to use `eval' twice.
848 eval runtime_datadir="${datadir}"
849 eval runtime_datadir="${runtime_datadir}"
850 test "$prefix_NONE" && prefix=NONE
851 test "$exec_prefix_NONE" && exec_prefix=NONE
853 inkscape_sharedir="${runtime_datadir}/${PACKAGE_NAME}"
855 dnl Define our data paths for config.h
856 AC_SUBST(INKSCAPE_DATADIR)
857 AC_DEFINE_UNQUOTED([INKSCAPE_DATADIR], "${runtime_datadir}",
858                                         [Base data directory -- only path-prefix.h should use it!])
859 AC_SUBST(PACKAGE_LOCALE_DIR)
860 AC_DEFINE_UNQUOTED([PACKAGE_LOCALE_DIR], "${runtime_datadir}/locale",
861                                         [Localization directory])
862 AC_SUBST(INKSCAPE_LIBDIR)
863 AC_DEFINE_UNQUOTED([INKSCAPE_LIBDIR], "${prefix}/lib",
864                                         [Base library directory -- only path-prefix.h should use it!])
866 dnl Have to add module makefiles (lauris)
868 AC_CONFIG_FILES([
869 Makefile
870 src/Makefile
871 src/check-header-compile
872 src/algorithms/makefile
873 src/application/makefile
874 src/debug/makefile
875 src/dialogs/makefile
876 src/display/makefile
877 src/dom/makefile
878 src/extension/implementation/makefile
879 src/extension/internal/makefile
880 src/extension/makefile
881 src/extension/script/makefile
882 src/helper/makefile
883 src/inkjar/makefile
884 src/io/makefile
885 src/libcroco/makefile
886 src/libgdl/makefile
887 src/libnr/makefile
888 src/libnrtype/makefile
889 src/libavoid/makefile
890 src/livarot/makefile
891 src/live_effects/makefile
892 src/live_effects/parameter/makefile
893 src/pedro/makefile
894 src/jabber_whiteboard/makefile
895 src/removeoverlap/makefile
896 src/svg/makefile
897 src/trace/makefile
898 src/traits/makefile
899 src/ui/cache/makefile
900 src/ui/dialog/makefile
901 src/ui/makefile
902 src/ui/view/makefile
903 src/ui/widget/makefile
904 src/utest/makefile
905 src/util/makefile
906 src/widgets/makefile
907 src/xml/makefile
908 src/2geom/makefile
909 doc/Makefile
910 po/Makefile.in
911 share/Makefile
912 share/clipart/Makefile
913 share/examples/Makefile
914 share/extensions/Makefile
915 share/extensions/Barcode/Makefile
916 share/extensions/xaml2svg/Makefile
917 share/fonts/Makefile
918 share/gradients/Makefile
919 share/icons/Makefile
920 share/keys/Makefile
921 share/markers/Makefile
922 share/palettes/Makefile
923 share/patterns/Makefile
924 share/screens/Makefile
925 share/templates/Makefile
926 share/tutorials/Makefile
927 share/ui/Makefile
928 packaging/autopackage/default.apspec
929 inkscape.spec
930 Info.plist
931 inkview.1
932 ])
934 AH_BOTTOM([
937 ])
939 AC_OUTPUT
941 echo "
942 Configuration:
944         Source code location:     ${srcdir}
945         Destination path prefix:  ${prefix}
946         Compiler:                 ${CXX}
947         CPPFLAGS:                 ${CPPFLAGS}
948         CXXFLAGS:                 ${CXXFLAGS}
949         CFLAGS:                   ${CFLAGS}
950         LDFLAGS:                  ${LDFLAGS}
952         Use Xft font database:    ${xft_ok}
953         Use gnome-vfs:            ${gnome_vfs}
954         Use openoffice files:     ${ij}
955         Use MMX optimizations:    ${use_mmx_asm}
956         Use relocation support:   ${enable_binreloc}
957         Internal Python:          ${with_python}
958         Internal Perl:            ${with_perl}
959         Enable LittleCms:         ${enable_lcms}
960         Enable Inkboard:          ${with_inkboard}
961         Enable SSL in Inkboard:   ${with_inkboard_ssl}
962         Enable Poppler-Cairo:     ${enable_poppler_cairo}
963         ImageMagick Magick++:     ${magick_ok}
964         Libwpg:                   ${with_libwpg}