X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Faclocal.m4;h=b787f030ab532b7295313a2e2165ba7bdd31c05a;hp=81c1b9f05d7b560cf07d5a9fca414cc770be1e97;hb=96592d717179f99c8fe1c5a63fc4a26c24867288;hpb=aa70bf3c762c5b6407bf34812d63c20f7ac8ffdd diff --git a/test/aclocal.m4 b/test/aclocal.m4 index 81c1b9f0..b787f030 100644 --- a/test/aclocal.m4 +++ b/test/aclocal.m4 @@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl $Id: aclocal.m4,v 1.130 2016/06/25 20:29:33 tom Exp $ +dnl $Id: aclocal.m4,v 1.131 2016/08/06 23:42:15 tom Exp $ dnl dnl Author: Thomas E. Dickey dnl @@ -1629,7 +1629,7 @@ if test $cf_cv_getopt_header = getopt.h ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07 +dnl CF_GNU_SOURCE version: 7 updated: 2016/08/05 05:15:37 dnl ------------- dnl Check if we must define _GNU_SOURCE to get a reasonable value for dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect @@ -1656,7 +1656,20 @@ make an error CPPFLAGS="$cf_save" ]) ]) -test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + +if test "$cf_cv_gnu_source" = yes +then +AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[ +CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + AC_TRY_COMPILE([#include ],[ +#ifdef _DEFAULT_SOURCE +make an error +#endif], + [cf_cv_default_source=no], + [cf_cv_default_source=yes]) + ]) +test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" +fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_HEADER_PATH version: 13 updated: 2015/04/15 19:08:48