configure.ac revision 3b7f38d1e826b64153ec4a069c5d192a91952577
3f3aa287185afb5d48d7ef0717054a154c372dc9Adam Moorednl Process this file with autoconf to produce a configure script.
3f3aa287185afb5d48d7ef0717054a154c372dc9Adam MooreAC_PREREQ(2.50)
3f3aa287185afb5d48d7ef0717054a154c372dc9Adam MooreAC_INIT(inkscape, 0.45+devel)
3f3aa287185afb5d48d7ef0717054a154c372dc9Adam Moorednl N.B. After 0.40, please change to `0.40+cvs' instead of `0.41cvs'.
9f298ce1aa6fec44a47a40d6c358950d3c26ffd0Adam Moorednl Rationale: (i) placate simple version comparison software such as
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl `dpkg --compare-versions'. (ii) We don't always know what the next
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl version is going to be called until about the time we release it
483011d54907725ef9ea08d4c90cca21ae9fa11cLuke Smithdnl (whereas we always know what the previous version was called).
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_CANONICAL_HOST
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_CONFIG_SRCDIR(src/main.cpp)
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAM_INIT_AUTOMAKE
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_ARG_ENABLE([lsb], AS_HELP_STRING([--enable-lsb], [LSB-compatible build configuration]), [
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith export CC CXX
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAM_CONFIG_HEADER(config.h)
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_PROG_INTLTOOL(0.22)
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAM_PROG_CC_STDC
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_HEADER_STDC
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl These next few lines are needed only while libcroco is in our source tree.
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAM_PROG_CC_C_O
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_MSG_NOTICE([Testing -Wno-pointer-sign])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithif test "$GCC" = "yes"; then
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # Enable some warnings from gcc.
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_LANG_PUSH(C)
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # -Wno-pointer-sign is probably new in gcc 4.0; certainly it isn't accepted
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # by gcc 2.95.
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith ink_svd_CFLAGS="$CFLAGS"
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith CFLAGS="-Wno-pointer-sign $CFLAGS"
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), AC_MSG_NOTICE([ compiler supports -Wno-pointer-sign]), CFLAGS="$ink_svd_CFLAGS")
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith CFLAGS="-Wall -Wformat-security -W -D_FORTIFY_SOURCE=2 $CFLAGS"
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl Honor aclocal flags
e59eb7d181274b19657e7f22826237dcf8a95c80Luke SmithACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_PROG_RANLIB
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl Verify our GCC version
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithif test "x$GXX" = "xyes"; then
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_MSG_CHECKING([GNU compiler version])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # Don't pass CXXFLAGS to the following CXX command as some
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # of them can't be specified along with '-v'.
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith cc_version=["`$CXX -v 2>&1 </dev/null |grep 'gcc version' |\
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"]
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_MSG_RESULT([$cc_version])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # Some version numbers
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith cc_vers_major=`echo $cc_version | cut -f1 -d.`
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith cc_vers_minor=`echo $cc_version | cut -f2 -d.`
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith cc_vers_patch=`echo $cc_version | cut -f3 -d.`
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith test -n "$cc_vers_major" || cc_vers_major=0
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith test -n "$cc_vers_minor" || cc_vers_minor=0
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith test -n "$cc_vers_patch" || cc_vers_patch=0
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch`
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith if test $cc_vers_major -lt 3; then
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_MSG_ERROR([gcc >= 3.0 is needed to compile inkscape])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl ******************************
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl Gettext stuff
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl ******************************
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithGETTEXT_PACKAGE="AC_PACKAGE_NAME"
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_SUBST(GETTEXT_PACKAGE)
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Translation domain used])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl Add the languages which your application supports here.
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithALL_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 he 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"
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAM_GLIB_GNU_GETTEXT
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_PATH_PROG(PKG_CONFIG, pkg-config, no)
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithif test "x$PKG_CONFIG" = "xno"; then
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_MSG_ERROR(You have to install pkg-config to compile inkscape.)
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl Find msgfmt. Without this, po/Makefile fails to set MSGFMT on some platforms.
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_PATH_PROG(MSGFMT, msgfmt, msgfmt)
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl ******************************
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl Check for libpng
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl ******************************
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no)], png_ok=no, -lz -lm)
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithif test "x$png_ok" != "xyes"; then
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_MSG_ERROR([libpng >= 1.2 is needed to compile inkscape])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl Handle possible dlopen requirement for libgc
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithdnl Isn't this internal to something in autoconf? Couldn't find it...
b839e41217a63e244d65c3aadf54feec82ddd179Luke SmithAC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen],
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith [lt_cv_dlopen="dlopen"],
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith [AC_CHECK_LIB([dl], [dlopen],
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith [AC_CHECK_LIB([svld], [dlopen],
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith [AC_CHECK_LIB([dld], [dld_link],
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # To test for the different required libs, I have to
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # overcome autoconf's caching system, so I change the
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # desired function name. They're all in libgc.
5af2618af73bd3f008ef0e9b5f982f560c64059bAdam Moore # The "break" will exit from the top level
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith # AC_CHECK_HEADERS.
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_CHECK_LIB(gc, GC_init,
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith LIBS="-lgc $gc_libs $LIBS";
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith break], [gc_ok=no], [$gc_libs])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith gc_libs="-lpthread"
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_CHECK_LIB(gc, GC_malloc,
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith LIBS="-lgc $gc_libs $LIBS";
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith break], [gc_ok=no], [$gc_libs])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith gc_libs="$lt_cv_dlopen_libs"
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_CHECK_LIB(gc, GC_realloc,
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith LIBS="-lgc $gc_libs $LIBS";
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith break], [gc_ok=no], [$gc_libs])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith gc_libs="-lpthread $lt_cv_dlopen_libs"
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith AC_CHECK_LIB(gc, GC_free,
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith LIBS="-lgc $gc_libs $LIBS";
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith break], [gc_ok=no], [$gc_libs])
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smithif test "x$gc_ok" = "xyes"; then
5af2618af73bd3f008ef0e9b5f982f560c64059bAdam Moore AC_MSG_CHECKING([libgc version 6.4+])
5af2618af73bd3f008ef0e9b5f982f560c64059bAdam Moore AC_RUN_IFELSE(
5af2618af73bd3f008ef0e9b5f982f560c64059bAdam Moore [AC_LANG_SOURCE([[
537e74c4e869b8efba925d0e37c0a5636203a23bAdam Moore #ifdef HAVE_GC_GC_H
5af2618af73bd3f008ef0e9b5f982f560c64059bAdam Moore extern unsigned GC_version;
b839e41217a63e244d65c3aadf54feec82ddd179Luke Smith int main(void){
AC_MSG_ERROR([libgc (the Boehm Conservative Collector) 6.4+, is needed to compile inkscape -- http://www.hpl.hp.com/personal/Hans_Boehm/gc])
AC_CHECK_HEADERS([sys/filio.h])
AC_CHECK_HEADERS([malloc.h])
AC_CHECK_MEMBERS([struct mallinfo.usmblks,
struct mallinfo.fsmblks,
struct mallinfo.uordblks,
struct mallinfo.fordblks,
struct mallinfo.hblkhd],,,
[#include <malloc.h>])
AC_CHECK_HEADER(X11/Xft/Xft.h, xft_ok=yes, xft_ok=no)
XFT_LIBS="-L/usr/X11R6/lib -lXft "
PKG_CHECK_MODULES(GNOME_PRINT, libgnomeprint-2.2 >= 1.116.0 libgnomeprintui-2.2 >= 1.116.0, gp=yes, gp=no)
AC_MSG_ERROR([--with-gnome-print was specified, but appropriate libgnomeprint development packages could not be found])
AC_MSG_ERROR([--with-gnome-vfs was specified, but appropriate libgnomevfs development packages could not be found])
AC_HELP_STRING([--without-inkjar], [disable openoffice files (SVG jars)]),[with_ij=$withval], [with_ij=yes])
AC_CHECK_HEADERS(zlib.h)
checkPERL_CFLAGS=`perl -MExtUtils::Embed -e perl_inc 2>/dev/null`
checkPERL_LIBS=`perl -MExtUtils::Embed -e ldopts 2>/dev/null`
checkPYTHON_CFLAGS=`python -c "import distutils.sysconfig ; print '-I%s' % distutils.sysconfig.get_config_var('INCLUDEPY')" 2>/dev/null`
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`
AC_MSG_ERROR([--enable-lcms was specified, but appropriate LittleCms development packages could not be found])
AS_HELP_STRING([--enable-inkboard], [enable Inkboard online whiteboard facility (disabled by default)]),
AC_CHECK_LIB(Magick++, InitializeMagick, [AC_CHECK_HEADER(Magick++.h, magick_ok=yes, magick_ok=no)], magick_ok=no, -llcms -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lz -lpthread -lm -lpthread)
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)
AC_CHECK_HEADERS([boost/concept_check.hpp], [], AC_MSG_ERROR([You need the boost package (e.g. libboost-dev)]))
AC_CHECK_HEADER(popt.h,
AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
if test -e /proc/self/maps; then
AC_MSG_ERROR(/proc/self/maps is not available. Binary relocation cannot be enabled.)
AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
if test -e /proc/self/maps; then
AC_CHECK_HEADERS(ieeefp.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(libintl.h)
AC_CHECK_HEADERS(stddef.h)
AC_CHECK_HEADERS(sys/time.h)
# One way of selectively disabling the warnings (i.e. only where the
# programmer deliberately isn't using the parameter, e.g. for a callback)
# in src/seltrans.cpp:sp_seltrans_handle_event; this indicates that the
# programmer deliberately has an unused parameter (e.g. because it's used
CXXFLAGS="-Wall -Wformat-security -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -D_FORTIFY_SOURCE=2 $CXXFLAGS"
dnl AC_ARG_ENABLE(libinkscape, AC_HELP_STRING([--enable-libinkscape], [Compile dynamic library (experimental)]), [splib=$enableval], [splib=no])
AC_ARG_ENABLE(mmx, [ --disable-mmx Don't use MMX optimization [default=auto]], enable_mmx="$enableval", enable_mmx=auto)
dnl Define our data paths for config.h
[Base data directory -- only path-prefix.h should use it!])
[Base library directory -- only path-prefix.h should use it!])