# Set a helper variable to indicate GNU C and C++ are in use
if test "x$GCC" = "xyes" -a "x$GXX" = "xyes"; then
gnu_compilers="yes"
else
gnu_compilers="no"
fi
# Check for ICC and Sun Studio compilers
AC_LANG(C)
AC_CHECK_LANG_ICC
AC_CHECK_LANG_SUN_STUDIO
AC_LANG(C++)
AC_CHECK_LANG_ICC
AC_CHECK_LANG_SUN_STUDIO
# Checks for libraries.
AC_CHECK_LIB([pthread], [pthread_create])
# Extra CFLAGS are appended at the end of CFLAGS for pgm.
LIBZMQ_EXTRA_CFLAGS=""
# Extra CXXFLAGS are appended at the end of CXXFLAGS for libzmq.
LIBZMQ_EXTRA_CXXFLAGS=""
# Extra LDFLAGS are appended at the end of LDFLAGS for libzmq.
LIBZMQ_EXTRA_LDFLAGS=""
# Enable -pedantic if not using icc, this may be overridden later
AC_CHECK_LANG_ICC
if test "xyes" = "x$ac_cv_c_intel_compiler" -o "xyes" = "x$ac_cv_cpp_intel_compiler"; then
pedantic="no"
# Set a helper variable to indicate GNU C and C++ are in use
if test "x$GCC" = "xyes" -a "x$GXX" = "xyes"; then
gnu_compilers="yes"
# ICC is detected as GNU compiler, make sure that it's not being used as one
if test "xyes" = "x$ac_cv_c_intel_compiler" -o "xyes" = "x$ac_cv_cpp_intel_compiler"; then
gnu_compilers="no"
fi
else
gnu_compilers="no"
fi
# Set pedantic when using GNU compilers
if test "x$gnu_compilers" = "xyes"; then
pedantic="yes"
fi
#By default compiling with -Werror except OSX.
#By default compiling with -Werror except OSX.
werror="yes"
#Whether we are on mingw or not.
#Whether we are on mingw or not.
on_mingw32="no"
# Host speciffic checks
AC_CANONICAL_HOST
# Determine whether or not documentation should be built and installed.
build_doc="yes"
install_man="yes"
# Check for asciidoc and xmlto and don't build the docs if these are not installed.
AC_CHECK_PROG(have_asciidoc, asciidoc, yes, no)
AC_CHECK_PROG(have_xmlto, xmlto, yes, no)
if test "x$have_asciidoc" = "xno" -o "x$have_xmlto" = "xno"; then
build_doc="no"
# Tarballs built with 'make dist' ship with prebuilt documentation.
if ! test -f doc/zmq.7; then
install_man="no"
AC_MSG_WARN([You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed. Documentation will not be built and manual pages will not be installed.])
fi
fi
AC_MSG_CHECKING([whether to build documentation])
AC_MSG_RESULT([$build_doc])
AC_MSG_CHECKING([whether to install manpages])
AC_MSG_RESULT([$install_man])
# Set some default features required by 0MQ code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
...
...
@@ -100,18 +96,18 @@ case "${host_os}" in
CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
fi
AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
AC_CHECK_LIB(rt, main)
AC_CHECK_LIB(uuid, main, ,
AC_CHECK_LIB(rt, sem_init)
AC_CHECK_LIB(uuid, uuid_generate, ,
[AC_MSG_ERROR([cannot link with -luuid, install uuid-dev.])])
;;
*solaris*)
# Define on Solaris to enable all library features
CPPFLAGS="-D_PTHREADS $CPPFLAGS"
AC_DEFINE(ZMQ_HAVE_SOLARIS, 1, [Have Solaris OS])
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(rt, main)
AC_CHECK_LIB(uuid, main, ,
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(rt, sem_init)
AC_CHECK_LIB(uuid, uuid_generate, ,
[AC_MSG_ERROR([cannot link with -luuid, install uuid-dev.])])
AC_MSG_CHECKING([whether atomic operations can be used])