"Fossies" - the Fresh Open Source Software Archive

Member "amavisd-milter-1.7.2/aclocal/acinclude.m4" (6 Jan 2019, 4167 Bytes) of package /linux/privat/amavisd-milter-1.7.2.tar.gz:


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

    1 dnl Enables debug output and debug symbols
    2 AC_DEFUN([ACX_ENABLE_DEBUG],
    3 [
    4   dnl Configure --enable-debug option
    5   AC_ARG_ENABLE(debug,[  --enable-debug          enables debug output and debug symbols @<:@default=no@:>@],
    6   [
    7    if test $enableval = "no"
    8      then
    9        enable_debug="no"
   10      else
   11        enable_debug="yes"
   12    fi
   13   ],
   14   [
   15     enable_debug="no"
   16   ])
   17 
   18   dnl This prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
   19   CFLAGS=" $CFLAGS"
   20 
   21   AC_REQUIRE([AC_PROG_CC])
   22 
   23   if test "$GCC" = "yes";
   24     then
   25       if test "$enable_debug" = "yes"
   26         then
   27           CFLAGS="-g -O2 $CFLAGS"
   28           CFLAGS="-W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align $CFLAGS"
   29           CFLAGS="-Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes $CFLAGS"
   30           CFLAGS="-Wmissing-declarations -Wnested-externs -Wpointer-arith $CFLAGS"
   31           CFLAGS="-Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings $CFLAGS"
   32         else
   33           CFLAGS="-O2 -DNDEBUG $CFLAGS"
   34       fi
   35   fi
   36 
   37   AC_LANG_C
   38 ])
   39 
   40 dnl Set local state directory
   41 AC_DEFUN([AC_LOCAL_STATE_DIR],
   42 [
   43   if test "$localstatedir" = '${prefix}/var';
   44     then
   45       AC_SUBST([localstatedir], ['/var/amavis'])
   46   fi
   47 
   48   test "x$prefix" = xNONE && prefix_NONE=yes && prefix="$ac_default_prefix"
   49   test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix="${prefix}"
   50 
   51   eval LOCALSTATEDIR=\""$localstatedir"\"
   52   dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
   53   dnl refers to ${prefix}.  Thus we have to use `eval' twice.
   54   eval LOCALSTATEDIR=\""$LOCALSTATEDIR"\"
   55 
   56   AH_TEMPLATE([LOCAL_STATE_DIR], [Default location to store state files.])
   57   AC_DEFINE_UNQUOTED([LOCAL_STATE_DIR], ["$LOCALSTATEDIR"])
   58 
   59   test "$prefix_NONE" && prefix=NONE
   60   test "$exec_prefix_NONE" && exec_prefix=NONE
   61 ])
   62 
   63 dnl Set working dir
   64 AC_DEFUN([AC_WORKING_DIR],
   65 [
   66   AH_TEMPLATE([WORKING_DIR], [Default location of working directory.])
   67   AC_ARG_WITH([working-dir],
   68     [  --with-working-dir@<:@=<DIR>@:>@  set working directory (default tmp)
   69                               SUBDIR    subdirectry of local state dirertory
   70                               /DIR      absolute path to working directory],
   71     [
   72       case "$with_working_dir" in
   73         no)  AC_DEFINE_UNQUOTED([WORKING_DIR], [LOCAL_STATE_DIR]);;
   74         yes) AC_DEFINE_UNQUOTED([WORKING_DIR], [LOCAL_STATE_DIR] "/tmp");;
   75         /*)  AC_DEFINE_UNQUOTED([WORKING_DIR], ["$with_working_dir"]);;
   76         *)   AC_DEFINE_UNQUOTED([WORKING_DIR], [LOCAL_STATE_DIR "/$with_working_dir"]);;
   77        esac
   78     ],
   79     [AC_DEFINE_UNQUOTED([WORKING_DIR], [LOCAL_STATE_DIR])
   80   ])
   81 ])
   82 
   83 dnl Checks for working POSIX semaphores
   84 AC_DEFUN([AC_CHECK_POSIX_SEMAPHORES],
   85 [
   86   AC_MSG_CHECKING(if POSIX semaphores are working)
   87   AC_TRY_RUN([
   88   #include <semaphore.h>
   89   int main() {
   90     sem_t sem;
   91     int rc;
   92     rc = sem_init(&sem, 0, 0);
   93     return rc;
   94   }],
   95     AC_MSG_RESULT(yes),
   96     AC_MSG_ERROR(no),
   97     AC_MSG_ERROR(no)
   98   )
   99 ])
  100 
  101 dnl Checks for d_namlen in struct dirent
  102 AC_DEFUN([AC_STRUCT_DIRENT_D_NAMLEN],
  103 [
  104   AC_MSG_CHECKING(for d_namlen in struct dirent)
  105   AC_TRY_COMPILE([
  106   #if HAVE_DIRENT_H
  107   # include <dirent.h>
  108   #else
  109   # define dirent direct
  110   # if HAVE_SYS_NDIR_H
  111   #  include <sys/ndir.h>
  112   # endif
  113   # if HAVE_SYS_DIR_H
  114   #  include <sys/dir.h>
  115   # endif
  116   # if HAVE_NDIR_H
  117   #  include <ndir.h>
  118   # endif
  119   #endif
  120   ], [
  121   struct dirent dp;
  122   int X = dp.d_namlen;
  123   ],
  124     AC_DEFINE([HAVE_STRUCT_DIRENT_D_NAMLEN], 1,
  125       [Define to 1 if `struct direct' has a d_namlen element])
  126     AC_MSG_RESULT(yes),
  127     AC_MSG_RESULT(no)
  128   )
  129 ])
  130 
  131 dnl Checks for AF_INET6
  132 AC_DEFUN([AC_CHECK_AF_INET6],
  133 [
  134   AC_CHECK_DECLS([AF_INET6],[],[],[
  135     #include <sys/types.h>
  136     #include <sys/socket.h>
  137   ])
  138 ])
  139 
  140 dnl Checks for INET6_ADDRSTRLEN
  141 AC_DEFUN([AC_CHECK_INET6_ADDRSTRLEN],
  142 [
  143   AC_CHECK_DECLS([INET6_ADDRSTRLEN],[],[],[
  144     #include <sys/types.h>
  145     #include <sys/socket.h>
  146     #include <netinet/in.h>
  147   ])
  148 ])
  149 
  150 dnl Checks for struct sockaddr_in6
  151 AC_DEFUN([AC_CHECK_STRUCT_SOCKADDR_IN6],
  152 [
  153   AC_CHECK_TYPES([struct sockaddr_in6],[],[],[
  154     #include <sys/types.h>
  155     #include <sys/socket.h>
  156     #include <netinet/in.h>
  157   ])
  158 ])