ali@0: # -*- Autoconf -*- ali@0: # Process this file with autoconf to produce a configure script. ali@0: ali@80: AC_INIT([bookloupe],[1.92],[ali@juiblex.co.uk]) ali@0: AC_PREREQ(2.59) ali@0: AC_CONFIG_AUX_DIR([config]) ali@5: AC_CONFIG_SRCDIR([bookloupe/bookloupe.c]) ali@0: AC_CONFIG_FILES([Makefile ali@5: bl/Makefile ali@5: bookloupe/Makefile ali@0: test/Makefile ali@0: test/harness/Makefile ali@0: test/compatibility/Makefile ali@72: test/bookloupe/Makefile ali@0: doc/Makefile ali@0: ]) ali@71: AM_INIT_AUTOMAKE([no-define 1.11]) ali@69: AM_SILENT_RULES([yes]) ali@0: AC_CANONICAL_HOST ali@0: ali@0: ################################################## ali@0: # Checks for programs. ali@0: ################################################## ali@0: AC_PROG_CC ali@0: LT_INIT ali@0: # Libtool supports a --disable-shared option to tell it to avoid ali@0: # building shared versions of libraries. We don't have any libraries ali@0: # but we do want to support building static versions of our executables. ali@0: # Libtool can do this (under the right circumstances) so we overload ali@0: # this switch for this purpose. ali@0: # ali@0: # The libtool option that we use (-static-libtool-libs) means to use ali@0: # static linking with libraries that supply a .la file and which ali@0: # include a non-empty value for "old_library". If the library doesn't ali@0: # include a .la file (they are deleted by some distributions), then ali@0: # this option will have no effect and likewise if old_library is set ali@0: # to '' (eg., if the library was build with --disable-static) then ali@0: # again -static-libtool-libs will have no effect. ali@0: # ali@0: # If old_library is set to a non-empty value, then specifying ali@0: # -static-libtool-libs will cause the link to fail if the old library ali@0: # cannot be found (libtool will not fallback to a shared library ali@0: # in these circumstances). This can happen with Fedora, for example, ali@0: # if a main mingw32 library package is installed but not the ali@0: # coresponding static sub-package. The solution is to either ali@0: # install the relevant static sub-packages or don't use --disable-shared. ali@0: AS_IF([test "$enable_shared" = no],[ ali@0: LDFLAGS="$LDFLAGS -static-libtool-libs" ali@0: ]) ali@9: LT_OUTPUT ali@9: ac_compile="./libtool --mode=compile --tag=CC $ac_compile" ali@9: ac_link="./libtool --mode=link --tag=CC $ac_link" ali@0: PKG_PROG_PKG_CONFIG ali@0: ali@0: ################################################## ali@0: # Checks for header files. ali@0: ################################################## ali@0: ali@0: ################################################## ali@0: # Checks for typedefs, structures, and compiler characteristics. ali@0: ################################################## ali@0: ali@0: ################################################## ali@0: # Checks for libraries. ali@0: ################################################## ali@14: PKG_CHECK_MODULES([GLIB],[glib-2.0 >= 2.18]) ali@0: ali@4: # Glib 2.30 (at least) doesn't include "-framework Carbon" in Libs.private ali@4: # which causes link to fail for static glib on Mac (gnome bug #668152). ali@4: # Test for this problem and implement a workaround. ali@4: AC_MSG_CHECKING([for Mac OS X Carbon support]) ali@4: AC_TRY_CPP([ ali@4: #include ali@4: #include ali@4: ],[have_carbon=yes],[have_carbon=no]) ali@4: AC_MSG_RESULT([$have_carbon]) ali@4: AS_IF([test "$have_glib" != no -a "$have_carbon" = yes],[ ali@4: AC_MSG_CHECKING([whether -framework Carbon is needed]) ali@4: save_CFLAGS="$CFLAGS" ali@4: save_LIBS="$LIBS" ali@4: CFLAGS="$GLIB_CFLAGS" ali@4: LIBS="$GLIB_LIBS" ali@4: AC_TRY_LINK([ ali@4: #include ali@4: ],[ ali@4: return !g_get_user_special_dir(G_USER_DIRECTORY_DESKTOP); ali@4: ],[framework_carbon=no],[framework_carbon=yes]) ali@4: CFLAGS="$save_CFLAGS" ali@4: LIBS="$save_LIBS" ali@4: AC_MSG_RESULT([$framework_carbon]) ali@4: AS_IF([test "$framework_carbon" = yes],[ ali@4: GLIB_LIBS="$GLIB_LIBS -framework Carbon" ali@4: ]) ali@4: ]) ali@4: ali@9: # If we are using a static version of glib then we should define ali@9: # GLIB_STATIC_COMPILATION. This isn't needed when glib is built ali@9: # only for static use (in which case glibconfig.h will already ali@9: # define GLIB_STATIC_COMPILATION). ali@9: AS_IF([test "$enable_shared" = no],[ ali@9: AC_MSG_CHECKING([whether GLIB_STATIC_COMPILATION needs to be defined]) ali@9: save_CFLAGS="$CFLAGS" ali@9: save_LIBS="$LIBS" ali@9: CFLAGS="$GLIB_CFLAGS" ali@9: LIBS="$GLIB_LIBS" ali@9: AC_TRY_LINK([ ali@9: #include ali@9: ],[ ali@9: return glib_major_version!=2; ali@9: ],[static_compilation=no],[static_compilation=yes]) ali@9: CFLAGS="$save_CFLAGS" ali@9: LIBS="$save_LIBS" ali@9: AC_MSG_RESULT([$static_compilation]) ali@9: AS_IF([test "$static_compilation" = yes],[ ali@9: GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_STATIC_COMPILATION" ali@9: ]) ali@9: ]) ali@9: ali@0: ################################################## ali@0: # Checks for library functions. ali@0: ################################################## ali@9: save_CFLAGS="$CFLAGS" ali@9: save_LIBS="$LIBS" ali@9: CFLAGS="$GLIB_CFLAGS" ali@9: LIBS="$GLIB_LIBS" ali@9: AC_CHECK_FUNCS([g_mkdtemp mkdtemp],[break]) ali@9: CFLAGS="$save_CFLAGS" ali@9: LIBS="$save_LIBS" ali@0: ali@0: ################################################## ali@0: # Checks for processor independent files. ali@0: ################################################## ali@0: ali@0: ################################################## ali@0: # Generate the various configured files ali@0: ################################################## ali@0: AC_OUTPUT