"Fossies" - the Fresh Open Source Software Archive

Member "libmaxminddb-1.5.2/configure.ac" (18 Feb 2021, 4712 Bytes) of package /linux/misc/libmaxminddb-1.5.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. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.5.0_vs_1.5.2.

    1 #                                               -*- Autoconf -*-
    2 # Process this file with autoconf to produce a configure script.
    3 
    4 AC_PREREQ([2.63])
    5 AC_INIT([libmaxminddb], [1.5.2], [support@maxmind.com])
    6 AC_CONFIG_SRCDIR([include/maxminddb.h])
    7 AC_CONFIG_HEADERS([config.h include/maxminddb_config.h])
    8 
    9 PKG_PROG_PKG_CONFIG
   10 m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], [${libdir}/pkgconfig])])
   11 AC_CONFIG_FILES([src/libmaxminddb.pc])
   12 
   13 LT_INIT
   14 AM_INIT_AUTOMAKE(foreign m4_esyscmd([case `automake --version | head -n 1` in
   15                                      *1.14*) echo subdir-objects;;
   16                                      *1.11*);;
   17                                      *) echo serial-tests;;
   18                                      esac]))
   19 AC_PROG_LIBTOOL
   20 # Checks for programs.
   21 AC_PROG_CC_C99
   22 
   23 # Copied from http://stackoverflow.com/a/10682813/9832 and tweaked for C (as
   24 # opposed to C++)
   25 #
   26 # AX_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
   27 #
   28 # checks whether the $(CC) compiler accepts the ADDITIONAL-CFLAGS
   29 # if so, they are added to the CXXFLAGS
   30 AC_DEFUN([AX_CHECK_CFLAGS],
   31 [
   32   AC_MSG_CHECKING([whether compiler accepts "$1"])
   33   cat > conftest.c << EOF
   34   int main(){
   35     return 0;
   36   }
   37 EOF
   38   if $CC $CFLAGS -o conftest.o conftest.c [$1] > /dev/null 2>&1
   39   then
   40     AC_MSG_RESULT([yes])
   41     CFLAGS="${CFLAGS} [$1]"
   42     [$2]
   43   else
   44     AC_MSG_RESULT([no])
   45    [$3]
   46   fi
   47 ])dnl AX_CHECK_CFLAGS
   48 
   49 AX_CHECK_CFLAGS([-fms-extensions])
   50 
   51 # We will add this back for non-debug builds in the common.mk file
   52 CFLAGS=`echo ${CFLAGS} | sed 's/-O2//'`
   53 CXXFLAGS=`echo ${CXXFLAGS} | sed 's/-O2//'`
   54 
   55 # autoconf insists on giving us gnu99 if it's available
   56 CC=`echo ${CC} | sed 's/-std=gnu99/-std=c99/'`
   57 
   58 AC_C_RESTRICT
   59 
   60 AC_CHECK_HEADERS([arpa/inet.h assert.h fcntl.h inttypes.h libgen.h math.h netdb.h netinet/in.h stdarg.h stdbool.h stdint.h stdio.h stdlib.h string.h sys/mman.h sys/socket.h sys/stat.h sys/time.h sys/types.h unistd.h])
   61 
   62 # configure generates an invalid config for MinGW because of the type checks
   63 # so we only run them on non MinGW-Systems. For MinGW we also need to link
   64 # against ws2_32.
   65 AC_CANONICAL_HOST
   66 is_windows=false
   67 case $host_os in
   68         mingw*)
   69                 LDFLAGS="-lws2_32"
   70                 is_windows=true
   71         ;;
   72         *)
   73                 AC_TYPE_OFF_T
   74                 AC_TYPE_SIZE_T
   75                 AC_TYPE_SSIZE_T
   76                 AC_TYPE_UINT8_T
   77                 AC_TYPE_UINT32_T
   78                 AC_TYPE_UINT64_T
   79         ;;
   80 esac
   81 
   82 AM_CONDITIONAL([WINDOWS], [test x$is_windows = xtrue])
   83 
   84 # This check is backwards in order to make life easier for people writing
   85 # extensions in other languages that link to this library. If they want to
   86 # simply assume that they are using a newish compiler, they don't need to
   87 # check for this type nor do they need to define anything on the CLI. They'll
   88 # just get code that assumes this type exists.
   89 AC_CHECK_TYPE(
   90         [unsigned __int128],
   91         [AC_DEFINE([MMDB_UINT128_IS_BYTE_ARRAY], [0], [Missing the unsigned __int128 type])],
   92         [AC_CHECK_TYPE(
   93                 [unsigned int __attribute__((mode(TI)))],
   94                 [AC_DEFINE([MMDB_UINT128_IS_BYTE_ARRAY], [0], [Missing the unsigned __int128 type])
   95                  AC_DEFINE([MMDB_UINT128_USING_MODE], [1], [int128 types are available with __attribute__((mode(TI)))])],
   96                 [AC_DEFINE([MMDB_UINT128_IS_BYTE_ARRAY], [1], [Missing the unsigned __int128 type])])])
   97 
   98 AC_CHECK_TYPES([boolean])
   99 
  100 AC_CHECK_FUNCS([clock_gettime open_memstream])
  101 
  102 AC_C_BIGENDIAN(
  103         [AC_DEFINE([MMDB_LITTLE_ENDIAN], [0], [System is big-endian])],
  104         [AC_DEFINE([MMDB_LITTLE_ENDIAN], [1], [System is little-endian])])
  105 
  106 AC_FUNC_MMAP
  107 
  108 AC_SEARCH_LIBS([fabs], [m])
  109 AC_SEARCH_LIBS([fabsf], [m])
  110 AC_SEARCH_LIBS([getaddrinfo], [socket])
  111 
  112 AC_ARG_ENABLE(
  113         [debug],
  114         [  --enable-debug    Turn on debugging],
  115         [case "${enableval}" in
  116           yes) debug=true ;;
  117           no)  debug=false ;;
  118           *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
  119         esac],[debug=false])
  120 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
  121 
  122 AC_ARG_ENABLE([binaries],
  123         AS_HELP_STRING([--enable-binaries], [Compilation of binaries code]),
  124         [enable_binaries=${enableval}],
  125         [enable_binaries=yes])
  126 AM_CONDITIONAL([BINARIES], [test "${enable_binaries}" = "yes"])
  127 
  128 AC_ARG_ENABLE([tests],
  129         AS_HELP_STRING([--enable-tests], [Compilation of tests code]),
  130         [enable_tests=${enableval}],
  131         [enable_tests=yes])
  132 AM_CONDITIONAL([TESTS], [test "${enable_tests}" = "yes"])
  133 
  134 AC_CONFIG_FILES([Makefile
  135                  src/Makefile
  136                  bin/Makefile
  137                  t/Makefile])
  138 AC_OUTPUT