Code

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