X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fansi-c%2B%2B.m4;h=b7bc530904766d9e5dddc3133f8d6f374c447486;hb=4e48756921cae0aec44afad18bfaa881890e6142;hp=1b65cec3e1c8eb55d02f0db1e56e3e91f02065d0;hpb=5f1dc805decae66f75d568218166f3ffa67387c9;p=gnulib.git diff --git a/m4/ansi-c++.m4 b/m4/ansi-c++.m4 index 1b65cec3e..b7bc53090 100644 --- a/m4/ansi-c++.m4 +++ b/m4/ansi-c++.m4 @@ -1,4 +1,4 @@ -# ansi-c++.m4 serial 3 +# ansi-c++.m4 serial 6 dnl Copyright (C) 2002-2003, 2005, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,16 +7,34 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. # Sets CXX_CHOICE to 'yes' or 'no', depending on the preferred use of C++. +# The default is 'yes'. If the configure.ac contains a definition of the +# macro gl_CXX_CHOICE_DEFAULT_NO, then the default is 'no'. In both cases, +# the user can change the value by passing the option --disable-cxx or +# --enable-cxx, respectively. AC_DEFUN([gl_CXX_CHOICE], [ AC_MSG_CHECKING([whether to use C++]) - dnl It would be so nice if plus signs were supported in AC_ARG_ENABLE. - dnl Feature request submitted on 2010-03-13. - AC_ARG_ENABLE([cxx], - [ --disable-cxx do not build C++ sources], - [CXX_CHOICE="$enableval"], - [CXX_CHOICE=yes]) + dnl Plus signs are supported in AC_ARG_ENABLE starting with autoconf-2.66. + m4_version_prereq([2.66], + [m4_ifdef([gl_CXX_CHOICE_DEFAULT_NO], + [AC_ARG_ENABLE([c++], + [ --enable-c++ also build C++ sources], + [CXX_CHOICE="$enableval"], + [CXX_CHOICE=no])], + [AC_ARG_ENABLE([c++], + [ --disable-c++ do not build C++ sources], + [CXX_CHOICE="$enableval"], + [CXX_CHOICE=yes])])], + [m4_ifdef([gl_CXX_CHOICE_DEFAULT_NO], + [AC_ARG_ENABLE([cxx], + [ --enable-cxx also build C++ sources], + [CXX_CHOICE="$enableval"], + [CXX_CHOICE=no])], + [AC_ARG_ENABLE([cxx], + [ --disable-cxx do not build C++ sources], + [CXX_CHOICE="$enableval"], + [CXX_CHOICE=yes])])]) AC_MSG_RESULT([$CXX_CHOICE]) AC_SUBST([CXX_CHOICE]) ]) @@ -39,7 +57,9 @@ AC_DEFUN([gl_PROG_ANSI_CXX], if test -n "$CCC"; then CXX="$CCC" else - AC_CHECK_PROGS([CXX], [g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC], [:]) + AC_CHECK_TOOLS([CXX], + [g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC], + [:]) fi fi if test "$CXX" != ":"; then