# HG changeset patch # User Bruno Haible # Date 1533600037 -7200 # Node ID 9e0852441f4bcc013c2fb48056371ba1e2182521 # Parent a8ff12fcd1ea9a92824b3354d40d2eb8d32ee011 Force generation of substitute .h file when C++ support is enabled. * m4/ansi-c++.m4 (gl_ANSI_CXX): New macro. * modules/ansi-c++-opt (configure.ac): Just require gl_ANSI_CXX. * m4/fnmatch_h.m4 (gl_FNMATCH_H): If C++ support is enabled, set FNMATCH_H to non-empty. * m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS): If C++ support is enabled, set ICONV_H to non-empty. * m4/monetary_h.m4 (gl_MONETARY_H_BODY): If C++ support is enabled, set MONETARY_H to non-empty. * m4/utime_h.m4 (gl_UTIME_H): If C++ support is enabled, set UTIME_H to non-empty. diff -r a8ff12fcd1ea -r 9e0852441f4b ChangeLog --- a/ChangeLog Tue Aug 07 00:25:13 2018 +0200 +++ b/ChangeLog Tue Aug 07 02:00:37 2018 +0200 @@ -1,3 +1,17 @@ +2018-08-06 Bruno Haible + + Force generation of substitute .h file when C++ support is enabled. + * m4/ansi-c++.m4 (gl_ANSI_CXX): New macro. + * modules/ansi-c++-opt (configure.ac): Just require gl_ANSI_CXX. + * m4/fnmatch_h.m4 (gl_FNMATCH_H): If C++ support is enabled, set + FNMATCH_H to non-empty. + * m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS): If C++ support is enabled, set + ICONV_H to non-empty. + * m4/monetary_h.m4 (gl_MONETARY_H_BODY): If C++ support is enabled, set + MONETARY_H to non-empty. + * m4/utime_h.m4 (gl_UTIME_H): If C++ support is enabled, set UTIME_H to + non-empty. + 2018-08-06 Bruno Haible fnmatch-h: Fix test compilation error on mingw (regression from today). diff -r a8ff12fcd1ea -r 9e0852441f4b m4/ansi-c++.m4 --- a/m4/ansi-c++.m4 Tue Aug 07 00:25:13 2018 +0200 +++ b/m4/ansi-c++.m4 Tue Aug 07 02:00:37 2018 +0200 @@ -1,4 +1,4 @@ -# ansi-c++.m4 serial 9 +# ansi-c++.m4 serial 10 dnl Copyright (C) 2002-2003, 2005, 2010-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -126,3 +126,13 @@ AM_CONDITIONAL([am__fastdepCXX], [false]) fi ]) + +# gl_ANSI_CXX +# Sets CXX to the name of a sufficiently ANSI C++ compliant compiler, or to +# "no" if none is found. +# Defines the Automake condition ANSICXX to true if such a compiler was found, +# or to false if not. +AC_DEFUN([gl_ANSI_CXX], +[ + gl_PROG_ANSI_CXX([CXX], [ANSICXX]) +]) diff -r a8ff12fcd1ea -r 9e0852441f4b m4/fnmatch_h.m4 --- a/m4/fnmatch_h.m4 Tue Aug 07 00:25:13 2018 +0200 +++ b/m4/fnmatch_h.m4 Tue Aug 07 02:00:37 2018 +0200 @@ -1,4 +1,4 @@ -# fnmatch_h.m4 serial 1 +# fnmatch_h.m4 serial 2 dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,6 +9,7 @@ AC_DEFUN([gl_FNMATCH_H], [ AC_REQUIRE([gl_FNMATCH_H_DEFAULTS]) + m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) AC_CHECK_HEADERS_ONCE([fnmatch.h]) gl_CHECK_NEXT_HEADERS([fnmatch.h]) @@ -28,9 +29,14 @@ m4_ifdef([gl_POSIXCHECK], [FNMATCH_H=fnmatch.h], [FNMATCH_H='' - if test $ac_cv_header_fnmatch_h != yes; then - dnl Provide a substitute file. + if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then + dnl Override always, to support the C++ GNULIB_NAMESPACE. FNMATCH_H=fnmatch.h + else + if test $ac_cv_header_fnmatch_h != yes; then + dnl Provide a substitute file. + FNMATCH_H=fnmatch.h + fi fi ]) AC_SUBST([FNMATCH_H]) diff -r a8ff12fcd1ea -r 9e0852441f4b m4/iconv_h.m4 --- a/m4/iconv_h.m4 Tue Aug 07 00:25:13 2018 +0200 +++ b/m4/iconv_h.m4 Tue Aug 07 02:00:37 2018 +0200 @@ -1,4 +1,4 @@ -# iconv_h.m4 serial 10 +# iconv_h.m4 serial 11 dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -36,6 +36,7 @@ AC_DEFUN([gl_ICONV_H_DEFAULTS], [ + m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) GNULIB_ICONV=0; AC_SUBST([GNULIB_ICONV]) dnl Assume proper GNU behavior unless another module says otherwise. ICONV_CONST=; AC_SUBST([ICONV_CONST]) @@ -43,6 +44,12 @@ REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN]) REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF]) ICONV_H=''; AC_SUBST([ICONV_H]) - m4_ifdef([gl_POSIXCHECK],[ICONV_H='iconv.h']) + m4_ifdef([gl_POSIXCHECK], + [ICONV_H='iconv.h'], + [if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then + dnl Override always, to support the C++ GNULIB_NAMESPACE. + ICONV_H='iconv.h' + fi + ]) AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) ]) diff -r a8ff12fcd1ea -r 9e0852441f4b m4/monetary_h.m4 --- a/m4/monetary_h.m4 Tue Aug 07 00:25:13 2018 +0200 +++ b/m4/monetary_h.m4 Tue Aug 07 02:00:37 2018 +0200 @@ -1,4 +1,4 @@ -# monetary_h.m4 serial 2 +# monetary_h.m4 serial 3 dnl Copyright (C) 2017-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,11 +14,14 @@ AC_DEFUN([gl_MONETARY_H_BODY], [ AC_REQUIRE([gl_MONETARY_H_DEFAULTS]) + m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) AC_CHECK_HEADERS_ONCE([monetary.h]) - dnl For now, we provide a wrapper only if the system already - dnl has a . - if m4_ifdef([gl_POSIXCHECK],[true],[test $ac_cv_header_monetary_h = yes]); then + dnl For now, we provide a wrapper only if + dnl - module 'posixcheck' is present, or + dnl - C++ GNULIB_NAMESPACE support may be requested, or + dnl - the system already has a . + if m4_ifdef([gl_POSIXCHECK], [true], [m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]) || test $ac_cv_header_monetary_h = yes]); then MONETARY_H='monetary.h' gl_CHECK_NEXT_HEADERS([monetary.h]) diff -r a8ff12fcd1ea -r 9e0852441f4b m4/utime_h.m4 --- a/m4/utime_h.m4 Tue Aug 07 00:25:13 2018 +0200 +++ b/m4/utime_h.m4 Tue Aug 07 02:00:37 2018 +0200 @@ -1,4 +1,4 @@ -# utime_h.m4 serial 2 +# utime_h.m4 serial 3 dnl Copyright (C) 2017-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -10,6 +10,7 @@ [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_UTIME_H_DEFAULTS]) + m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) AC_CHECK_HEADERS_ONCE([utime.h]) gl_CHECK_NEXT_HEADERS([utime.h]) @@ -23,15 +24,20 @@ m4_ifdef([gl_POSIXCHECK], [UTIME_H=utime.h], [UTIME_H='' - if test $ac_cv_header_utime_h != yes; then - dnl Provide a substitute file. + if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then + dnl Override always, to support the C++ GNULIB_NAMESPACE. UTIME_H=utime.h else - case "$host_os" in - mingw*) dnl Need special handling of 'struct utimbuf'. - UTIME_H=utime.h - ;; - esac + if test $ac_cv_header_utime_h != yes; then + dnl Provide a substitute file. + UTIME_H=utime.h + else + case "$host_os" in + mingw*) dnl Need special handling of 'struct utimbuf'. + UTIME_H=utime.h + ;; + esac + fi fi ]) AC_SUBST([UTIME_H]) diff -r a8ff12fcd1ea -r 9e0852441f4b modules/ansi-c++-opt --- a/modules/ansi-c++-opt Tue Aug 07 00:25:13 2018 +0200 +++ b/modules/ansi-c++-opt Tue Aug 07 02:00:37 2018 +0200 @@ -7,7 +7,7 @@ Depends-on: configure.ac: -gl_PROG_ANSI_CXX([CXX], [ANSICXX]) +AC_REQUIRE([gl_ANSI_CXX]) Makefile.am: