Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
479 lines (410 sloc) 15.5 KB
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
################################################################################
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
#
# The version number is extracted from include/filemq.h using
# the version.sh script. Hence, it should be updated there.
# The version in git should reflect the *next* version planned.
#
AC_INIT([filemq],[m4_esyscmd([./version.sh filemq.h])],[email@hostname.com])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_CONFIG_HEADERS([src/platform.h])
AM_INIT_AUTOMAKE([subdir-objects tar-ustar foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# This defines PACKAGE_VERSION_... in src/platform.h
PV_MAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`
PV_MINOR=`echo $PACKAGE_VERSION | cut -d . -f 2`
PV_PATCH=`echo $PACKAGE_VERSION | cut -d . -f 3`
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],[$PV_MAJOR],
[FILEMQ major version])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],[$PV_MINOR],
[FILEMQ minor version])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCH],[$PV_PATCH],
[FILEMQ patchlevel])
# This lets us use PACKAGE_VERSION in Makefiles
AC_SUBST(PACKAGE_VERSION)
#
# Libtool -version-info (ABI version)
#
# Currently 2.0.1 ("stable"). Don't change this unless you
# know exactly what you're doing and have read and understand
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
#
# libfilemq -version-info
LTVER="2:0:0"
AC_SUBST(LTVER)
# Capture c flags
FILEMQ_ORIG_CFLAGS="${CFLAGS:-none}"
# Checks for programs
AC_PROG_CC
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_PROG_SED
AC_PROG_AWK
PKG_PROG_PKG_CONFIG
# Code coverage
AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
[With GCC Code Coverage reporting.])],
[FILEMQ_GCOV="$withval"])
if test "x${FILEMQ_GCOV}" == "xyes"; then
CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
if test "x${FILEMQ_ORIG_CFLAGS}" != "xnone"; then
CFLAGS="${CFLAGS} ${FILEMQ_ORIG_CFLAGS}"
fi
AM_CONDITIONAL(WITH_GCOV, true)
else
AM_CONDITIONAL(WITH_GCOV, false)
fi
PREVIOUS_CFLAGS="${CFLAGS}"
PREVIOUS_LIBS="${LIBS}"
was_libsodium_check_lib_detected=no
PKG_CHECK_MODULES([libsodium], [libsodium >= 0.0.0],
[
AC_DEFINE(HAVE_LIBSODIUM, 1, [The libsodium library is to be used.])
],
[
AC_ARG_WITH([libsodium],
[
AS_HELP_STRING([--with-libsodium],
[Specify libsodium prefix])
],
[search_libsodium="yes"],
[])
libsodium_synthetic_cflags=""
libsodium_synthetic_libs="-lsodium"
if test "x$search_libsodium" = "xyes"; then
if test -r "${with_libsodium}/include/sodium.h"; then
libsodium_synthetic_cflags="-I${with_libsodium}/include"
libsodium_synthetic_libs="-L${with_libsodium}/lib -lsodium"
else
AC_MSG_ERROR([${with_libsodium}/include/sodium.h not found. Please check libsodium prefix])
fi
fi
AC_CHECK_LIB([libsodium], [sodium_init],
[
CFLAGS="${libsodium_synthetic_cflags} ${CFLAGS}"
LDFLAGS="${libsodium_synthetic_libs} ${LDFLAGS}"
LIBS="${libsodium_synthetic_libs} ${LIBS}"
AC_SUBST([libsodium_CFLAGS],[${libsodium_synthetic_cflags}])
AC_SUBST([libsodium_LIBS],[${libsodium_synthetic_libs}])
was_libsodium_check_lib_detected=yes
AC_DEFINE(HAVE_LIBSODIUM, 1, [The libsodium library is to be used.])
],
[])
])
if test "x$was_libsodium_check_lib_detected" = "xno"; then
CFLAGS="${libsodium_CFLAGS} ${CFLAGS}"
LIBS="${libsodium_LIBS} ${LIBS}"
fi
was_libzmq_check_lib_detected=no
PKG_CHECK_MODULES([libzmq], [libzmq >= 0.0.0],
[
],
[
AC_ARG_WITH([libzmq],
[
AS_HELP_STRING([--with-libzmq],
[Specify libzmq prefix])
],
[search_libzmq="yes"],
[])
libzmq_synthetic_cflags=""
libzmq_synthetic_libs="-lzmq"
if test "x$search_libzmq" = "xyes"; then
if test -r "${with_libzmq}/include/zmq.h"; then
libzmq_synthetic_cflags="-I${with_libzmq}/include"
libzmq_synthetic_libs="-L${with_libzmq}/lib -lzmq"
else
AC_MSG_ERROR([${with_libzmq}/include/zmq.h not found. Please check libzmq prefix])
fi
fi
AC_CHECK_LIB([libzmq], [zmq_init],
[
CFLAGS="${libzmq_synthetic_cflags} ${CFLAGS}"
LDFLAGS="${libzmq_synthetic_libs} ${LDFLAGS}"
LIBS="${libzmq_synthetic_libs} ${LIBS}"
AC_SUBST([libzmq_CFLAGS],[${libzmq_synthetic_cflags}])
AC_SUBST([libzmq_LIBS],[${libzmq_synthetic_libs}])
was_libzmq_check_lib_detected=yes
],
[AC_MSG_ERROR([cannot link with -lzmq, install libzmq.])])
])
if test "x$was_libzmq_check_lib_detected" = "xno"; then
CFLAGS="${libzmq_CFLAGS} ${CFLAGS}"
LIBS="${libzmq_LIBS} ${LIBS}"
fi
was_czmq_check_lib_detected=no
PKG_CHECK_MODULES([czmq], [libczmq >= 0.0.0],
[
],
[
AC_ARG_WITH([libczmq],
[
AS_HELP_STRING([--with-libczmq],
[Specify libczmq prefix])
],
[search_libczmq="yes"],
[])
czmq_synthetic_cflags=""
czmq_synthetic_libs="-lczmq"
if test "x$search_libczmq" = "xyes"; then
if test -r "${with_libczmq}/include/czmq.h"; then
czmq_synthetic_cflags="-I${with_libczmq}/include"
czmq_synthetic_libs="-L${with_libczmq}/lib -lczmq"
else
AC_MSG_ERROR([${with_libczmq}/include/czmq.h not found. Please check libczmq prefix])
fi
fi
AC_CHECK_LIB([libczmq], [zctx_test],
[
CFLAGS="${czmq_synthetic_cflags} ${CFLAGS}"
LDFLAGS="${czmq_synthetic_libs} ${LDFLAGS}"
LIBS="${czmq_synthetic_libs} ${LIBS}"
AC_SUBST([czmq_CFLAGS],[${czmq_synthetic_cflags}])
AC_SUBST([czmq_LIBS],[${czmq_synthetic_libs}])
was_czmq_check_lib_detected=yes
],
[AC_MSG_ERROR([cannot link with -lczmq, install libczmq.])])
])
if test "x$was_czmq_check_lib_detected" = "xno"; then
CFLAGS="${czmq_CFLAGS} ${CFLAGS}"
LIBS="${czmq_LIBS} ${LIBS}"
fi
CFLAGS="${PREVIOUS_CFLAGS}"
LIBS="${PREVIOUS_LIBS}"
# Platform specific checks
filemq_on_mingw32="no"
filemq_on_cygwin="no"
filemq_on_android="no"
filemq_on_linux="no"
filemq_on_gnu="no"
# Host specific checks
AC_CANONICAL_HOST
# Man pages are built/installed if asciidoc and xmlto are present
# --with-docs=no overrides this
AC_ARG_WITH([docs],
AS_HELP_STRING([--with-docs],
[Build and install man pages [default=yes]]),
[with_docs=$withval])
if test "x$with_docs" = "xno"; then
filemq_build_doc="no"
filemq_install_man="no"
else
# Determine whether or not documentation should be built and installed.
filemq_build_doc="yes"
filemq_install_man="yes"
# Check for asciidoc and xmlto and don't build the docs if these are not installed.
AC_CHECK_PROG(filemq_have_asciidoc, asciidoc, yes, no)
AC_CHECK_PROG(filemq_have_xmlto, xmlto, yes, no)
if test "x$filemq_have_asciidoc" = "xno" -o "x$filemq_have_xmlto" = "xno"; then
filemq_build_doc="no"
# Tarballs built with 'make dist' ship with prebuilt documentation.
if ! test -f doc/filemq.7; then
filemq_install_man="no"
AC_MSG_WARN([You are building an unreleased version of FILEMQ and asciidoc or xmlto are not installed.])
AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.])
fi
fi
fi
AC_MSG_CHECKING([whether to build documentation])
AC_MSG_RESULT([$filemq_build_doc])
AC_MSG_CHECKING([whether to install manpages])
AC_MSG_RESULT([$filemq_install_man])
# Set some default features required by libfilemq code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
# OS-specific tests
case "${host_os}" in
*linux*)
# Define on Linux to enable all library features
CPPFLAGS="-D_GNU_SOURCE -DLINUX $CPPFLAGS"
AC_DEFINE(FILEMQ_HAVE_LINUX, 1, [Have Linux OS])
filemq_on_linux="yes"
case "${host_os}" in
*android*)
AC_DEFINE(FILEMQ_HAVE_ANDROID, 1, [Have Android OS])
filemq_on_android="yes"
;;
esac
;;
*solaris*)
# Define on Solaris to enable all library features
CPPFLAGS="-D_PTHREADS $CPPFLAGS"
AC_DEFINE(FILEMQ_HAVE_SOLARIS, 1, [Have Solaris OS])
CFLAGS="${CFLAGS} -lsocket -lssp"
;;
*freebsd*)
# Define on FreeBSD to enable all library features
CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS"
AC_DEFINE(FILEMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS])
;;
*darwin*)
# Define on Darwin to enable all library features
CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"
AC_DEFINE(FILEMQ_HAVE_OSX, 1, [Have DarwinOSX OS])
;;
*netbsd*)
# Define on NetBSD to enable all library features
CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS"
AC_DEFINE(FILEMQ_HAVE_NETBSD, 1, [Have NetBSD OS])
;;
*openbsd*)
# Define on OpenBSD to enable all library features
CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
AC_DEFINE(FILEMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])
;;
*nto-qnx*)
AC_DEFINE(FILEMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS])
;;
*aix*)
AC_DEFINE(FILEMQ_HAVE_AIX, 1, [Have AIX OS])
;;
*hpux*)
# Define on HP-UX to enable all library features
CPPFLAGS="-D_POSIX_C_SOURCE=200112L"
AC_DEFINE(FILEMQ_HAVE_HPUX, 1, [Have HPUX OS])
;;
*mingw32*)
AC_DEFINE(FILEMQ_HAVE_WINDOWS, 1, [Have Windows OS])
AC_DEFINE(FILEMQ_HAVE_MINGW32, 1, [Have MinGW32])
AC_CHECK_HEADERS(windows.h)
filemq_on_mingw32="yes"
filemq_install_man="no"
;;
*cygwin*)
# Define on Cygwin to enable all library features
CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
AC_DEFINE(FILEMQ_HAVE_CYGWIN, 1, [Have Cygwin])
filemq_on_cygwin="yes"
;;
gnu*)
# Define on GNU/Hurd to enable all library features
if test "x$GXX" = "xyes"; then
CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
fi
AC_DEFINE(FILEMQ_HAVE_GNU, 1, [Have GNU/Hurd OS])
filemq_on_gnu="yes"
;;
*)
AC_MSG_ERROR([unsupported system: ${host_os}.])
;;
esac
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(errno.h arpa/inet.h netinet/tcp.h netinet/in.h stddef.h \
stdlib.h string.h sys/socket.h sys/time.h unistd.h \
limits.h ifaddrs.h)
AC_CHECK_HEADERS([net/if.h net/if_media.h linux/wireless.h], [], [],
[
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#include <stdint.h>
])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_HEADER_TIME
AC_TYPE_UINT32_T
AC_C_VOLATILE
AC_C_BIGENDIAN
# These options are GNU compiler specific.
if test "x$GCC" = "xyes"; then
CPPFLAGS="-pedantic -Werror -Wall -Wc++-compat ${CPPFLAGS}"
fi
AM_CONDITIONAL(ENABLE_SHARED, test "x$enable_shared" = "xyes")
AM_CONDITIONAL(ON_MINGW, test "x$filemq_on_mingw32" = "xyes")
AM_CONDITIONAL(ON_CYGWIN, test "x$filemq_on_cygwin" = "xyes")
AM_CONDITIONAL(ON_ANDROID, test "x$filemq_on_android" = "xyes")
AM_CONDITIONAL(ON_LINUX, test "x$filemq_on_linux" = "xyes")
AM_CONDITIONAL(ON_GNU, test "x$filemq_on_gnu" = "xyes")
AM_CONDITIONAL(INSTALL_MAN, test "x$filemq_install_man" = "xyes")
AM_CONDITIONAL(BUILD_DOC, test "x$filemq_build_doc" = "xyes")
# Check for filemq_server intent
AC_ARG_WITH([filemq_server],
AS_HELP_STRING([--with-filemq_server],
[Compile and install the filemq_server program [default=yes].]),
[with_filemq_server=$withval],
[with_filemq_server=yes])
AM_CONDITIONAL([WITH_FILEMQ_SERVER], [test x$with_filemq_server != xno])
AM_COND_IF([WITH_FILEMQ_SERVER], [AC_MSG_NOTICE([WITH_FILEMQ_SERVER defined])])
# Check for filemq_client intent
AC_ARG_WITH([filemq_client],
AS_HELP_STRING([--with-filemq_client],
[Compile and install the filemq_client program [default=yes].]),
[with_filemq_client=$withval],
[with_filemq_client=yes])
AM_CONDITIONAL([WITH_FILEMQ_CLIENT], [test x$with_filemq_client != xno])
AM_COND_IF([WITH_FILEMQ_CLIENT], [AC_MSG_NOTICE([WITH_FILEMQ_CLIENT defined])])
# Check for filemq_selftest intent
AC_ARG_WITH([filemq_selftest],
AS_HELP_STRING([--with-filemq_selftest],
[Compile the filemq_selftest program [default=yes].]),
[with_filemq_selftest=$withval],
[with_filemq_selftest=yes])
AM_CONDITIONAL([WITH_FILEMQ_SELFTEST], [test x$with_filemq_selftest != xno])
AM_COND_IF([WITH_FILEMQ_SELFTEST], [AC_MSG_NOTICE([WITH_FILEMQ_SELFTEST defined])])
# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(perror gettimeofday memset getifaddrs)
# Set pkgconfigdir
AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
[Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
[pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir])
# enable specific system integration features
AC_ARG_WITH([systemd],
AS_HELP_STRING([--with-systemd],
[Build and install with systemd integration [default=no].]),
[with_systemd=$withval],
[with_systemd=no])
AM_CONDITIONAL([WITH_SYSTEMD], [test x$with_systemd != xno])
AM_COND_IF([WITH_SYSTEMD],
[PKG_CHECK_MODULES([SYSTEMD], [systemd >= 200], [],
[AC_MSG_ERROR([Cannot find required package for systemd. Note, pkg-config is required due to specified version >= 200])])],
[])
if test "x$cross_compiling" = "xyes"; then
# Enable draft by default when cross-compiling
gitmaster=yes
else
# enable draft API by default if we're in a git repository
# else disable it by default; then allow --with-draft=yes/no override
AC_CHECK_FILE(.git, [gitmaster=yes], [gitmaster=no])
fi
AC_ARG_WITH([drafts],
AS_HELP_STRING([--with-drafts],
[Build and install draft classes and methods [default=yes.]]),
[with_drafts=$withval],
[with_drafts=$gitmaster])
AM_CONDITIONAL([WITH_DRAFTS], [test x$with_drafts != xno])
if test "x$with_drafts" = "xyes"; then
AC_MSG_NOTICE([building draft, stable, and legacy API])
AC_DEFINE(WITH_DRAFTS, 1, [Build and install draft classes and methods.])
AC_SUBST(pkg_config_defines, "-DWITH_DRAFTS=1")
else
AC_MSG_NOTICE([building stable and legacy API (no drafts)])
AC_SUBST(pkg_config_defines, "")
fi
# Specify output files
AC_CONFIG_FILES([Makefile
doc/Makefile
src/libfilemq.pc
])
AM_COND_IF([WITH_SYSTEMD],
[AC_CONFIG_FILES([
])],
[])
AC_OUTPUT
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
################################################################################