From: Bruno Haible Date: Sun, 28 Mar 2010 13:30:39 +0000 (+0200) Subject: ansi-c++-opt: Allow turning off the C++ build by default. X-Git-Tag: v0.1~4408 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=3c6b19e8e32d893fb50c5455eb5e3223a01df616;p=gnulib.git ansi-c++-opt: Allow turning off the C++ build by default. --- diff --git a/ChangeLog b/ChangeLog index c467060df..e1f2a1ed4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2010-03-28 Bruno Haible + ansi-c++-opt: Allow turning off the C++ build by default. + * m4/ansi-c++.m4 (gl_CXX_CHOICE): Let CXX_CHOICE default to 'no' if + gl_CXX_CHOICE_DEFAULT_NO is defined. + Requested by Eric Blake. + +2010-03-28 Bruno Haible + unistd: Avoid #define replacements in C++ mode. * lib/unistd.in.h (socket, connect, accept, bind, getpeername, getsockname, getsockopt, listen, recv, send, recvfrom, sendto, diff --git a/m4/ansi-c++.m4 b/m4/ansi-c++.m4 index 1b65cec3e..b8bd73fb2 100644 --- a/m4/ansi-c++.m4 +++ b/m4/ansi-c++.m4 @@ -1,4 +1,4 @@ -# ansi-c++.m4 serial 3 +# ansi-c++.m4 serial 4 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,25 @@ 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]) + 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]) ])