summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorMikko Koppanen <mkoppanen@php.net>2010-11-19 09:10:26 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-11-19 09:10:26 +0100
commitedf7c18d79b195001d7ed7d05ac30a4d7a64bce1 (patch)
treefd30945917c8cc1a7f7cdc8a30d92d1f1bf4b660 /acinclude.m4
parent945c931daf0c053a9cdbfdbb3ec7d0e90c29fc10 (diff)
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>
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m418
1 files changed, 18 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index fc4cc70..f16c2c0 100644
--- a/acinclude.m4
+++ b/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
+}])