]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* aclang.m4 (AC_PROG_CXXCPP, AC_PROG_CPP): Require AC_PROG_CXX/CC.
authorAkim Demaille <akim@epita.fr>
Fri, 15 Dec 2000 11:50:18 +0000 (11:50 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 15 Dec 2000 11:50:18 +0000 (11:50 +0000)
ChangeLog
aclang.m4
lib/autoconf/c.m4
lib/autoconf/fortran.m4
lib/autoconf/lang.m4
tests/compile.at

index c4c932587f38e3eb8b1838cf0e749efba9a685a4..f3242e42e2a97c04c19db73769bc186aac5b225e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-12-15  Akim Demaille  <akim@epita.fr>
+
+       * aclang.m4 (AC_PROG_CXXCPP, AC_PROG_CPP): Require AC_PROG_CXX/CC.
+
 2000-12-15  Akim Demaille  <akim@epita.fr>
 
        * tests/compile.at (GNU Fortran 77): G77 is a `yes'/`' var.
index f49ec1cf9a3c45b226b6b85a40a680653b7f9649..2640ddd565e4ba677168c0cc6233eccedc4ba9c8 100644 (file)
--- a/aclang.m4
+++ b/aclang.m4
@@ -749,16 +749,19 @@ fi])])# _AC_PROG_PREPROC_WORKS
 
 # AC_PROG_CPP
 # -----------
