configure.ac
changeset 0 c2f4c0285180
child 4 218904410231
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/configure.ac	Tue Jan 24 23:54:05 2012 +0000
     1.3 @@ -0,0 +1,94 @@
     1.4 +#                                               -*- Autoconf -*-
     1.5 +# Process this file with autoconf to produce a configure script.
     1.6 +
     1.7 +AC_INIT([gutcheck],[1.50],[ali@juiblex.co.uk])
     1.8 +AC_PREREQ(2.59)
     1.9 +AC_CONFIG_AUX_DIR([config])
    1.10 +AC_CONFIG_SRCDIR([gutcheck/gutcheck.c])
    1.11 +AC_CONFIG_FILES([Makefile
    1.12 +gclib/Makefile
    1.13 +gutcheck/Makefile
    1.14 +test/Makefile
    1.15 +test/harness/Makefile
    1.16 +test/compatibility/Makefile
    1.17 +doc/Makefile
    1.18 +])
    1.19 +AM_INIT_AUTOMAKE(no-define)
    1.20 +AC_CANONICAL_HOST
    1.21 +
    1.22 +##################################################
    1.23 +# Checks for programs.
    1.24 +##################################################
    1.25 +AC_PROG_CC
    1.26 +LT_INIT
    1.27 +# Libtool supports a --disable-shared option to tell it to avoid
    1.28 +# building shared versions of libraries. We don't have any libraries
    1.29 +# but we do want to support building static versions of our executables.
    1.30 +# Libtool can do this (under the right circumstances) so we overload
    1.31 +# this switch for this purpose.
    1.32 +#
    1.33 +# The libtool option that we use (-static-libtool-libs) means to use
    1.34 +# static linking with libraries that supply a .la file and which
    1.35 +# include a non-empty value for "old_library". If the library doesn't
    1.36 +# include a .la file (they are deleted by some distributions), then
    1.37 +# this option will have no effect and likewise if old_library is set
    1.38 +# to '' (eg., if the library was build with --disable-static) then
    1.39 +# again -static-libtool-libs will have no effect.
    1.40 +#
    1.41 +# If old_library is set to a non-empty value, then specifying
    1.42 +# -static-libtool-libs will cause the link to fail if the old library
    1.43 +# cannot be found (libtool will not fallback to a shared library
    1.44 +# in these circumstances). This can happen with Fedora, for example,
    1.45 +# if a main mingw32 library package is installed but not the
    1.46 +# coresponding static sub-package. The solution is to either
    1.47 +# install the relevant static sub-packages or don't use --disable-shared.
    1.48 +AS_IF([test "$enable_shared" = no],[
    1.49 +  LDFLAGS="$LDFLAGS -static-libtool-libs"
    1.50 +])
    1.51 +PKG_PROG_PKG_CONFIG
    1.52 +
    1.53 +##################################################
    1.54 +# Checks for header files.
    1.55 +##################################################
    1.56 +
    1.57 +##################################################
    1.58 +# Checks for typedefs, structures, and compiler characteristics.
    1.59 +##################################################
    1.60 +
    1.61 +##################################################
    1.62 +# Checks for libraries.
    1.63 +##################################################
    1.64 +AC_MSG_CHECKING([whether to use glib])
    1.65 +AC_ARG_WITH([glib],[AS_HELP_STRING([--without-glib],
    1.66 +  [use internal re-invented wheel rather than glib2])])
    1.67 +AS_IF([test "$with_glib" != no],[
    1.68 +  AC_MSG_RESULT([yes])
    1.69 +  PKG_CHECK_MODULES([GLIB],[glib-2.0])
    1.70 +  AC_DEFINE([HAVE_GLIB],[1],[Define if you have glib version 2.x])
    1.71 +],[
    1.72 +  AC_MSG_RESULT([no])
    1.73 +])
    1.74 +AM_CONDITIONAL([HAVE_GLIB],[test "$with_glib" != no])
    1.75 +
    1.76 +# NOTE: If we are using a static version of glib then we
    1.77 +# should define GLIB_STATIC_COMPILATION. This isn't needed
    1.78 +# when glib is built only for static use (in which case
    1.79 +# glibconfig.h will already define GLIB_STATIC_COMPILATION).
    1.80 +# It's not easy to tell if libtool will actually link with
    1.81 +# a static glib but luckily we don't currently need to;
    1.82 +# this pre-processor define only affects the behaviour of
    1.83 +# libraries which use glib and we don't have any.
    1.84 +
    1.85 +##################################################
    1.86 +# Checks for library functions.
    1.87 +##################################################
    1.88 +AC_CHECK_FUNCS_ONCE([mkstemp])
    1.89 +
    1.90 +##################################################
    1.91 +# Checks for processor independent files.
    1.92 +##################################################
    1.93 +
    1.94 +##################################################
    1.95 +# Generate the various configured files
    1.96 +##################################################
    1.97 +AC_OUTPUT