]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - aclocal.m4
ncurses 6.5 - patch 20240525
[ncurses.git] / aclocal.m4
index b2b9c3f8f50f81125371883883bf1b4d96c9d933..003bb308edaefe8b83182be7418f13c08ef82f8d 100644 (file)
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright 2018-2022,2023 Thomas E. Dickey                                *
+dnl Copyright 2018-2023,2024 Thomas E. Dickey                                *
 dnl Copyright 1998-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 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.1062 2023/12/04 00:39:37 tom Exp $
+dnl $Id: aclocal.m4,v 1.1071 2024/05/18 19:49:14 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -741,7 +741,7 @@ if test "$cf_cv_type_of_bool" = unknown ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_BUILD_CC version: 11 updated: 2022/12/04 15:40:08
+dnl CF_BUILD_CC version: 12 updated: 2024/03/17 09:17:26
 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
@@ -841,9 +841,9 @@ else
        : ${BUILD_CC:='${CC}'}
        : ${BUILD_CPP:='${CPP}'}
        : ${BUILD_CFLAGS:='${CFLAGS}'}
-       : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
+       : ${BUILD_CPPFLAGS:='ifelse([$1],,'${CPPFLAGS}',[$1])'}
        : ${BUILD_LDFLAGS:='${LDFLAGS}'}
-       : ${BUILD_LIBS:='${LIBS}'}
+       : ${BUILD_LIBS:='ifelse([$2],,'${LIBS}',[$2])'}
        : ${BUILD_EXEEXT:='$x'}
        : ${BUILD_OBJEXT:='o'}
 fi
