📄 configure.in
字号:
dnldnl Historydnl -------dnl before time a lot happend before start of historydnl 8-Sep-2002 tries included more tests for used functionsdnl 17-Sep-2002 tries fail configure if needed libs not therednl 14-Nov-2002 tries support for *BSD systemsdnl 22-Mar-2003 tries check for sockaddr_t, hstrerror()dnl --enable-almost-static (for Fli4l use)dnl --enable-uclibc (uClibc building support)dnl 29-Mar-2003 tries added support for libosip2dnl 6-Apr-2003 tries redone the fli4l specific build optionsdnl now: --enable-fli4l-libc5, --enable-fli4l-uclibcdnl 7-Apr-2003 tries added siproxd.spec to autoconf processdnl 31-Jul-2003 tries changed to support OSIP2 onlydnl 1-Sep-2003 tries check for IPCHAINSdnl 5-Sep-2003 tries test for pthreads before libosip stuffdnl 19-Sep-2003 tries DMALLOC supportdnl 1-Nov-2003 tries check for NETFILTER (IPTABLES)dnl 18-Nov-2003 tries include sysconfdir to search for configdnl 19-Nov-2003 tries changes to support Solaris & BSD/OSdnl 22-Nov-2003 tries test for gethostbyname_r() & # of argsdnl 22-Jan-2004 tries add --enable-static optiondnl 06-Mar-2004 tries del daemon(), add setsid()dnl 09-Apr-2004 tries add --with-custom-fwmodulednl 09-May-2004 tries fli4l-uclibc links statically agains pthreadsdnl 29-May-2004 tries use AC_CHECK_TYPE to check for socklen_tdnl 09-May-2004 tries fli4l-libc5 does NOT use gethostbyname_r()dnl (there seems to be a bug somewhere)dnl 18-Aug-2004 tries fli4l-uclibc -> fli4l-21-uclibc, fli4l-22-uclibcdnl 2.1.x has no pthread support, link -staticdnl 2.2.x has (maybe) pthread supportdnl 08-Jan-2005 tries FreeBSD: check for libgnugetopt before using itdnl Cygwin build supportdnl 13-Feb-2005 tries check for # of args on libosip2 functionsdnl 10-Apr-2005 tries check for docbookdnl 18-Apr-2005 tries added libresolvdnl 9-Oct-2005 tries libresolv is now included in static builddnl 10-Jun-2007 tries test more .h files (DNS resolver related)dnl 18-Dec-2007 tries requires libosip2-3.x.xdnldnldnl Process this file with autoconf to produce a configure script.AC_INIT(src/siproxd.c)dnl ******************************************************************dnldnl Release VersiondnlSPD_MAJOR_VERSION=0SPD_MINOR_VERSION=7SPD_MICRO_VERSION=0SPD_VERSION=$SPD_MAJOR_VERSION.$SPD_MINOR_VERSION.$SPD_MICRO_VERSIONdnl *********************************************************************dnldnl Initialize automake stuffdnlAC_CONFIG_AUX_DIR(scripts)AC_CANONICAL_SYSTEMAM_CONFIG_HEADER(config.h)AM_INIT_AUTOMAKE(siproxd, $SPD_VERSION)dnldnl Checks for needed programs.dnlAC_PROG_AWKAC_PROG_CCAC_PROG_CPPAC_PROG_RANLIBAC_PROG_INSTALLAC_PROG_LN_SAC_CHECK_PROG(docbook2pdf,docbook2pdf,yes,)AM_CONDITIONAL(have_docbook2pdf,test "$docbook2pdf" = "yes")AC_CHECK_PROG(docbook2html,docbook2html,yes,)AM_CONDITIONAL(have_docbook2html,test "$docbook2html" = "yes")dnldnl adddnl --with-extra-includesdnl --with-extra-libsdnlAC_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";donefor each in $extra_libs; do LIBS="$LIBS -L$each";donednldnl adddnl --enable-static AC_MSG_CHECKING(build statically linked executable) AC_ARG_ENABLE(static, [ --enable-static build statically linked executable], LDFLAGS="$LDFLAGS -static"; AC_MSG_RESULT(yes), AC_MSG_RESULT(no))dnldnl adddnl --enable-dmalloc AC_MSG_CHECKING(building with DMALLOC support) AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc build with DMALLOC support], CFLAGS="$CFLAGS -DDMALLOC ";LIBS="-ldmallocth $LIBS"; AC_MSG_RESULT(yes), AC_MSG_RESULT(no))dnldnl target platform specific stuffdnlAC_DEFINE_UNQUOTED(UNAME,"$target",[target platform])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/" AC_CHECK_LIB(gnugetopt,getopt_long,[LIBS="$LIBS -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/" ;; *-*-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" ;; *-*-bsdi* | *-*-bsdos*) AC_MSG_RESULT(BSD/OS) AC_DEFINE(_BSD,,[building on BSD platform]) AC_DEFINE(_BSDOS,,[building on BSD/OS platform]) ;; *-*-solaris2*) # It's easier to do this here, rather than AC_CHECK_LIBS for all of the # things that are/might be in libsocket or libnsl... AC_MSG_RESULT(Solaris 2.x) AC_DEFINE(_SOLARIS2,,[building on Solaris2 platform]) LIBS="$LIBS -lsocket -lnsl" ;; *-*-darwin*) AC_MSG_RESULT(Mac OS X) AC_DEFINE(_MACOSX,,[building on Mac OSX platform]) ;; *-*-cygwin*) AC_MSG_RESULT(Cygwin) AC_DEFINE(_CYGWIN,,[building on Cygwin (Windows) platform]) ;; *) AC_MSG_RESULT(Unknown Platform) AC_DEFINE(_UNKNOWN,,[building on unknown platform]) ;;esacdnldnl Feature:dnl Fli4l libc5 support (only available on Linux, yet)dnl Fli4l uClibc support (only available on Linux, yet)dnlbuild_fli4l_libc5="no"build_fli4l_21_uclibc="no"build_fli4l_22_uclibc="no"case "$target" in *-*-linux*) AC_MSG_CHECKING(whether build for FLI4L 2.0.x libc5 ) AC_ARG_ENABLE(fli4l-libc5, [ --enable-fli4l-libc5 build FLI4L 2.0.x (libc5)], build_fli4l_libc5=$enableval,) AC_MSG_RESULT($build_fli4l_libc5) AC_MSG_CHECKING(whether build for FLI4L 2.1.x uClibc) AC_ARG_ENABLE(fli4l-21-uclibc, [ --enable-fli4l-21-uclibc build FLI4L 2.1.x (uClibc, no pthreads support)], build_fli4l_21_uclibc=$enableval,) AC_MSG_RESULT($build_fli4l_21_uclibc) AC_MSG_CHECKING(whether build for FLI4L 2.2.x uClibc) AC_ARG_ENABLE(fli4l-22-uclibc, [ --enable-fli4l-22-uclibc build FLI4L 2.2.x (uClibc, with pthreads support)], build_fli4l_22_uclibc=$enableval,) AC_MSG_RESULT($build_fli4l_22_uclibc) ;; *) AC_MSG_RESULT(building FLI4L not available on this platform) ;;esacbuild_static_libosip="no"build_static_pthread="no"if test "x$build_fli4l_libc5" = "xyes"; then dnl FLI4l 2.0.x libc5: make libosip and libpthread static build_static_libosip="yes" build_static_pthread="yes"elif test "x$build_fli4l_21_uclibc" = "xyes"; then dnl FLI4l 2.1.x uClibc: build all static LDFLAGS="$LDFLAGS -static";elif test "x$build_fli4l_22_uclibc" = "xyes"; then dnl FLI4l 2.2.x uClibc: make libosip build_static_libosip="yes"fidnldnl Check for pthreadsdnlACX_PTHREAD(, echo "*** ERROR: pthreads is required!"; exit 1;)if test "x$build_static_pthread" = "xno"; then dnl link dynamically (default) LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC"else dnl link statically to this lib dnl (this probably only will work on linux yet...) AC_MSG_CHECKING("where I can find static threads library") libpthreads_static=`find $extra_libs /lib /usr/lib /usr/local/lib \ -name 'lib*thread*.a' 2>/dev/null| \ egrep 'lib[p]?thread[s]?.a' |head -1` if test "x$libpthreads_static" != "x"; then LIBS="$libpthreads_static $LIBS" AC_MSG_RESULT($libpthreads_static) else echo "*** ERROR: a static threads library is required!";exit 1; fi CC="$PTHREAD_CC"fidnldnl Make sure that symbol _POSIX_THREAD_SAFE_FUNCTIONS is defined.dnl This is needed by some platforms to make reentrant functionsdnl available (gethostbyname_r)dnlCFLAGS="$CFLAGS -D_POSIX_THREAD_SAFE_FUNCTIONS"dnldnl adddnl --with-libosip-prefix=DIRdnllibosip_prefix_dir=""AC_ARG_WITH(libosip-prefix, [ --with-libosip-prefix=DIR use libosip2 from DIR/include and DIR/lib], if test x$withval != x ; then libosip_prefix_dir="$withval"; fi, )AC_SUBST(libosip_prefix_dir)AC_MSG_CHECKING("libosip prefix")AC_MSG_RESULT($libosip_prefix_dir)dnldnl Check for libosipdnlif test x$libosip_prefix_dir != x; then LIBS="-L$libosip_prefix_dir/lib $LIBS" CPPFLAGS="$CPPFLAGS -I$libosip_prefix_dir/include"fiif test "x$build_static_libosip" = "xno"; then dnl link dynamically (default) AC_CHECK_LIB(osip2, osip_init,, echo "*** ERROR: libosip2 is required! "\ "Maybe you need to use --with-libosip-prefix ?"; exit 1;, [-losipparser2]) AC_CHECK_LIB(osipparser2, parser_init,, echo "*** ERROR: libosipparser2 is required!";exit 1;,)else dnl link statically to this lib dnl (this probably only will work on linux yet...) AC_MSG_CHECKING("where I can find libosip2.a") libosip_static=`find $extra_libs /lib /usr/lib /usr/local/lib \ -name libosip2.a 2>/dev/null|head -1` if test "x$libosip_static" != "x"; then LIBS="$libosip_static $LIBS" AC_MSG_RESULT($libosip_static) else echo "*** ERROR: a static libosip library is required!";exit 1; fi AC_MSG_CHECKING("where I can find libosipparser2.a") libosip_static=`find $extra_libs /lib /usr/lib /usr/local/lib \ -name libosipparser2.a 2>/dev/null|head -1` if test "x$libosip_static" != "x"; then LIBS="$libosip_static $LIBS" AC_MSG_RESULT($libosip_static) else echo "*** ERROR: a static libosip library is required!";exit 1; fifidnl correct version of libosip2?ACX_CHECK_LIBOSIP_VERSION()dnldnl adddnl --with-custom-fwmodule AC_MSG_CHECKING(building with a custom FW module) AC_ARG_WITH(custom-fwmodule, [ --with-custom-fwmodule=LIBRARY.a use custom firewall control module], FWLIBS="$withval"; AC_DEFINE(CUSTOM_FWMODULE, 1,[use custom firewall control module]) AC_MSG_RESULT($FWLIBS), AC_MSG_RESULT(no))dnldnl Checks for header files.dnlAC_HEADER_STDCAC_CHECK_HEADERS(sys/time.h errno.h)AC_CHECK_HEADERS(stdarg.h varargs.h)AC_CHECK_HEADERS(pwd.h getopt.h sys/socket.h netdb.h)AC_CHECK_HEADERS(resolv.h arpa/nameser.h)dnldnl Checks for typedefs, structures, and compiler characteristics.dnlAC_C_CONSTAC_TYPE_SIZE_TAC_HEADER_TIMEAC_STRUCT_TMdnldnl check for typedef socklen (not available on SUSE 5.3 for example)dnldnl FreeBSD has it in <netdb.h> and <sys/socket.h>AC_CHECK_TYPE(socklen_t, , AC_MSG_RESULT(socklen_t is not available - creating DEFINE to uint) AC_DEFINE(socklen_t, [unsigned int],[typedef socklen_t available]), [[$ac_includes_default] [#ifdef HAVE_NETDB_H] [#include <netdb.h>] [#endif]])dnldnl Checks for librariesdnl Note: the __res_query symbol is to catch the lib when building "static"dnl AC_CHECK_LIB(resolv,res_query,) AC_CHECK_LIB(resolv,__res_query,)dnldnl Checks for library functions.dnlAC_FUNC_MEMCMPAC_FUNC_VPRINTFAC_CHECK_FUNCS(strerror)AC_CHECK_FUNCS(gethostbyname)dnl !! with FLI4L 2.0.x strange behavior with gethostbyname_r()dnl !! has been seen, dont use it.if test "x$build_fli4l_libc5" = "xno"; thendnl AC_CHECK_FUNCS(gethostbyname_r) ACX_WHICH_GETHOSTBYNAME_R()fiAC_CHECK_FUNCS(getopt_long setsid syslog)AC_CHECK_FUNCS(getuid setuid getgid setgid getpwnam chroot)AC_CHECK_FUNCS(socket bind select read send sendto fcntl)AC_CHECK_FUNCS(strcmp strcasecmp)AC_CHECK_FUNCS(strncpy strchr strstr sprintf vfprintf vsnprintf)AC_CHECK_FUNCS(listen accept)AC_CHECK_FUNCS(fgets sscanf)AC_CHECK_FUNCS(hstrerror,,AC_CHECK_LIB(resolv,hstrerror,[ AC_DEFINE_UNQUOTED(HAVE_HSTRERROR) LIBS="$LIBS -lresolv"]))AC_CHECK_FUNCS(inet_pton inet_ntop inet_aton inet_ntoa)AC_CHECK_FUNCS(pthread_setschedparam sched_get_priority_min)AC_CHECK_FUNCS(sched_get_priority_max)dnldnl sysconfdirdnlSIPROXDCONFPATH=""tmpset="$sysconfdir"while test "x$tmpset" != "x$SIPROXDCONFPATH"; do SIPROXDCONFPATH="$tmpset" eval tmpset="$tmpset"doneAC_DEFINE_UNQUOTED(SIPROXDCONFPATH,"$SIPROXDCONFPATH", [will search for config file here])dnldnl Finish...dnlLIBS="$LIBS $FWLIBS"AC_SUBST(CPPFLAGS)AC_SUBST(LDFLAGS)AC_SUBST(LIBS)dnldnl Generate output filesdnlAC_OUTPUT( \siproxd.spec \Makefile \src/Makefile \doc/Makefile \scripts/Makefile \contrib/Makefile \)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -