1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT([ivman],[0.6.12])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(ivman,0.6.12)
dnl If 'prefix' is not set, just set it to the default prefix
if test x$prefix = xNONE; then
prefix="$ac_default_prefix"
fi
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_LIBTOOL
dnl Check for gettext
AM_GNU_GETTEXT([external])
dnl check for mkdir
AC_PATH_PROG(MKDIR, mkdir, NOTFOUND)
if test $MKDIR = "NOTFOUND" ; then
AC_MSG_ERROR(['mkdir' could not be found])
fi
AC_DEFINE_UNQUOTED(MKDIR_PATH, "$MKDIR", [Path of mkdir binary])
dnl check for grep
AC_PATH_PROG(GREP, grep, NOTFOUND)
if test $GREP = "NOTFOUND" ; then
AC_MSG_ERROR(['grep' could not be found!])
fi
AC_DEFINE_UNQUOTED(GREP_PATH, "$GREP", [Path of grep binary])
dnl Check for debug
AC_MSG_CHECKING(whether to enable debugging)
debug_default="no"
AC_ARG_ENABLE(debug,AS_HELP_STRING([--enable-debug],[with debugging code]),,[enable_debug=$debug_default])
if test "x$enable_debug" = "xyes"; then
AC_DEFINE([IVM_DEBUG],[],[Enable debugging])
CFLAGS="${CFLAGS} -g"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
CFLAGS="${CFLAGS} -std=gnu99 -Wall"
dnl Checks for libraries.
PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
if test "x$have_libxml" = "xfalse" ; then
AC_MSG_ERROR([No LibXML library found, check config.log for failed attempts])
fi
AC_SUBST(LIBXML_CFLAGS)
AC_SUBST(LIBXML_LIBS)
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6.0 , have_glib=true, have_glib=false)
if test "x$have_glib" = "xfalse" ; then
AC_MSG_ERROR([No Glib found, check config.log for failed attempts])
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.3 , have_dbus_glib=true, have_dbus_glib=false)
if test "x$have_dbus_glib" = "xfalse" ; then
AC_MSG_ERROR([No Dbus-Glib found, check config.log for failed attempts])
fi
AC_SUBST(DBUS_GLIB_CFLAGS)
AC_SUBST(DBUS_GLIB_LIBS)
PKG_CHECK_MODULES(HAL, hal >= 0.5 , hal_0_5=true, hal_0_5=false)
if test "x$hal_0_5" = "xfalse" ; then
PKG_CHECK_MODULES(HAL, hal >= 0.4 , hal_0_4=true, hal_0_4=false)
if test "x$hal_0_4" = "xfalse" ; then
AC_MSG_ERROR([Couldn't find HAL >= 0.4!])
else
AC_DEFINE_UNQUOTED(HAL_0_4,1,[HAL is version 0.4.x])
fi
else
AC_DEFINE_UNQUOTED(HAL_0_5,1,[HAL is version 0.5.x])
fi
AC_SUBST(HAL_CFLAGS)
AC_SUBST(HAL_LIBS)
dnl Checks for header files.
AC_CHECK_HEADERS(unistd.h stdio.h libintl.h)
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_CHECK_FUNCS(printf)
AC_CHECK_FUNCS(fprintf)
AC_CHECK_FUNCS(strcmp strncmp)
AC_DEFINE_UNQUOTED(SYSCONFDIR,"`eval echo \"$sysconfdir\"`",[Default location base of config files])
AC_DEFINE_UNQUOTED(DATADIR,"`eval echo \"$datadir\"`",[Default location of shared data (i.e. /usr/share/ usually)])
AC_CONFIG_FILES([Makefile \
po/Makefile.in \
src/Makefile \
src/IvmConfig/Makefile
])
AC_OUTPUT([Makefile.in])
|