(_AC_LANG_ABBREV(C++), _AC_LANG_ABBREV(Fortran 77): New macros.
(AC_LANG_(C), AC_LANG_(C++), AC_LANG_(Fortran 77)): Don't define
AC_LANG_ABBREV.
(_AC_PROG_PREPROC_WORKS): Adjust.
* acgeneral.m4 (_AC_TRY_CPP): Likewise.
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * aclang.m4 (_AC_LANG_ABBREV, _AC_LANG_ABBREV(C))
+ (_AC_LANG_ABBREV(C++), _AC_LANG_ABBREV(Fortran 77): New macros.
+ (AC_LANG_(C), AC_LANG_(C++), AC_LANG_(Fortran 77)): Don't define
+ AC_LANG_ABBREV.
+ (_AC_PROG_PREPROC_WORKS): Adjust.
+ * acgeneral.m4 (_AC_TRY_CPP): Likewise.
+
2000-10-02 Pavel Roskin <proski@gnu.org>
* acspecific.m4 (AC_PROG_LEX): Use AC_DEFUN_ONCE.
AC_DEFUN([_AC_TRY_CPP],
[ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err"
if AC_TRY_EVAL(ac_try); then
- if egrep -v '^ *\+' conftest.err | grep . >/dev/null
- then
- ac_cpp_err=$ac_[]AC_LANG_ABBREV[]_preproc_warn_flag
+ if egrep -v '^ *\+' conftest.err | grep . >/dev/null; then
+ ac_cpp_err=$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag
else
ac_cpp_err=
fi
AU_DEFUN([AC_LANG_RESTORE], [AC_LANG_POP($@)])
+# _AC_LANG_ABBREV
+# ---------------
+# Return a short signature of _AC_LANG which can be used in shell
+# variable names, or in M4 macro names.
+define([_AC_LANG_ABBREV],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
# -------------------- #
# 1b. The C language. #
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_gcc
-define([AC_LANG_ABBREV], [c])dnl
])
AU_DEFUN([AC_LANG_C], [AC_LANG(C)])
+# _AC_LANG_ABBREV(C)
+# ------------------
+define([_AC_LANG_ABBREV(C)], [c])
+
# ---------------------- #
# 1c. The C++ language. #
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_gxx
-define([AC_LANG_ABBREV], [cxx])dnl
])
AU_DEFUN([AC_LANG_CPLUSPLUS], [AC_LANG(C++)])
+# _AC_LANG_ABBREV(C++)
+# --------------------
+define([_AC_LANG_ABBREV(C++)], [cxx])
+
# ----------------------------- #
# 1d. The Fortran 77 language. #
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${F77-f77} -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_g77
-define([AC_LANG_ABBREV], [f77])dnl
])
AU_DEFUN([AC_LANG_FORTRAN77], [AC_LANG(Fortran 77)])
-
+# _AC_LANG_ABBREV(Fortran 77)
+# ---------------------------
+define([_AC_LANG_ABBREV(Fortran 77)], [f77])
# not just through cpp. "Syntax error" is here to catch this case.
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <assert.h>
Syntax error]])])
-ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=maybe
+ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe
_AC_TRY_CPP()
# Now check whether non-existent headers can be detected and how
# Skip if ac_cpp_err is not empty - ac_cpp is broken
if test -z "$ac_cpp_err"; then
- AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <ac_nonexistent.h>]])])
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[@%:@include <ac_nonexistent.h>]])])
_AC_TRY_CPP()
if test -z "$ac_cpp_err"; then
# cannot detect missing includes at all
ac_cpp_err=yes
else
if test "x$ac_cpp_err" = xmaybe; then
- ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=yes
+ ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes
else
- ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=
+ ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=
fi
ac_cpp_err=
fi
AU_DEFUN([AC_LANG_RESTORE], [AC_LANG_POP($@)])
+# _AC_LANG_ABBREV
+# ---------------
+# Return a short signature of _AC_LANG which can be used in shell
+# variable names, or in M4 macro names.
+define([_AC_LANG_ABBREV],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
# -------------------- #
# 1b. The C language. #
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_gcc
-define([AC_LANG_ABBREV], [c])dnl
])
AU_DEFUN([AC_LANG_C], [AC_LANG(C)])
+# _AC_LANG_ABBREV(C)
+# ------------------
+define([_AC_LANG_ABBREV(C)], [c])
+
# ---------------------- #
# 1c. The C++ language. #
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_gxx
-define([AC_LANG_ABBREV], [cxx])dnl
])
AU_DEFUN([AC_LANG_CPLUSPLUS], [AC_LANG(C++)])
+# _AC_LANG_ABBREV(C++)
+# --------------------
+define([_AC_LANG_ABBREV(C++)], [cxx])
+
# ----------------------------- #
# 1d. The Fortran 77 language. #
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${F77-f77} -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_g77
-define([AC_LANG_ABBREV], [f77])dnl
])
AU_DEFUN([AC_LANG_FORTRAN77], [AC_LANG(Fortran 77)])
-
+# _AC_LANG_ABBREV(Fortran 77)
+# ---------------------------
+define([_AC_LANG_ABBREV(Fortran 77)], [f77])
# not just through cpp. "Syntax error" is here to catch this case.
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <assert.h>
Syntax error]])])
-ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=maybe
+ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe
_AC_TRY_CPP()
# Now check whether non-existent headers can be detected and how
# Skip if ac_cpp_err is not empty - ac_cpp is broken
if test -z "$ac_cpp_err"; then
- AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <ac_nonexistent.h>]])])
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[@%:@include <ac_nonexistent.h>]])])
_AC_TRY_CPP()
if test -z "$ac_cpp_err"; then
# cannot detect missing includes at all
ac_cpp_err=yes
else
if test "x$ac_cpp_err" = xmaybe; then
- ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=yes
+ ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes
else
- ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=
+ ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=
fi
ac_cpp_err=
fi
AU_DEFUN([AC_LANG_RESTORE], [AC_LANG_POP($@)])
+# _AC_LANG_ABBREV
+# ---------------
+# Return a short signature of _AC_LANG which can be used in shell
+# variable names, or in M4 macro names.
+define([_AC_LANG_ABBREV],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
# -------------------- #
# 1b. The C language. #
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_gcc
-define([AC_LANG_ABBREV], [c])dnl
])
AU_DEFUN([AC_LANG_C], [AC_LANG(C)])
+# _AC_LANG_ABBREV(C)
+# ------------------
+define([_AC_LANG_ABBREV(C)], [c])
+
# ---------------------- #
# 1c. The C++ language. #
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_gxx
-define([AC_LANG_ABBREV], [cxx])dnl
])
AU_DEFUN([AC_LANG_CPLUSPLUS], [AC_LANG(C++)])
+# _AC_LANG_ABBREV(C++)
+# --------------------
+define([_AC_LANG_ABBREV(C++)], [cxx])
+
# ----------------------------- #
# 1d. The Fortran 77 language. #
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${F77-f77} -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_g77
-define([AC_LANG_ABBREV], [f77])dnl
])
AU_DEFUN([AC_LANG_FORTRAN77], [AC_LANG(Fortran 77)])
-
+# _AC_LANG_ABBREV(Fortran 77)
+# ---------------------------
+define([_AC_LANG_ABBREV(Fortran 77)], [f77])
# not just through cpp. "Syntax error" is here to catch this case.
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <assert.h>
Syntax error]])])
-ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=maybe
+ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe
_AC_TRY_CPP()
# Now check whether non-existent headers can be detected and how
# Skip if ac_cpp_err is not empty - ac_cpp is broken
if test -z "$ac_cpp_err"; then
- AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <ac_nonexistent.h>]])])
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[@%:@include <ac_nonexistent.h>]])])
_AC_TRY_CPP()
if test -z "$ac_cpp_err"; then
# cannot detect missing includes at all
ac_cpp_err=yes
else
if test "x$ac_cpp_err" = xmaybe; then
- ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=yes
+ ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes
else
- ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=
+ ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=
fi
ac_cpp_err=
fi
AC_DEFUN([_AC_TRY_CPP],
[ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err"
if AC_TRY_EVAL(ac_try); then
- if egrep -v '^ *\+' conftest.err | grep . >/dev/null
- then
- ac_cpp_err=$ac_[]AC_LANG_ABBREV[]_preproc_warn_flag
+ if egrep -v '^ *\+' conftest.err | grep . >/dev/null; then
+ ac_cpp_err=$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag
else
ac_cpp_err=
fi
AU_DEFUN([AC_LANG_RESTORE], [AC_LANG_POP($@)])
+# _AC_LANG_ABBREV
+# ---------------
+# Return a short signature of _AC_LANG which can be used in shell
+# variable names, or in M4 macro names.
+define([_AC_LANG_ABBREV],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
# -------------------- #
# 1b. The C language. #
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_gcc
-define([AC_LANG_ABBREV], [c])dnl
])
AU_DEFUN([AC_LANG_C], [AC_LANG(C)])
+# _AC_LANG_ABBREV(C)
+# ------------------
+define([_AC_LANG_ABBREV(C)], [c])
+
# ---------------------- #
# 1c. The C++ language. #
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_gxx
-define([AC_LANG_ABBREV], [cxx])dnl
])
AU_DEFUN([AC_LANG_CPLUSPLUS], [AC_LANG(C++)])
+# _AC_LANG_ABBREV(C++)
+# --------------------
+define([_AC_LANG_ABBREV(C++)], [cxx])
+
# ----------------------------- #
# 1d. The Fortran 77 language. #
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext >&AC_FD_LOG'
ac_link='${F77-f77} -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'
ac_gnu_compiler=$ac_cv_prog_g77
-define([AC_LANG_ABBREV], [f77])dnl
])
AU_DEFUN([AC_LANG_FORTRAN77], [AC_LANG(Fortran 77)])
-
+# _AC_LANG_ABBREV(Fortran 77)
+# ---------------------------
+define([_AC_LANG_ABBREV(Fortran 77)], [f77])
# not just through cpp. "Syntax error" is here to catch this case.
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <assert.h>
Syntax error]])])
-ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=maybe
+ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe
_AC_TRY_CPP()
# Now check whether non-existent headers can be detected and how
# Skip if ac_cpp_err is not empty - ac_cpp is broken
if test -z "$ac_cpp_err"; then
- AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <ac_nonexistent.h>]])])
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[@%:@include <ac_nonexistent.h>]])])
_AC_TRY_CPP()
if test -z "$ac_cpp_err"; then
# cannot detect missing includes at all
ac_cpp_err=yes
else
if test "x$ac_cpp_err" = xmaybe; then
- ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=yes
+ ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes
else
- ac_[]AC_LANG_ABBREV[]_preproc_warn_flag=
+ ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=
fi
ac_cpp_err=
fi
macros.m4: $(MACRO_FILES) $(srcdir)/Makefile.am
cat $(MACRO_FILES) | \
- sed -ne 's/^A[CU]_DEFUN(\[*\([a-zA-Z0-9_]*\).*$$/\1/p' | \
+ sed -ne 's/^A[CU]_DEFUN\(_ONCE\)\?(\[*\([a-zA-Z0-9_]*\).*$$/\2/p' | \
sort | uniq | $(FILTER_MACROS) >defuns
# Get the list of macros that are required: there is little interest
# in testing them since they will be run but the guy who requires