]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - aclocal.m4
ncurses 6.5 - patch 20240922
[ncurses.git] / aclocal.m4
index 003bb308edaefe8b83182be7418f13c08ef82f8d..d195f32467bc17b49daffac952c88f112ce859e6 100644 (file)
@@ -29,7 +29,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.1071 2024/05/18 19:49:14 tom Exp $
+dnl $Id: aclocal.m4,v 1.1088 2024/08/11 00:17:28 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: 12 updated: 2024/03/17 09:17:26
+dnl CF_BUILD_CC version: 13 updated: 2024/06/22 13:42:22
 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:='ifelse([$1],,'${CPPFLAGS}',[$1])'}
+       : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
        : ${BUILD_LDFLAGS:='${LDFLAGS}'}
-       : ${BUILD_LIBS:='ifelse([$2],,'${LIBS}',[$2])'}
+       : ${BUILD_LIBS:='${LIBS}'}
        : ${BUILD_EXEEXT:='$x'}
        : ${BUILD_OBJEXT:='o'}
 fi
@@ -1411,7 +1411,7 @@ then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_LIBTOOL_VERSION version: 2 updated: 2021/05/01 16:24:34
+dnl CF_CHECK_LIBTOOL_VERSION version: 3 updated: 2024/06/12 04:19:01
 dnl ------------------------
 dnl Show the version of libtool
 dnl
@@ -1427,6 +1427,7 @@ then
        AC_MSG_CHECKING(version of $LIBTOOL)
        CF_LIBTOOL_VERSION
        AC_MSG_RESULT($cf_cv_libtool_version)
+       ifdef([LT_PACKAGE_VERSION],,[
        if test -n "$cf_cv_libtool_version"
        then
                cf_check_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' -e 's,[[()]],...,g' -e 's,[[ ]],-,g' -e '2,$d'`
@@ -1440,6 +1441,7 @@ then
        else
                AC_MSG_ERROR(No version found for $LIBTOOL)
        fi
+       ])
 else
        AC_MSG_ERROR(GNU libtool has not been found)
 fi
