X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=ef2a607a23d6612904516b2d4008c9400a0df44d;hp=a2bde8155b2274f2cca8b3d4876096be67eff0e9;hb=8d8a3537cd58af7879c6e1921235daeed2b74926;hpb=df51c7005b77c6dcc78565d8cc87f8f68a8525c2 diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index a2bde815..ef2a607a 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 2010-2017,2018 Free Software Foundation, Inc. * +dnl Copyright (c) 2010-2018,2019 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.136 2018/08/18 20:38:26 tom Exp $ +dnl $Id: aclocal.m4,v 1.146 2019/09/21 22:12:40 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -677,6 +677,22 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_CHECK_GNAT_VERSION version: 1 updated: 2019/09/21 18:08:42 +dnl --------------------- +AC_DEFUN([CF_CHECK_GNAT_VERSION], +[ +AC_REQUIRE([CF_GNAT_VERSION]) +case $cf_gnat_version in +(3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*|20[[0-9]][[0-9]]) + cf_cv_prog_gnat_correct=yes + ;; +(*) + AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.) + cf_cv_prog_gnat_correct=no + ;; +esac +]) +dnl --------------------------------------------------------------------------- dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines @@ -710,6 +726,60 @@ cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" fi ]) dnl --------------------------------------------------------------------------- +dnl CF_CONST_X_STRING version: 1 updated: 2019/04/08 17:50:29 +dnl ----------------- +dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most +dnl character-strings. +dnl +dnl It is ambiguous because the specification accommodated the pre-ANSI +dnl compilers bundled by more than one vendor in lieu of providing a standard C +dnl compiler other than by costly add-ons. Because of this, the specification +dnl did not take into account the use of const for telling the compiler that +dnl string literals would be in readonly memory. +dnl +dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to +dnl let the compiler decide how to represent Xt's strings which were #define'd. +dnl That does not solve the problem of using the block of Xt's strings which +dnl are compiled into the library (and is less efficient than one might want). +dnl +dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both +dnl when compiling the library and compiling using the library, to tell the +dnl compiler that String is const. +AC_DEFUN([CF_CONST_X_STRING], +[ +AC_TRY_COMPILE( +[ +#include +#include +], +[String foo = malloc(1)],[ + +AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ + AC_TRY_COMPILE( + [ +#define _CONST_X_STRING /* X11R7.8 (perhaps) */ +#undef XTSTRINGDEFINES /* X11R5 and later */ +#include +#include + ],[String foo = malloc(1); *foo = 0],[ + cf_cv_const_x_string=no + ],[ + cf_cv_const_x_string=yes + ]) +]) + +case $cf_cv_const_x_string in +(no) + CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES) + ;; +(*) + CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING) + ;; +esac + +]) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_CURSES_HEADER version: 5 updated: 2015/04/23 20:35:30 dnl ---------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common @@ -1100,9 +1170,10 @@ rm -rf conftest* fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33 +dnl CF_GCC_VERSION version: 8 updated: 2019/09/07 13:38:36 dnl -------------- -dnl Find version of gcc +dnl Find version of gcc, and (because icc/clang pretend to be gcc without being +dnl compatible), attempt to determine if icc/clang is actually used. AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none @@ -1112,9 +1183,11 @@ if test "$GCC" = yes ; then test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi +CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) +CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 33 updated: 2018/06/20 20:23:13 +dnl CF_GCC_WARNINGS version: 36 updated: 2019/09/07 13:38:36 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: @@ -1136,14 +1209,11 @@ dnl AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) -CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) -CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) - +if test "x$have_x" = xyes; then CF_CONST_X_STRING fi cat > conftest.$ac_ext <&1 | \ +AC_CACHE_CHECK(for ifelse($2,,gnat,$2) version, cf_gnat_version,[ +cf_gnat_version=`ifelse($2,,${cf_ada_make:-gnatmake},$2) --version 2>&1 | \ grep '[[0-9]].[[0-9]][[0-9]]*' |\ sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` -AC_MSG_RESULT($cf_gnat_version) - -case $cf_gnat_version in -(3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*|20[[0-9]][[0-9]]) - cf_cv_prog_gnat_correct=yes - ;; -(*) - AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.) - cf_cv_prog_gnat_correct=no - ;; -esac ]) +test -z "$cf_gnat_version" && cf_gnat_version=no +ifelse($1,,,[eval $1=$cf_gnat_version; unset cf_gnat_version]) +])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNU_SOURCE version: 9 updated: 2018/06/20 20:23:13 +dnl CF_GNU_SOURCE version: 10 updated: 2018/12/10 20:09:41 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 @@ -1527,6 +1587,8 @@ AC_CACHE_CHECK(if this is the GNU C library,cf_cv_gnu_library,[ AC_TRY_COMPILE([#include ],[ #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 return 0; + #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 + return 0; #else # error not GNU C library #endif], @@ -1537,13 +1599,16 @@ AC_TRY_COMPILE([#include ],[ if test x$cf_cv_gnu_library = xyes; then # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE - # was changed to help a little... + # was changed to help a little. newlib incorporated the change about 4 + # years later. AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[ cf_save="$CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) AC_TRY_COMPILE([#include ],[ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) return 0; + #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) + return 0; #else # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old #endif], @@ -2867,7 +2932,7 @@ fi AC_SUBST(PKG_CONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 10 updated: 2018/06/20 20:23:13 +dnl CF_POSIX_C_SOURCE version: 11 updated: 2018/12/31 20:46:17 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -2882,7 +2947,10 @@ dnl dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], -[ +[AC_REQUIRE([CF_POSIX_VISIBLE])dnl + +if test "$cf_cv_posix_visible" = no; then + cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" @@ -2939,6 +3007,35 @@ if test "$cf_cv_posix_c_source" != no ; then CF_ADD_CFLAGS($cf_cv_posix_c_source) fi +fi # cf_cv_posix_visible + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_POSIX_VISIBLE version: 1 updated: 2018/12/31 20:46:17 +dnl ---------------- +dnl POSIX documents test-macros which an application may set before any system +dnl headers are included to make features available. +dnl +dnl Some BSD platforms (originally FreeBSD, but copied by a few others) +dnl diverged from POSIX in 2002 by setting symbols which make all of the most +dnl recent features visible in the system header files unless the application +dnl overrides the corresponding test-macros. Doing that introduces portability +dnl problems. +dnl +dnl This macro makes a special check for the symbols used for this, to avoid a +dnl conflicting definition. +AC_DEFUN([CF_POSIX_VISIBLE], +[ +AC_CACHE_CHECK(if the POSIX test-macros are already defined,cf_cv_posix_visible,[ +AC_TRY_COMPILE([#include ],[ +#if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ + && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ + && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ + && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) +#error conflicting symbols found +#endif +],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes]) +]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22 @@ -3051,38 +3148,40 @@ AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT",[Define to the program extension (normally blank)]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_INSTALL version: 7 updated: 2015/04/18 08:56:57 -dnl --------------- -dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the -dnl misc/tabset install won't work properly. Usually this happens only when -dnl using the fallback mkinstalldirs script -AC_DEFUN([CF_PROG_INSTALL], -[AC_PROG_INSTALL -case $INSTALL in -(/*) - ;; -(*) - CF_DIRNAME(cf_dir,$INSTALL) - test -z "$cf_dir" && cf_dir=. - INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'` - ;; -esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PROG_GNAT version: 6 updated: 2018/01/16 16:45:49 +dnl CF_PROG_GNAT version: 9 updated: 2019/09/21 18:08:42 dnl ------------ -dnl Check for gnatmake, ensure that it is complete. +dnl Check for gnat/gnatmake/etc, ensure that the toolset is complete. AC_DEFUN([CF_PROG_GNAT],[ -cf_ada_make=gnatmake -cf_ada_config="#" -AC_CHECK_PROG(gnatmake_exists, $cf_ada_make, yes, no) -if test "$ac_cv_prog_gnatmake_exists" = no; then +for cf_prog_gnat in gnat gnatmake gprconfig gprbuild +do + CF_UPPER(cf_upper_prog_gnat,${cf_prog_gnat}) + + unset ac_cv_path_cf_TEMP_gnat + unset cf_TEMP_gnat + AC_PATH_PROG(cf_TEMP_gnat,$cf_prog_gnat,no) + eval cf_cv_PATH_$cf_upper_prog_gnat=[$]ac_cv_path_cf_TEMP_gnat + + if test "x$cf_TEMP_gnat" != xno; then + unset cf_gnat_version + unset cf_TEMP_gnat + CF_GNAT_VERSION(cf_TEMP_gnat,$cf_prog_gnat) + fi + eval cf_cv_VERSION_$cf_upper_prog_gnat=[$]cf_TEMP_gnat + + unset cf_TEMP_gnat + unset cf_gnat_version + unset ac_cv_path_cf_TEMP_gnat +done + +if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then cf_ada_make= cf_cv_prog_gnat_correct=no else - AC_CHECK_PROG(gprconfig_exists, gprconfig, yes, no) - if test "$ac_cv_prog_gprconfig_exists" = yes - then + cf_ada_make=gnatmake + if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then + # gprconfig is newer than gnatmake; we can continue... + cf_ada_config="##" + else rm -rf conftest* *~conftest* if mkdir conftest.src then @@ -3091,7 +3190,20 @@ else for cf_gprconfig in Ada C do AC_MSG_CHECKING(for gprconfig name for $cf_gprconfig) - cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig 2>&AC_FD_CC | ${AWK:-awk} '/^\*/{print [$]3;}' | head -n 1` + if test $cf_gprconfig = C + then + for cf_gprconfig_param in \ + $cf_gprconfig,,,,GNATGCC \ + $cf_gprconfig,,,,GCC \ + $cf_gprconfig + do + cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&AC_FD_CC | ${AWK:-awk} '/^\*/{print [$]3;}' | head -n 1` + test -n "$cf_gprconfig_value" && break + done + else + cf_gprconfig_param=$cf_gprconfig + cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&AC_FD_CC | ${AWK:-awk} '/^\*/{print [$]3;}' | head -n 1` + fi if test -n "$cf_gprconfig_value" then eval cf_ada_config_[$]cf_gprconfig=[$]cf_gprconfig_value @@ -3105,17 +3217,15 @@ else cd .. rm -rf conftest* *~conftest* fi - else - # gprconfig is newer than gnatmake; we can continue... - cf_ada_config="##" fi if test "x$cf_ada_config" != "x#" then CF_GNAT_VERSION + CF_CHECK_GNAT_VERSION AC_CHECK_PROG(M4_exists, m4, yes, no) if test "$ac_cv_prog_M4_exists" = no; then cf_cv_prog_gnat_correct=no - echo Ada95 binding required program m4 not found. Ada95 binding disabled. + AC_MSG_WARN(Ada95 binding required program m4 not found. Ada95 binding disabled) fi if test "$cf_cv_prog_gnat_correct" = yes; then AC_MSG_CHECKING(if GNAT works) @@ -3127,7 +3237,9 @@ begin Text_IO.Put ("Hello World"); Text_IO.New_Line; GNAT.OS_Lib.OS_Exit (0); -end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) +end conftest;], +[cf_cv_prog_gnat_correct=yes], +[cf_cv_prog_gnat_correct=no]) AC_MSG_RESULT($cf_cv_prog_gnat_correct) fi else @@ -3141,6 +3253,24 @@ AC_SUBST(cf_ada_config_Ada) AC_SUBST(cf_ada_config_C) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_PROG_INSTALL version: 7 updated: 2015/04/18 08:56:57 +dnl --------------- +dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the +dnl misc/tabset install won't work properly. Usually this happens only when +dnl using the fallback mkinstalldirs script +AC_DEFUN([CF_PROG_INSTALL], +[AC_PROG_INSTALL +case $INSTALL in +(/*) + ;; +(*) + CF_DIRNAME(cf_dir,$INSTALL) + test -z "$cf_dir" && cf_dir=. + INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'` + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37 dnl ------------ dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f" @@ -3875,6 +4005,27 @@ AC_SUBST(ADA_INCLUDE) AC_MSG_RESULT($ADA_INCLUDE) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_LIBNAME version: 1 updated: 2019/09/07 18:59:41 +dnl ------------------- +dnl CF_WITH_ADA_LIBNAME +dnl ------------------- +dnl Command-line option to specify how to name the resulting Ada library. +dnl $1 = default value +AC_DEFUN([CF_WITH_ADA_LIBNAME],[ +AC_MSG_CHECKING(for ada-libname) +AC_ARG_WITH(ada-libname, + [ --with-ada-libname=XXX override default Ada library-name], + ADA_LIBNAME=[$]withval, + ADA_LIBNAME=$1) +case "x$ADA_LIBNAME" in +(x|xyes|xno) + ADA_LIBNAME=$1 + ;; +esac +AC_SUBST(ADA_LIBNAME) +AC_MSG_RESULT($ADA_LIBNAME) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58 dnl ------------------- dnl Command-line option to specify where Ada objects will install. @@ -4141,7 +4292,7 @@ AC_ARG_WITH(system-type, ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 53 updated: 2018/06/16 18:58:58 +dnl CF_XOPEN_SOURCE version: 55 updated: 2018/12/31 20:46:17 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, @@ -4152,6 +4303,9 @@ dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([CF_POSIX_VISIBLE]) + +if test "$cf_cv_posix_visible" = no; then cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) @@ -4171,7 +4325,7 @@ case $host_os in cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; -(freebsd*|dragonfly*) +(freebsd*|dragonfly*|midnightbsd*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L @@ -4266,4 +4420,5 @@ make an error CF_TRY_XOPEN_SOURCE fi fi +fi # cf_cv_posix_visible ])