"Fossies" - the Fresh Open Source Software Archive

Member "postal-0.76/configure.in" (13 Dec 2016, 3444 Bytes) of package /linux/privat/postal-0.76.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ 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 dnl Process this file with autoconf to produce a configure script.
    2 AC_INIT(postal.cpp)
    3 AC_CONFIG_HEADER(conf.h)
    4 AC_SUBST(version)
    5 version="0.75"
    6 
    7 AC_ARG_ENABLE(openssl,
    8       [  --disable-openssl  disables openssl support],
    9       DISABLEOPENSSL=$opensslval, DISABLEOPENSSL=no)
   10 AC_ARG_ENABLE(gnutls,
   11       [  --disable-gnutls  disables gnutls support],
   12       DISABLEGNUTLS=$gnutlsval, DISABLEGNUTLS=no)
   13 
   14 dnl Checks for programs.
   15 AC_LANG_CPLUSPLUS
   16 AC_PROG_CC
   17 AC_PROG_CXX
   18 AC_PROG_CXXCPP
   19 AC_PROG_INSTALL
   20 
   21 dnl Checks for typedefs, structures, and compiler characteristics.
   22 AC_C_CONST
   23 AC_TYPE_SIZE_T
   24 
   25 AC_SUBST(semun)
   26 AC_TRY_COMPILE(#include <sys/types.h>
   27 #include <sys/ipc.h>
   28 #include <sys/sem.h>
   29     , union semun sem; , semun="yes")
   30 if [[ -n "$semun" ]]; then
   31    semun="#define SEMUN_IN_SEM_H"
   32 fi
   33 
   34 AC_SUBST(bool)
   35 AC_TRY_COMPILE([], [bool var;] , , bool="typedef bool char;")
   36 AC_SUBST(true_false)
   37 AC_TRY_COMPILE(, [char c = true; char d = false;
   38 ] , true_false="0", true_false="1")
   39 AC_SUBST(snprintf)
   40 AC_TRY_LINK([#include <stdio.h>], char buf[[10]]; snprintf(buf, sizeof(buf), "abc");,,snprintf="no");
   41 if [[ -n "$snprintf" ]]; then
   42    snprintf="#define NO_SNPRINTF"
   43 fi
   44 
   45 AC_SUBST(extra_ldflags)
   46 extra_ldflags=
   47 AC_ARG_WITH(extra-libs, [  --with-extra-libs=DIR   adds non standard library paths],
   48   use_extra_libs=$withval,
   49   use_extra_libs=NONE
   50 )
   51 if test -n "$use_extra_libs" && \
   52    test "$use_extra_libs" != "NONE"; then
   53  
   54    ac_save_ifs=$IFS
   55    IFS=':'
   56    for dir in $use_extra_libs; do
   57      extra_ldflags="$extra_ldflags -L$dir"
   58    done
   59    IFS=$ac_save_ifs
   60 fi
   61 
   62 extra_ldflags=`/usr/bin/uname -a | grep -q SunOS && echo -lrt`
   63 
   64 dnl Checks for library -l socket.
   65 AC_CHECK_LIB(socket, bind, extra_ldflags="$extra_ldflags -lsocket -lnsl")
   66 
   67 dnl Checks for header files.
   68 AC_SUBST(gnutls)
   69 AC_SUBST(openssl)
   70 AC_SUBST(extra_objs)
   71 if [[ "$DISABLEGNUTLS" = "no" ]]; then
   72   AC_CHECK_HEADER(gnutls/gnutls.h, GNUTLS=yes, GNUTLS=no)
   73 else
   74   GNUTLS=no
   75 fi
   76 if [[ "$GNUTLS" = "yes" ]]; then
   77   DISABLEOPENSSL=yes
   78 fi
   79 if [[ "$DISABLEOPENSSL" = "no" ]]; then
   80   AC_CHECK_HEADER(openssl/crypto.h, OPENSSL=yes, OPENSSL=no)
   81 else
   82   OPENSSL=no
   83 fi
   84 if [[ "$OPENSSL" = "no" ]]; then
   85   extra_objs="md5.o"
   86 fi
   87 
   88 AC_SUBST(linux_pthread)
   89 AC_TRY_COMPILE([#define _GNU_SOURCE
   90 #include <pthread.h>
   91 ] , [pthread_mutexattr_t attr;
   92     pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);]
   93   , linux_pthread="yes")
   94 if [[ -n "$linux_pthread" ]]; then
   95    linux_pthread="#define LINUX_PTHREAD"
   96 fi
   97 
   98 LDFLAGS=-lpthread
   99 AC_TRY_LINK([#include <pthread.h>
  100 void * thread_func(void * param) { return NULL; }
  101 ] , [pthread_t thread_info;
  102      pthread_attr_t attr;
  103      pthread_create(&thread_info, &attr, &thread_func, NULL);]
  104   , extra_ldflags="$extra_ldflags -lpthread"
  105   , extra_ldflags="$extra_ldflags -pthread")
  106 
  107 AC_SUBST(crypt_ldflags)
  108 crypt_ldflags="$extra_ldflags"
  109 if [[ "$GNUTLS" = "no" ]]; then
  110   gnutls=""
  111 else
  112   gnutls="#define USE_GNUTLS"
  113   crypt_ldflags="$extra_ldflags -lgnutls"
  114 fi
  115 if [[ "$OPENSSL" = "no" ]]; then
  116   openssl=""
  117 else
  118   openssl="#define USE_OPENSSL"
  119   crypt_ldflags="$extra_ldflags -lssl -lcrypto"
  120 fi
  121 
  122 AC_SUBST(large_file)
  123 large_file=""
  124 
  125 AC_SUBST(socklen_t)
  126 AC_TRY_COMPILE([#include <sys/types.h>
  127 #include <sys/socket.h>
  128 ] , [socklen_t * namelen;], , no_socklen_t="true")
  129 if [[ -n "$no_socklen_t" ]]; then
  130   socklen_t="#define socklen_t int"
  131 fi
  132 
  133 AC_CHECK_HEADERS(vector)
  134 
  135 dnl Checks for library functions.
  136 
  137 AC_OUTPUT(Makefile postal.h port.h postal.spec sun/pkginfo)