Code

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