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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
dnl Process this file with autoconf to produce a configure script.
dnl The ONLY thing this is used for is to configure for different
dnl linux architectures and configurations, it is not used to make the
dnl code more portable
AC_INIT(configure.in)
CFLAGS="-Wall $CFLAGS -D_GNU_SOURCE"
AC_CONFIG_AUX_DIR(.)
AC_CONFIG_HEADER(src/config.h:src/config.h.in)
AC_DEFINE_UNQUOTED(DEBCONF_VERSION,2.0)
AC_DEFINE_UNQUOTED(PACKAGE,"cdebconf")
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_ISC_POSIX
dnl We must have sed...
AC_CHECK_PROG(HAVESED,sed,yes,no)
test "$HAVESED" = "yes" || exit 1
dnl Use pod2man for generating manpages
AC_PATH_PROG(POD2MAN,pod2man)
test -n "$POD2MAN" || exit 1
AC_SUBST(POD2MAN)
dnl setup source and build paths
TOPDIR=$(dirname $0)
if [[ "$TOPDIR" = "${TOPDIR#/}" ]]; then
# not absolute, resolve it
TOPDIR=$(readlink -f $(dirname $(pwd)/$0))
fi
AC_SUBST(TOPDIR)
BUILDDIR=$(pwd)
AC_SUBST(BUILDDIR)
if [[ "$TOPDIR" != "$BUILDDIR" ]]; then
echo "Setting up build directory"
for d in `(cd $TOPDIR; find . -type d -a -not -name CVS -a -not -name debian)`; do
mkdir -p $BUILDDIR/$d
test -f $TOPDIR/$d/Makefile && cp $TOPDIR/$d/Makefile $BUILDDIR/$d/
test -f $TOPDIR/$d/modules.mak && cp $TOPDIR/$d/modules.mak $BUILDDIR/$d/
done
fi
dnl Enable debugging?
AC_ARG_WITH(debug,[ --without-debug turn off debugging?])
if test "$with_debug" != "no"; then
AC_DEFINE(DODEBUG)
CFLAGS="$CFLAGS -g -D_DEBUG_"
fi
dnl Use rpath? (for testing mostly)
AC_ARG_WITH(depends,[ --with-rpath use rpath? (for testing)])
if test "$with_rpath" != "no"; then
RPATH="-Wl,-rpath,\$(shell pwd)"
AC_SUBST(RPATH)
fi
dnl What db modules to build?
AC_ARG_WITH(db,[ --with-db db modules to build])
DB_MODULES=$with_db
dnl What frontend modules to build?
AC_ARG_WITH(frontend,[ --with-frontend frontend modules to build])
FRONTEND_MODULES=$with_frontend
dnl debconf config file
DEBCONFCONFIG="/etc/cdebconf.conf"
AC_ARG_WITH(conffile,[ --with-conffile=PATH cdebconf config file [/etc/debconf.conf]],
[case "$withval" in
"") AC_MSG_ERROR(invalid conffile specified) ;;
*) DEBCONFCONFIG="$withval" ;;
esac])
AC_DEFINE_UNQUOTED(DEBCONFCONFIG, "$DEBCONFCONFIG")
DEFAULT_FRONTEND=text
AC_ARG_WITH(default-frontend, [ --with-default-frontend default frontend to use[text]],
[case "$withval" in
"") AC_MSG_ERROR(invalid default frontend specified) ;;
*) DEFAULT_FRONTEND="$withval";;
esac])
AC_SUBST(DEFAULT_FRONTEND)
dnl whether to use libtextwrap
AC_ARG_WITH(textwrap, [ --with-textwrap use libtextwrap for line-folding],
[if test "x$withval" = "xyes" ; then
AC_CHECK_LIB(textwrap, textwrap_init)
fi])
dnl logging to syslog (should be configurable in config file
SYSLOG_LOGGING=
AC_ARG_WITH(syslog-logging, [ --with-syslog-logging enable logging to syslog],
[SYSLOG_LOGGING=1])
AC_DEFINE_UNQUOTED(SYSLOG_LOGGING, "$SYSLOG_LOGGING")
dnl compile cdebconf udeb?
AC_ARG_ENABLE(d_i,
[ --enable-d-i build cdebconf for the debian-installer],
[test "$enableval" = "yes" && CFLAGS="$CFLAGS -DDI_UDEB"])
dnl Check for libraries
AC_CHECK_LIB(dl, dlopen)
dnl Autodetect what to build if not specified
dnl Databases - which to include.
if test -z "$DB_MODULES"; then
DB_MODULES="textdb rfc822db"
AC_CHECK_LIB(mysqlclient, mysql_init, DB_MODULES="$DB_MODULES mysql", echo "*** Cannot build mysql database ***")
fi
dnl Frontends - which to include.
if test -z "$FRONTEND_MODULES"; then
FRONTEND_MODULES=text
AC_CHECK_LIB(ncurses, initscr, FRONTEND_MODULES="$FRONTEND_MODULES ncurses", echo "*** Cannot build ncurses frontend ***")
AC_CHECK_LIB(bogl, bowl_flush, FRONTEND_MODULES="$FRONTEND_MODULES bogl", echo "*** Cannot build BOGL frontend ***")
AC_CHECK_LIB(slang, SLang_init_all, FRONTEND_MODULES="$FRONTEND_MODULES slang", echo "*** Cannot build SLang frontend ***")
AC_SUBST(FRONTEND_MODULES)
fi
AC_SUBST(FRONTEND_MODULES)
AC_SUBST(DB_MODULES)
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(socket strdup strstr strtol)
AC_OUTPUT(globalmakeflags src/cdebconf.conf-dist src/Makefile man/Makefile)
|