"Fossies" - the Fresh Open Source Software Archive

Member "libspf2-1.2.10/configure.ac" (20 Feb 2012, 8359 Bytes) of package /linux/privat/libspf2-1.2.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #                                               -*- Autoconf -*-
    2 # Process this file with autoconf to produce a configure script.
    3 
    4 AC_PREREQ(2.59)
    5 AC_INIT(libspf2, 1.2.10, libspf2@anarres.org)
    6 AC_CONFIG_AUX_DIR(config)
    7 AM_INIT_AUTOMAKE(libspf2, $PACKAGE_VERSION)
    8 AC_CONFIG_SRCDIR([src/libspf2/spf_server.c])
    9 AM_CONFIG_HEADER(config.h)
   10 
   11 dnl AC_USE_SYSTEM_EXTENSIONS
   12 
   13 # remember the version info for later
   14 
   15 KV_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\([[0-9]]*\)\.[[0-9]]*\.[[0-9]]*/\1/'`
   16 KV_MINOR=`echo $PACKAGE_VERSION | sed 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*/\1/'`
   17 KV_PATCH=`echo $PACKAGE_VERSION | sed 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)/\1/'`
   18 AC_SUBST([KV_MAJOR])
   19 AC_SUBST([KV_MINOR])
   20 AC_SUBST([KV_PATCH])
   21 
   22 cat >src/include/spf_lib_version.h <<_EOF_VERSION
   23 /**
   24  * @file
   25  * @brief Autogenerated configuration information - do not edit.
   26  */
   27 #ifndef INC_SPF_VERSION
   28 #define INC_SPF_VERSION
   29 
   30 #define SPF_LIB_VERSION_MAJOR   $KV_MAJOR
   31 #define SPF_LIB_VERSION_MINOR   $KV_MINOR
   32 #define SPF_LIB_VERSION_PATCH   $KV_PATCH
   33 
   34 #endif
   35 _EOF_VERSION
   36 
   37 AX_WITH_PERL
   38 PERL_SUBDIRS=""
   39 AC_SUBST([PERL_SUBDIRS])
   40 AC_ARG_ENABLE(perl,
   41     AC_HELP_STRING([--enable-perl],
   42         [build the Perl/XS interface to libspf2]),
   43 [
   44     PERL_SUBDIRS="perl"
   45     AC_CONFIG_COMMANDS([perl/Makefile], [
   46         # XXX This needs to use $PERL, somehow.
   47         ( cd perl && perl Makefile.PL )
   48     ])
   49 ])
   50 
   51 
   52 # Checks for programs.
   53 AC_PROG_CC
   54 if test "X$ac_cv_prog_gcc" = "Xyes"; then
   55         gcc_ver=`gcc -v 2>&1 | grep version | sed 's/.*gcc version \([[0-9]][[0-9]]*\)\..*/\1/'`
   56 #        echo "GCC version: $gcc_ver"
   57         if test "X$gcc_ver" = "X3"; then
   58             CFLAGS="$CFLAGS -W -Wall -Wmissing-prototypes -Wwrite-strings"
   59 #           CFLAGS="$CFLAGS -std=c89 -D_BSD_SOURCE -W -Wall -Wmissing-prototypes -Wwrite-strings"
   60 #           CFLAGS="$CFLAGS -std=c99 -W -Wall -Wmissing-prototypes -Wwrite-strings"
   61 #           CFLAGS="$CFLAGS -std=gnu99 -W -Wall -Wmissing-prototypes -Wwrite-strings"
   62         else
   63             CFLAGS="$CFLAGS -Wall"
   64         fi
   65 fi
   66 AC_PROG_CPP
   67 AC_SUBST([SUBDIRS])
   68 AC_PROG_MAKE_SET
   69 AC_SUBST([LIBPROGS])
   70 AC_PROG_LIBTOOL
   71 AC_PROG_INSTALL
   72 AC_PROG_LN_S
   73 dnl This is obsolete
   74 dnl AC_PROG_RANLIB
   75 
   76 # Check if the linker accepts --rpath (for Darwin)
   77 AC_MSG_CHECKING([if ld accepts --rpath])
   78 SAVEDLDFLAGS=$LDFLAGS
   79 LDFLAGS=$LDFLAGS" -Wl,--rpath=/"
   80 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
   81     [rpath="--rpath="; ldrpath=yes], [rpath="-L"; ldrpath=no])
   82 LDFLAGS=$SAVEDLDFLAGS
   83 AC_MSG_RESULT([$ldrpath])
   84 
   85 # Checks for header files.
   86 AC_HEADER_STDC
   87 AC_HEADER_SYS_WAIT
   88 AC_HEADER_TIME
   89 AC_CHECK_SIZEOF([int])
   90 AC_CHECK_HEADERS([limits.h sys/param.h syslog.h sys/time.h errno.h sys/types.h])
   91 AC_CHECK_HEADERS([fcntl.h malloc.h nmemory.h stddef.h inttypes.h stdlib.h string.h strings.h unistd.h stdarg.h])
   92 AC_CHECK_HEADERS([pthread.h pwd.h grp.h libintl.h getopt.h])
   93 AC_CHECK_HEADERS([netdb.h netinet/in.h sys/socket.h arpa/inet.h arpa/nameser.h])
   94 AC_CHECK_HEADERS([resolv.h], [], [], [[
   95     #if HAVE_SYS_TYPES_H
   96     #  include <sys/types.h>
   97     #endif
   98     #ifdef HAVE_SYS_SOCKET_H
   99     #  include <sys/socket.h> /* DNS HEADER struct */
  100     #endif
  101     #ifdef HAVE_NETINET_IN_H
  102     #  include <netinet/in.h>   /* inet_ functions / structs */
  103     #endif
  104     #ifdef HAVE_ARPA_NAMESER_H
  105     #  include <arpa/nameser.h> /* DNS HEADER struct */
  106     #endif
  107     ]])
  108 dnl XXX This is no longer true.
  109 AC_CHECK_HEADER(pthread.h, , [
  110     echo "pthread.h is required to build this program."
  111     exit 1;
  112 ])
  113 
  114 dnl Moved to after header checks by Shevek
  115 AC_ARG_WITH(bind,
  116         [  --with-bind=DIR  Find BIND resolver in DIR],
  117         [AC_CHECK_FILE([$withval/include/bind/resolv.h],
  118                 [CFLAGS="$CFLAGS -I$withval/include/bind"],
  119                 [CFLAGS="$CFLAGS -I$withval/include"])
  120          LDFLAGS="$LDFLAGS -L$withval/lib -Wl,$rpath$withval/lib"
  121          AC_CHECK_LIB([bind], [res_query], [LIBS="$LIBS -lbind"],
  122                 [AC_CHECK_LIB([resolv],
  123                         [res_query],
  124                         [LIBS="$LIBS -lresolv"],
  125                         [echo "cannot find resolver library"; exit 1;])
  126                 ])
  127         ],
  128         [dnl Have to include resolv.h as res_query is sometimes defined as a macro
  129                 AC_MSG_CHECKING([for res_query in -lresolv (with resolv.h if present)])
  130                 saved_libs="$LIBS"
  131                 LIBS="-lresolv $LIBS"
  132                 AC_TRY_LINK([
  133                         #ifdef HAVE_RESOLV_H
  134                         #include <resolv.h>
  135                         #endif],
  136                         [res_query(0,0,0,0,0)],
  137                         [AC_MSG_RESULT(yes)
  138                                 have_res_query=yes],
  139                         [AC_MSG_RESULT(no)
  140                                 LIBS="$saved_libs"])
  141         ])
  142         
  143         
  144         
  145 dnl [AC_CHECK_LIB(resolv, res_query)])
  146 
  147 # Checks for libraries.
  148 AC_CHECK_LIB(nsl, inet_pton)
  149 AC_CHECK_LIB(socket, socket)
  150 AC_CHECK_LIB(intl, gettext)
  151 AC_CHECK_LIB(pthread, pthread_create)
  152 
  153 
  154 # Checks for typedefs, structures, and compiler characteristics.
  155 AC_C_CONST
  156 AC_C_INLINE
  157 AC_TYPE_PID_T
  158 AC_TYPE_UID_T
  159 AC_TYPE_SIZE_T
  160 AC_C_VOLATILE
  161 AC_C_BIGENDIAN
  162 AC_C_INLINE
  163 AC_C_CHAR_UNSIGNED
  164 AC_CHECK_TYPES([u_char, u_int8_t, u_int16_t, u_int32_t, uint8_t, uint16_t, uint32_t])
  165 AC_CHECK_TYPES([ns_type], [], [], [[
  166     #ifdef HAVE_SYS_TYPES_H
  167     # include <sys/types.h>
  168     #endif
  169     #ifdef HAVE_SYS_SOCKET_H
  170     # include <sys/socket.h>        /* inet_ functions / structs */
  171     #endif
  172     #ifdef HAVE_NETINET_IN_H
  173     # include <netinet/in.h>        /* inet_ functions / structs */
  174     #endif
  175     #ifdef HAVE_ARPA_NAMESER_H
  176     # include <arpa/nameser.h> /* DNS HEADER struct */
  177     #endif
  178     ]])
  179 AC_CHECK_TYPES([struct in6_addr], [], [], [[
  180     #ifdef HAVE_NETINET_IN_H
  181     # include <netinet/in.h>   /* inet_ functions / structs */
  182     #endif
  183     ]])
  184 
  185 # Checks for library functions.
  186 AC_FUNC_FORK
  187 AC_FUNC_MALLOC
  188 AC_FUNC_MEMCMP
  189 AC_FUNC_REALLOC
  190 AC_FUNC_SETPGRP
  191 AC_FUNC_SELECT_ARGTYPES
  192 AC_TYPE_SIGNAL
  193 
  194 
  195 # It is not clear if BIND8 and/or BIND9 require the use of the
  196 # res_ninit() and res_nquery() functions when threading, but it is
  197 # safest to use them.
  198 
  199 # Nowadays, I think libspf2 requires this function to be available.
  200 AC_CHECK_DECLS([res_ninit], [], [], [[
  201     #ifdef HAVE_SYS_TYPES_H
  202     # include <sys/types.h>
  203     #endif
  204     #ifdef HAVE_SYS_SOCKET_H
  205     # include <sys/socket.h>        /* inet_ functions / structs */
  206     #endif
  207     #ifdef HAVE_NETINET_IN_H
  208     # include <netinet/in.h>        /* inet_ functions / structs */
  209     #endif
  210     #ifdef HAVE_ARPA_NAMESER_H
  211     #  include <arpa/nameser.h> /* DNS HEADER struct */
  212     #endif
  213     #ifdef HAVE_RESOLV_H
  214     # include <resolv.h>
  215     #endif
  216     ]])
  217 AC_CHECK_DECLS([res_ndestroy], [], [], [[
  218     #ifdef HAVE_SYS_TYPES_H
  219     # include <sys/types.h>
  220     #endif
  221     #ifdef HAVE_SYS_SOCKET_H
  222     # include <sys/socket.h>        /* inet_ functions / structs */
  223     #endif
  224     #ifdef HAVE_NETINET_IN_H
  225     # include <netinet/in.h>        /* inet_ functions / structs */
  226     #endif
  227     #ifdef HAVE_ARPA_NAMESER_H
  228     #  include <arpa/nameser.h> /* DNS HEADER struct */
  229     #endif
  230     #ifdef HAVE_RESOLV_H
  231     # include <resolv.h>
  232     #endif
  233     ]])
  234 
  235 AC_CHECK_DECLS([ns_t_spf], [], [], [[
  236     #ifdef HAVE_SYS_TYPES_H
  237     # include <sys/types.h>
  238     #endif
  239     #ifdef HAVE_SYS_SOCKET_H
  240     # include <sys/socket.h>        /* inet_ functions / structs */
  241     #endif
  242     #ifdef HAVE_NETINET_IN_H
  243     # include <netinet/in.h>        /* inet_ functions / structs */
  244     #endif
  245     #ifdef HAVE_ARPA_NAMESER_H
  246     #  include <arpa/nameser.h> /* DNS HEADER struct */
  247     #endif
  248     #ifdef HAVE_RESOLV_H
  249     # include <resolv.h>
  250     #endif
  251     ]])
  252 
  253 AC_CHECK_DECLS([ns_t_invalid], [], [], [[
  254     #ifdef HAVE_SYS_TYPES_H
  255     # include <sys/types.h>
  256     #endif
  257     #ifdef HAVE_SYS_SOCKET_H
  258     # include <sys/socket.h>        /* inet_ functions / structs */
  259     #endif
  260     #ifdef HAVE_NETINET_IN_H
  261     # include <netinet/in.h>        /* inet_ functions / structs */
  262     #endif
  263     #ifdef HAVE_ARPA_NAMESER_H
  264     #  include <arpa/nameser.h> /* DNS HEADER struct */
  265     #endif
  266     #ifdef HAVE_RESOLV_H
  267     # include <resolv.h>
  268     #endif
  269     ]])
  270 
  271 AC_CHECK_FUNCS([ftruncate gethostname memmove memset socket])
  272 AC_CHECK_FUNCS([strchr strcspn strdup strerror])
  273 AC_CHECK_FUNCS([strcasecmp strncasecmp strspn strtoul])
  274 AC_CHECK_FUNCS([gethostbyname inet_ntoa select strrchr strstr strtol])
  275 
  276 AC_REPLACE_FUNCS([getopt_long_only strncasecmp])
  277 AC_REPLACE_FUNCS([__ns_initparse __ns_name_uncompress __ns_msg_getflag])
  278 dnl Magnus Holmgren says this avoids linking a private function
  279 AC_LIBOBJ([__ns_get16])
  280 
  281 AC_CONFIG_FILES([Makefile
  282                  Doxyfile
  283                  src/Makefile
  284                  src/include/Makefile
  285                  src/libreplace/Makefile
  286                  src/libspf2/Makefile
  287                  src/spfquery/Makefile
  288                  src/spftest/Makefile
  289                  src/spfd/Makefile
  290                  src/spf_example/Makefile])
  291 AC_OUTPUT