Commit 656b646b authored by Mikko Koppanen's avatar Mikko Koppanen Committed by Martin Sustrik

Large rename: AC_ZMQ_ to LIBZMQ_ and ac_zmq_ to libzmq_. Fixes "warning suspicious cache-id"

Signed-off-by: 's avatarMikko Koppanen <mkoppanen@php.net>
parent bdeddb89
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CONFIG_LIBTOOL # dnl # LIBZMQ_CONFIG_LIBTOOL #
dnl # Configure libtool. Requires AC_CANONICAL_HOST # dnl # Configure libtool. Requires AC_CANONICAL_HOST #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CONFIG_LIBTOOL], [{ AC_DEFUN([LIBZMQ_CONFIG_LIBTOOL], [{
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
# Libtool configuration for different targets # Libtool configuration for different targets
...@@ -19,192 +19,192 @@ AC_DEFUN([AC_ZMQ_CONFIG_LIBTOOL], [{ ...@@ -19,192 +19,192 @@ AC_DEFUN([AC_ZMQ_CONFIG_LIBTOOL], [{
}]) }])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CHECK_LANG_ICC([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_LANG_ICC([action-if-found], [action-if-not-found]) #
dnl # Check if the current language is compiled using ICC # dnl # Check if the current language is compiled using ICC #
dnl # Adapted from http://software.intel.com/en-us/forums/showthread.php?t=67984 # dnl # Adapted from http://software.intel.com/en-us/forums/showthread.php?t=67984 #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CHECK_LANG_ICC], AC_DEFUN([LIBZMQ_CHECK_LANG_ICC],
[AC_CACHE_CHECK([whether we are using Intel _AC_LANG compiler], [AC_CACHE_CHECK([whether we are using Intel _AC_LANG compiler],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler], [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler],
[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[[#ifndef __INTEL_COMPILER [[#ifndef __INTEL_COMPILER
error if not ICC error if not ICC
#endif #endif
]])], ]])],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="yes" ; $1],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="no" ; $2]) [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="no" ; $2])
])]) ])])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CHECK_LANG_SUN_STUDIO([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_LANG_SUN_STUDIO([action-if-found], [action-if-not-found]) #
dnl # Check if the current language is compiled using Sun Studio # dnl # Check if the current language is compiled using Sun Studio #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CHECK_LANG_SUN_STUDIO], AC_DEFUN([LIBZMQ_CHECK_LANG_SUN_STUDIO],
[AC_CACHE_CHECK([whether we are using Sun Studio _AC_LANG compiler], [AC_CACHE_CHECK([whether we are using Sun Studio _AC_LANG compiler],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler], [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler],
[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[[#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) [[#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C)
error if not sun studio error if not sun studio
#endif #endif
]])], ]])],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="yes" ; $1],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="no" ; $2]) [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="no" ; $2])
])]) ])])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CHECK_LANG_CLANG([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_LANG_CLANG([action-if-found], [action-if-not-found]) #
dnl # Check if the current language is compiled using clang # dnl # Check if the current language is compiled using clang #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CHECK_LANG_CLANG], AC_DEFUN([LIBZMQ_CHECK_LANG_CLANG],
[AC_CACHE_CHECK([whether we are using clang _AC_LANG compiler], [AC_CACHE_CHECK([whether we are using clang _AC_LANG compiler],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler], [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler],
[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[[#ifndef __clang__ [[#ifndef __clang__
error if not clang error if not clang
#endif #endif
]])], ]])],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="yes" ; $1],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="no" ; $2]) [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="no" ; $2])
])]) ])])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CHECK_LANG_GCC4([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_LANG_GCC4([action-if-found], [action-if-not-found]) #
dnl # Check if the current language is compiled using clang # dnl # Check if the current language is compiled using clang #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CHECK_LANG_GCC4], AC_DEFUN([LIBZMQ_CHECK_LANG_GCC4],
[AC_CACHE_CHECK([whether we are using gcc >= 4 _AC_LANG compiler], [AC_CACHE_CHECK([whether we are using gcc >= 4 _AC_LANG compiler],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler], [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler],
[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[[#if (!defined __GNUC__ || __GNUC__ < 4) [[#if (!defined __GNUC__ || __GNUC__ < 4)
error if not gcc4 or higher error if not gcc4 or higher
#endif #endif
]])], ]])],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="yes" ; $1],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="no" ; $2]) [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="no" ; $2])
])]) ])])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CHECK_DOC_BUILD # dnl # LIBZMQ_CHECK_DOC_BUILD #
dnl # Check whether to build documentation and install man-pages # dnl # Check whether to build documentation and install man-pages #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CHECK_DOC_BUILD], [{ AC_DEFUN([LIBZMQ_CHECK_DOC_BUILD], [{
# Allow user to disable doc build # Allow user to disable doc build
AC_ARG_WITH([documentation], [AS_HELP_STRING([--without-documentation], AC_ARG_WITH([documentation], [AS_HELP_STRING([--without-documentation],
[disable documentation build even if asciidoc and xmlto are present [default=no]])]) [disable documentation build even if asciidoc and xmlto are present [default=no]])])
if test "x$with_documentation" = "xno"; then if test "x$with_documentation" = "xno"; then
ac_zmq_build_doc="no" libzmq_build_doc="no"
ac_zmq_install_man="no" libzmq_install_man="no"
else else
# Determine whether or not documentation should be built and installed. # Determine whether or not documentation should be built and installed.
ac_zmq_build_doc="yes" libzmq_build_doc="yes"
ac_zmq_install_man="yes" libzmq_install_man="yes"
# Check for asciidoc and xmlto and don't build the docs if these are not installed. # Check for asciidoc and xmlto and don't build the docs if these are not installed.
AC_CHECK_PROG(ac_zmq_have_asciidoc, asciidoc, yes, no) AC_CHECK_PROG(libzmq_have_asciidoc, asciidoc, yes, no)
AC_CHECK_PROG(ac_zmq_have_xmlto, xmlto, yes, no) AC_CHECK_PROG(libzmq_have_xmlto, xmlto, yes, no)
if test "x$ac_zmq_have_asciidoc" = "xno" -o "x$ac_zmq_have_xmlto" = "xno"; then if test "x$libzmq_have_asciidoc" = "xno" -o "x$libzmq_have_xmlto" = "xno"; then
ac_zmq_build_doc="no" libzmq_build_doc="no"
# Tarballs built with 'make dist' ship with prebuilt documentation. # Tarballs built with 'make dist' ship with prebuilt documentation.
if ! test -f doc/zmq.7; then if ! test -f doc/zmq.7; then
ac_zmq_install_man="no" libzmq_install_man="no"
AC_MSG_WARN([You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed.]) AC_MSG_WARN([You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed.])
AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.]) AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.])
fi fi
fi fi
# Do not install man pages if on mingw # Do not install man pages if on mingw
if test "x$ac_zmq_on_mingw32" = "xyes"; then if test "x$libzmq_on_mingw32" = "xyes"; then
ac_zmq_install_man="no" libzmq_install_man="no"
fi fi
fi fi
AC_MSG_CHECKING([whether to build documentation]) AC_MSG_CHECKING([whether to build documentation])
AC_MSG_RESULT([$ac_zmq_build_doc]) AC_MSG_RESULT([$libzmq_build_doc])
AC_MSG_CHECKING([whether to install manpages]) AC_MSG_CHECKING([whether to install manpages])
AC_MSG_RESULT([$ac_zmq_install_man]) AC_MSG_RESULT([$libzmq_install_man])
AM_CONDITIONAL(BUILD_DOC, test "x$ac_zmq_build_doc" = "xyes") AM_CONDITIONAL(BUILD_DOC, test "x$libzmq_build_doc" = "xyes")
AM_CONDITIONAL(INSTALL_MAN, test "x$ac_zmq_install_man" = "xyes") AM_CONDITIONAL(INSTALL_MAN, test "x$libzmq_install_man" = "xyes")
}]) }])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CHECK_LANG_COMPILER([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_LANG_COMPILER([action-if-found], [action-if-not-found]) #
dnl # Check that compiler for the current language actually works # dnl # Check that compiler for the current language actually works #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CHECK_LANG_COMPILER], [{ AC_DEFUN([LIBZMQ_CHECK_LANG_COMPILER], [{
# Test that compiler for the current language actually works # Test that compiler for the current language actually works
AC_CACHE_CHECK([whether the _AC_LANG compiler works], AC_CACHE_CHECK([whether the _AC_LANG compiler works],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_compiler_works], [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="yes" ; $1],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="no" ; $2]) [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="no" ; $2])
]) ])
if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_compiler_works" != "xyes"; then if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works" != "xyes"; then
AC_MSG_ERROR([Unable to find a working _AC_LANG compiler]) AC_MSG_ERROR([Unable to find a working _AC_LANG compiler])
fi fi
}]) }])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CHECK_COMPILERS # dnl # LIBZMQ_CHECK_COMPILERS #
dnl # Check compiler characteristics. This is so that we can AC_REQUIRE checks # dnl # Check compiler characteristics. This is so that we can AC_REQUIRE checks #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CHECK_COMPILERS], [{ AC_DEFUN([LIBZMQ_CHECK_COMPILERS], [{
# For that the compiler works and try to come up with the type # For that the compiler works and try to come up with the type
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
AC_ZMQ_CHECK_LANG_COMPILER LIBZMQ_CHECK_LANG_COMPILER
AC_ZMQ_CHECK_LANG_ICC LIBZMQ_CHECK_LANG_ICC
AC_ZMQ_CHECK_LANG_SUN_STUDIO LIBZMQ_CHECK_LANG_SUN_STUDIO
AC_ZMQ_CHECK_LANG_CLANG LIBZMQ_CHECK_LANG_CLANG
AC_ZMQ_CHECK_LANG_GCC4 LIBZMQ_CHECK_LANG_GCC4
AC_LANG_POP([C]) AC_LANG_POP([C])
AC_LANG_PUSH(C++) AC_LANG_PUSH(C++)
AC_ZMQ_CHECK_LANG_COMPILER LIBZMQ_CHECK_LANG_COMPILER
AC_ZMQ_CHECK_LANG_ICC LIBZMQ_CHECK_LANG_ICC
AC_ZMQ_CHECK_LANG_SUN_STUDIO LIBZMQ_CHECK_LANG_SUN_STUDIO
AC_ZMQ_CHECK_LANG_CLANG LIBZMQ_CHECK_LANG_CLANG
AC_ZMQ_CHECK_LANG_GCC4 LIBZMQ_CHECK_LANG_GCC4
AC_LANG_POP([C++]) AC_LANG_POP([C++])
# Set GCC and GXX variables correctly # Set GCC and GXX variables correctly
if test "x$GCC" = "xyes"; then if test "x$GCC" = "xyes"; then
if test "xyes" = "x$ac_zmq_cv_c_intel_compiler"; then if test "xyes" = "x$libzmq_cv_c_intel_compiler"; then
GCC="no" GCC="no"
fi fi
fi fi
if test "x$GXX" = "xyes"; then if test "x$GXX" = "xyes"; then
if test "xyes" = "x$ac_zmq_cv_cxx_intel_compiler"; then if test "xyes" = "x$libzmq_cv_cxx_intel_compiler"; then
GXX="no" GXX="no"
fi fi
fi fi
}]) }])
dnl ############################################################################ dnl ############################################################################
dnl # AC_ZMQ_CHECK_LANG_FLAG([flag], [action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_LANG_FLAG([flag], [action-if-found], [action-if-not-found]) #
dnl # Check if the compiler supports given flag. Works for C and C++ # dnl # Check if the compiler supports given flag. Works for C and C++ #
dnl # Sets ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no # dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no #
dnl ############################################################################ dnl ############################################################################
AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG], [{ AC_DEFUN([LIBZMQ_CHECK_LANG_FLAG], [{
AC_REQUIRE([AC_PROG_GREP]) AC_REQUIRE([AC_PROG_GREP])
AC_MSG_CHECKING([whether _AC_LANG compiler supports $1]) AC_MSG_CHECKING([whether _AC_LANG compiler supports $1])
ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag
ac_[]_AC_LANG_ABBREV[]_werror_flag="yes" ac_[]_AC_LANG_ABBREV[]_werror_flag="yes"
case "x[]_AC_LANG_ABBREV" in case "x[]_AC_LANG_ABBREV" in
xc) xc)
ac_zmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS" libzmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $1" CFLAGS="$CFLAGS $1"
;; ;;
xcxx) xcxx)
ac_zmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS" libzmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $1" CPPFLAGS="$CPPFLAGS $1"
;; ;;
*) *)
...@@ -217,18 +217,18 @@ AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG], [{ ...@@ -217,18 +217,18 @@ AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG], [{
# Remarks are not turned into errors even with -Werror on # Remarks are not turned into errors even with -Werror on
[if ($GREP 'ignoring unknown' conftest.err || [if ($GREP 'ignoring unknown' conftest.err ||
$GREP 'not supported' conftest.err) >/dev/null 2>&1; then $GREP 'not supported' conftest.err) >/dev/null 2>&1; then
eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no" eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no"
else else
eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="yes" eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="yes"
fi], fi],
[eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no"]) [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no"])
case "x[]_AC_LANG_ABBREV" in case "x[]_AC_LANG_ABBREV" in
xc) xc)
CFLAGS="$ac_zmq_cv_check_lang_flag_save_CFLAGS" CFLAGS="$libzmq_cv_check_lang_flag_save_CFLAGS"
;; ;;
xcxx) xcxx)
CPPFLAGS="$ac_zmq_cv_check_lang_flag_save_CPPFLAGS" CPPFLAGS="$libzmq_cv_check_lang_flag_save_CPPFLAGS"
;; ;;
*) *)
# nothing to restore # nothing to restore
...@@ -236,42 +236,42 @@ AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG], [{ ...@@ -236,42 +236,42 @@ AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG], [{
esac esac
# Restore the werror flag # Restore the werror flag
ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save ac_[]_AC_LANG_ABBREV[]_werror_flag=$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save
# Call the action as the flags are restored # Call the action as the flags are restored
AS_IF([eval test x$]AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"],
[AC_MSG_RESULT(yes) ; $2], [AC_MSG_RESULT(no) ; $3]) [AC_MSG_RESULT(yes) ; $2], [AC_MSG_RESULT(no) ; $3])
}]) }])
dnl #################################################################################### dnl ####################################################################################
dnl # AC_ZMQ_CHECK_LANG_FLAG_PREPEND([flag], [action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_LANG_FLAG_PREPEND([flag], [action-if-found], [action-if-not-found]) #
dnl # Check if the compiler supports given flag. Works for C and C++ # dnl # Check if the compiler supports given flag. Works for C and C++ #
dnl # This macro prepends the flag to CFLAGS or CPPFLAGS accordingly # dnl # This macro prepends the flag to CFLAGS or CPPFLAGS accordingly #
dnl # Sets ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no # dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no #
dnl #################################################################################### dnl ####################################################################################
AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG_PREPEND], [{ AC_DEFUN([LIBZMQ_CHECK_LANG_FLAG_PREPEND], [{
AC_ZMQ_CHECK_LANG_FLAG([$1]) LIBZMQ_CHECK_LANG_FLAG([$1])
case "x[]_AC_LANG_ABBREV" in case "x[]_AC_LANG_ABBREV" in
xc) xc)
AS_IF([eval test x$]AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"],
[CFLAGS="$1 $CFLAGS"; $2], $3) [CFLAGS="$1 $CFLAGS"; $2], $3)
;; ;;
xcxx) xcxx)
AS_IF([eval test x$]AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"],
[CPPFLAGS="$1 $CPPFLAGS"; $2], $3) [CPPFLAGS="$1 $CPPFLAGS"; $2], $3)
;; ;;
esac esac
}]) }])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CHECK_ENABLE_DEBUG([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_ENABLE_DEBUG([action-if-found], [action-if-not-found]) #
dnl # Check whether to enable debug build and set compiler flags accordingly # dnl # Check whether to enable debug build and set compiler flags accordingly #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{ AC_DEFUN([LIBZMQ_CHECK_ENABLE_DEBUG], [{
# Require compiler specifics # Require compiler specifics
AC_REQUIRE([AC_ZMQ_CHECK_COMPILERS]) AC_REQUIRE([LIBZMQ_CHECK_COMPILERS])
# This flag is checked also in # This flag is checked also in
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
...@@ -283,21 +283,21 @@ AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{ ...@@ -283,21 +283,21 @@ AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{
# GCC, clang and ICC # GCC, clang and ICC
if test "x$GCC" = "xyes" -o \ if test "x$GCC" = "xyes" -o \
"x$ac_zmq_cv_c_intel_compiler" = "xyes" -o \ "x$libzmq_cv_c_intel_compiler" = "xyes" -o \
"x$ac_zmq_cv_c_clang_compiler" = "xyes"; then "x$libzmq_cv_c_clang_compiler" = "xyes"; then
CFLAGS="-g -O0 " CFLAGS="-g -O0 "
elif test "x$ac_zmq_cv_c_sun_studio_compiler" = "xyes"; then elif test "x$libzmq_cv_c_sun_studio_compiler" = "xyes"; then
CFLAGS="-g0 " CFLAGS="-g0 "
fi fi
# GCC, clang and ICC # GCC, clang and ICC
if test "x$GXX" = "xyes" -o \ if test "x$GXX" = "xyes" -o \
"x$ac_zmq_cv_cxx_intel_compiler" = "xyes" -o \ "x$libzmq_cv_cxx_intel_compiler" = "xyes" -o \
"x$ac_zmq_cv_cxx_clang_compiler" = "xyes"; then "x$libzmq_cv_cxx_clang_compiler" = "xyes"; then
CPPFLAGS="-g -O0 " CPPFLAGS="-g -O0 "
CXXFLAGS="-g -O0 " CXXFLAGS="-g -O0 "
# Sun studio # Sun studio
elif test "x$ac_zmq_cv_cxx_sun_studio_compiler" = "xyes"; then elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then
CPPFLAGS="-g0 " CPPFLAGS="-g0 "
CXXFLAGS="-g0 " CXXFLAGS="-g0 "
fi fi
...@@ -318,12 +318,12 @@ AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{ ...@@ -318,12 +318,12 @@ AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{
}]) }])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_WITH_GCOV([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_WITH_GCOV([action-if-found], [action-if-not-found]) #
dnl # Check whether to build with code coverage # dnl # Check whether to build with code coverage #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_WITH_GCOV], [{ AC_DEFUN([LIBZMQ_WITH_GCOV], [{
# Require compiler specifics # Require compiler specifics
AC_REQUIRE([AC_ZMQ_CHECK_COMPILERS]) AC_REQUIRE([LIBZMQ_CHECK_COMPILERS])
AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no], AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
[With GCC Code Coverage reporting.])], [With GCC Code Coverage reporting.])],
...@@ -350,12 +350,12 @@ AC_DEFUN([AC_ZMQ_WITH_GCOV], [{ ...@@ -350,12 +350,12 @@ AC_DEFUN([AC_ZMQ_WITH_GCOV], [{
}]) }])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_CHECK_WITH_FLAG([flags], [macro]) # dnl # LIBZMQ_CHECK_WITH_FLAG([flags], [macro]) #
dnl # Runs a normal autoconf check with compiler flags # dnl # Runs a normal autoconf check with compiler flags #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_CHECK_WITH_FLAG], [{ AC_DEFUN([LIBZMQ_CHECK_WITH_FLAG], [{
ac_zmq_check_with_flag_save_CFLAGS="$CFLAGS" libzmq_check_with_flag_save_CFLAGS="$CFLAGS"
ac_zmq_check_with_flag_save_CPPFLAGS="$CPPFLAGS" libzmq_check_with_flag_save_CPPFLAGS="$CPPFLAGS"
CFLAGS="$CFLAGS $1" CFLAGS="$CFLAGS $1"
CPPFLAGS="$CPPFLAGS $1" CPPFLAGS="$CPPFLAGS $1"
...@@ -363,43 +363,43 @@ AC_DEFUN([AC_ZMQ_CHECK_WITH_FLAG], [{ ...@@ -363,43 +363,43 @@ AC_DEFUN([AC_ZMQ_CHECK_WITH_FLAG], [{
# Execute the macro # Execute the macro
$2 $2
CFLAGS="$ac_zmq_check_with_flag_save_CFLAGS" CFLAGS="$libzmq_check_with_flag_save_CFLAGS"
CPPFLAGS="$ac_zmq_check_with_flag_save_CPPFLAGS" CPPFLAGS="$libzmq_check_with_flag_save_CPPFLAGS"
}]) }])
dnl ############################################################################## dnl ##############################################################################
dnl # AC_ZMQ_LANG_WALL([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_LANG_WALL([action-if-found], [action-if-not-found]) #
dnl # How to define -Wall for the current compiler # dnl # How to define -Wall for the current compiler #
dnl # Sets ac_zmq_cv_[]_AC_LANG_ABBREV[]__wall_flag variable to found style # dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]__wall_flag variable to found style #
dnl ############################################################################## dnl ##############################################################################
AC_DEFUN([AC_ZMQ_LANG_WALL], [{ AC_DEFUN([LIBZMQ_LANG_WALL], [{
AC_MSG_CHECKING([how to enable additional warnings for _AC_LANG compiler]) AC_MSG_CHECKING([how to enable additional warnings for _AC_LANG compiler])
ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="" libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag=""
# C compilers # C compilers
case "x[]_AC_LANG_ABBREV" in case "x[]_AC_LANG_ABBREV" in
xc) xc)
# GCC, clang and ICC # GCC, clang and ICC
if test "x$GCC" = "xyes" -o \ if test "x$GCC" = "xyes" -o \
"x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \
"x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall" libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall"
# Sun studio # Sun studio
elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-v" libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-v"
fi fi
;; ;;
xcxx) xcxx)
# GCC, clang and ICC # GCC, clang and ICC
if test "x$GXX" = "xyes" -o \ if test "x$GXX" = "xyes" -o \
"x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \
"x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall" libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall"
# Sun studio # Sun studio
elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="+w" libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="+w"
fi fi
;; ;;
*) *)
...@@ -407,8 +407,8 @@ AC_DEFUN([AC_ZMQ_LANG_WALL], [{ ...@@ -407,8 +407,8 @@ AC_DEFUN([AC_ZMQ_LANG_WALL], [{
esac esac
# Call the action # Call the action
if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" != "x"; then if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" != "x"; then
AC_MSG_RESULT([$ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag]) AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag])
$1 $1
else else
AC_MSG_RESULT([not found]) AC_MSG_RESULT([not found])
...@@ -417,36 +417,36 @@ AC_DEFUN([AC_ZMQ_LANG_WALL], [{ ...@@ -417,36 +417,36 @@ AC_DEFUN([AC_ZMQ_LANG_WALL], [{
}]) }])
dnl #################################################################### dnl ####################################################################
dnl # AC_ZMQ_LANG_STRICT([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_LANG_STRICT([action-if-found], [action-if-not-found]) #
dnl # Check how to turn on strict standards compliance # dnl # Check how to turn on strict standards compliance #
dnl #################################################################### dnl ####################################################################
AC_DEFUN([AC_ZMQ_LANG_STRICT], [{ AC_DEFUN([LIBZMQ_LANG_STRICT], [{
AC_MSG_CHECKING([how to enable strict standards compliance in _AC_LANG compiler]) AC_MSG_CHECKING([how to enable strict standards compliance in _AC_LANG compiler])
ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="" libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag=""
# C compilers # C compilers
case "x[]_AC_LANG_ABBREV" in case "x[]_AC_LANG_ABBREV" in
xc) xc)
# GCC, clang and ICC # GCC, clang and ICC
if test "x$GCC" = "xyes" -o "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then if test "x$GCC" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic" libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic"
elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi" libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi"
# Sun studio # Sun studio
elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-Xc" libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-Xc"
fi fi
;; ;;
xcxx) xcxx)
# GCC, clang and ICC # GCC, clang and ICC
if test "x$GXX" = "xyes" -o "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then if test "x$GXX" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic" libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic"
elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi" libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi"
# Sun studio # Sun studio
elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-compat=5" libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-compat=5"
fi fi
;; ;;
*) *)
...@@ -454,8 +454,8 @@ AC_DEFUN([AC_ZMQ_LANG_STRICT], [{ ...@@ -454,8 +454,8 @@ AC_DEFUN([AC_ZMQ_LANG_STRICT], [{
esac esac
# Call the action # Call the action
if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag" != "x"; then if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag" != "x"; then
AC_MSG_RESULT([$ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag]) AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag])
$1 $1
else else
AC_MSG_RESULT([not found]) AC_MSG_RESULT([not found])
...@@ -464,32 +464,32 @@ AC_DEFUN([AC_ZMQ_LANG_STRICT], [{ ...@@ -464,32 +464,32 @@ AC_DEFUN([AC_ZMQ_LANG_STRICT], [{
}]) }])
dnl ######################################################################## dnl ########################################################################
dnl # AC_ZMQ_LANG_WERROR([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_LANG_WERROR([action-if-found], [action-if-not-found]) #
dnl # Check how to turn warnings to errors # dnl # Check how to turn warnings to errors #
dnl ######################################################################## dnl ########################################################################
AC_DEFUN([AC_ZMQ_LANG_WERROR], [{ AC_DEFUN([LIBZMQ_LANG_WERROR], [{
AC_MSG_CHECKING([how to turn warnings to errors in _AC_LANG compiler]) AC_MSG_CHECKING([how to turn warnings to errors in _AC_LANG compiler])
ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="" libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag=""
# C compilers # C compilers
case "x[]_AC_LANG_ABBREV" in case "x[]_AC_LANG_ABBREV" in
xc) xc)
# GCC, clang and ICC # GCC, clang and ICC
if test "x$GCC" = "xyes" -o "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then if test "x$GCC" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror" libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror"
# Sun studio # Sun studio
elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all" libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all"
fi fi
;; ;;
xcxx) xcxx)
# GCC, clang and ICC # GCC, clang and ICC
if test "x$GXX" = "xyes" -o "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then if test "x$GXX" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror" libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror"
# Sun studio # Sun studio
elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all" libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all"
fi fi
;; ;;
*) *)
...@@ -497,8 +497,8 @@ AC_DEFUN([AC_ZMQ_LANG_WERROR], [{ ...@@ -497,8 +497,8 @@ AC_DEFUN([AC_ZMQ_LANG_WERROR], [{
esac esac
# Call the action # Call the action
if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag" != "x"; then if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag" != "x"; then
AC_MSG_RESULT([$ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag]) AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag])
$1 $1
else else
AC_MSG_RESULT([not found]) AC_MSG_RESULT([not found])
...@@ -507,66 +507,66 @@ AC_DEFUN([AC_ZMQ_LANG_WERROR], [{ ...@@ -507,66 +507,66 @@ AC_DEFUN([AC_ZMQ_LANG_WERROR], [{
}]) }])
dnl ################################################################################ dnl ################################################################################
dnl # AC_ZMQ_CHECK_LANG_PRAGMA([pragma], [action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_LANG_PRAGMA([pragma], [action-if-found], [action-if-not-found]) #
dnl # Check if the compiler supports given pragma # dnl # Check if the compiler supports given pragma #
dnl ################################################################################ dnl ################################################################################
AC_DEFUN([AC_ZMQ_CHECK_LANG_PRAGMA], [{ AC_DEFUN([LIBZMQ_CHECK_LANG_PRAGMA], [{
# Need to know how to enable all warnings # Need to know how to enable all warnings
AC_ZMQ_LANG_WALL LIBZMQ_LANG_WALL
AC_MSG_CHECKING([whether _AC_LANG compiler supports pragma $1]) AC_MSG_CHECKING([whether _AC_LANG compiler supports pragma $1])
# Save flags # Save flags
ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag
ac_[]_AC_LANG_ABBREV[]_werror_flag="yes" ac_[]_AC_LANG_ABBREV[]_werror_flag="yes"
if test "x[]_AC_LANG_ABBREV" = "xc"; then if test "x[]_AC_LANG_ABBREV" = "xc"; then
ac_zmq_cv_check_lang_pragma_save_CFLAGS="$CFLAGS" libzmq_cv_check_lang_pragma_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" CFLAGS="$CFLAGS $libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag"
elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then
ac_zmq_cv_check_lang_pragma_save_CPPFLAGS="$CPPFLAGS" libzmq_cv_check_lang_pragma_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" CPPFLAGS="$CPPFLAGS $libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag"
else else
AC_MSG_WARN([testing compiler characteristic on an unknown language]) AC_MSG_WARN([testing compiler characteristic on an unknown language])
fi fi
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#pragma $1]])], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#pragma $1]])],
[eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="yes" ; AC_MSG_RESULT(yes)], [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="yes" ; AC_MSG_RESULT(yes)],
[eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="no" ; AC_MSG_RESULT(no)]) [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="no" ; AC_MSG_RESULT(no)])
if test "x[]_AC_LANG_ABBREV" = "xc"; then if test "x[]_AC_LANG_ABBREV" = "xc"; then
CFLAGS="$ac_zmq_cv_check_lang_pragma_save_CFLAGS" CFLAGS="$libzmq_cv_check_lang_pragma_save_CFLAGS"
elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then
CPPFLAGS="$ac_zmq_cv_check_lang_pragma_save_CPPFLAGS" CPPFLAGS="$libzmq_cv_check_lang_pragma_save_CPPFLAGS"
fi fi
ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save ac_[]_AC_LANG_ABBREV[]_werror_flag=$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save
# Call the action as the flags are restored # Call the action as the flags are restored
AS_IF([eval test x$]AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)[ = "xyes"], AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)[ = "xyes"],
[$2], [$3]) [$2], [$3])
}]) }])
dnl ################################################################################ dnl ################################################################################
dnl # AC_ZMQ_CHECK_LANG_VISIBILITY([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_LANG_VISIBILITY([action-if-found], [action-if-not-found]) #
dnl # Check if the compiler supports dso visibility # dnl # Check if the compiler supports dso visibility #
dnl ################################################################################ dnl ################################################################################
AC_DEFUN([AC_ZMQ_CHECK_LANG_VISIBILITY], [{ AC_DEFUN([LIBZMQ_CHECK_LANG_VISIBILITY], [{
ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="" libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag=""
if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \
"x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes" -o \ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes" -o \
"x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler" = "xyes"; then "x$libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler" = "xyes"; then
AC_ZMQ_CHECK_LANG_FLAG([-fvisibility=hidden], LIBZMQ_CHECK_LANG_FLAG([-fvisibility=hidden],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-fvisibility=hidden"]) [libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-fvisibility=hidden"])
elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
AC_ZMQ_CHECK_LANG_FLAG([-xldscope=hidden], LIBZMQ_CHECK_LANG_FLAG([-xldscope=hidden],
[ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-xldscope=hidden"]) [libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-xldscope=hidden"])
fi fi
AC_MSG_CHECKING(whether _AC_LANG compiler supports dso visibility) AC_MSG_CHECKING(whether _AC_LANG compiler supports dso visibility)
AS_IF([test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag" != "x"], AS_IF([test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag" != "x"],
[AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2]) [AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2])
}]) }])
...@@ -50,30 +50,30 @@ AC_ARG_VAR([XMLTO], [Path to xmlto command]) ...@@ -50,30 +50,30 @@ AC_ARG_VAR([XMLTO], [Path to xmlto command])
AC_PATH_PROG([XMLTO], [xmlto]) AC_PATH_PROG([XMLTO], [xmlto])
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
AC_PATH_PROG([ASCIIDOC], [asciidoc]) AC_PATH_PROG([ASCIIDOC], [asciidoc])
AC_ZMQ_CONFIG_LIBTOOL LIBZMQ_CONFIG_LIBTOOL
AC_LIBTOOL_WIN32_DLL AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
# Check whether to build a with debug symbols # Check whether to build a with debug symbols
AC_ZMQ_CHECK_ENABLE_DEBUG LIBZMQ_CHECK_ENABLE_DEBUG
# Check wheter to enable code coverage # Check wheter to enable code coverage
AC_ZMQ_WITH_GCOV LIBZMQ_WITH_GCOV
# Checks for libraries. # Checks for libraries.
AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_LIB([pthread], [pthread_create])
# Set pedantic # Set pedantic
ac_zmq_pedantic="yes" libzmq_pedantic="yes"
# By default compiling with -Werror except OSX. # By default compiling with -Werror except OSX.
ac_zmq_werror="yes" libzmq_werror="yes"
# By default use DSO visibility # By default use DSO visibility
ac_zmq_dso_visibility="yes" libzmq_dso_visibility="yes"
# Whether we are on mingw or not. # Whether we are on mingw or not.
ac_zmq_on_mingw32="no" libzmq_on_mingw32="no"
# Set some default features required by 0MQ code. # Set some default features required by 0MQ code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS" CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
...@@ -124,11 +124,11 @@ case "${host_os}" in ...@@ -124,11 +124,11 @@ case "${host_os}" in
*darwin*) *darwin*)
# Define on Darwin to enable all library features # Define on Darwin to enable all library features
CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS" CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"
ac_zmq_pedantic="no" libzmq_pedantic="no"
ac_zmq_werror="no" libzmq_werror="no"
AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS]) AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS])
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_ZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-uninitialized]) LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-uninitialized])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
;; ;;
*netbsd*) *netbsd*)
...@@ -138,7 +138,7 @@ case "${host_os}" in ...@@ -138,7 +138,7 @@ case "${host_os}" in
# NetBSD 5.0 and newer provides atomic operations but we can # NetBSD 5.0 and newer provides atomic operations but we can
# only use these on systems where PR #42842 has been fixed so # only use these on systems where PR #42842 has been fixed so
# we must try and link a test program using C++. # we must try and link a test program using C++.
ac_zmq_netbsd_has_atomic=no libzmq_netbsd_has_atomic=no
AC_MSG_CHECKING([whether atomic operations can be used]) AC_MSG_CHECKING([whether atomic operations can be used])
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_LINK_IFELSE([AC_LANG_PROGRAM( AC_LINK_IFELSE([AC_LANG_PROGRAM(
...@@ -146,11 +146,11 @@ case "${host_os}" in ...@@ -146,11 +146,11 @@ case "${host_os}" in
[[uint32_t value; [[uint32_t value;
atomic_cas_32 (&value, 0, 0); atomic_cas_32 (&value, 0, 0);
return 0;]])], return 0;]])],
[ac_zmq_netbsd_has_atomic=yes], [libzmq_netbsd_has_atomic=yes],
[ac_zmq_netbsd_has_atomic=no]) [libzmq_netbsd_has_atomic=no])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
AC_MSG_RESULT([$ac_zmq_netbsd_has_atomic]) AC_MSG_RESULT([$libzmq_netbsd_has_atomic])
if test "x$ac_zmq_netbsd_has_atomic" = "xno"; then if test "x$libzmq_netbsd_has_atomic" = "xno"; then
AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes]) AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes])
fi fi
;; ;;
...@@ -160,7 +160,7 @@ case "${host_os}" in ...@@ -160,7 +160,7 @@ case "${host_os}" in
AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS]) AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])
;; ;;
*nto-qnx*) *nto-qnx*)
ac_zmq_pedantic="no" libzmq_pedantic="no"
AC_DEFINE(ZMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS]) AC_DEFINE(ZMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS])
AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(crypto, RAND_bytes) AC_CHECK_LIB(crypto, RAND_bytes)
...@@ -188,10 +188,10 @@ case "${host_os}" in ...@@ -188,10 +188,10 @@ case "${host_os}" in
[AC_MSG_ERROR([cannot link with iphlpapi.dll.])]) [AC_MSG_ERROR([cannot link with iphlpapi.dll.])])
# mingw32 defines __int64_t as long long # mingw32 defines __int64_t as long long
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_ZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-long-long]) LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-long-long])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
ac_zmq_on_mingw32="yes" libzmq_on_mingw32="yes"
ac_zmq_dso_visibility="no" libzmq_dso_visibility="no"
if test "x$enable_static" = "xyes"; then if test "x$enable_static" = "xyes"; then
AC_MSG_ERROR([Building static libraries is not supported under MinGW32]) AC_MSG_ERROR([Building static libraries is not supported under MinGW32])
...@@ -219,9 +219,9 @@ esac ...@@ -219,9 +219,9 @@ esac
# #
# Check if the compiler supports -fvisibility=hidden flag. MinGW32 uses __declspec # Check if the compiler supports -fvisibility=hidden flag. MinGW32 uses __declspec
# #
if test "x$ac_zmq_dso_visibility" = "xyes"; then if test "x$libzmq_dso_visibility" = "xyes"; then
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_ZMQ_CHECK_LANG_VISIBILITY([LIBZMQ_EXTRA_CXXFLAGS="$ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag ${LIBZMQ_EXTRA_CXXFLAGS}"]) LIBZMQ_CHECK_LANG_VISIBILITY([LIBZMQ_EXTRA_CXXFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag ${LIBZMQ_EXTRA_CXXFLAGS}"])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
fi fi
...@@ -229,7 +229,7 @@ fi ...@@ -229,7 +229,7 @@ fi
case "${host_cpu}" in case "${host_cpu}" in
*sparc*) *sparc*)
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_ZMQ_CHECK_LANG_FLAG_PREPEND([-mcpu=v9]) LIBZMQ_CHECK_LANG_FLAG_PREPEND([-mcpu=v9])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
;; ;;
*) *)
...@@ -237,7 +237,7 @@ case "${host_cpu}" in ...@@ -237,7 +237,7 @@ case "${host_cpu}" in
esac esac
# Check whether to build docs / install man pages # Check whether to build docs / install man pages
AC_ZMQ_CHECK_DOC_BUILD LIBZMQ_CHECK_DOC_BUILD
# Checks for header files. # Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
...@@ -254,11 +254,11 @@ AC_HEADER_STDBOOL ...@@ -254,11 +254,11 @@ AC_HEADER_STDBOOL
AC_C_CONST AC_C_CONST
AC_C_INLINE AC_C_INLINE
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
dnl 279: controlling expression is constant dnl 279: controlling expression is constant
dnl Fixes build with ICC 12.x dnl Fixes build with ICC 12.x
AC_ZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SIZE_T]) LIBZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SIZE_T])
AC_ZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SSIZE_T]) LIBZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SSIZE_T])
else else
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T AC_TYPE_SSIZE_T
...@@ -268,7 +268,7 @@ AC_TYPE_UINT32_T ...@@ -268,7 +268,7 @@ AC_TYPE_UINT32_T
AC_C_VOLATILE AC_C_VOLATILE
# PGM extension # PGM extension
ac_zmq_pgm_ext="no" libzmq_pgm_ext="no"
pgm_basename="libpgm-5.1.115~dfsg" pgm_basename="libpgm-5.1.115~dfsg"
...@@ -295,14 +295,14 @@ if test "x$with_pgm_ext" != "xno"; then ...@@ -295,14 +295,14 @@ if test "x$with_pgm_ext" != "xno"; then
# Unpack libpgm # Unpack libpgm
AC_MSG_NOTICE([Unpacking ${pgm_basename}.tar.gz]) AC_MSG_NOTICE([Unpacking ${pgm_basename}.tar.gz])
ac_zmq_pwd=`pwd` libzmq_pwd=`pwd`
cd foreign/openpgm cd foreign/openpgm
if ! (gzip -dc "${pgm_basename}.tar.gz" || echo "failed") | ${am__untar}; then if ! (gzip -dc "${pgm_basename}.tar.gz" || echo "failed") | ${am__untar}; then
AC_MSG_ERROR([cannot unpack the foreign/openpgm/${pgm_basename}.tar.gz file]) AC_MSG_ERROR([cannot unpack the foreign/openpgm/${pgm_basename}.tar.gz file])
fi fi
cd "${ac_zmq_pwd}" cd "${libzmq_pwd}"
if test -d foreign/openpgm/build-staging; then if test -d foreign/openpgm/build-staging; then
rm -rf foreign/openpgm/build-staging rm -rf foreign/openpgm/build-staging
...@@ -317,7 +317,7 @@ if test "x$with_pgm_ext" != "xno"; then ...@@ -317,7 +317,7 @@ if test "x$with_pgm_ext" != "xno"; then
# DSO symbol visibility for openpgm # DSO symbol visibility for openpgm
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
AC_ZMQ_CHECK_LANG_VISIBILITY([ac_configure_args="CFLAGS='$ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag' ${ac_configure_args}"]) LIBZMQ_CHECK_LANG_VISIBILITY([ac_configure_args="CFLAGS='$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag' ${ac_configure_args}"])
AC_LANG_POP([C]) AC_LANG_POP([C])
pgm_subdir=build-staging/openpgm/pgm pgm_subdir=build-staging/openpgm/pgm
...@@ -328,7 +328,7 @@ if test "x$with_pgm_ext" != "xno"; then ...@@ -328,7 +328,7 @@ if test "x$with_pgm_ext" != "xno"; then
# Success! # Success!
AC_DEFINE(ZMQ_HAVE_OPENPGM, 1, [Have OpenPGM extension]) AC_DEFINE(ZMQ_HAVE_OPENPGM, 1, [Have OpenPGM extension])
ac_zmq_pgm_ext="yes" libzmq_pgm_ext="yes"
fi fi
# Build with system openpgm # Build with system openpgm
...@@ -345,19 +345,19 @@ AC_SUBST(pgm_basename) ...@@ -345,19 +345,19 @@ AC_SUBST(pgm_basename)
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
# Check how to enable -Wall # Check how to enable -Wall
AC_ZMQ_LANG_WALL([CPPFLAGS="$ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag $CPPFLAGS"]) LIBZMQ_LANG_WALL([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag $CPPFLAGS"])
if test "x$ac_zmq_werror" = "xyes" -a "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" != "xyes"; then if test "x$libzmq_werror" = "xyes" -a "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" != "xyes"; then
AC_ZMQ_LANG_WERROR([CPPFLAGS="$ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag $CPPFLAGS"]) LIBZMQ_LANG_WERROR([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag $CPPFLAGS"])
fi fi
if test "x$ac_zmq_pedantic" = "xyes"; then if test "x$libzmq_pedantic" = "xyes"; then
AC_ZMQ_LANG_STRICT([CPPFLAGS="$ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag $CPPFLAGS"]) LIBZMQ_LANG_STRICT([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag $CPPFLAGS"])
fi fi
AC_LANG_POP([C++]) AC_LANG_POP([C++])
AM_CONDITIONAL(BUILD_PGM, test "x$ac_zmq_pgm_ext" = "xyes") AM_CONDITIONAL(BUILD_PGM, test "x$libzmq_pgm_ext" = "xyes")
AM_CONDITIONAL(ON_MINGW, test "x$ac_zmq_on_mingw32" = "xyes") AM_CONDITIONAL(ON_MINGW, test "x$libzmq_on_mingw32" = "xyes")
# Checks for library functions. # Checks for library functions.
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment