################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
#
AC_INIT([czmq],[4.0.1],[zeromq-dev@lists.zeromq.org])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_CONFIG_HEADERS([src/platform.h])
AM_INIT_AUTOMAKE([subdir-objects tar-ustar dist-zip 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],
[CZMQ major version])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],[$PV_MINOR],
[CZMQ minor version])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCH],[$PV_PATCH],
[CZMQ 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
#
# libczmq -version-info
LTVER="4:0:0"
AC_SUBST(LTVER)
# Capture c flags
CZMQ_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
AX_PROJECT_LOCAL_HOOK # Optional project-local hook (acinclude.m4)
# Code coverage
AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
[With GCC Code Coverage reporting])],
[CZMQ_GCOV="$withval"])
if test "x${CZMQ_GCOV}" == "xyes"; then
CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
if test "x${CZMQ_ORIG_CFLAGS}" != "xnone"; then
CFLAGS="${CFLAGS} ${CZMQ_ORIG_CFLAGS}"
fi
AM_CONDITIONAL(WITH_GCOV, true)
else
AM_CONDITIONAL(WITH_GCOV, false)
fi
# Will be used to add flags to pkg-config useful when apps want to statically link
PKGCFG_LIBS_PRIVATE=""
PREVIOUS_CFLAGS="${CFLAGS}"
PREVIOUS_LIBS="${LIBS}"
was_libzmq_check_lib_detected=no
PKG_CHECK_MODULES([libzmq], [libzmq >= 0.0.0],
[
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $libzmq_LIBS"
],
[
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([zmq], [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
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lzmq"
],
[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_uuid_check_lib_detected=no
PKG_CHECK_MODULES([uuid], [uuid >= 0.0.0],
[
AC_DEFINE(HAVE_UUID, 1, [The uuid library is to be used])
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $uuid_LIBS"
],
[
AC_ARG_WITH([uuid],
[
AS_HELP_STRING([--with-uuid],
[Specify uuid prefix])
],
[search_uuid="yes"],
[])
uuid_synthetic_cflags=""
uuid_synthetic_libs="-luuid"
if test "x$search_uuid" = "xyes"; then
if test -r "${with_uuid}/include/uuid/uuid.h"; then
uuid_synthetic_cflags="-I${with_uuid}/include"
uuid_synthetic_libs="-L${with_uuid}/lib -luuid"
else
AC_MSG_ERROR([${with_uuid}/include/uuid/uuid.h not found. Please check uuid prefix])
fi
fi
AC_CHECK_LIB([uuid], [uuid_generate],
[
CFLAGS="${uuid_synthetic_cflags} ${CFLAGS}"
LDFLAGS="${uuid_synthetic_libs} ${LDFLAGS}"
LIBS="${uuid_synthetic_libs} ${LIBS}"
AC_SUBST([uuid_CFLAGS],[${uuid_synthetic_cflags}])
AC_SUBST([uuid_LIBS],[${uuid_synthetic_libs}])
was_uuid_check_lib_detected=yes
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -luuid"
AC_DEFINE(HAVE_UUID, 1, [The uuid library is to be used])
],
[])
])
if test "x$was_uuid_check_lib_detected" = "xno"; then
CFLAGS="${uuid_CFLAGS} ${CFLAGS}"
LIBS="${uuid_LIBS} ${LIBS}"
fi
was_systemd_check_lib_detected=no
PKG_CHECK_MODULES([systemd], [libsystemd >= 200.0.0],
[
AC_DEFINE(HAVE_LIBSYSTEMD, 1, [The libsystemd library is to be used])
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $systemd_LIBS"
],
[
AC_MSG_WARN([Cannot find libsystemd 200.0.0 or higher])
])
if test "x$was_systemd_check_lib_detected" = "xno"; then
CFLAGS="${systemd_CFLAGS} ${CFLAGS}"
LIBS="${systemd_LIBS} ${LIBS}"
fi
CFLAGS="${PREVIOUS_CFLAGS}"
LIBS="${PREVIOUS_LIBS}"
AC_SUBST(pkg_config_libs_private, $PKGCFG_LIBS_PRIVATE)
# Platform specific checks
czmq_on_mingw32="no"
czmq_on_cygwin="no"
czmq_on_android="no"
czmq_on_linux="no"
czmq_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
czmq_build_doc="no"
czmq_install_man="no"
else
# Determine whether or not documentation should be built and installed.
czmq_build_doc="yes"
czmq_install_man="yes"
# Check for asciidoc and xmlto and don't build the docs if these are not installed.
AC_CHECK_PROG(czmq_have_asciidoc, asciidoc, yes, no)
AC_CHECK_PROG(czmq_have_xmlto, xmlto, yes, no)
if test "x$czmq_have_asciidoc" = "xno" -o "x$czmq_have_xmlto" = "xno"; then
czmq_build_doc="no"
# Tarballs built with 'make dist' ship with prebuilt documentation.
if ! test -f doc/czmq.7; then
czmq_install_man="no"
AC_MSG_WARN([You are building an unreleased version of CZMQ 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([$czmq_build_doc])
AC_MSG_CHECKING([whether to install manpages])
AC_MSG_RESULT([$czmq_install_man])
# Set some default features required by libczmq code.
CPPFLAGS="-DCZMQ_INTERNAL_BUILD -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(CZMQ_HAVE_LINUX, 1, [Have Linux OS])
czmq_on_linux="yes"
case "${host_os}" in
*android*)
AC_DEFINE(CZMQ_HAVE_ANDROID, 1, [Have Android OS])
czmq_on_android="yes"
;;
esac
;;
*solaris*)
# Define on Solaris to enable all library features
CPPFLAGS="-D_PTHREADS $CPPFLAGS"
AC_DEFINE(CZMQ_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(CZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS])
;;
*darwin*)
# Define on Darwin to enable all library features
CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"
AC_DEFINE(CZMQ_HAVE_OSX, 1, [Have DarwinOSX OS])
;;
*netbsd*)
# Define on NetBSD to enable all library features
CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS"
AC_DEFINE(CZMQ_HAVE_NETBSD, 1, [Have NetBSD OS])
;;
*openbsd*)
# Define on OpenBSD to enable all library features
CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
AC_DEFINE(CZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])
;;
*nto-qnx*)
AC_DEFINE(CZMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS])
;;
*aix*)
AC_DEFINE(CZMQ_HAVE_AIX, 1, [Have AIX OS])
;;
*hpux*)
# Define on HP-UX to enable all library features
CPPFLAGS="-D_POSIX_C_SOURCE=200112L"
AC_DEFINE(CZMQ_HAVE_HPUX, 1, [Have HPUX OS])
;;
*mingw32*)
AC_DEFINE(CZMQ_HAVE_WINDOWS, 1, [Have Windows OS])
AC_DEFINE(CZMQ_HAVE_MINGW32, 1, [Have MinGW32])
AC_CHECK_HEADERS(windows.h)
czmq_on_mingw32="yes"
czmq_install_man="no"
;;
*mingw64*)
# Define on MINGW64 to enable all libeary features
# Disable format error due to incomplete ANSI C
CPPFLAGS="-Wno-error=format -D_XOPEN_SOURCE $CPPFLAGS"
AC_DEFINE(CZMQ_HAVE_WINDOWS, 1, [Have Windows OS])
AC_DEFINE(CZMQ_HAVE_MINGW32, 1, [Have MinGW32])
AC_CHECK_HEADERS(windows.h)
czmq_on_mingw32="yes"
czmq_install_man="no"
;;
*cygwin*)
# Define on Cygwin to enable all library features
CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
AC_DEFINE(CZMQ_HAVE_CYGWIN, 1, [Have Cygwin])
czmq_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(CZMQ_HAVE_GNU, 1, [Have GNU/Hurd OS])
czmq_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$czmq_on_mingw32" = "xyes")
AM_CONDITIONAL(ON_CYGWIN, test "x$czmq_on_cygwin" = "xyes")
AM_CONDITIONAL(ON_ANDROID, test "x$czmq_on_android" = "xyes")
AM_CONDITIONAL(ON_LINUX, test "x$czmq_on_linux" = "xyes")
AM_CONDITIONAL(ON_GNU, test "x$czmq_on_gnu" = "xyes")
AM_CONDITIONAL(INSTALL_MAN, test "x$czmq_install_man" = "xyes")
AM_CONDITIONAL(BUILD_DOC, test "x$czmq_build_doc" = "xyes")
# Check for zmakecert intent
AC_ARG_ENABLE([zmakecert],
AS_HELP_STRING([--enable-zmakecert],
[Compile and install 'zmakecert' [default=yes]]),
[enable_zmakecert=$enableval],
[enable_zmakecert=yes])
AM_CONDITIONAL([ENABLE_ZMAKECERT], [test x$enable_zmakecert != xno])
AM_COND_IF([ENABLE_ZMAKECERT], [AC_MSG_NOTICE([ENABLE_ZMAKECERT defined])])
# Check for czmq_selftest intent
AC_ARG_ENABLE([czmq_selftest],
AS_HELP_STRING([--enable-czmq_selftest],
[Compile 'czmq_selftest' in src [default=yes]]),
[enable_czmq_selftest=$enableval],
[enable_czmq_selftest=yes])
AM_CONDITIONAL([ENABLE_CZMQ_SELFTEST], [test x$enable_czmq_selftest != xno])
AM_COND_IF([ENABLE_CZMQ_SELFTEST], [AC_MSG_NOTICE([ENABLE_CZMQ_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
if test "x$cross_compiling" = "xyes"; then
# Enable draft by default when cross-compiling
defaultval=yes
else
# enable draft API by default if we're in a git repository
# else disable it by default; then allow --enable-drafts=yes/no override
AC_CHECK_FILE($srcdir/.git, [defaultval=yes], [defaultval=no])
fi
AC_ARG_ENABLE([drafts],
AS_HELP_STRING([--enable-drafts],
[Build and install draft classes and methods [default=yes]]),
[enable_drafts=$enableval],
[enable_drafts=$defaultval])
AM_CONDITIONAL([ENABLE_DRAFTS], [test x$enable_drafts != xno])
if test "x$enable_drafts" = "xyes"; then
AC_MSG_NOTICE([Building stable and legacy API + draft API])
AC_DEFINE(CZMQ_BUILD_DRAFT_API, 1, [Provide draft classes and methods])
AC_SUBST(pkg_config_defines, "-DCZMQ_BUILD_DRAFT_API=1")
else
AC_MSG_NOTICE([Building stable and legacy API (no draft API)])
AC_SUBST(pkg_config_defines, "")
fi
# Specify output files
AC_CONFIG_FILES([Makefile
doc/Makefile
src/libczmq.pc
])
AC_OUTPUT
# Print configure summary and list make options
AC_DEFUN([AX_SUMMARIZE_ENV],
[
BUILD_USER=${USER}
BUILD_ARCH=${host}
BUILD_HOST=${ac_hostname}
BUILD_DATE=$(date +'%F %H:%M')
AC_DEFINE_UNQUOTED([BUILD_USER], "${BUILD_USER}", [The fine user who built the package])
AC_DEFINE_UNQUOTED([BUILD_ARCH], "${BUILD_ARCH}", [Architecture of the build host])
AC_DEFINE_UNQUOTED([BUILD_HOST], "${BUILD_HOST}", [Build host name])
AC_DEFINE_UNQUOTED([BUILD_DATE], "${BUILD_DATE}", [Build date])
AC_SUBST(BUILD_USER)
AC_SUBST(BUILD_ARCH)
AC_SUBST(BUILD_HOST)
AC_SUBST(BUILD_DATE)
AC_SUBST(BUILD_VERSION)
])
AC_DEFUN([AX_SUMMARIZE_CONFIG],
[
echo
echo '##########################################################################'
echo '# SUMMARY #'
echo '##########################################################################'
echo
echo Package version............... : $PACKAGE-$VERSION
echo
echo C compiler.................... : $CC
echo C compiler flags.............. : $CFLAGS
echo Configure date................ : $BUILD_DATE
echo Build architecture............ : $BUILD_ARCH
echo Build docs.................... : $czmq_build_doc
echo Build host.................... : $BUILD_HOST
echo Build user.................... : $USER
echo Draft API..................... : $enable_drafts
echo Install dir................... : $prefix
echo Install man pages............. : $czmq_install_man
echo
echo Help:
echo Use the Draft API \(default = yes\):
echo --enable-drafts=\(yes\|no\)
echo
echo Build the docs and install the man pages \(default = yes\):
echo --with-docs=\(yes\|no\) *requires asciidoc and xmlto
echo
echo '##########################################################################'
echo
echo Configure complete! Now procced with:
echo " - 'make' compile the project"
echo " - 'make check' run the project's selftest"
echo " - 'make install' install the project to $prefix"
echo
echo Further options are:
echo " - 'make callcheck' run the project's selftest with valgrind to"
echo " check for performance leaks"
echo " - 'make check-verbose' run the project's selftest in verbose mode"
echo " - 'make code' generate code from models in src directory"
echo " (requires zproject and zproto)"
echo " - 'make debug' run the project's selftest under gdb"
echo " - 'make memcheck' run the project's selftest with valgrind to"
echo " check for memory leaks"
echo " - 'make coverage' generate project's selftest coverage report"
echo " expects --with-gcov option for configure"
echo
])
AX_SUMMARIZE_ENV
AX_SUMMARIZE_CONFIG
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################