+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.
# 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"
# 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,
# 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"
# 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,
# 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"
# 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,
# 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"
# 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,
# 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. ##
## --------------------------- ##
-## ------------ ##
-## 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. ##
## --------------------- ##