X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=5636b3cd9c105beb423da1e4aa77a0a71ac64dd0;hb=18c5cff3297b96ac5988a716c66b374734a7de90;hp=c675b6a310b78d9a57a7e50d74cb32b3afe2e795;hpb=461e72d1826483cb2c2cb243412f2dc5b00b2b1a;p=ncurses.git diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index c675b6a3..5636b3cd 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright 2018-2020,2021 Thomas E. Dickey * +dnl Copyright 2018-2021,2022 Thomas E. Dickey * dnl Copyright 2010-2017,2018 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.191 2021/11/20 19:58:23 tom Exp $ +dnl $Id: aclocal.m4,v 1.196 2022/10/02 23:55:56 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -477,7 +477,7 @@ fi AC_SUBST(ARFLAGS) ]) dnl --------------------------------------------------------------------------- -dnl CF_BUILD_CC version: 9 updated: 2021/01/02 09:31:20 +dnl CF_BUILD_CC version: 10 updated: 2022/09/24 16:36:41 dnl ----------- dnl If we're cross-compiling, allow the user to override the tools and their dnl options. The configure script is oriented toward identifying the host @@ -543,7 +543,30 @@ if test "$cross_compiling" = yes ; then : ${BUILD_CC:='${CC}'} - if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then + AC_MSG_CHECKING(if the build-compiler "$BUILD_CC" works) + + cf_save_crossed=$cross_compiling + cf_save_ac_link=$ac_link + cross_compiling=no + ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $BUILD_CPPFLAGS $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&AS_MESSAGE_LOG_FD' + + AC_TRY_RUN([#include + int main(int argc, char *argv[]) + { + ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0); + } + ], + cf_ok_build_cc=yes, + cf_ok_build_cc=no, + cf_ok_build_cc=unknown) + + cross_compiling=$cf_save_crossed + ac_link=$cf_save_ac_link + + AC_MSG_RESULT($cf_ok_build_cc) + + if test "$cf_ok_build_cc" != yes + then AC_MSG_ERROR([Cross-build requires two compilers. Use --with-build-cc to specify the native compiler.]) fi @@ -1329,7 +1352,7 @@ AC_DEFUN([CF_FIXUP_ADAFLAGS],[ AC_MSG_RESULT($ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FIX_WARNINGS version: 3 updated: 2020/12/31 18:40:20 +dnl CF_FIX_WARNINGS version: 4 updated: 2021/12/16 18:22:31 dnl --------------- dnl Warning flags do not belong in CFLAGS, CPPFLAGS, etc. Any of gcc's dnl "-Werror" flags can interfere with configure-checks. Those go into @@ -1341,11 +1364,13 @@ if test "$GCC" = yes || test "$GXX" = yes then case [$]$1 in (*-Werror=*) - CF_VERBOSE(repairing $1: [$]$1) cf_temp_flags= for cf_temp_scan in [$]$1 do case "x$cf_temp_scan" in + (x-Werror=format*) + CF_APPEND_TEXT(cf_temp_flags,$cf_temp_scan) + ;; (x-Werror=*) CF_APPEND_TEXT(EXTRA_CFLAGS,$cf_temp_scan) ;; @@ -1354,9 +1379,13 @@ then ;; esac done - $1="$cf_temp_flags" - CF_VERBOSE(... fixed [$]$1) - CF_VERBOSE(... extra $EXTRA_CFLAGS) + if test "x[$]$1" != "x$cf_temp_flags" + then + CF_VERBOSE(repairing $1: [$]$1) + $1="$cf_temp_flags" + CF_VERBOSE(... fixed [$]$1) + CF_VERBOSE(... extra $EXTRA_CFLAGS) + fi ;; esac fi @@ -4517,34 +4546,20 @@ top_builddir=ifelse($1,,`pwd`,$1) AC_SUBST(top_builddir) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_TRY_XOPEN_SOURCE version: 3 updated: 2021/08/28 15:20:37 +dnl CF_TRY_XOPEN_SOURCE version: 4 updated: 2022/09/10 15:16:16 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. AC_DEFUN([CF_TRY_XOPEN_SOURCE],[ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ - AC_TRY_COMPILE([ -#include -#include -#include -],[ -#ifndef _XOPEN_SOURCE -make an error -#endif], + AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY, [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE) - AC_TRY_COMPILE([ -#include -#include -#include -],[ -#ifdef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) - CPPFLAGS="$cf_save" + AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY, + [cf_cv_xopen_source=no], + [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) + CPPFLAGS="$cf_save" ]) ]) @@ -4802,7 +4817,7 @@ eval $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 19 updated: 2021/11/20 14:57:36 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 20 updated: 2022/01/29 17:03:42 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. dnl @@ -4834,7 +4849,7 @@ AC_ARG_WITH(pkg-config-libdir, [cf_search_path=$withval], [test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir]) -case x$cf_search_path in +case "x$cf_search_path" in (xlibdir) PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' AC_MSG_RESULT($PKG_CONFIG_LIBDIR) @@ -4842,6 +4857,9 @@ case x$cf_search_path in ;; (x) ;; +(x/*\ *) + PKG_CONFIG_LIBDIR= + ;; (x/*) PKG_CONFIG_LIBDIR="$cf_search_path" AC_MSG_RESULT($PKG_CONFIG_LIBDIR) @@ -4996,7 +5014,7 @@ AC_ARG_WITH(system-type, ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 59 updated: 2021/08/28 15:20:37 +dnl CF_XOPEN_SOURCE version: 62 updated: 2022/10/02 19:55:56 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, @@ -5047,7 +5065,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) +(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) @@ -5096,7 +5114,13 @@ case "$host_os" in ;; (*) CF_TRY_XOPEN_SOURCE + cf_save_xopen_cppflags="$CPPFLAGS" CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) + # Some of these niche implementations use copy/paste, double-check... + CF_VERBOSE(checking if _POSIX_C_SOURCE inteferes) + AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY,,[ + AC_MSG_WARN(_POSIX_C_SOURCE definition is not usable) + CPPFLAGS="$cf_save_xopen_cppflags"]) ;; esac @@ -5140,3 +5164,23 @@ dnl ------------------ dnl Trim something using sed, then trim extra whitespace dnl $1 = extra parameters, e.g., in CF_STRIP_G_OPT define([CF__SED_TRIMBLANKS],[sed ifelse($1,,,[$1] )-e 's%[[ ]]% %g' -e 's% [[ ]]*% %g' -e 's%^ %%' -e 's% [$]%%'])dnl +dnl --------------------------------------------------------------------------- +dnl CF__XOPEN_SOURCE_BODY version: 1 updated: 2022/09/10 15:17:35 +dnl --------------------- +dnl body of test when test-compiling for _XOPEN_SOURCE check +define([CF__XOPEN_SOURCE_BODY], +[ +#ifndef _XOPEN_SOURCE +make an error +#endif +]) +dnl --------------------------------------------------------------------------- +dnl CF__XOPEN_SOURCE_HEAD version: 1 updated: 2022/09/10 15:17:03 +dnl --------------------- +dnl headers to include when test-compiling for _XOPEN_SOURCE check +define([CF__XOPEN_SOURCE_HEAD], +[ +#include +#include +#include +])