Code

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