mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 10:33:52 +01:00
Add a check that the compiler actually works.
The patch tests that the C and C++ compilers actually exist and work. autoconf seems to default to 'g++' when C++ compiler is not found, which causes the following error (when the compiler isn't there): checking for uuid_generate in -luuid... no configure: error: cannot link with -luuid, install uuid-dev. The config.log contains the real error message "g++ command not found" but the error message shown to the user is misleading. Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
This commit is contained in:
parent
945c931daf
commit
edf7c18d79
18
acinclude.m4
18
acinclude.m4
@ -101,3 +101,21 @@ AC_DEFUN([AC_CHECK_DOC_BUILD], [{
|
||||
AM_CONDITIONAL(BUILD_DOC, test "x$build_doc" = "xyes")
|
||||
AM_CONDITIONAL(INSTALL_MAN, test "x$install_man" = "xyes")
|
||||
}])
|
||||
|
||||
dnl ##############################################################################
|
||||
dnl # AC_CHECK_LANG_COMPILER #
|
||||
dnl # Check that compiler for the current language actually works #
|
||||
dnl ##############################################################################
|
||||
AC_DEFUN([AC_CHECK_LANG_COMPILER], [{
|
||||
# Test that compiler for the current language actually works
|
||||
AC_CACHE_CHECK([whether the _AC_LANG compiler works],
|
||||
[ac_cv_[]_AC_LANG_ABBREV[]_compiler_works],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
|
||||
[ac_cv_[]_AC_LANG_ABBREV[]_compiler_works=yes],
|
||||
[ac_cv_[]_AC_LANG_ABBREV[]_compiler_works=no])
|
||||
])
|
||||
|
||||
if test "x$ac_cv_[]_AC_LANG_ABBREV[]_compiler_works" != "xyes"; then
|
||||
AC_MSG_ERROR([Unable to find a working _AC_LANG compiler])
|
||||
fi
|
||||
}])
|
||||
|
@ -42,12 +42,16 @@ AC_CONFIG_LIBTOOL
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
# Check for ICC and Sun Studio compilers
|
||||
# For that the compiler works and try to come up with the type
|
||||
AC_LANG(C)
|
||||
AC_CHECK_LANG_COMPILER
|
||||
|
||||
AC_CHECK_LANG_ICC
|
||||
AC_CHECK_LANG_SUN_STUDIO
|
||||
|
||||
AC_LANG(C++)
|
||||
AC_CHECK_LANG_COMPILER
|
||||
|
||||
AC_CHECK_LANG_ICC
|
||||
AC_CHECK_LANG_SUN_STUDIO
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user