Code

manually merging the INKBOARD_PEDRO branch into trunk
[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 AC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no)], png_ok=no, -lz -lm)
86 if test "x$png_ok" != "xyes"; then
87         AC_MSG_ERROR([libpng >= 1.2 is needed to compile inkscape])
88 fi
90 dnl Handle possible dlopen requirement for libgc
91 dnl Isn't this internal to something in autoconf?  Couldn't find it...
92 AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen],
93           [lt_cv_dlopen="dlopen"],
94       [AC_CHECK_LIB([dl], [dlopen],
95             [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
96         [AC_CHECK_LIB([svld], [dlopen],
97               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
98           [AC_CHECK_LIB([dld], [dld_link],
99                 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
100           ])
101         ])
102       ])
103     ])
105 AC_CHECK_HEADERS([gc.h gc/gc.h],
106                  [
107                     # To test for the different required libs, I have to
108                     # overcome autoconf's caching system, so I change the
109                     # desired function name.  They're all in libgc.
110                     # The "break" will exit from the top level
111                     # AC_CHECK_HEADERS.
112                     gc_libs=""
113                     AC_CHECK_LIB(gc, GC_init,
114                                  [gc_ok=yes;
115                                   LIBS="-lgc $gc_libs $LIBS";
116                                   break], [gc_ok=no], [$gc_libs])
117                     gc_libs="-lpthread"
118                     AC_CHECK_LIB(gc, GC_malloc,
119                                  [gc_ok=yes;
120                                   LIBS="-lgc $gc_libs $LIBS";
121                                   break], [gc_ok=no], [$gc_libs])
122                     gc_libs="$lt_cv_dlopen_libs"
123                     AC_CHECK_LIB(gc, GC_realloc,
124                                  [gc_ok=yes;
125                                   LIBS="-lgc $gc_libs $LIBS";
126                                   break], [gc_ok=no], [$gc_libs])
127                     gc_libs="-lpthread $lt_cv_dlopen_libs"
128                     AC_CHECK_LIB(gc, GC_free,
129                                  [gc_ok=yes;
130                                   LIBS="-lgc $gc_libs $LIBS";
131                                   break], [gc_ok=no], [$gc_libs])
132                     break],
133                  [gc_ok=no])
134 if test "x$gc_ok" = "xyes"; then
135         AC_MSG_CHECKING([libgc version 6.4+])
136         AC_RUN_IFELSE(
137                 [AC_LANG_SOURCE([[
138                         #ifdef HAVE_GC_GC_H
139                         # include <gc/gc.h>
140                         #else
141                         # include <gc.h>
142                         #endif
143                         #include <stdio.h>
144                         extern unsigned GC_version;
145                         int main(void){
146                                 unsigned min = ((6 << 16) | (4 << 8) | 0);
147                                 printf("%d.%d.%d ",GC_version >> 16, (GC_version >> 8) & 0xFF, GC_version & 0xFF);
148                                 if (GC_version>=min) return 0;
149                                 return 1;
150                         }]])],
151                 [gc_ok=yes],
152                 [gc_ok=no]
153         )
154         AC_MSG_RESULT([$gc_ok])
155 fi
156 if test "x$gc_ok" != "xyes"; then
157         AC_MSG_ERROR([libgc (the Boehm Conservative Collector) 6.4+, is needed to compile inkscape -- http://www.hpl.hp.com/personal/Hans_Boehm/gc])
158 fi
160 AC_CHECK_HEADERS([malloc.h])
161 AC_CHECK_FUNCS([mallinfo], [
162         AC_CHECK_MEMBERS([struct mallinfo.usmblks,
163                           struct mallinfo.fsmblks,
164                           struct mallinfo.uordblks,
165                           struct mallinfo.fordblks,
166                           struct mallinfo.hblkhd],,,
167                          [#include <malloc.h>])
168 ])
170 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
171 if test "x$FREETYPE_CONFIG" = "xno"; then
172         AC_MSG_ERROR([Cannot find freetype-config])
173 fi
174 FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
175 FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
176 AC_SUBST(FREETYPE_CFLAGS)
177 AC_SUBST(FREETYPE_LIBS)
179 dnl ******************************
180 dnl Win32
181 dnl ******************************
182 AC_MSG_CHECKING([for Win32 platform])
183 case "$host" in
184   *-*-mingw*)
185     platform_win32=yes
186     INKSCAPE_CFLAGS="$INKSCAPE_CFLAGS -mms-bitfields -DLIBXML_STATIC"
187     ;;
188   *)
189     platform_win32=no
190     ;;
191 esac
192 AC_MSG_RESULT([$platform_win32])
193 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
195 dnl ******************************
196 dnl Xft checking
197 dnl ******************************
199 AC_ARG_WITH(xft,
200             AC_HELP_STRING([--with-xft], [use xft scalable font database (default is auto)]),
201             [with_xft=$withval], [with_xft=auto])
203 if test "x$with_xft" != "xno" ; then
204         dnl Test fontconfig package
205         PKG_CHECK_MODULES(XFT, xft, xft_ok=yes, xft_ok=no)
206         if test "x$xft_ok" != "xyes"; then
207                 dnl test xft package
208                 PKG_CHECK_MODULES(XFT, fontconfig, xft_ok=yes, xft_ok=no)
209                 if test "x$xft_ok" != "xyes"; then
210                         dnl Have to test xft presence
211                         AC_CHECK_HEADER(X11/Xft/Xft.h, xft_ok=yes, xft_ok=no)
212                         if test "x$xft_ok" != "xyes"; then
213                                 dnl No xft found
214                                 if test "x$with_xft" = "xyes"; then
215                                         dnl Xft was explicitly asked, so stop
216                                         AC_MSG_ERROR([--with-xft was specified, but appropriate development packages could not be found])
217                                 fi
218                         else
219                                 dnl Working Xft1
220                                 XFT_LIBS="-L/usr/X11R6/lib -lXft "
221                         fi
222                 fi
223         fi
224 else
225         dnl Asked to ignore xft
226         xft_ok=no
227 fi
229 AC_SUBST(XFT_CFLAGS)
230 AC_SUBST(XFT_LIBS)
232 AM_CONDITIONAL(USE_XFT, test "x$xft_ok" = "xyes")
233 if test "x$xft_ok" = "xyes"; then
234         AC_DEFINE(WITH_XFT, 1, [Use Xft font database])
235 fi
237 dnl ******************************
238 dnl pangoft2 for xft
239 dnl ******************************
241 if test "x$xft_ok" = "xyes"; then
242         PKG_CHECK_MODULES(PANGOFT2, pangoft2, pango_ok=yes, pango_ok=no)
243         if test "x$pango_ok" = "xyes"; then
244                 XFT_LIBS="$XFT_LIBS $PANGOFT2_LIBS"
245         fi
246 fi
248 dnl ******************************
249 dnl GnomePrint checking
250 dnl ******************************
252 AC_ARG_WITH(gnome-print,
253             AC_HELP_STRING([--with-gnome-print], [use gnome print font database and spooler frontend]),
254             [with_gp=$withval], [with_gp=auto])
256 if test "x$with_gp" = "xyes"; then
257         dnl Have to test gnome-print presence
258         PKG_CHECK_MODULES(GNOME_PRINT, libgnomeprint-2.2 >= 1.116.0  libgnomeprintui-2.2 >= 1.116.0, gp=yes, gp=no)
259         if test "x$gp" != "xyes"; then
260                 dnl No gnome-print found
261                 if test "x$with_gp" = "xyes"; then
262                         dnl Gnome-print was explicitly asked, so stop
263                         AC_MSG_ERROR([--with-gnome-print was specified, but appropriate libgnomeprint development packages could not be found])
264                 else 
265                         # gp is no, tell us for the log file 
266                         AC_MSG_RESULT($gp)
267                 fi
268         fi
269 else
270         dnl Asked to ignore gnome-print
271         gp=no
272 fi
274 AC_SUBST(GNOME_PRINT_CFLAGS)
275 AC_SUBST(GNOME_PRINT_LIBS)
277 AM_CONDITIONAL(USE_GNOME_PRINT, test "x$gp" = "xyes")
278 if test "x$gp" = "xyes"; then
279         AC_DEFINE(WITH_GNOME_PRINT, 1, [Use gnome print font database and spooler frontend])
280 fi
282 dnl ******************************
283 dnl gnome vfs checking
284 dnl ******************************
286 AC_ARG_WITH(gnome-vfs,
287         AC_HELP_STRING([--with-gnome-vfs], [use gnome vfs for loading files]),
288         [with_gnome_vfs=$withval], [with_gnome_vfs=auto])
290 if test "x$with_gnome_vfs" = "xno"; then
291         dnl Asked to ignore gnome-vfs
292         gnome_vfs=no
293 else
294         dnl Have to test gnome-vfs presence
295         PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.0, gnome_vfs=yes, gnome_vfs=no)
296         if test "x$gnome_vfs" != "xyes"; then
297                 dnl No gnome-vfs found
298                 if test "x$with_gnome_vfs" = "xyes"; then
299                         dnl Gnome-VFS was explicitly asked for, so stop
300                         AC_MSG_ERROR([--with-gnome-vfs was specified, but appropriate libgnomevfs development packages could not be found])
301                 else
302                         # gnome-vfs is no, tell us for the log file
303                         AC_MSG_RESULT($gnome_vfs)
304                 fi
305         fi
306 fi
308 AM_CONDITIONAL(USE_GNOME_VFS, test "x$gnome_vfs" = "xyes")
309 if test "x$gnome_vfs" = "xyes"; then
310         AC_DEFINE(WITH_GNOME_VFS, 1, [Use gnome vfs file load functionality])
311 fi
313 AC_SUBST(GNOME_VFS_CFLAGS)
314 AC_SUBST(GNOME_VFS_LIBS)
316 dnl ******************************
317 dnl libinkjar checking
318 dnl ******************************
320 AC_ARG_WITH(inkjar,
321         AC_HELP_STRING([--without-inkjar], [disable openoffice files (SVG jars)]),[with_ij=$withval], [with_ij=yes])
323 if test "x$with_ij" = "xyes"; then
324         AC_DEFINE(WITH_INKJAR, 1, [enable openoffice files (SVG jars)])
325         AC_C_BIGENDIAN
326         AC_CHECK_HEADERS(zlib.h)
327         ij=yes
328 else
329         ij=no
330 fi
331 AM_CONDITIONAL(INKJAR, test "$with_ij" = "yes")
333 ink_spell_pkg=
334 if pkg-config --exists gtkspell-2.0; then
335         ink_spell_pkg=gtkspell-2.0
336         AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])
337 fi
339 dnl ******************************
340 dnl PERL checking
341 dnl ******************************
343 AC_MSG_CHECKING(for Perl development environment)
344 AC_ARG_WITH(perl,
345             AC_HELP_STRING([--with-perl], [use Perl for embedded scripting (EXPERIMENTAL)]),
346             [with_perl=$withval], [with_perl=skipped])
348 if test "x$with_perl" = "xyes"; then
349     checkPERL_CFLAGS=`perl -MExtUtils::Embed -e perl_inc 2>/dev/null`
350     if test "$?" -gt "0"; then
351         with_perl="no"
352     else
353         checkPERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts 2>/dev/null`
354         if test "$?" -gt "0"; then
355             with_perl="no"
356         else
357             with_perl="yes"
358         fi
359     fi
360 fi
361 AC_MSG_RESULT([$with_perl])
362 if test "x$with_perl" = "xyes"; then
363     # Test that we actually have the perl libraries installed
364     oldCFLAGS="$CFLAGS"
365     oldLDFLAGS="$LDFLAGS"
366     CFLAGS="$CFLAGS $checkPERL_CFLAGS"
367     LDFLAGS="$LDFLAGS $checkPERL_LDFLAGS"
368     AC_CHECK_FUNC([perl_parse],[
369         PERL_CFLAGS="$checkPERL_CFLAGS"
370         PERL_LDFLAGS="$checkPERL_LDFLAGS"
371         AC_DEFINE(WITH_PERL, 1, [use Perl for embedded scripting])
372         ],[
373         with_perl="no"
374         ])
375     CFLAGS="$oldCFLAGS"
376     LDFLAGS="$oldLDFLAGS"
377 fi
378 AM_CONDITIONAL(WITH_PERL, test "x$with_perl" = "xyes")
379 AC_SUBST(PERL_CFLAGS)
380 AC_SUBST(PERL_LDFLAGS)
382 dnl ******************************
383 dnl Python checking
384 dnl ******************************
386 AC_MSG_CHECKING(for Python development environment)
387 AC_ARG_WITH(python,
388             AC_HELP_STRING([--with-python], [use Python for embedded scripting (EXPERIMENTAL)]),
389             [with_python=$withval], [with_python=skipped])
391 if test "x$with_python" = "xyes"; then
392     checkPYTHON_CFLAGS=`python -c "import distutils.sysconfig ; print '-I%s' % distutils.sysconfig.get_config_var('INCLUDEPY')" 2>/dev/null`
393     if test "$?" -gt "0"; then
394         with_python="no"
395     else
396         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`
397         if test "$?" -gt "0"; then
398             with_python="no"
399         else
400             with_python="yes"
401         fi
402     fi
403 fi
404 AC_MSG_RESULT([$with_python])
405 if test "x$with_python" = "xyes"; then
406     # Test that we actually have the python libraries installed
407     oldCFLAGS="$CFLAGS"
408     oldLIBS="$LIBS"
409     CFLAGS="$CFLAGS $checkPYTHON_CFLAGS"
410     LIBS="$LIBS $checkPYTHON_LIBS"
411     AC_CHECK_FUNC([Py_Initialize],[
412         PYTHON_CFLAGS="$checkPYTHON_CFLAGS"
413         PYTHON_LIBS="$checkPYTHON_LIBS"
414         AC_DEFINE(WITH_PYTHON, 1, [use Python for embedded scripting])
415         ],[
416         with_python="no"
417         ])
418     CFLAGS="$oldCFLAGS"
419     LIBS="$oldLIBS"
420 fi
421 AM_CONDITIONAL(WITH_PYTHON, test "x$with_python" = "xyes")
422 AC_SUBST(PYTHON_CFLAGS)
423 AC_SUBST(PYTHON_LIBS)
425 dnl ******************************
426 dnl LittleCms checking
427 dnl ******************************
429 AC_ARG_ENABLE(lcms,
430         AC_HELP_STRING([--enable-lcms], [enable LittleCms for color management]),
431         [enable_lcms=$enableval], [enable_lcms=yes])
433 if test "x$enable_lcms" = "xno"; then
434         dnl Asked to ignore LittleCms
435         lcms=no
436 else
437         dnl Have to test LittleCms presence
438         PKG_CHECK_MODULES(LCMS, lcms >= 1.13, lcms=yes, lcms=no)
439         if test "x$lcms" != "xyes"; then
440                 dnl No lcms found
441                 if test "x$enable_lcms" = "xyes"; then
442                         dnl LittleCms was explicitly asked for, so stop
443                         AC_MSG_ERROR([--enable-lcms was specified, but appropriate LittleCms development packages could not be found])
444                 else
445                         # lcms is no, tell us for the log file
446                         AC_MSG_RESULT($lcms)
447                 fi
448         else
449                 dnl Working lcms
450                 LCMS_LIBS="-llcms "
451         fi
452 fi
454 if test "x$lcms" = "xyes"; then
455         LIBS="$LIBS $LCMS_LIBS"
456         AC_DEFINE(ENABLE_LCMS, 1, [Use LittleCms color management])
457 fi
458 AM_CONDITIONAL(USE_LCMS, test "x$lcms" = "xyes")
459 AC_SUBST(LCMS_CFLAGS)
460 AC_SUBST(LCMS_LIBS)
462 dnl ******************************
463 dnl Inkboard dependency checking
464 dnl ******************************
466 with_inkboard="no"
467 with_inkboard_ssl="no"
469 INKBOARD_CFLAGS=""
471 AC_ARG_ENABLE(inkboard,
472                 AS_HELP_STRING([--enable-inkboard], [enable Inkboard online whiteboard facility (disabled by default)]),
473        with_inkboard=$enableval,with_inkboard=no)
475 if test "x$with_inkboard" = "xyes"; then
476                 with_inkboard="yes"
477                 AC_DEFINE(WITH_INKBOARD,1,[Build in Inkboard support])
478                 
479                 dnl Test for OpenSSL
480                 PKG_CHECK_MODULES(INKBOARD, openssl, with_inkboard_ssl=yes, with_inkboard_ssl=no)
481                 if test "x$with_inkboard_ssl" = "xyes"; then
482                         dnl OpenSSL found; enable SSL support in Pedro
483                         INKBOARD_CFLAGS="$INKBOARD_CFLAGS -DHAVE_SSL"
484                         AC_DEFINE(WITH_INKBOARD_SSL,1,[Build in SSL support for Inkboard])
485                 fi
486 else
487         with_inkboard="no"
488 fi
490 AC_MSG_RESULT($with_inkboard)
491 AM_CONDITIONAL(WITH_INKBOARD, test "x$with_inkboard" = "xyes")
492 AC_SUBST(INKBOARD_LIBS)
493 AC_SUBST(INKBOARD_CFLAGS)
495 dnl ******************************
496 dnl   Unconditional dependencies
497 dnl ******************************
499 dnl *** NOTE: when we move to gtk 2.6 or later, we can remove the 
500 dnl ********* the override for g_ascii_strtod below...
501 dnl sigc++-2.0 >= 2.0.12: using "visit_each" not available in 2.0.10
502 if test $cc_vers_major -gt 3; then
503     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)
504 else
505     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)
506 fi
508 dnl Shouldn't we test for libpng and libz?
509 INKSCAPE_LIBS="$INKSCAPE_LIBS -lpng -lz"
511 AC_CHECK_HEADER(popt.h,
512                 [INKSCAPE_LIBS="$INKSCAPE_LIBS -lpopt"],
513                 AC_MSG_ERROR([libpopt is required]))
515 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
516 sp_save_LIBS=$LIBS
517 LIBS="$LIBS $INKSCAPE_LIBS"
518 AC_CHECK_FUNCS(bind_textdomain_codeset)
519 dnl Check for gtk_window_fullscreen in gtk (>= 2.2)
520 AC_CHECK_FUNCS(gtk_window_set_default_icon_from_file)
521 AC_CHECK_FUNCS(gtk_window_fullscreen)
522 LIBS=$sp_save_LIBS
525 dnl Check for binary relocation support
526 dnl Hongli Lai <h.lai@chello.nl>
528 AC_ARG_ENABLE(binreloc,
529        [  --enable-binreloc       compile with binary relocation support],
530        enable_binreloc=$enableval,enable_binreloc=no)
532 AC_MSG_CHECKING(whether binary relocation support should be enabled)
533 if test "$enable_binreloc" = "yes"; then
534        AC_MSG_RESULT(yes)
535        AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
536        if test -e /proc/self/maps; then
537                AC_MSG_RESULT(yes)
538        else
539                AC_MSG_RESULT(no)
540                AC_MSG_ERROR(/proc/self/maps is not available. Binary relocation cannot be enabled.)
541                enable_binreloc="no"
542        fi
544 elif test "$enable_binreloc" = "auto"; then
545        AC_MSG_RESULT(yes when available)
546        AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
547        if test -e /proc/self/maps; then
548                AC_MSG_RESULT(yes)
549                enable_binreloc=yes
551                AC_MSG_CHECKING(whether everything is installed to the same prefix)
552                if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
553                        "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
554                        "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
555                then
556                        AC_MSG_RESULT(yes)
557                else
558                        AC_MSG_RESULT(no)
559                        AC_MSG_NOTICE(Binary relocation support will be disabled.)
560                        enable_binreloc=no
561                fi
563        else
564                AC_MSG_RESULT(no)
565                enable_binreloc=no
566        fi
568 elif test "$enable_binreloc" = "no"; then
569        AC_MSG_RESULT(no)
570 else
571        AC_MSG_RESULT(no (unknown value "$enable_binreloc"))
572        enable_binreloc=no
573 fi
574 AC_DEFINE(BR_PTHREADS,[0],[Use binreloc thread support?])
575 if test "$enable_binreloc" = "yes"; then
576    AC_DEFINE(ENABLE_BINRELOC,,[Use AutoPackage?])
577 fi
579 AC_ARG_ENABLE(osxapp,
580        [  --enable-osxapp         compile with OSX .app data dir paths],
581        enable_osxapp=$enableval,enable_osxapp=no)
582 if test "$enable_osxapp" = "yes"; then
583    AC_DEFINE(ENABLE_OSX_APP_LOCATIONS,,[Build with OSX .app data dir paths?])
584 fi
586 dnl ******************************
587 dnl   Boost graph library is required for graphlayout functions
588 dnl ******************************
589 AC_CHECK_HEADER([boost/graph/adjacency_list.hpp],
590                 [AC_DEFINE([HAVE_BOOST_GRAPH_LIB],[],[Will enable connector network layout])],
591                 [AC_MSG_WARN([Boost graph lib not found, can't include connector network layout functionality.])])
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}