dnl Process this file with autoconf to produce a configure script. dnl initialization AC_PREREQ(2.13) AC_INIT(gw/alt_charsets.h) AC_CONFIG_HEADER(config.h) AC_SUBST(SHELL) dnl Gateway version number. AC_DEFINE_UNQUOTED(VERSION, "`head -1 VERSION`") dnl Target installation directory for documentation AC_SUBST(docdir) docdir='${prefix}/doc/kannel' dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB AC_PROG_YACC AC_PROG_LEX AC_PATH_PROG(PERL, perl) AC_CHECK_FILE(/sbin/start-stop-daemon, , STARTSTOPDAEMONSRC="utils/start-stop-daemon.c") AC_SUBST(STARTSTOPDAEMONSRC) dnl Checks for libraries. AC_CHECK_LIB(m, log) AC_CHECK_LIB(socket, accept) AC_CHECK_LIB(nsl, inet_ntoa) AC_CHECK_LIB(pthread, pthread_create) if test -z "$pthread"; then AC_CHECK_LIB(c_r, pthread_create, [LIBS="$LIBS -lc_r"]) fi AC_CHECK_LIB(z, gzopen) AC_PATH_PROG(XML_CONFIG, xml-config, no) if test "$XML_CONFIG" = "no"; then echo "You MUST have the gnome-xml library installed"; exit 1 else changequote(<<, >>)dnl case `$XML_CONFIG --version` in *2.[2-9].[0-9]*) ;; *) echo "Libxml is too old. You need at least 2.2.0." ; exit 1 ;; esac changequote([, ])dnl LIBS="$LIBS `$XML_CONFIG --libs`" CFLAGS="$CFLAGS `$XML_CONFIG --cflags`" fi dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(sys/ioctl.h sys/time.h sys/types.h unistd.h) AC_CHECK_HEADERS(pthread.h getopt.h) AC_CHECK_HEADER(sys/strsun.h, CFLAGS="$CFLAGS -DSunOS=1") dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_CHECK_FUNCS(gettimeofday select socket strdup getopt_long) AC_CHECK_FUNC(getopt, , LIBOBJS="$LIBOBJS utils/attgetopt.o") AC_SUBST(LIBOBJS) dnl Extra feature checks dnl GW_HAVE_TYPE_FROM(HDRNAME, TYPE, HAVENAME, DESCRIPTION) AC_DEFUN(GW_HAVE_TYPE_FROM, [ AC_CACHE_CHECK([for $2 in <$1>], gw_cv_type_$3, AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H #include #endif #include <$1> ], [$2 foo;], gw_cv_type_$3=yes, gw_cv_type_$3=no)) if test $gw_cv_type_$3 = yes; then AC_DEFINE($3, 1, $4) fi ]) dnl GW_HAVE_FUNC_FROM(HDRNAME, FUNC, HAVENAME, DESCRIPTION) AC_DEFUN(GW_HAVE_FUNC_FROM, [ AC_CACHE_CHECK([for $2 in <$1>], gw_cv_func_$3, AC_TRY_COMPILE([#include <$1>], [void *foo = $2;], gw_cv_func_$3=yes, gw_cv_func_$3=no)) if test $gw_cv_func_$3 = yes; then AC_DEFINE($3, 1, $4) fi ]) GW_HAVE_TYPE_FROM(sys/socket.h, socklen_t, HAVE_SOCKLEN_T, [Defined if there is a socklen_t in ]) dnl DocBook stuff AC_CHECK_PROG(JADE, jade, jade, :) AC_CHECK_PROG(JADETEX, jadetex, jadetex, :) AC_CHECK_PROG(DVIPS, dvips, dvips, :) AC_CHECK_PROG(FIG2DEV, fig2dev, fig2dev, :) AC_SUBST(HTML_DSL) for file in /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/html/docbook.dsl \ /usr/lib/sgml/stylesheets/nwalsh-modular/html/docbook.dsl do AC_CHECK_FILE($file,HTML_DSL=$file) done AC_SUBST(TEX_DSL) for file in /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/print/docbook.dsl \ /usr/lib/sgml/stylesheets/nwalsh-modular/print/docbook.dsl do AC_CHECK_FILE($file,TEX_DSL=$file) done dnl Implement --enable-docs option. AC_SUBST(DOCSTARGET) if test "x$HTML_DSL" = "x" -o "x$TEX_DSL" = "x" then DOCSTARGET="no-docs" else DOCSTARGET="docs" fi AC_ARG_ENABLE(docs, [ --enable-docs enable building of documentation], [ if test "$enableval" = "yes" then DOCSTARGET="docs" else DOCSTARGET="no-docs" fi ]) case "$DOCSTARGET" in no-docs) echo Not building documentation. ;; docs) echo Documentation will be built as well. ;; esac dnl Implement --enable-debug option. AC_ARG_ENABLE(debug, [ --enable-debug enable non-reentrant development time debugging], [ echo enabling debugging if test -n "$GCC"; then CFLAGS="$CFLAGS -Wall" fi AC_DEFINE(WS_DEBUG) ]) dnl Implement --enable-localtime option. AC_ARG_ENABLE(localtime, [ --enable-localtime log file time stamps in local time, not GMT], [ if test "$enableval" = yes; then AC_DEFINE(LOG_TIMESTAMP_LOCALTIME) fi ]) dnl --with-malloc=native/fast/checking AC_ARG_WITH(malloc, [ --with-malloc select malloc wrapper to use: native/checking], [ case "$withval" in native) AC_DEFINE(USE_GWMEM_NATIVE) ;; check) AC_DEFINE(USE_GWMEM_CHECK) ;; *) echo "Unknown malloc wrapper $withval. Oops."; exit 1 ;; esac ], [ echo "malloc without" AC_DEFINE(USE_GWMEM_CHECK) ]) dnl --enable-mutex-stats option. AC_ARG_ENABLE(mutex-stats, [ --enable-mutex-stats produce information about lock contention], [ if test "$enableval" = yes; then AC_DEFINE(MUTEX_STATS) fi ]) dnl Final Output AC_OUTPUT(Makefile)