diff --git a/ChangeLog b/ChangeLog index c4c93258..f3242e42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-12-15 Akim Demaille + + * aclang.m4 (AC_PROG_CXXCPP, AC_PROG_CPP): Require AC_PROG_CXX/CC. + 2000-12-15 Akim Demaille * tests/compile.at (GNU Fortran 77): G77 is a `yes'/`' var. diff --git a/aclang.m4 b/aclang.m4 index f49ec1cf..2640ddd5 100644 --- 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, diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index f49ec1cf..2640ddd5 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.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, diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index f49ec1cf..2640ddd5 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.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, diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index f49ec1cf..2640ddd5 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.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, diff --git a/tests/compile.at b/tests/compile.at index 6fae0bd3..ddd377df 100644 --- a/tests/compile.at +++ b/tests/compile.at @@ -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. ## ## --------------------- ##