mirror of
git://git.sv.gnu.org/autoconf
synced 2024-11-21 01:01:48 +08:00
Factor the AC_PROG_<compiler>_WORKS macros.
* acgeneral.m4 (_AC_INIT_DEFAULTS): Set `cross_compiling'. (AC_TRY_COMPILER): Remove. * aclang.m4 (AC_PROG_CC_WORKS, AC_PROG_CXX_WORKS, AC_PROG_F77_WORKS): Removed. (_AC_LANG_COMPILER_WORKS): New macro. (AC_PROG_CC, AC_PROG_CXX, AC_PROG_F77): Adjust.
This commit is contained in:
parent
465f8f2b1e
commit
164b08eb76
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
||||
2000-05-22 Akim Demaille <akim@epita.fr>
|
||||
|
||||
Factor the AC_PROG_<compiler>_WORKS macros.
|
||||
|
||||
* acgeneral.m4 (_AC_INIT_DEFAULTS): Set `cross_compiling'.
|
||||
(AC_TRY_COMPILER): Remove.
|
||||
* aclang.m4 (AC_PROG_CC_WORKS, AC_PROG_CXX_WORKS,
|
||||
AC_PROG_F77_WORKS): Removed.
|
||||
(_AC_LANG_COMPILER_WORKS): New macro.
|
||||
(AC_PROG_CC, AC_PROG_CXX, AC_PROG_F77): Adjust.
|
||||
|
||||
2000-05-22 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* aclang.m4: Formatting changes.
|
||||
|
26
acgeneral.m4
26
acgeneral.m4
@ -837,6 +837,7 @@ AC_DEFUN(_AC_INIT_DEFAULTS,
|
||||
# Initializations.
|
||||
#
|
||||
ac_default_prefix=/usr/local
|
||||
cross_compiling=no
|
||||
subdirs=
|
||||
MFLAGS= MAKEFLAGS=
|
||||
AC_SUBST(SHELL, ${CONFIG_SHELL-/bin/sh})dnl
|
||||
@ -2323,7 +2324,6 @@ AC_DEFUN(AC_TRY_COMMAND,
|
||||
[{ ac_try='$1'; AC_TRY_EVAL(ac_try); }])
|
||||
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## Default includes. ##
|
||||
## ------------------ ##
|
||||
@ -2670,26 +2670,6 @@ popdef([AC_Prog])dnl
|
||||
])# AC_PREFIX_PROGRAM
|
||||
|
||||
|
||||
# AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
|
||||
# -----------------------------------------------------
|
||||
# Try to compile, link and execute TEST-PROGRAM. Set WORKING-VAR to
|
||||
# `yes' if the current compiler works, otherwise set it ti `no'. Set
|
||||
# CROSS-VAR to `yes' if the compiler and linker produce non-native
|
||||
# executables, otherwise set it to `no'. Before calling
|
||||
# `AC_TRY_COMPILER()', call `AC_LANG_*' to set-up for the right
|
||||
# language.
|
||||
AC_DEFUN(AC_TRY_COMPILER,
|
||||
[AC_LINK_IFELSE([AC_LANG_SOURCE([[$1]])],
|
||||
[$2=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
$3=no
|
||||
else
|
||||
$3=yes
|
||||
fi],
|
||||
[$2=no])[]dnl
|
||||
])# AC_TRY_COMPILER
|
||||
|
||||
|
||||
|
||||
## ------------------------ ##
|
||||
@ -2974,7 +2954,7 @@ rm -f conftest*[]dnl
|
||||
# [ACTION-IF-CROSS-COMPILING])
|
||||
# --------------------------------------------------------
|
||||
AC_DEFUN([AC_TRY_RUN],
|
||||
[if test "$cross_compiling" = yes; then
|
||||
[if test $cross_compiling = yes; then
|
||||
m4_default([$4],
|
||||
[AC_DIAGNOSE([cross],
|
||||
[AC_TRY_RUN called without default to allow cross compiling])dnl
|
||||
@ -3038,7 +3018,7 @@ AC_DEFUN(AC_CHECK_FILE,
|
||||
AC_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
|
||||
dnl FIXME: why was there this line? AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_CACHE_CHECK([for $1], ac_File,
|
||||
[test "$cross_compiling" = yes &&
|
||||
[test $cross_compiling = yes &&
|
||||
AC_MSG_ERROR([Cannot check for file existence when cross compiling])
|
||||
if test -r "[$1]"; then
|
||||
AC_VAR_SET(ac_File, yes)
|
||||
|
123
aclang.m4
123
aclang.m4
@ -239,8 +239,8 @@ AC_DEFUN([AC_LANG_SOURCE],
|
||||
[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(PROLOGUE, BODY)
|
||||
# -------------------------------
|
||||
# AC_LANG_PROGRAM([PROLOGUE], [BODY])
|
||||
# -----------------------------------
|
||||
# Produce a valid source for the current language. Prepend the
|
||||
# PROLOGUE (typically CPP directives and/or declarations) to an
|
||||
# execution the BODY (typically glued inside the `main' function, or
|
||||
@ -271,8 +271,8 @@ define([AC_LANG_SOURCE(C)],
|
||||
$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(C)(PROLOGUE, BODY)
|
||||
# ----------------------------------
|
||||
# AC_LANG_PROGRAM(C)([PROLOGUE], [BODY])
|
||||
# --------------------------------------
|
||||
define([AC_LANG_PROGRAM(C)],
|
||||
[$1
|
||||
int
|
||||
@ -317,8 +317,8 @@ extern "C" void exit (int);
|
||||
$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(C++)(PROLOGUE, BODY)
|
||||
# ------------------------------------
|
||||
# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
|
||||
# ----------------------------------------
|
||||
# Same as C.
|
||||
define([AC_LANG_PROGRAM(C++)], defn([AC_LANG_PROGRAM(C)]))
|
||||
|
||||
@ -343,8 +343,8 @@ define([AC_LANG_SOURCE(Fortran 77)],
|
||||
[$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(Fortran 77)(PROLOGUE, BODY)
|
||||
# -------------------------------------------
|
||||
# AC_LANG_PROGRAM(Fortran 77)([PROLOGUE], [BODY])
|
||||
# -----------------------------------------------
|
||||
# Yes, we discard the PROLOGUE.
|
||||
define([AC_LANG_PROGRAM(Fortran 77)],
|
||||
[ program main
|
||||
@ -379,6 +379,24 @@ AC_DEFUN([AC_REQUIRE_CPP],
|
||||
[AC_REQUIRE([AC_PROG_CXXCPP])])])
|
||||
|
||||
|
||||
# AC_LANG_COMPILER_WORKS
|
||||
# ----------------------
|
||||
define([_AC_LANG_COMPILER_WORKS],
|
||||
[AC_MSG_CHECKING([whether the _AC_LANG compiler works])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
|
||||
[# If not cross compiling, check that we can run a simple program.
|
||||
if test $cross_compiling != yes; then
|
||||
if AC_TRY_COMMAND(./conftest); then :; else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([cannot run _AC_LANG compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([_AC_LANG compiler cannot create executables], 77)])[]dnl
|
||||
])# AC_LANG_COMPILER_WORKS
|
||||
|
||||
|
||||
# -------------------- #
|
||||
# 3b. The C compiler. #
|
||||
@ -427,6 +445,7 @@ AC_SUBST(CPP)dnl
|
||||
# search list for the C compiler.
|
||||
AC_DEFUN(AC_PROG_CC,
|
||||
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_LANG_PUSH(C)
|
||||
AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler])
|
||||
ifval([$1],
|
||||
[AC_CHECK_PROGS(CC, [$1])],
|
||||
@ -442,9 +461,7 @@ ifval([$1],
|
||||
|
||||
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_CC_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_CC_GNU
|
||||
|
||||
dnl Check whether -g works, even if CFLAGS is set, in case the package
|
||||
@ -469,30 +486,10 @@ else
|
||||
CFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_CC
|
||||
|
||||
|
||||
# AC_PROG_CC_WORKS
|
||||
# ----------------
|
||||
AC_DEFUN(AC_PROG_CC_WORKS,
|
||||
[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(C)
|
||||
AC_TRY_COMPILER([int main(){return(0);}],
|
||||
ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_cc_works)
|
||||
if test $ac_cv_prog_cc_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_cc_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_cc_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run C compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_CC_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_CC_GNU
|
||||
# ---------------
|
||||
define([_AC_PROG_CC_GNU],
|
||||
@ -639,11 +636,10 @@ AC_SUBST(CXXCPP)dnl
|
||||
# compiler.
|
||||
AC_DEFUN(AC_PROG_CXX,
|
||||
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++)
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_CXX_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_CXX_GNU
|
||||
|
||||
dnl Check whether -g works, even if CXXFLAGS is set, in case the package
|
||||
@ -668,30 +664,10 @@ else
|
||||
CXXFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_CXX
|
||||
|
||||
|
||||
# AC_PROG_CXX_WORKS
|
||||
# -----------------
|
||||
AC_DEFUN(AC_PROG_CXX_WORKS,
|
||||
[AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_TRY_COMPILER([int main(){return(0);}],
|
||||
ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_cxx_works)
|
||||
if test $ac_cv_prog_cxx_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_cxx_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_cxx_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run C++ compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_CXX_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_CXX_GNU
|
||||
# ----------------
|
||||
define([_AC_PROG_CXX_GNU],
|
||||
@ -742,12 +718,11 @@ rm -f conftest*
|
||||
# for.
|
||||
AC_DEFUN(AC_PROG_F77,
|
||||
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_LANG_PUSH(Fortran 77)
|
||||
AC_CHECK_PROGS(F77,
|
||||
m4_default([$1], [g77 f77 xlf cf77 fl32 fort77 f90 xlf90 f2c]))
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_F77_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_F77_GNU
|
||||
|
||||
dnl Check whether -g works, even if FFLAGS is set, in case the package
|
||||
@ -772,36 +747,10 @@ else
|
||||
FFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_F77
|
||||
|
||||
|
||||
# AC_PROG_F77_WORKS
|
||||
# -----------------
|
||||
# Test whether the Fortran 77 compiler can compile and link a trivial
|
||||
# Fortran program. Also, test whether the Fortran 77 compiler is a
|
||||
# cross-compiler (which may realistically be the case if the Fortran
|
||||
# compiler is `g77').
|
||||
AC_DEFUN(AC_PROG_F77_WORKS,
|
||||
[AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(Fortran 77)
|
||||
AC_TRY_COMPILER(
|
||||
[ program conftest
|
||||
end
|
||||
], ac_cv_prog_f77_works, ac_cv_prog_f77_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_f77_works)
|
||||
if test $ac_cv_prog_f77_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: Fortran 77 compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_f77_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_f77_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run Fortran 77 compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_F77_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_F77_GNU
|
||||
# ----------------
|
||||
# Test whether for Fortran 77 compiler is `g77' (the GNU Fortran 77
|
||||
@ -1233,7 +1182,7 @@ AC_MSG_CHECKING([for function prototypes])
|
||||
if test "$ac_cv_prog_cc_stdc" != no; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(PROTOTYPES, 1,
|
||||
[Define if the compiler supports function prototypes.])
|
||||
[Define if the C compiler supports function prototypes.])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
@ -239,8 +239,8 @@ AC_DEFUN([AC_LANG_SOURCE],
|
||||
[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(PROLOGUE, BODY)
|
||||
# -------------------------------
|
||||
# AC_LANG_PROGRAM([PROLOGUE], [BODY])
|
||||
# -----------------------------------
|
||||
# Produce a valid source for the current language. Prepend the
|
||||
# PROLOGUE (typically CPP directives and/or declarations) to an
|
||||
# execution the BODY (typically glued inside the `main' function, or
|
||||
@ -271,8 +271,8 @@ define([AC_LANG_SOURCE(C)],
|
||||
$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(C)(PROLOGUE, BODY)
|
||||
# ----------------------------------
|
||||
# AC_LANG_PROGRAM(C)([PROLOGUE], [BODY])
|
||||
# --------------------------------------
|
||||
define([AC_LANG_PROGRAM(C)],
|
||||
[$1
|
||||
int
|
||||
@ -317,8 +317,8 @@ extern "C" void exit (int);
|
||||
$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(C++)(PROLOGUE, BODY)
|
||||
# ------------------------------------
|
||||
# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
|
||||
# ----------------------------------------
|
||||
# Same as C.
|
||||
define([AC_LANG_PROGRAM(C++)], defn([AC_LANG_PROGRAM(C)]))
|
||||
|
||||
@ -343,8 +343,8 @@ define([AC_LANG_SOURCE(Fortran 77)],
|
||||
[$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(Fortran 77)(PROLOGUE, BODY)
|
||||
# -------------------------------------------
|
||||
# AC_LANG_PROGRAM(Fortran 77)([PROLOGUE], [BODY])
|
||||
# -----------------------------------------------
|
||||
# Yes, we discard the PROLOGUE.
|
||||
define([AC_LANG_PROGRAM(Fortran 77)],
|
||||
[ program main
|
||||
@ -379,6 +379,24 @@ AC_DEFUN([AC_REQUIRE_CPP],
|
||||
[AC_REQUIRE([AC_PROG_CXXCPP])])])
|
||||
|
||||
|
||||
# AC_LANG_COMPILER_WORKS
|
||||
# ----------------------
|
||||
define([_AC_LANG_COMPILER_WORKS],
|
||||
[AC_MSG_CHECKING([whether the _AC_LANG compiler works])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
|
||||
[# If not cross compiling, check that we can run a simple program.
|
||||
if test $cross_compiling != yes; then
|
||||
if AC_TRY_COMMAND(./conftest); then :; else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([cannot run _AC_LANG compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([_AC_LANG compiler cannot create executables], 77)])[]dnl
|
||||
])# AC_LANG_COMPILER_WORKS
|
||||
|
||||
|
||||
# -------------------- #
|
||||
# 3b. The C compiler. #
|
||||
@ -427,6 +445,7 @@ AC_SUBST(CPP)dnl
|
||||
# search list for the C compiler.
|
||||
AC_DEFUN(AC_PROG_CC,
|
||||
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_LANG_PUSH(C)
|
||||
AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler])
|
||||
ifval([$1],
|
||||
[AC_CHECK_PROGS(CC, [$1])],
|
||||
@ -442,9 +461,7 @@ ifval([$1],
|
||||
|
||||
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_CC_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_CC_GNU
|
||||
|
||||
dnl Check whether -g works, even if CFLAGS is set, in case the package
|
||||
@ -469,30 +486,10 @@ else
|
||||
CFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_CC
|
||||
|
||||
|
||||
# AC_PROG_CC_WORKS
|
||||
# ----------------
|
||||
AC_DEFUN(AC_PROG_CC_WORKS,
|
||||
[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(C)
|
||||
AC_TRY_COMPILER([int main(){return(0);}],
|
||||
ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_cc_works)
|
||||
if test $ac_cv_prog_cc_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_cc_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_cc_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run C compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_CC_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_CC_GNU
|
||||
# ---------------
|
||||
define([_AC_PROG_CC_GNU],
|
||||
@ -639,11 +636,10 @@ AC_SUBST(CXXCPP)dnl
|
||||
# compiler.
|
||||
AC_DEFUN(AC_PROG_CXX,
|
||||
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++)
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_CXX_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_CXX_GNU
|
||||
|
||||
dnl Check whether -g works, even if CXXFLAGS is set, in case the package
|
||||
@ -668,30 +664,10 @@ else
|
||||
CXXFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_CXX
|
||||
|
||||
|
||||
# AC_PROG_CXX_WORKS
|
||||
# -----------------
|
||||
AC_DEFUN(AC_PROG_CXX_WORKS,
|
||||
[AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_TRY_COMPILER([int main(){return(0);}],
|
||||
ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_cxx_works)
|
||||
if test $ac_cv_prog_cxx_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_cxx_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_cxx_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run C++ compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_CXX_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_CXX_GNU
|
||||
# ----------------
|
||||
define([_AC_PROG_CXX_GNU],
|
||||
@ -742,12 +718,11 @@ rm -f conftest*
|
||||
# for.
|
||||
AC_DEFUN(AC_PROG_F77,
|
||||
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_LANG_PUSH(Fortran 77)
|
||||
AC_CHECK_PROGS(F77,
|
||||
m4_default([$1], [g77 f77 xlf cf77 fl32 fort77 f90 xlf90 f2c]))
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_F77_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_F77_GNU
|
||||
|
||||
dnl Check whether -g works, even if FFLAGS is set, in case the package
|
||||
@ -772,36 +747,10 @@ else
|
||||
FFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_F77
|
||||
|
||||
|
||||
# AC_PROG_F77_WORKS
|
||||
# -----------------
|
||||
# Test whether the Fortran 77 compiler can compile and link a trivial
|
||||
# Fortran program. Also, test whether the Fortran 77 compiler is a
|
||||
# cross-compiler (which may realistically be the case if the Fortran
|
||||
# compiler is `g77').
|
||||
AC_DEFUN(AC_PROG_F77_WORKS,
|
||||
[AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(Fortran 77)
|
||||
AC_TRY_COMPILER(
|
||||
[ program conftest
|
||||
end
|
||||
], ac_cv_prog_f77_works, ac_cv_prog_f77_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_f77_works)
|
||||
if test $ac_cv_prog_f77_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: Fortran 77 compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_f77_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_f77_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run Fortran 77 compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_F77_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_F77_GNU
|
||||
# ----------------
|
||||
# Test whether for Fortran 77 compiler is `g77' (the GNU Fortran 77
|
||||
@ -1233,7 +1182,7 @@ AC_MSG_CHECKING([for function prototypes])
|
||||
if test "$ac_cv_prog_cc_stdc" != no; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(PROTOTYPES, 1,
|
||||
[Define if the compiler supports function prototypes.])
|
||||
[Define if the C compiler supports function prototypes.])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
@ -239,8 +239,8 @@ AC_DEFUN([AC_LANG_SOURCE],
|
||||
[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(PROLOGUE, BODY)
|
||||
# -------------------------------
|
||||
# AC_LANG_PROGRAM([PROLOGUE], [BODY])
|
||||
# -----------------------------------
|
||||
# Produce a valid source for the current language. Prepend the
|
||||
# PROLOGUE (typically CPP directives and/or declarations) to an
|
||||
# execution the BODY (typically glued inside the `main' function, or
|
||||
@ -271,8 +271,8 @@ define([AC_LANG_SOURCE(C)],
|
||||
$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(C)(PROLOGUE, BODY)
|
||||
# ----------------------------------
|
||||
# AC_LANG_PROGRAM(C)([PROLOGUE], [BODY])
|
||||
# --------------------------------------
|
||||
define([AC_LANG_PROGRAM(C)],
|
||||
[$1
|
||||
int
|
||||
@ -317,8 +317,8 @@ extern "C" void exit (int);
|
||||
$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(C++)(PROLOGUE, BODY)
|
||||
# ------------------------------------
|
||||
# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
|
||||
# ----------------------------------------
|
||||
# Same as C.
|
||||
define([AC_LANG_PROGRAM(C++)], defn([AC_LANG_PROGRAM(C)]))
|
||||
|
||||
@ -343,8 +343,8 @@ define([AC_LANG_SOURCE(Fortran 77)],
|
||||
[$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(Fortran 77)(PROLOGUE, BODY)
|
||||
# -------------------------------------------
|
||||
# AC_LANG_PROGRAM(Fortran 77)([PROLOGUE], [BODY])
|
||||
# -----------------------------------------------
|
||||
# Yes, we discard the PROLOGUE.
|
||||
define([AC_LANG_PROGRAM(Fortran 77)],
|
||||
[ program main
|
||||
@ -379,6 +379,24 @@ AC_DEFUN([AC_REQUIRE_CPP],
|
||||
[AC_REQUIRE([AC_PROG_CXXCPP])])])
|
||||
|
||||
|
||||
# AC_LANG_COMPILER_WORKS
|
||||
# ----------------------
|
||||
define([_AC_LANG_COMPILER_WORKS],
|
||||
[AC_MSG_CHECKING([whether the _AC_LANG compiler works])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
|
||||
[# If not cross compiling, check that we can run a simple program.
|
||||
if test $cross_compiling != yes; then
|
||||
if AC_TRY_COMMAND(./conftest); then :; else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([cannot run _AC_LANG compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([_AC_LANG compiler cannot create executables], 77)])[]dnl
|
||||
])# AC_LANG_COMPILER_WORKS
|
||||
|
||||
|
||||
# -------------------- #
|
||||
# 3b. The C compiler. #
|
||||
@ -427,6 +445,7 @@ AC_SUBST(CPP)dnl
|
||||
# search list for the C compiler.
|
||||
AC_DEFUN(AC_PROG_CC,
|
||||
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_LANG_PUSH(C)
|
||||
AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler])
|
||||
ifval([$1],
|
||||
[AC_CHECK_PROGS(CC, [$1])],
|
||||
@ -442,9 +461,7 @@ ifval([$1],
|
||||
|
||||
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_CC_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_CC_GNU
|
||||
|
||||
dnl Check whether -g works, even if CFLAGS is set, in case the package
|
||||
@ -469,30 +486,10 @@ else
|
||||
CFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_CC
|
||||
|
||||
|
||||
# AC_PROG_CC_WORKS
|
||||
# ----------------
|
||||
AC_DEFUN(AC_PROG_CC_WORKS,
|
||||
[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(C)
|
||||
AC_TRY_COMPILER([int main(){return(0);}],
|
||||
ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_cc_works)
|
||||
if test $ac_cv_prog_cc_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_cc_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_cc_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run C compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_CC_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_CC_GNU
|
||||
# ---------------
|
||||
define([_AC_PROG_CC_GNU],
|
||||
@ -639,11 +636,10 @@ AC_SUBST(CXXCPP)dnl
|
||||
# compiler.
|
||||
AC_DEFUN(AC_PROG_CXX,
|
||||
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++)
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_CXX_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_CXX_GNU
|
||||
|
||||
dnl Check whether -g works, even if CXXFLAGS is set, in case the package
|
||||
@ -668,30 +664,10 @@ else
|
||||
CXXFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_CXX
|
||||
|
||||
|
||||
# AC_PROG_CXX_WORKS
|
||||
# -----------------
|
||||
AC_DEFUN(AC_PROG_CXX_WORKS,
|
||||
[AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_TRY_COMPILER([int main(){return(0);}],
|
||||
ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_cxx_works)
|
||||
if test $ac_cv_prog_cxx_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_cxx_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_cxx_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run C++ compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_CXX_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_CXX_GNU
|
||||
# ----------------
|
||||
define([_AC_PROG_CXX_GNU],
|
||||
@ -742,12 +718,11 @@ rm -f conftest*
|
||||
# for.
|
||||
AC_DEFUN(AC_PROG_F77,
|
||||
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_LANG_PUSH(Fortran 77)
|
||||
AC_CHECK_PROGS(F77,
|
||||
m4_default([$1], [g77 f77 xlf cf77 fl32 fort77 f90 xlf90 f2c]))
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_F77_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_F77_GNU
|
||||
|
||||
dnl Check whether -g works, even if FFLAGS is set, in case the package
|
||||
@ -772,36 +747,10 @@ else
|
||||
FFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_F77
|
||||
|
||||
|
||||
# AC_PROG_F77_WORKS
|
||||
# -----------------
|
||||
# Test whether the Fortran 77 compiler can compile and link a trivial
|
||||
# Fortran program. Also, test whether the Fortran 77 compiler is a
|
||||
# cross-compiler (which may realistically be the case if the Fortran
|
||||
# compiler is `g77').
|
||||
AC_DEFUN(AC_PROG_F77_WORKS,
|
||||
[AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(Fortran 77)
|
||||
AC_TRY_COMPILER(
|
||||
[ program conftest
|
||||
end
|
||||
], ac_cv_prog_f77_works, ac_cv_prog_f77_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_f77_works)
|
||||
if test $ac_cv_prog_f77_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: Fortran 77 compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_f77_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_f77_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run Fortran 77 compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_F77_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_F77_GNU
|
||||
# ----------------
|
||||
# Test whether for Fortran 77 compiler is `g77' (the GNU Fortran 77
|
||||
@ -1233,7 +1182,7 @@ AC_MSG_CHECKING([for function prototypes])
|
||||
if test "$ac_cv_prog_cc_stdc" != no; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(PROTOTYPES, 1,
|
||||
[Define if the compiler supports function prototypes.])
|
||||
[Define if the C compiler supports function prototypes.])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
@ -837,6 +837,7 @@ AC_DEFUN(_AC_INIT_DEFAULTS,
|
||||
# Initializations.
|
||||
#
|
||||
ac_default_prefix=/usr/local
|
||||
cross_compiling=no
|
||||
subdirs=
|
||||
MFLAGS= MAKEFLAGS=
|
||||
AC_SUBST(SHELL, ${CONFIG_SHELL-/bin/sh})dnl
|
||||
@ -2323,7 +2324,6 @@ AC_DEFUN(AC_TRY_COMMAND,
|
||||
[{ ac_try='$1'; AC_TRY_EVAL(ac_try); }])
|
||||
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## Default includes. ##
|
||||
## ------------------ ##
|
||||
@ -2670,26 +2670,6 @@ popdef([AC_Prog])dnl
|
||||
])# AC_PREFIX_PROGRAM
|
||||
|
||||
|
||||
# AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
|
||||
# -----------------------------------------------------
|
||||
# Try to compile, link and execute TEST-PROGRAM. Set WORKING-VAR to
|
||||
# `yes' if the current compiler works, otherwise set it ti `no'. Set
|
||||
# CROSS-VAR to `yes' if the compiler and linker produce non-native
|
||||
# executables, otherwise set it to `no'. Before calling
|
||||
# `AC_TRY_COMPILER()', call `AC_LANG_*' to set-up for the right
|
||||
# language.
|
||||
AC_DEFUN(AC_TRY_COMPILER,
|
||||
[AC_LINK_IFELSE([AC_LANG_SOURCE([[$1]])],
|
||||
[$2=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
$3=no
|
||||
else
|
||||
$3=yes
|
||||
fi],
|
||||
[$2=no])[]dnl
|
||||
])# AC_TRY_COMPILER
|
||||
|
||||
|
||||
|
||||
## ------------------------ ##
|
||||
@ -2974,7 +2954,7 @@ rm -f conftest*[]dnl
|
||||
# [ACTION-IF-CROSS-COMPILING])
|
||||
# --------------------------------------------------------
|
||||
AC_DEFUN([AC_TRY_RUN],
|
||||
[if test "$cross_compiling" = yes; then
|
||||
[if test $cross_compiling = yes; then
|
||||
m4_default([$4],
|
||||
[AC_DIAGNOSE([cross],
|
||||
[AC_TRY_RUN called without default to allow cross compiling])dnl
|
||||
@ -3038,7 +3018,7 @@ AC_DEFUN(AC_CHECK_FILE,
|
||||
AC_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
|
||||
dnl FIXME: why was there this line? AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_CACHE_CHECK([for $1], ac_File,
|
||||
[test "$cross_compiling" = yes &&
|
||||
[test $cross_compiling = yes &&
|
||||
AC_MSG_ERROR([Cannot check for file existence when cross compiling])
|
||||
if test -r "[$1]"; then
|
||||
AC_VAR_SET(ac_File, yes)
|
||||
|
@ -239,8 +239,8 @@ AC_DEFUN([AC_LANG_SOURCE],
|
||||
[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(PROLOGUE, BODY)
|
||||
# -------------------------------
|
||||
# AC_LANG_PROGRAM([PROLOGUE], [BODY])
|
||||
# -----------------------------------
|
||||
# Produce a valid source for the current language. Prepend the
|
||||
# PROLOGUE (typically CPP directives and/or declarations) to an
|
||||
# execution the BODY (typically glued inside the `main' function, or
|
||||
@ -271,8 +271,8 @@ define([AC_LANG_SOURCE(C)],
|
||||
$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(C)(PROLOGUE, BODY)
|
||||
# ----------------------------------
|
||||
# AC_LANG_PROGRAM(C)([PROLOGUE], [BODY])
|
||||
# --------------------------------------
|
||||
define([AC_LANG_PROGRAM(C)],
|
||||
[$1
|
||||
int
|
||||
@ -317,8 +317,8 @@ extern "C" void exit (int);
|
||||
$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(C++)(PROLOGUE, BODY)
|
||||
# ------------------------------------
|
||||
# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
|
||||
# ----------------------------------------
|
||||
# Same as C.
|
||||
define([AC_LANG_PROGRAM(C++)], defn([AC_LANG_PROGRAM(C)]))
|
||||
|
||||
@ -343,8 +343,8 @@ define([AC_LANG_SOURCE(Fortran 77)],
|
||||
[$1])
|
||||
|
||||
|
||||
# AC_LANG_PROGRAM(Fortran 77)(PROLOGUE, BODY)
|
||||
# -------------------------------------------
|
||||
# AC_LANG_PROGRAM(Fortran 77)([PROLOGUE], [BODY])
|
||||
# -----------------------------------------------
|
||||
# Yes, we discard the PROLOGUE.
|
||||
define([AC_LANG_PROGRAM(Fortran 77)],
|
||||
[ program main
|
||||
@ -379,6 +379,24 @@ AC_DEFUN([AC_REQUIRE_CPP],
|
||||
[AC_REQUIRE([AC_PROG_CXXCPP])])])
|
||||
|
||||
|
||||
# AC_LANG_COMPILER_WORKS
|
||||
# ----------------------
|
||||
define([_AC_LANG_COMPILER_WORKS],
|
||||
[AC_MSG_CHECKING([whether the _AC_LANG compiler works])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
|
||||
[# If not cross compiling, check that we can run a simple program.
|
||||
if test $cross_compiling != yes; then
|
||||
if AC_TRY_COMMAND(./conftest); then :; else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([cannot run _AC_LANG compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([_AC_LANG compiler cannot create executables], 77)])[]dnl
|
||||
])# AC_LANG_COMPILER_WORKS
|
||||
|
||||
|
||||
# -------------------- #
|
||||
# 3b. The C compiler. #
|
||||
@ -427,6 +445,7 @@ AC_SUBST(CPP)dnl
|
||||
# search list for the C compiler.
|
||||
AC_DEFUN(AC_PROG_CC,
|
||||
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_LANG_PUSH(C)
|
||||
AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler])
|
||||
ifval([$1],
|
||||
[AC_CHECK_PROGS(CC, [$1])],
|
||||
@ -442,9 +461,7 @@ ifval([$1],
|
||||
|
||||
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_CC_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_CC_GNU
|
||||
|
||||
dnl Check whether -g works, even if CFLAGS is set, in case the package
|
||||
@ -469,30 +486,10 @@ else
|
||||
CFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_CC
|
||||
|
||||
|
||||
# AC_PROG_CC_WORKS
|
||||
# ----------------
|
||||
AC_DEFUN(AC_PROG_CC_WORKS,
|
||||
[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(C)
|
||||
AC_TRY_COMPILER([int main(){return(0);}],
|
||||
ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_cc_works)
|
||||
if test $ac_cv_prog_cc_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_cc_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_cc_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run C compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_CC_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_CC_GNU
|
||||
# ---------------
|
||||
define([_AC_PROG_CC_GNU],
|
||||
@ -639,11 +636,10 @@ AC_SUBST(CXXCPP)dnl
|
||||
# compiler.
|
||||
AC_DEFUN(AC_PROG_CXX,
|
||||
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++)
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_CXX_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_CXX_GNU
|
||||
|
||||
dnl Check whether -g works, even if CXXFLAGS is set, in case the package
|
||||
@ -668,30 +664,10 @@ else
|
||||
CXXFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_CXX
|
||||
|
||||
|
||||
# AC_PROG_CXX_WORKS
|
||||
# -----------------
|
||||
AC_DEFUN(AC_PROG_CXX_WORKS,
|
||||
[AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_TRY_COMPILER([int main(){return(0);}],
|
||||
ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_cxx_works)
|
||||
if test $ac_cv_prog_cxx_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_cxx_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_cxx_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run C++ compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_CXX_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_CXX_GNU
|
||||
# ----------------
|
||||
define([_AC_PROG_CXX_GNU],
|
||||
@ -742,12 +718,11 @@ rm -f conftest*
|
||||
# for.
|
||||
AC_DEFUN(AC_PROG_F77,
|
||||
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
||||
AC_LANG_PUSH(Fortran 77)
|
||||
AC_CHECK_PROGS(F77,
|
||||
m4_default([$1], [g77 f77 xlf cf77 fl32 fort77 f90 xlf90 f2c]))
|
||||
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_PROG_F77_WORKS
|
||||
fi
|
||||
_AC_LANG_COMPILER_WORKS
|
||||
_AC_PROG_F77_GNU
|
||||
|
||||
dnl Check whether -g works, even if FFLAGS is set, in case the package
|
||||
@ -772,36 +747,10 @@ else
|
||||
FFLAGS=
|
||||
fi
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])# AC_PROG_F77
|
||||
|
||||
|
||||
# AC_PROG_F77_WORKS
|
||||
# -----------------
|
||||
# Test whether the Fortran 77 compiler can compile and link a trivial
|
||||
# Fortran program. Also, test whether the Fortran 77 compiler is a
|
||||
# cross-compiler (which may realistically be the case if the Fortran
|
||||
# compiler is `g77').
|
||||
AC_DEFUN(AC_PROG_F77_WORKS,
|
||||
[AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works])
|
||||
AC_LANG_PUSH(Fortran 77)
|
||||
AC_TRY_COMPILER(
|
||||
[ program conftest
|
||||
end
|
||||
], ac_cv_prog_f77_works, ac_cv_prog_f77_cross)
|
||||
AC_LANG_POP()dnl
|
||||
AC_MSG_RESULT($ac_cv_prog_f77_works)
|
||||
if test $ac_cv_prog_f77_works = no; then
|
||||
AC_MSG_ERROR([installation or configuration problem: Fortran 77 compiler cannot create executables.], 77)
|
||||
fi
|
||||
AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler])
|
||||
AC_MSG_RESULT($ac_cv_prog_f77_cross)
|
||||
if test $cross_compiling,$ac_cv_prog_f77_cross = no,yes; then
|
||||
AC_MSG_ERROR([installation or configuration problem: cannot run Fortran 77 compiled programs.
|
||||
To enable cross compilation, use `--host'.])
|
||||
fi
|
||||
])# AC_PROG_F77_WORKS
|
||||
|
||||
|
||||
# _AC_PROG_F77_GNU
|
||||
# ----------------
|
||||
# Test whether for Fortran 77 compiler is `g77' (the GNU Fortran 77
|
||||
@ -1233,7 +1182,7 @@ AC_MSG_CHECKING([for function prototypes])
|
||||
if test "$ac_cv_prog_cc_stdc" != no; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(PROTOTYPES, 1,
|
||||
[Define if the compiler supports function prototypes.])
|
||||
[Define if the C compiler supports function prototypes.])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
@ -63,12 +63,16 @@ testsuite: atgeneral.m4 atspecific.m4 suite.m4 macros.m4 $(SUITE)
|
||||
# - AC_PATH_PROGS?
|
||||
# They produce `= val' because $1, the variable used to store the result,
|
||||
# is empty.
|
||||
# - AC_TRY
|
||||
# - AC_TRY, AC_.*_IFELSE
|
||||
# Used in many places.
|
||||
# - _AC_
|
||||
# Internal macros are used elsewhere.
|
||||
# - AC_OUTPUT
|
||||
# Already tested by `AT_TEST_MACRO'.
|
||||
# - AC_FD_CC
|
||||
# Is a number.
|
||||
# - AC_PROG_CC, AC_C_(CONST|INLINE|VOLATILE)
|
||||
# Checked in semantics.
|
||||
#
|
||||
# Multiple `-e' to egrep are not portable, so join all the patterns together.
|
||||
# We use the fact that automake will replace all the `\\\n' with ` '.
|
||||
@ -88,6 +92,9 @@ FILTER_MACROS = egrep -v -e \
|
||||
^AC_REPLACE_FUNCS$$\
|
||||
^AC_SEARCH_LIBS$$\
|
||||
^AC_TRY\
|
||||
^AC_.*_IFELSE$$\
|
||||
^AC_FD_CC$$\
|
||||
^(AC_(PROG_CC|C_CONST|C_INLINE|C_VOLATILE))$$\
|
||||
_AC_' | tr ' ' '|'`
|
||||
|
||||
# The files which contains macro we check for syntax.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@ -10,7 +10,6 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
@ -32,8 +31,6 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@ -46,9 +43,10 @@ AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_FLAG =
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
@ -57,12 +55,15 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
|
||||
@SET_MAKE@
|
||||
AWK = @AWK@
|
||||
HELP2MAN = @HELP2MAN@
|
||||
M4 = @M4@
|
||||
PERLSCRIPTS = @PERLSCRIPTS@
|
||||
standards_texi = @standards_texi@
|
||||
|
||||
|
||||
AUTOMAKE_OPTIONS = gnits
|
||||
|
||||
SUITE = torture.m4 semantics.m4 syntax.m4 base.m4 tools.m4
|
||||
@ -96,43 +97,69 @@ PERL = perl
|
||||
# - AC_PATH_PROGS?
|
||||
# They produce `= val' because $1, the variable used to store the result,
|
||||
# is empty.
|
||||
# - AC_TRY
|
||||
# - AC_TRY, AC_.*_IFELSE
|
||||
# Used in many places.
|
||||
# - _AC_
|
||||
# Internal macros are used elsewhere.
|
||||
# - AC_OUTPUT
|
||||
# Already tested by `AT_TEST_MACRO'.
|
||||
# - AC_FD_CC
|
||||
# Is a number.
|
||||
# - AC_PROG_CC, AC_C_(CONST|INLINE|VOLATILE)
|
||||
# Checked in semantics.
|
||||
#
|
||||
# Multiple `-e' to egrep are not portable, so join all the patterns together.
|
||||
# We use the fact that automake will replace all the `\\\n' with ` '.
|
||||
FILTER_MACROS = egrep -v -e `echo '^AC_ARG_VAR$$ ^AC_CANONICALIZE$$ ^AC_CHECK_(DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|TYPE)S?$$ ^AC_CONFIG ^AC_INIT ^AC_LANG ^AC_LINKER_OPTION$$ ^AC_LINK_FILES$$ ^AC_LIST_MEMBER_OF$$ ^AC_OUTPUT$$ ^AC_PATH_(TOOL|PROG)S?$$ ^AC_PROG_(CC|CXX|F77)_(GNU|WORKS)$$ ^AC_REPLACE_FUNCS$$ ^AC_SEARCH_LIBS$$ ^AC_TRY _AC_' | tr ' ' '|'`
|
||||
FILTER_MACROS = egrep -v -e \
|
||||
`echo '^AC_ARG_VAR$$\
|
||||
^AC_CANONICALIZE$$\
|
||||
^AC_CHECK_(DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|TYPE)S?$$\
|
||||
^AC_CONFIG\
|
||||
^AC_INIT\
|
||||
^AC_LANG\
|
||||
^AC_LINKER_OPTION$$\
|
||||
^AC_LINK_FILES$$\
|
||||
^AC_LIST_MEMBER_OF$$\
|
||||
^AC_OUTPUT$$\
|
||||
^AC_PATH_(TOOL|PROG)S?$$\
|
||||
^AC_PROG_(CC|CXX|F77)_(GNU|WORKS)$$\
|
||||
^AC_REPLACE_FUNCS$$\
|
||||
^AC_SEARCH_LIBS$$\
|
||||
^AC_TRY\
|
||||
^AC_.*_IFELSE$$\
|
||||
^AC_FD_CC$$\
|
||||
^(AC_(PROG_CC|C_CONST|C_INLINE|C_VOLATILE))$$\
|
||||
_AC_' | tr ' ' '|'`
|
||||
|
||||
|
||||
# The files which contains macro we check for syntax.
|
||||
MACRO_FILES = $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 $(top_srcdir)/aclang.m4
|
||||
MACRO_FILES = $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 \
|
||||
$(top_srcdir)/aclang.m4
|
||||
|
||||
|
||||
CLEANFILES = debug-*.sh macro configure configure.in config.status config.cache config.log config.h.in config.h
|
||||
CLEANFILES = debug-*.sh macro configure configure.in config.status \
|
||||
config.cache config.log config.h.in config.h
|
||||
|
||||
DISTCLEANFILES = atconfig testsuite
|
||||
subdir = tests
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_CLEAN_FILES = atconfig
|
||||
DIST_SOURCES =
|
||||
DIST_COMMON = Makefile.am Makefile.in atconfig.in
|
||||
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits tests/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@ -144,22 +171,16 @@ TAGS:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = tests
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits tests/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
cp -pR $$d/$$file $(distdir) \
|
||||
|| exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
@ -185,7 +206,7 @@ uninstall: uninstall-am
|
||||
all-am: Makefile
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
@ -200,6 +221,7 @@ distclean-generic:
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-rm -f Makefile.in
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
@ -221,7 +243,7 @@ maintainer-clean: maintainer-clean-am
|
||||
.PHONY: tags distdir info-am info dvi-am dvi check-local check check-am \
|
||||
installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
all-redirect all-am all install-strip installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
@ -281,7 +281,7 @@ AT_CLEANUP(path config.log config.cache configure)
|
||||
## ----------------- ##
|
||||
|
||||
|
||||
# AC_C_CONST
|
||||
# C compiler
|
||||
# ----------
|
||||
# GCC supports `const', `volatile', and `inline'.
|
||||
AT_TEST_MACRO(C keywords,
|
||||
|
Loading…
Reference in New Issue
Block a user