-# Find a working C preprocessor
+# Find a working C preprocessor.
+# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
+# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC.
 AC_DEFUN([AC_PROG_CPP],
-[AC_MSG_CHECKING([how to run the C preprocessor])
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_MSG_CHECKING([how to run the C preprocessor])
 AC_LANG_ASSERT(C)dnl
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  AC_CACHE_VAL(ac_cv_prog_CPP,
+  AC_CACHE_VAL([ac_cv_prog_CPP],
   [dnl
     # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -951,9 +954,12 @@ AC_DEFUN([AC_LANG_PREPROC(C++)],
 
 # AC_PROG_CXXCPP
 # --------------
-# Find a working C++ preprocessor
+# Find a working C++ preprocessor.
+# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
+# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX.
 AC_DEFUN([AC_PROG_CXXCPP],
-[AC_MSG_CHECKING([how to run the C++ preprocessor])
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_MSG_CHECKING([how to run the C++ preprocessor])
 AC_LANG_ASSERT(C++)dnl
 if test -z "$CXXCPP"; then
   AC_CACHE_VAL(ac_cv_prog_CXXCPP,
index f49ec1cf9a3c45b226b6b85a40a680653b7f9649..2640ddd565e4ba677168c0cc6233eccedc4ba9c8 100644 (file)
@@ -749,16 +749,19 @@ fi])])# _AC_PROG_PREPROC_WORKS
 
 # AC_PROG_CPP
 # -----------
-# Find a working C preprocessor
+# Find a working C preprocessor.
+# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
+# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC.
 AC_DEFUN([AC_PROG_CPP],
-[AC_MSG_CHECKING([how to run the C preprocessor])
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_MSG_CHECKING([how to run the C preprocessor])
 AC_LANG_ASSERT(C)dnl
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  AC_CACHE_VAL(ac_cv_prog_CPP,
+  AC_CACHE_VAL([ac_cv_prog_CPP],
   [dnl
     # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -951,9 +954,12 @@ AC_DEFUN([AC_LANG_PREPROC(C++)],
 
 # AC_PROG_CXXCPP
 # --------------
-# Find a working C++ preprocessor
+# Find a working C++ preprocessor.
+# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
+# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX.
 AC_DEFUN([AC_PROG_CXXCPP],
-[AC_MSG_CHECKING([how to run the C++ preprocessor])
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_MSG_CHECKING([how to run the C++ preprocessor])
 AC_LANG_ASSERT(C++)dnl
 if test -z "$CXXCPP"; then
   AC_CACHE_VAL(ac_cv_prog_CXXCPP,
index f49ec1cf9a3c45b226b6b85a40a680653b7f9649..2640ddd565e4ba677168c0cc6233eccedc4ba9c8 100644 (file)
@@ -749,16 +749,19 @@ fi])])# _AC_PROG_PREPROC_WORKS
 
 # AC_PROG_CPP
 # -----------
-# Find a working C preprocessor
+# Find a working C preprocessor.
+# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
+# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC.
 AC_DEFUN([AC_PROG_CPP],
-[AC_MSG_CHECKING([how to run the C preprocessor])
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_MSG_CHECKING([how to run the C preprocessor])
 AC_LANG_ASSERT(C)dnl
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  AC_CACHE_VAL(ac_cv_prog_CPP,
+  AC_CACHE_VAL([ac_cv_prog_CPP],
   [dnl
     # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -951,9 +954,12 @@ AC_DEFUN([AC_LANG_PREPROC(C++)],
 
 # AC_PROG_CXXCPP
 # --------------
-# Find a working C++ preprocessor
+# Find a working C++ preprocessor.
+# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
+# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX.
 AC_DEFUN([AC_PROG_CXXCPP],
-[AC_MSG_CHECKING([how to run the C++ preprocessor])
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_MSG_CHECKING([how to run the C++ preprocessor])
 AC_LANG_ASSERT(C++)dnl
 if test -z "$CXXCPP"; then
   AC_CACHE_VAL(ac_cv_prog_CXXCPP,
index f49ec1cf9a3c45b226b6b85a40a680653b7f9649..2640ddd565e4ba677168c0cc6233eccedc4ba9c8 100644 (file)
@@ -749,16 +749,19 @@ fi])])# _AC_PROG_PREPROC_WORKS
 
 # AC_PROG_CPP
 # -----------
-# Find a working C preprocessor
+# Find a working C preprocessor.
+# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
+# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC.
 AC_DEFUN([AC_PROG_CPP],
-[AC_MSG_CHECKING([how to run the C preprocessor])
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_MSG_CHECKING([how to run the C preprocessor])
 AC_LANG_ASSERT(C)dnl
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  AC_CACHE_VAL(ac_cv_prog_CPP,
+  AC_CACHE_VAL([ac_cv_prog_CPP],
   [dnl
     # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -951,9 +954,12 @@ AC_DEFUN([AC_LANG_PREPROC(C++)],
 
 # AC_PROG_CXXCPP
 # --------------
-# Find a working C++ preprocessor
+# Find a working C++ preprocessor.
+# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
+# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX.
 AC_DEFUN([AC_PROG_CXXCPP],
-[AC_MSG_CHECKING([how to run the C++ preprocessor])
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_MSG_CHECKING([how to run the C++ preprocessor])
 AC_LANG_ASSERT(C++)dnl
 if test -z "$CXXCPP"; then
   AC_CACHE_VAL(ac_cv_prog_CXXCPP,
index 6fae0bd30c91b99e3760f48eaaa4797afdc56ba0..ddd377dfec42cbe94ae4d65d581c0346529c11b8 100644 (file)
@@ -7,6 +7,36 @@ AT_BANNER([Low level compiling/preprocessing macros.])
 # primitive, so check those first.
 
 
+## ------------ ##
+## C keywords.  ##
+## ------------ ##
+
+# GCC supports `const', `volatile', and `inline'.
+AT_CHECK_MACRO([C keywords],
+[[AC_PROG_CC
+AC_C_CONST
+AC_C_INLINE
+AC_C_VOLATILE
+case "$GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile" in
+ yes,*no*)
+   AC_MSG_ERROR([failed to detect `const', `inline' or `volatile' support]);;
+esac]])
+
+
+
+## --------------------------------- ##
+## AC_PROG_CPP requires AC_PROG_CC.  ##
+## --------------------------------- ##
+
+# Must invoke AC_PROG_CC.
+AT_CHECK_MACRO([AC_PROG_CPP requires AC_PROG_CC],
+[[AC_PROG_CPP
+test -z "$CC" &&
+   AC_MSG_ERROR([looked for a C preprocessor without looking for a compiler])
+]])
+
+
+
 ## --------------------------- ##
 ## AC_PROG_CPP with warnings.  ##
 ## --------------------------- ##
@@ -85,23 +115,6 @@ AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this,
 
 
 
-## ------------ ##
-## C keywords.  ##
-## ------------ ##
-
-# GCC supports `const', `volatile', and `inline'.
-AT_CHECK_MACRO([C keywords],
-[[AC_PROG_CC
-AC_C_CONST
-AC_C_INLINE
-AC_C_VOLATILE
-case "$GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile" in
- yes,*no*)
-   AC_MSG_ERROR([failed to detect `const', `inline' or `volatile' support]);;
-esac]])
-
-
-
 ## --------------------- ##
 ## Fortran 77 Compiler.  ##
 ## --------------------- ##