From 758fee15d9627556a3f0011973e83afb8d56d9be Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 31 Jul 2010 23:34:12 +0200 Subject: [PATCH] ansi-c++-opt: Provide option --enable-c++/--disable-c++ when possible. --- ChangeLog | 6 ++++++ m4/ansi-c++.m4 | 33 +++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09bf87f6e..8532f0183 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-07-31 Bruno Haible + ansi-c++-opt: Provide option --enable-c++/--disable-c++ when possible. + * m4/ansi-c++.m4 (gl_CXX_CHOICE): In Autoconf 2.66 or newer, provide + option --enable/disable-c++ instead of --enable/disable-cxx. + +2010-07-31 Bruno Haible + readlink, areadlink: Relax test a bit. * tests/test-readlink.h (test_readlink): Accept EINVAL as an alternative to ENOTDIR. diff --git a/m4/ansi-c++.m4 b/m4/ansi-c++.m4 index 0b024379f..b7bc53090 100644 --- a/m4/ansi-c++.m4 +++ b/m4/ansi-c++.m4 @@ -1,4 +1,4 @@ -# ansi-c++.m4 serial 5 +# 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, @@ -15,17 +15,26 @@ dnl From Bruno Haible. 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. - 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])]) + 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]) ]) -- 2.11.0