@@ -2623,19 +2623,36 @@ else
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_FUNC_GETTIME version: 2 updated: 2023/02/25 08:45:56
+dnl CF_FUNC_GETTIME version: 3 updated: 2024/05/11 13:40:02
 dnl ---------------
 dnl Check for gettimeofday or clock_gettime.  In 2023, the former is still more
 dnl widely supported, but "deprecated" (2008), so we will use the latter if it
 dnl is available, to reduce compiler warnings.
 AC_DEFUN([CF_FUNC_GETTIME],[
-AC_CACHE_CHECK(for clock_gettime,cf_cv_func_clock_gettime,[
-               AC_TRY_LINK([#include <time.h>],
+cf_save_libs="$LIBS"
+AC_CHECK_FUNC(clock_gettime,
+       cf_cv_test_clock_gettime=yes,
+       AC_CHECK_LIB(rt, clock_gettime,
+               [LIBS="-lrt $LIBS"
+                cf_cv_test_clock_gettime=yes],
+                cf_cv_test_clock_gettime=no))
+
+if test "$cf_cv_test_clock_gettime" = yes ; then
+AC_CACHE_CHECK(if clock_gettime links,cf_cv_func_clock_gettime,[
+               AC_TRY_LINK([
+$ac_includes_default
+#include <time.h>
+               ],
                [struct timespec ts;
-               int rc = clock_gettime(CLOCK_REALTIME, &ts); (void) rc; (void)ts],
+               int rc = clock_gettime(CLOCK_REALTIME, &ts)
+                          + clock_gettime(CLOCK_MONOTONIC, &ts);
+                (void) rc; (void)ts],
                [cf_cv_func_clock_gettime=yes],
                [cf_cv_func_clock_gettime=no])
 ])
+else
+       cf_cv_func_clock_gettime=no
+fi
 
 if test "$cf_cv_func_clock_gettime" = yes
 then
@@ -5681,7 +5698,7 @@ AC_SUBST(MAKE_UPPER_TAGS)
 AC_SUBST(MAKE_LOWER_TAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MANPAGE_FORMAT version: 18 updated: 2023/05/19 18:35:02
+dnl CF_MANPAGE_FORMAT version: 19 updated: 2024/03/30 08:27:40
 dnl -----------------
 dnl Option to allow user to override automatic configuration of manpage format.
 dnl There are several special cases:
@@ -5799,6 +5816,7 @@ cf_manpage_format=no
 cf_manpage_inboth=no
 cf_manpage_so_strip=
 cf_manpage_compress=
+cf_manpage_coptions=
 
 for cf_item in $MANPAGE_FORMAT
 do
@@ -5818,6 +5836,7 @@ case "$cf_item" in
 (gzip)
        cf_manpage_so_strip="gz"
        cf_manpage_compress=gzip
+       cf_manpage_coptions=-n
        ;;
 (bzip2)
        cf_manpage_so_strip="bz2"
@@ -5834,6 +5853,7 @@ AC_SUBST(cf_manpage_format)
 AC_SUBST(cf_manpage_inboth)
 AC_SUBST(cf_manpage_so_strip)
 AC_SUBST(cf_manpage_compress)
+AC_SUBST(cf_manpage_coptions)
 
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -5938,7 +5958,32 @@ AC_ARG_WITH(manpage-tbl,
 AC_MSG_RESULT($MANPAGE_TBL)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MAN_PAGES version: 58 updated: 2023/07/28 20:13:29
+dnl CF_MB_LEN_MAX version: 1 updated: 2024/03/02 15:45:10
+dnl -------------
+dnl Check if <limits.h> defines a usable MB_LEN_MAX.  That may be because it is
+dnl not defined, or it may be a bogus value.
+AC_DEFUN([CF_MB_LEN_MAX],[
+AC_CACHE_CHECK(if MB_LEN_MAX is usable,cf_cv_mb_len_max,[
+AC_TRY_COMPILE([
+$ac_includes_default
+#include <limits.h>],
+[
+#if defined(MB_LEN_MAX) && MB_LEN_MAX >= 6
+       ${cf_cv_main_return:-return}(0);
+#else
+#error MB_LEN_MAX is not usable
+#endif
+],     [cf_cv_mb_len_max=yes],
+       [cf_cv_mb_len_max=no])])
+if test "$cf_cv_mb_len_max" = yes
+then
+       AC_DEFINE(HAVE_CONSISTENT_MB_LEN_MAX,1,[Define to 1 if MB_LEN_MAX is usable])
+else
+       AC_MSG_WARN(MB_LEN_MAX is missing/inconsistent in system headers)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MAN_PAGES version: 59 updated: 2024/03/30 08:27:40
 dnl ------------
 dnl Try to determine if the man-pages on the system are compressed, and if
 dnl so, what format is used.  Use this information to construct a script that
@@ -6212,7 +6257,7 @@ CF_EOF
 if test -n "$cf_manpage_compress" ; then
 cat >>$cf_edit_man <<CF_EOF
                                                if test -n "$cf_manpage_so_strip" ; then
-                                                       "$cf_manpage_compress" -f \$TMP
+                                                       "$cf_manpage_compress" $cf_manpage_coptions -f \$TMP
                                                        mv \$TMP.$cf_manpage_so_strip \$TMP
                                                fi
 CF_EOF
@@ -7395,7 +7440,7 @@ do
 done
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 109 updated: 2023/12/03 09:21:34
+dnl CF_SHARED_OPTS version: 111 updated: 2024/03/29 20:08:49
 dnl --------------
 dnl --------------
 dnl Attempt to determine the appropriate CC/LD options for creating a shared
@@ -7855,11 +7900,11 @@ CF_EOF
                # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
                # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
                if test "$DFT_LWR_MODEL" = "shared" ; then
-                       LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
+                       LOCAL_LDFLAGS="-R\$(LOCAL_LIBDIR):\${libdir}"
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
                fi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="-R\${libdir} $EXTRA_LDFLAGS"
                fi
                CF_SHARED_SONAME
                if test "$GCC" != yes; then
@@ -7871,9 +7916,9 @@ CF_EOF
                        done
                        CFLAGS="$cf_save_CFLAGS"
                        CC_SHARED_OPTS=$cf_shared_opts
-                       MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -'$cf_cv_shared_soname' -o $[@]'
+                       MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $[@]'
                else
-                       MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -'$cf_cv_shared_soname' -o $[@]'
+                       MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $[@]'
                fi
                ;;
        (sysv5uw7*|unix_sv*)
@@ -8973,6 +9018,56 @@ $1_ABI=$cf_cv_abi_version
 cf_cv_abi_default=$cf_cv_abi_version
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_WITH_ADA version: 1 updated: 2024/05/18 13:55:23
+dnl -----------
+dnl Check for the Ada compiler (unless requested to not do this), which causes
+dnl a further check for a C compiler which can work with the Ada compiler.
+AC_DEFUN([CF_WITH_ADA],[
+AC_ARG_WITH(ada,
+       [  --without-ada           suppress check for Ada compiler],
+       [cf_with_ada=$withval],
+       [cf_with_ada=yes])
+
+cf_prog_cc="gcc cc"
+if test "x$cf_with_ada" = xyes
+then
+       CF_PROG_GNAT
+       if test "x$cf_cv_prog_gnat_correct" = xyes; then
+               # gcc's developers chose to deprecate gnatgcc before making gprconfig
+               # work.  They replaced gnatgcc in gcc 13 with a script which spits out
+               # a warning offering advice which could never work.
+               #
+               # Here is a workaround.
+               AC_PATH_PROG(cf_cv_path_gnatgcc,gnatgcc,no)
+               if test "$cf_cv_path_gnatgcc" != no
+               then
+                       AC_MSG_CHECKING(for improvement) 
+                       cf_file_gnatgcc=`file -L "$cf_cv_path_gnatgcc" 2>/dev/null`
+                       case "x$cf_file_gnatgcc" in
+                       (*script*)
+                               cf_cv_path_gnatgcc=`sh -x "$cf_cv_path_gnatgcc" --version 2>&1 | grep -w exec | sed -e 's/^[[   ]]*+[[  ]]*//' -e 's/exec[[     ]]//' -e 's/ .*//'`
+                               ;;
+                       (*)
+                               cf_cv_path_gnatgcc=no
+                               ;;
+                       esac
+                       AC_MSG_RESULT($cf_cv_path_gnatgcc)
+                       test "$cf_cv_path_gnatgcc" = no && cf_cv_path_gnatgcc=gnatgcc
+                       cf_prog_cc="$cf_cv_path_gnatgcc $cf_prog_cc"
+               fi
+       fi
+fi
+case "$cf_prog_cc" in
+(*/*)
+       CC="$cf_prog_cc"
+       AC_SUBST(CC)
+       ;;
+(*)
+       CF_PROG_CC($cf_prog_cc)
+       ;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_WITH_ADA_COMPILER version: 3 updated: 2023/10/28 11:59:01
 dnl --------------------
 dnl Command-line option to specify the Ada95 compiler.