siproxd/configure.in
2002-11-23 17:42:42 +00:00

166 lines
3.5 KiB
Plaintext

dnl
dnl History
dnl -------
dnl before time a lot happend before start of history
dnl 8-Sep-2002 tries included more tests for used functions
dnl 17-Sep-2002 tries fail configure if needed libs not there
dnl 14-Nov-2002 tries support for *BSD systems
dnl
dnl
dnl
dnl
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/siproxd.c)
dnl ******************************************************************
dnl
dnl Release Version
dnl
SPD_MAJOR_VERSION=0
SPD_MINOR_VERSION=2
SPD_MICRO_VERSION=5
SPD_VERSION=$SPD_MAJOR_VERSION.$SPD_MINOR_VERSION.$SPD_MICRO_VERSION
dnl *********************************************************************
dnl
dnl Initialize automake stuff
dnl
AC_CONFIG_AUX_DIR(scripts)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(siproxd, $SPD_VERSION)
dnl
dnl Checks for needed programs.
dnl
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
dnl
dnl add
dnl --with-extra-includes
dnl --with-extra-libs
dnl
AC_ARG_WITH(extra-includes,
[ --with-extra-includes=DIR adds non standard include paths],
extra_includes="$withval" )
AC_SUBST(extra_includes)
AC_MSG_CHECKING("extra includes")
AC_MSG_RESULT($extra_includes)
AC_ARG_WITH(extra-libs,
[ --with-extra-libs=DIR adds non standard library paths],
extra_libs="$withval" )
AC_SUBST(extra_libs)
AC_MSG_CHECKING("extra libs")
AC_MSG_RESULT($extra_libs)
for each in $extra_includes; do
CPPFLAGS="$CPPFLAGS -I$each";
done
for each in $extra_libs; do
LIBS="$LIBS -L$each";
done
dnl
dnl system specific stuff
dnl
AC_MSG_CHECKING("target platform")
case "$target" in
*-*-linux*)
AC_MSG_RESULT("Linux")
AC_DEFINE(_LINUX,,[building on Linux platform])
;;
*-*-freebsd*)
AC_MSG_RESULT("FreeBSD")
AC_DEFINE(_BSD,,[building on BSD platform])
AC_DEFINE(_FREEBSD,,[building on FreeBSD platform])
CPPFLAGS="$CPPFLAGS -I/usr/local/include/"
LIBS="$LIBS -L/usr/local/lib/ -lgnugetopt"
;;
*-*-openbsd*)
AC_MSG_RESULT("OpenBSD")
AC_DEFINE(_BSD,,[building on BSD platform])
AC_DEFINE(_OPENBSD,,[building on OpenBSD platform])
CPPFLAGS="$CPPFLAGS -I/usr/local/include/"
LIBS="$LIBS -L/usr/local/lib/ -lgnugetopt"
;;
*-*-netbsd*)
AC_MSG_RESULT("NetBSD")
AC_DEFINE(_BSD,,[building on BSD platform])
AC_DEFINE(_NETBSD,,[building on NetBSD platform])
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
LIBS="$LIBS -L/usr/pkg/lib"
;;
*)
;;
esac
dnl
dnl Check for libosip
dnl
AC_CHECK_LIB(osip, parser_init,,
echo "*** ERROR: libosip is required!";exit 1;)
dnl
dnl Check for pthreads
dnl
ACX_PTHREAD(,
echo "*** ERROR: pthreads is required!"; exit 1;)
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
dnl
dnl Checks for header files.
dnl
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h unistd.h errno.h)
AC_CHECK_HEADERS(stdarg.h varargs.h)
AC_CHECK_HEADERS(pwd.h)
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl
dnl Checks for library functions.
dnl
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strerror)
AC_CHECK_FUNCS(gethostbyname)
AC_CHECK_FUNCS(getopt_long daemon syslog)
AC_CHECK_FUNCS(getuid setuid getgid setgid getpwnam chroot)
AC_CHECK_FUNCS(socket bind select read send sendto)
AC_CHECK_FUNCS(strncpy strchr strstr sprintf vfprintf vsnprintf)
AC_CHECK_FUNCS(fgets sscanf)
AC_SUBST(CPPFLAGS)
AC_SUBST(LIBS)
dnl
dnl Generate output files
dnl
AC_OUTPUT(Makefile \
src/Makefile \
doc/Makefile \
scripts/Makefile \
)