summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-07-24 02:01:15 +0200
committerKevin Ryde <user42@zip.com.au>2001-07-24 02:01:15 +0200
commit4dc8fe5e31ecabaafed25f03512bcf9c89e3b9c4 (patch)
tree91b99d0915c545d5ecd99bf9c17c293a577cffb0 /aclocal.m4
parentde4da2e4740449312f10df326a9b6e315b860b16 (diff)
downloadgmp-4dc8fe5e31ecabaafed25f03512bcf9c89e3b9c4.tar.gz
Regenerate for:
Change from: * configure.in, acinclude.m4 (GMP_OPTION_CXX): New macro. To: * configure.in, acinclude.m4 (GMP_PROG_CXX): New macro.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m4151
1 files changed, 69 insertions, 82 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 40585911c..10bf1a0d2 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1645,17 +1645,15 @@ AC_SUBST(TAL_OBJECT)
])
-dnl GMP_OPTION_CXX
-dnl --------------
-dnl Handle the --enable-cxx option.
+dnl GMP_PROG_CXX
+dnl ------------
+dnl Attempt to locate a C++ compiler.
-AC_DEFUN(GMP_OPTION_CXX,
-[have_cxx=no
-if test $enable_cxx != no; then
- test_CXXFLAGS=${CXXFLAGS+set}
- AC_PROG_CXX
+AC_DEFUN(GMP_PROG_CXX,
+[test_CXXFLAGS=${CXXFLAGS+set}
+AC_PROG_CXX
- cat >conftest.cc <<EOF
+cat >conftest.cc <<EOF
#include <iostream.h>
int
main (void)
@@ -1665,63 +1663,52 @@ main (void)
return 0;
}
EOF
- echo "configure: C++ test program:" >&AC_FD_CC
- cat conftest.cc >&AC_FD_CC
+echo "configure: C++ test program:" >&AC_FD_CC
+cat conftest.cc >&AC_FD_CC
+
+if test "$test_CXXFLAGS" = set; then
+ # User specified $CXXFLAGS, just check the compiler works
+ AC_MSG_CHECKING([C++ compiler $CXX $CXXFLAGS])
gmp_cxxcompile="$CXX $CXXFLAGS conftest.cc"
+ if AC_TRY_EVAL(gmp_cxxcompile); then
+ AC_MSG_RESULT(yes)
+ have_cxx=yes
+ fi
+ AC_MSG_RESULT(no)
+
+else
+ # User didn't specify $CXXFLAGS, try $CFLAGS (possibly with -g removed)
+ # or what AC_PROG_CXX decided (which is either "-g -O2" or "-O2").
+ #
+ # $CFLAGS stands a good chance of working, eg. on a GNU system where
+ # CC=gcc and CXX=g++, but no need to worry if it doesn't.
+
+ if test "$ac_prog_cxx_g" = no; then
+ cxxflags_cflags=`echo "$CFLAGS" | sed -e 's/ -g //' -e 's/^-g //' -e 's/ -g$//'`
+ else
+ cxxflags_cflags=$CFLAGS
+ fi
- if test "$test_CXXFLAGS" = set; then
- # User specified $CXXFLAGS, just check the compiler works
+ echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC
+ cxxflags_ac_prog_cxx="$CXXFLAGS"
+
+ for CXXFLAGS in "$cxxflags_cflags" "$cxxflags_ac_prog_cxx" ""; do
AC_MSG_CHECKING([C++ compiler $CXX $CXXFLAGS])
+ gmp_cxxcompile="$CXX $CXXFLAGS conftest.cc"
if AC_TRY_EVAL(gmp_cxxcompile); then
AC_MSG_RESULT(yes)
have_cxx=yes
+ break
fi
AC_MSG_RESULT(no)
-
- else
- # User didn't specify $CXXFLAGS, try $CFLAGS (possibly with -g removed)
- # or what AC_PROG_CXX decided (which is either "-g -O2" or "-O2").
- #
- # $CFLAGS stands a good chance of working, eg. on a GNU system where
- # CC=gcc and CXX=g++, but no need to worry if it doesn't.
-
- if test "$ac_prog_cxx_g" = no; then
- cxxflags_cflags=`echo "$CFLAGS" | sed -e 's/ -g //' -e 's/^-g //' -e 's/ -g$//'`
- else
- cxxflags_cflags=$CFLAGS
- fi
-
- echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC
- cxxflags_ac_prog_cxx="$CXXFLAGS"
-
- for CXXFLAGS in "$cxxflags_cflags" "$cxxflags_ac_prog_cxx" ""; do
- AC_MSG_CHECKING([C++ compiler $CXX $CXXFLAGS])
- if AC_TRY_EVAL(gmp_cxxcompile); then
- AC_MSG_RESULT(yes)
- have_cxx=yes
- break
- fi
- AC_MSG_RESULT(no)
- done
- fi
- rm -f conftest* a.out
-
- # an error if C++ was requested but doesn't work
- if test $have_cxx = no && test $enable_cxx = yes; then
- AC_MSG_ERROR([C++ compiler not available])
- fi
+ done
fi
+rm -f conftest* a.out
-AM_CONDITIONAL(HAVE_CXX, test $have_cxx = yes)
-
-# FIXME: This hack is because automake doesn't seem to like AM_CONDITIONAL
-# defined variables in libgmp_la_DEPENDENCIES.
-if test $have_cxx = yes; then
- PRINTF_CXX_OBJECTS='$(PRINTF_CXX_OBJECTS)'
-else
- PRINTF_CXX_OBJECTS=
+# an error if C++ was requested but doesn't work
+if test $have_cxx = no && test $enable_cxx = yes; then
+ AC_MSG_ERROR([C++ compiler not available])
fi
-AC_SUBST(PRINTF_CXX_OBJECTS)
])
@@ -5091,33 +5078,6 @@ AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
# This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])
-# serial 3
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-#
-# FIXME: Once using 2.50, use this:
-# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_DEFUN([AM_CONDITIONAL],
-[ifelse([$1], [TRUE],
- [errprint(__file__:__line__: [$0: invalid condition: $1
-])dnl
-m4exit(1)])dnl
-ifelse([$1], [FALSE],
- [errprint(__file__:__line__: [$0: invalid condition: $1
-])dnl
-m4exit(1)])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi])
-
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
@@ -5555,6 +5515,33 @@ AC_MSG_RESULT($_am_result)
rm -f confinc confmf
])
+# serial 3
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+#
+# FIXME: Once using 2.50, use this:
+# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_DEFUN([AM_CONDITIONAL],
+[ifelse([$1], [TRUE],
+ [errprint(__file__:__line__: [$0: invalid condition: $1
+])dnl
+m4exit(1)])dnl
+ifelse([$1], [FALSE],
+ [errprint(__file__:__line__: [$0: invalid condition: $1
+])dnl
+m4exit(1)])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
# Like AC_CONFIG_HEADER, but automatically create stamp file.
# serial 3