@@ -3211,13 +3213,14 @@ rm -rf ./conftest*
 AC_SUBST(EXTRA_CFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GETOPT_HEADER version: 8 updated: 2021/06/19 19:16:16
+dnl CF_GETOPT_HEADER version: 9 updated: 2024/08/10 10:30:39
 dnl ----------------
 dnl Check for getopt's variables which are commonly defined in stdlib.h,
 dnl unistd.h or (nonstandard) in getopt.h
 AC_DEFUN([CF_GETOPT_HEADER],
-[
-AC_HAVE_HEADERS(unistd.h getopt.h)
+[AC_REQUIRE([AC_HEADER_STDC])
+
+AC_CHECK_HEADERS(getopt.h)
 AC_CACHE_CHECK(for header declaring getopt variables,cf_cv_getopt_header,[
 cf_cv_getopt_header=none
 for cf_header in stdio.h stdlib.h unistd.h getopt.h
@@ -3237,6 +3240,26 @@ if test "$cf_cv_getopt_header" = getopt.h ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_GLOB_FULLPATH version: 2 updated: 2024/08/03 12:34:02
+dnl ----------------
+dnl Use this in case-statements to check for pathname syntax, i.e., absolute
+dnl pathnames.  The "x" is assumed since we provide an alternate form for DOS.
+AC_DEFUN([CF_GLOB_FULLPATH],[
+AC_REQUIRE([CF_WITH_SYSTYPE])dnl
+case "$cf_cv_system_name" in
+(cygwin*|msys*|mingw32*|mingw64|os2*)
+       GLOB_FULLPATH_POSIX='/*'
+       GLOB_FULLPATH_OTHER='[[a-zA-Z]]:[[\\/]]*'
+       ;;
+(*)
+       GLOB_FULLPATH_POSIX='/*'
+       GLOB_FULLPATH_OTHER=$GLOB_FULLPATH_POSIX
+       ;;
+esac
+AC_SUBST(GLOB_FULLPATH_POSIX)
+AC_SUBST(GLOB_FULLPATH_OTHER)
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_GNATPREP_OPT_T version: 1 updated: 2014/08/02 18:37:25
 dnl -----------------
 AC_DEFUN([CF_GNATPREP_OPT_T],[
@@ -4195,6 +4218,40 @@ fi
 AC_SUBST(INSTALL_OPT_S)
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_INSTALL_PREFIX version: 1 updated: 2024/08/10 20:16:32
+dnl -----------------
+dnl Special option for use by system-builders: the install-prefix is used to
+dnl adjust the location into which the actual install is done, so that an
+dnl archive can be built without modifying the host system's configuration.
+AC_DEFUN([CF_INSTALL_PREFIX],[
+AC_MSG_CHECKING(for an installation directory prefix)
+AC_ARG_WITH(install-prefix,
+       [  --with-install-prefix=DESTDIR use DESTDIR as installation directory prefix],
+       [case "x$withval" in
+       (xyes|xno)
+               ;;
+       (*)     DESTDIR="$withval"
+               ;;
+       esac])
+AC_MSG_RESULT([${DESTDIR:-(none)}])
+AC_SUBST(DESTDIR)
+
+AC_MSG_CHECKING(if installation directory prefix should be merged)
+CF_ARG_ENABLE(install-prefix,
+       [  --enable-install-prefix merge DESTDIR with installation prefix],
+       cf_install_prefix=yes,
+       cf_install_prefix=no)
+AC_MSG_RESULT($cf_install_prefix)
+
+if test "$cf_install_prefix" = yes ; then
+       MERGE_PREFIX=':$(prefix)%=%'
+else
+       MERGE_PREFIX=''
+fi
+
+AC_SUBST(MERGE_PREFIX)
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_INTEL_COMPILER version: 9 updated: 2023/02/18 17:41:25
 dnl -----------------
 dnl Check if the given compiler is really the Intel compiler for Linux.  It
@@ -4584,9 +4641,12 @@ CF_SUBDIR_PATH($1,$2,lib)
 $1="$cf_library_path_list [$]$1"
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LIBTOOL_VERSION version: 1 updated: 2013/04/06 18:03:09
+dnl CF_LIBTOOL_VERSION version: 2 updated: 2024/06/12 04:19:01
 dnl ------------------
 AC_DEFUN([CF_LIBTOOL_VERSION],[
+ifdef([LT_PACKAGE_VERSION],[
+       cf_cv_libtool_version=LT_PACKAGE_VERSION
+],[
 if test -n "$LIBTOOL" && test "$LIBTOOL" != none
 then
        cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'`
@@ -4595,6 +4655,7 @@ else
 fi
 test -z "$cf_cv_libtool_version" && unset cf_cv_libtool_version
 ])dnl
+])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_LIB_PREFIX version: 14 updated: 2021/01/01 13:31:04
 dnl -------------
@@ -4620,7 +4681,7 @@ ifelse($1,,,[$1=$LIB_PREFIX])
        AC_SUBST(LIB_PREFIX)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LIB_RULES version: 100 updated: 2023/06/03 15:17:30
+dnl CF_LIB_RULES version: 101 updated: 2024/08/03 13:08:58
 dnl ------------
 dnl Append definitions and rules for the given models to the subdirectory
 dnl Makefiles, and the recursion rule for the top-level Makefile.  If the
@@ -4638,6 +4699,7 @@ dnl Note: Libs_To_Make is mixed case, since it is not a pure autoconf variable.
 AC_DEFUN([CF_LIB_RULES],
 [AC_REQUIRE([AC_PROG_FGREP])dnl
 AC_REQUIRE([CF_MAKE_PHONY])dnl
+AC_REQUIRE([CF_GLOB_FULLPATH])dnl
 
 cf_prefix=$LIB_PREFIX
 AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
@@ -5163,7 +5225,7 @@ CF_EOF
 if test "$WITH_CURSES_H" = yes; then
        cat >>headers.sh <<CF_EOF
 case \$DST in
-(/*/include/*)
+($GLOB_FULLPATH_POSIX/include/*)
        END=\`basename \$DST\`
        for i in \`cat \$REF/../*/headers |${FGREP-fgrep} -v "#"\`
        do
@@ -5180,7 +5242,7 @@ CF_EOF
 else
        cat >>headers.sh <<CF_EOF
 case \$DST in
-(/*/include/*)
+($GLOB_FULLPATH_POSIX/include/*)
        END=\`basename \$DST\`
        for i in \`cat \$REF/../*/headers |${FGREP-fgrep} -v "#"\`
        do
@@ -5958,31 +6020,6 @@ AC_ARG_WITH(manpage-tbl,
 AC_MSG_RESULT($MANPAGE_TBL)
 ])dnl
 dnl ---------------------------------------------------------------------------
-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
@@ -6370,6 +6407,31 @@ then
 fi
 ])
 dnl ---------------------------------------------------------------------------
+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_MIXEDCASE_FILENAMES version: 9 updated: 2021/01/01 16:53:59
 dnl ----------------------
 dnl Check if the file-system supports mixed-case filenames.  If we're able to
@@ -6651,35 +6713,35 @@ if test -n "$cf_path_prog" ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PATH_SYNTAX version: 18 updated: 2020/12/31 18:40:20
+dnl CF_PATH_SYNTAX version: 19 updated: 2024/08/03 13:08:58
 dnl --------------
 dnl Check the argument to see that it looks like a pathname.  Rewrite it if it
 dnl begins with one of the prefix/exec_prefix variables, and then again if the
 dnl result begins with 'NONE'.  This is necessary to work around autoconf's
 dnl delayed evaluation of those symbols.
 AC_DEFUN([CF_PATH_SYNTAX],[
+AC_REQUIRE([CF_GLOB_FULLPATH])dnl
+
 if test "x$prefix" != xNONE; then
        cf_path_syntax="$prefix"
 else
        cf_path_syntax="$ac_default_prefix"
 fi
 
-case ".[$]$1" in
-(.\[$]\(*\)*|.\'*\'*)
-       ;;
-(..|./*|.\\*)
+case "x[$]$1" in
+(x\[$]\(*\)*|x\'*\'*)
        ;;
-(.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX
+(x.|x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER)
        ;;
-(.\[$]\{*prefix\}*|.\[$]\{*dir\}*)
+(x\[$]\{*prefix\}*|x\[$]\{*dir\}*)
        eval $1="[$]$1"
-       case ".[$]$1" in
-       (.NONE/*)
+       case "x[$]$1" in
+       (xNONE/*)
                $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%`
                ;;
        esac
        ;;
-(.no|.NONE/*)
+(xno|xNONE/*)
        $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%`
        ;;
 (*)
@@ -7068,15 +7130,16 @@ AC_SUBST(cf_ada_config_Ada)
 AC_SUBST(cf_ada_config_C)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PROG_INSTALL version: 10 updated: 2021/01/04 19:33:05
+dnl CF_PROG_INSTALL version: 11 updated: 2024/08/03 13:08:58
 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
-(/*)
+AC_REQUIRE([CF_GLOB_FULLPATH])dnl
+case x$INSTALL in
+(x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER)
        ;;
 (*)
        CF_DIRNAME(cf_dir,$INSTALL)
@@ -8680,12 +8743,12 @@ AC_DEFUN([CF_UPPER],
 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 10 updated: 2023/01/11 04:05:23
+dnl CF_UTF8_LIB version: 11 updated: 2024/08/10 10:23:45
 dnl -----------
 dnl Check for multibyte support, and if not found, utf8 compatibility library
 AC_DEFUN([CF_UTF8_LIB],
 [
-AC_HAVE_HEADERS(wchar.h)
+AC_CHECK_HEADERS(wchar.h)
 AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
        cf_save_LIBS="$LIBS"
        AC_TRY_LINK([
@@ -8804,7 +8867,7 @@ AC_DEFUN([CF_VERBOSE],
 CF_MSG_LOG([$1])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_VERSION_INFO version: 8 updated: 2021/01/01 13:31:04
+dnl CF_VERSION_INFO version: 9 updated: 2024/06/12 04:04:13
 dnl ---------------
 dnl Define several useful symbols derived from the VERSION file.  A separate
 dnl file is preferred to embedding the version numbers in various scripts.
@@ -8882,13 +8945,13 @@ AC_SUBST(VERSION_PATCH)
 dnl if a package name is given, define its corresponding version info.  We
 dnl need the package name to ensure that the defined symbols are unique.
 ifelse($1,,,[
-       cf_PACKAGE=$1
        PACKAGE=ifelse($2,,$1,$2)
        AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE",[Define to the package-name])
        AC_SUBST(PACKAGE)
-       CF_UPPER(cf_PACKAGE,$cf_PACKAGE)
-       AC_DEFINE_UNQUOTED(${cf_PACKAGE}_VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}")
-       AC_DEFINE_UNQUOTED(${cf_PACKAGE}_PATCHDATE,${VERSION_PATCH})
+       AH_TEMPLATE([AS_TR_CPP($1[_VERSION])],[version of package])
+       AC_DEFINE_UNQUOTED(AS_TR_CPP($1[_VERSION]),"${VERSION_MAJOR}.${VERSION_MINOR}")
+       AH_TEMPLATE([AS_TR_CPP($1[_PATCHDATE])],[patchdate of package])
+       AC_DEFINE_UNQUOTED(AS_TR_CPP($1[_PATCHDATE]),${VERSION_PATCH})
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -9632,7 +9695,7 @@ if test "x$with_pcre2" != xno ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PKG_CONFIG_LIBDIR version: 23 updated: 2023/11/22 20:48:30
+dnl CF_WITH_PKG_CONFIG_LIBDIR version: 25 updated: 2024/08/03 13:34:29
 dnl -------------------------
 dnl Allow the choice of the pkg-config library directory to be overridden.
 dnl
@@ -9646,6 +9709,7 @@ dnl pkgconf (used with some systems such as FreeBSD in place of pkg-config)
 dnl optionally ignores $PKG_CONFIG_LIBDIR.  Very old versions of pkg-config,
 dnl e.g., Solaris 10 also do not recognize $PKG_CONFIG_LIBDIR.
 AC_DEFUN([CF_WITH_PKG_CONFIG_LIBDIR],[
+AC_REQUIRE([CF_GLOB_FULLPATH])dnl
 
 case "$PKG_CONFIG" in
 (no|none|yes)
@@ -9679,10 +9743,10 @@ case "x$cf_search_path" in
        ;;
 (x)
        ;;
-(x/*\ *)
+(x$GLOB_FULLPATH_POSIX\ *|x$GLOB_FULLPATH_OTHER\ *)
        PKG_CONFIG_LIBDIR=
        ;;
-(x/*)
+(x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER)
        PKG_CONFIG_LIBDIR="$cf_search_path"
        AC_MSG_RESULT($PKG_CONFIG_LIBDIR)
        cf_search_path=
@@ -9701,7 +9765,15 @@ case "x$cf_search_path" in
                        pkg-config \
                        pkgconf
                do
-                       cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
+                       cf_raw_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null`
+                       case "$cf_raw_search_path" in
+                       (*\\*)
+                               cf_search_path=`echo "$cf_raw_search_path" | tr ';' ' ' | tr '\' '/'`
+                               ;;
+                       (*/*)
+                               cf_search_path=`echo "$cf_raw_search_path" | tr : ' '`
+                               ;;
+                       esac
                        test -n "$cf_search_path" && break
                done
 
@@ -9921,7 +9993,7 @@ CF_NO_LEAKS_OPTION(valgrind,
        [USE_VALGRIND])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_VERSIONED_SYMS version: 13 updated: 2023/12/03 09:24:04
+dnl CF_WITH_VERSIONED_SYMS version: 14 updated: 2024/08/03 12:34:02
 dnl ----------------------
 dnl Use this when building shared library with ELF, to markup symbols with the
 dnl version identifier from the given input file.  Generally that identifier is
@@ -9931,6 +10003,7 @@ dnl $1 = basename of the ".map" file (default $PACKAGE)
 AC_DEFUN([CF_WITH_VERSIONED_SYMS],
 [AC_REQUIRE([AC_PROG_FGREP])dnl
 AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([CF_GLOB_FULLPATH])dnl
 
 AC_MSG_CHECKING(if versioned-symbols file should be used)
 AC_ARG_WITH(versioned-syms,
@@ -9944,7 +10017,7 @@ case "x$with_versioned_syms" in
        ;;
 (xno)
        ;;
-(x/*)
+(x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER)
        test -f "$with_versioned_syms" || AC_MSG_ERROR(expected a filename: $with_versioned_syms)
        ;;
 (*)