Code

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