]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - aclocal.m4
ncurses 6.0 - patch 20160910
[ncurses.git] / aclocal.m4
index 806dec1c92ec52213e5e298d9f5361d8a313adbc..467350a9ba3b3cfd2e7bf2f5f51f171e43f2b368 100644 (file)
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.790 2016/05/29 00:35:34 tom Exp $
+dnl $Id: aclocal.m4,v 1.800 2016/09/10 19:33:21 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -711,11 +711,14 @@ AC_SUBST(BUILD_EXEEXT)
 AC_SUBST(BUILD_OBJEXT)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CC_ENV_FLAGS version: 3 updated: 2016/05/21 18:10:17
+dnl CF_CC_ENV_FLAGS version: 6 updated: 2016/08/29 20:57:00
 dnl ---------------
 dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
-dnl into CC.  This will not help with broken scripts that wrap the compiler with
-dnl options, but eliminates a more common category of user confusion.
+dnl into CC.  This will not help with broken scripts that wrap the compiler
+dnl with options, but eliminates a more common category of user confusion.
+dnl
+dnl In particular, it addresses the problem of being able to run the C
+dnl preprocessor in a consistent manner.
 dnl
 dnl Caveat: this also disallows blanks in the pathname for the compiler, but
 dnl the nuisance of having inconsistent settings for compiler and preprocessor
@@ -731,9 +734,19 @@ case "$CC" in
        AC_MSG_RESULT(broken)
        AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
        # humor him...
-       cf_flags=`echo "$CC" | sed -e 's/^[[^   ]]*[[   ]][[    ]]*//'`
-       CC=`echo "$CC" | sed -e 's/[[   ]].*//'`
-       CF_ADD_CFLAGS($cf_flags)
+       cf_flags=`echo "$CC" | sed -e 's/^.*[[  ]]\(-[[^        ]]\)/\1/'`
+       CC=`echo "$CC " | sed -e 's/[[  ]]-[[^  ]].*$//' -e 's/[[       ]]*$//'`
+       for cf_arg in $cf_flags
+       do
+               case "x$cf_arg" in
+               (x-[[IUDfgOW]]*)
+                       CF_ADD_CFLAGS($cf_flags)
+                       ;;
+               (*)
+                       CC="$CC $cf_arg"
+                       ;;
+               esac
+       done
        CF_VERBOSE(resulting CC: '$CC')
        CF_VERBOSE(resulting CFLAGS: '$CFLAGS')
        CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS')
@@ -1579,7 +1592,7 @@ AC_ARG_ENABLE(rpath,
 AC_MSG_RESULT($cf_cv_enable_rpath)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ENABLE_STRING_HACKS version: 3 updated: 2013/01/26 16:26:12
+dnl CF_ENABLE_STRING_HACKS version: 4 updated: 2016/09/10 15:33:21
 dnl ----------------------
 dnl On a few platforms, the compiler and/or loader nags with untruthful
 dnl comments stating that "most" uses of strcat/strcpy/sprintf are incorrect,
@@ -1606,7 +1619,14 @@ AC_MSG_RESULT($with_string_hacks)
 if test "x$with_string_hacks" = "xyes"; then
        AC_DEFINE(USE_STRING_HACKS,1,[Define to 1 to work around bogus compiler/loader warnings])
        AC_MSG_WARN(enabling string-hacks to work around bogus compiler/loader warnings)
-       AC_CHECK_FUNCS( strlcat strlcpy snprintf )
+       AC_CHECK_FUNC(strlcat,,[
+               AC_CHECK_LIB(bsd,strlcat,[
+                       CF_ADD_LIB(bsd)
+                       AC_CHECK_HEADERS(bsd/string.h)
+                       AC_DEFINE(HAVE_STRLCAT,1,[Define to 1 if we have strlcat function])
+                       ])
+               ])
+       AC_CHECK_FUNCS( strlcpy snprintf )
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -2650,7 +2670,7 @@ case $cf_gnat_version in
 esac
 ])
 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
@@ -2677,7 +2697,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 <sys/types.h>],[
+#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_GPP_LIBRARY version: 12 updated: 2015/04/17 21:13:04
@@ -7812,7 +7845,7 @@ AC_SUBST(VERSIONED_SYMS)
 AC_SUBST(WILDCARD_SYMS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 50 updated: 2015/10/17 19:03:33
+dnl CF_XOPEN_SOURCE version: 52 updated: 2016/08/27 12:21:42
 dnl ---------------
 dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
 dnl or adapt to the vendor's definitions to get equivalent functionality,
@@ -7832,7 +7865,7 @@ case $host_os in
 (aix[[4-7]]*)
        cf_xopen_source="-D_ALL_SOURCE"
        ;;
-(cygwin|msys)
+(msys)
        cf_XOPEN_SOURCE=600
        ;;
 (darwin[[0-8]].*)
@@ -7860,7 +7893,7 @@ case $host_os in
        cf_xopen_source="-D_SGI_SOURCE"
        cf_XOPEN_SOURCE=
        ;;
-(linux*|gnu*|mint*|k*bsd*-gnu)
+(linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
        CF_GNU_SOURCE
        ;;
 (minix*)
@@ -7882,9 +7915,6 @@ case $host_os in
 (openbsd*)
        # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
        ;;
-(os2*)
-       cf_XOPEN_SOURCE=
-       ;;
 (osf[[45]]*)
        cf_xopen_source="-D_OSF_SOURCE"
        ;;