X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=96cae09c942cf831435fbe95f8d0749f0b80f703;hp=5f0b7a9e899ad10542d656a477a3b61697d5ade5;hb=1f474475aab29bc166012819129d46c70320efdc;hpb=9b51794524995304d8788e42aacb36feede9364f diff --git a/aclocal.m4 b/aclocal.m4 index 5f0b7a9e..96cae09c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.974 2021/08/28 20:24:23 tom Exp $ +dnl $Id: aclocal.m4,v 1.981 2021/10/17 15:14:04 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -264,9 +264,9 @@ CXXFLAGS="$CFLAGS" CFLAGS="$cf_save_CXXFLAGS" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 16 updated: 2020/12/31 20:19:42 +dnl CF_ADD_INCDIR version: 17 updated: 2021/09/04 06:35:04 dnl ------------- -dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's +dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it is dnl redundant. We don't normally need to add -I/usr/local/include for gcc, dnl but old versions (and some misinstalled ones) need that. To make things dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to @@ -415,7 +415,7 @@ ifelse([$5],NONE,,[{ test -z "$5" || test "x$5" = xNONE || test "x$4" != "x$5"; } ])dnl dnl --------------------------------------------------------------------------- -dnl CF_APPEND_CFLAGS version: 1 updated: 2021/08/28 15:20:37 +dnl CF_APPEND_CFLAGS version: 3 updated: 2021/09/05 17:25:40 dnl ---------------- dnl Use CF_ADD_CFLAGS after first checking for potential redefinitions. dnl $1 = flags to add @@ -424,10 +424,14 @@ define([CF_APPEND_CFLAGS], [ for cf_add_cflags in $1 do - CF_REMOVE_CFLAGS($cf_add_cflags,CFLAGS,[$2]) - CF_REMOVE_CFLAGS($cf_add_cflags,CPPFLAGS,[$2]) + case "x$cf_add_cflags" in + (x-[[DU]]*) + CF_REMOVE_CFLAGS($cf_add_cflags,CFLAGS,[$2]) + CF_REMOVE_CFLAGS($cf_add_cflags,CPPFLAGS,[$2]) + ;; + esac + CF_ADD_CFLAGS([$cf_add_cflags],[$2]) done -CF_ADD_CFLAGS([$1],[$2]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55 @@ -619,10 +623,10 @@ else AC_MSG_RESULT(no) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_BOOL_SIZE version: 17 updated: 2020/10/24 19:48:55 +dnl CF_BOOL_SIZE version: 18 updated: 2021/09/04 06:35:04 dnl ------------ dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type). -dnl Don't bother looking for bool.h, since it's been deprecated. +dnl Don't bother looking for bool.h, since it has been deprecated. dnl dnl If the current compiler is C rather than C++, we get the bool definition dnl from . @@ -1108,10 +1112,10 @@ fi CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2])) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_EXTERN_DATA version: 4 updated: 2015/04/18 08:56:57 +dnl CF_CHECK_EXTERN_DATA version: 5 updated: 2021/09/04 06:35:04 dnl -------------------- dnl Check for existence of external data in the current set of libraries. If -dnl we can modify it, it's real enough. +dnl we can modify it, it is real enough. dnl $1 = the name to check dnl $2 = its type AC_DEFUN([CF_CHECK_EXTERN_DATA], @@ -1879,9 +1883,9 @@ done AC_SUBST(DIRS_TO_MAKE) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57 +dnl CF_DISABLE_ECHO version: 14 updated: 2021/09/04 06:35:04 dnl --------------- -dnl You can always use "make -n" to see the actual options, but it's hard to +dnl You can always use "make -n" to see the actual options, but it is hard to dnl pick out/analyze warning messages when the compile-line is long. dnl dnl Sets: @@ -2037,7 +2041,7 @@ fi AC_SUBST(BROKEN_LINKER) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_PC_FILES version: 13 updated: 2015/11/01 05:27:39 +dnl CF_ENABLE_PC_FILES version: 14 updated: 2021/10/17 11:12:47 dnl ------------------ dnl This is the "--enable-pc-files" option, which is available if there is a dnl pkg-config configuration on the local machine. @@ -2062,7 +2066,7 @@ if test "x$enable_pc_files" != xno then MAKE_PC_FILES= case "x$PKG_CONFIG_LIBDIR" in - (xno|xyes) + (xno|xnone|xyes) AC_MSG_WARN(no PKG_CONFIG_LIBDIR was found) ;; (*) @@ -5244,10 +5248,10 @@ int main(void) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKEFLAGS version: 20 updated: 2021/01/03 19:29:49 +dnl CF_MAKEFLAGS version: 21 updated: 2021/09/04 06:47:34 dnl ------------ dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' -dnl options to lower-levels. It's very useful for "make -n" -- if we have it. +dnl options to lower-levels. It is very useful for "make -n" -- if we have it. dnl (GNU 'make' does both, something POSIX 'make', which happens to make the dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-) AC_DEFUN([CF_MAKEFLAGS], @@ -5407,7 +5411,7 @@ AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_FORMAT version: 14 updated: 2021/01/02 17:09:14 +dnl CF_MANPAGE_FORMAT version: 15 updated: 2021/09/04 06:35:04 dnl ----------------- dnl Option to allow user to override automatic configuration of manpage format. dnl There are several special cases: @@ -5443,7 +5447,7 @@ case "$MANPAGE_FORMAT" in MANPATH="/usr/man:/usr/share/man" fi - # look for the 'date' man-page (it's most likely to be installed!) + # look for the 'date' man-page (it is most likely to be installed!) MANPAGE_FORMAT= cf_preform="no" cf_catonly="yes" @@ -6311,9 +6315,11 @@ case ".[$]$1" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 11 updated: 2021/01/01 13:31:04 +dnl CF_PKG_CONFIG version: 12 updated: 2021/10/10 20:18:09 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. +dnl +dnl Sets $PKG_CONFIG to the pathname of the pkg-config program. AC_DEFUN([CF_PKG_CONFIG], [ AC_MSG_CHECKING(if you want to use pkg-config) @@ -6858,7 +6864,7 @@ case "$cf_cv_regex_hdrs" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REMOVE_CFLAGS version: 1 updated: 2021/08/28 15:20:37 +dnl CF_REMOVE_CFLAGS version: 3 updated: 2021/09/05 17:25:40 dnl ---------------- dnl Remove a given option from CFLAGS/CPPFLAGS dnl $1 = option to remove @@ -6867,25 +6873,13 @@ dnl $3 = nonempty to allow verbose message define([CF_REMOVE_CFLAGS], [ cf_tmp_cflag=`echo "x$1" | sed -e 's/^.//' -e 's/=.*//'` -cf_old_cflag="[$]$2" - -case "[$]$2" in -(*$1=*) - cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[[^ ]]*%%g"` - ;; -(*$1\ *) - cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"` - ;; -(*$1) - cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"` - ;; -esac - -if test "[$]$2" != "$cf_old_cflag" ; -then +while true +do + cf_old_cflag=`echo "x[$]$2" | sed -e 's/^.//' -e 's/[[ ]][[ ]]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[[^ ]][[^ ]]*\\)\?%%" -e 's/^[[ ]]*//' -e 's%[[ ]][[ ]]*-D% -D%g' -e 's%[[ ]][[ ]]*-I% -I%g'` + test "[$]$2" != "$cf_old_cflag" || break ifelse([$3],,,[CF_VERBOSE(removing old option $1 from $2)]) - $2="$cf_new_cflag" -fi + $2="$cf_old_cflag" +done ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 @@ -7072,7 +7066,7 @@ do done ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 106 updated: 2021/08/07 16:59:57 +dnl CF_SHARED_OPTS version: 107 updated: 2021/09/04 06:47:34 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -7096,7 +7090,7 @@ dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library dnl version numbers are infix (ex: libncurses..dylib) or postfix dnl (ex: libncurses.so.). dnl -dnl Some loaders leave 'so_locations' lying around. It's nice to clean up. +dnl Some loaders leave 'so_locations' lying around. It is nice to clean up. AC_DEFUN([CF_SHARED_OPTS], [ AC_REQUIRE([CF_LD_RPATH_OPT]) @@ -7746,7 +7740,7 @@ AC_MSG_RESULT($cf_cv_sig_atomic_t) test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t,[Define to signal global datatype]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SIZECHANGE version: 17 updated: 2021/01/01 13:31:04 +dnl CF_SIZECHANGE version: 18 updated: 2021/09/04 06:35:04 dnl ------------- dnl Check for definitions & structures needed for window size-changing dnl @@ -7777,7 +7771,7 @@ do #ifdef NEED_PTEM_H /* This is a workaround for SCO: they neglected to define struct winsize in - * termios.h -- it's only in termio.h and ptem.h + * termios.h -- it is only in termio.h and ptem.h */ #include #include @@ -9067,7 +9061,7 @@ else fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATH version: 11 updated: 2012/09/29 15:04:19 +dnl CF_WITH_PATH version: 12 updated: 2021/09/04 06:35:04 dnl ------------ dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just dnl defaulting to yes/no. @@ -9076,7 +9070,7 @@ dnl $1 = option name dnl $2 = help-text dnl $3 = environment variable to set dnl $4 = default value, shown in the help-message, must be a constant -dnl $5 = default value, if it's an expression & cannot be in the help-message +dnl $5 = default value, if it is an expression & cannot be in the help-message dnl AC_DEFUN([CF_WITH_PATH], [AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),, @@ -9088,7 +9082,7 @@ eval $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATHLIST version: 12 updated: 2021/01/01 13:31:04 +dnl CF_WITH_PATHLIST version: 13 updated: 2021/09/04 06:35:04 dnl ---------------- dnl Process an option specifying a list of colon-separated paths. dnl @@ -9096,7 +9090,7 @@ dnl $1 = option name dnl $2 = help-text dnl $3 = environment variable to set dnl $4 = default value, shown in the help-message, must be a constant -dnl $5 = default value, if it's an expression & cannot be in the help-message +dnl $5 = default value, if it is an expression & cannot be in the help-message dnl $6 = flag to tell if we want to define or substitute dnl AC_DEFUN([CF_WITH_PATHLIST],[ @@ -9212,9 +9206,18 @@ if test "x$with_pcre2" != xno ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 11 updated: 2021/01/01 16:16:30 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 13 updated: 2021/10/17 11:12:47 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. +dnl +dnl pkg-config uses a search-list built from these colon-separated lists of +dnl directories: +dnl a) $PKG_CONFIG_PATH (tested first, added if set) +dnl b) $PKG_CONFIG_LIBDIR (tested second, added if set) +dnl c) builtin-list (added if $PKG_CONFIG_LIBDIR is not set) +dnl +dnl pkgconf (used with some systems such as FreeBSD in place of pkg-config) +dnl optionally ignores $PKG_CONFIG_LIBDIR. AC_DEFUN([CF_WITH_PKG_CONFIG_LIBDIR],[ case "$PKG_CONFIG" in @@ -9226,68 +9229,98 @@ case "$PKG_CONFIG" in ;; esac -PKG_CONFIG_LIBDIR=no +cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[[ ]]*,,'` AC_ARG_WITH(pkg-config-libdir, [ --with-pkg-config-libdir=XXX use given directory for installing pc-files], - [PKG_CONFIG_LIBDIR=$withval], - [test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes]) + [cf_search_path=$withval], + [test "x$PKG_CONFIG" != xnone && cf_search_path=yes]) -case x$PKG_CONFIG_LIBDIR in +case x$cf_search_path in (x/*) ;; (xyes) + cf_search_path= + CF_VERBOSE(auto...) # Look for the library directory using the same prefix as the executable + AC_MSG_CHECKING(for search-list) if test "x$PKG_CONFIG" = xnone then cf_path=$prefix else cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'` + cf_search_path=` + "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | awk "\ +/^Scanning directory #[1-9][0-9]* '.*'$/{ \ + sub(\"^[[^']]*'\",\"\"); \ + sub(\"'.*\",\"\"); \ + printf \" %s\", \\[$]0; } \ +/trying path:/{ + sub(\"^.* trying path: \",\"\"); + sub(\" for no-such-package.*$\",\"\"); + printf \" %s\", \\[$]0; +} +{ next; } \ +"` fi - # If you don't like using the default architecture, you have to specify the - # intended library directory and corresponding compiler/linker options. - # - # This case allows for Debian's 2014-flavor of multiarch, along with the - # most common variations before that point. Some other variants spell the - # directory differently, e.g., "pkg-config", and put it in unusual places. - # pkg-config has always been poorly standardized, which is ironic... - case x`(arch) 2>/dev/null` in - (*64) - cf_search_path="\ - $cf_path/lib/*64-linux-gnu \ - $cf_path/share \ - $cf_path/lib64 \ - $cf_path/lib32 \ - $cf_path/lib" - ;; - (*) - cf_search_path="\ - $cf_path/lib/*-linux-gnu \ - $cf_path/share \ - $cf_path/lib32 \ - $cf_path/lib \ - $cf_path/libdata" - ;; - esac + if test -z "$cf_search_path" + then + # If you don't like using the default architecture, you have to specify + # the intended library directory and corresponding compiler/linker + # options. + # + # This case allows for Debian's 2014-flavor of multiarch, along with + # the most common variations before that point. Some other variants + # spell the directory differently, e.g., "pkg-config", and put it in + # unusual places. + # + # pkg-config has always been poorly standardized, which is ironic... + case x`(arch) 2>/dev/null` in + (*64) + cf_test_path="\ + $cf_path/lib/*64-linux-gnu \ + $cf_path/share \ + $cf_path/lib64 \ + $cf_path/lib32 \ + $cf_path/lib" + ;; + (*) + cf_test_path="\ + $cf_path/lib/*-linux-gnu \ + $cf_path/share \ + $cf_path/lib32 \ + $cf_path/lib \ + $cf_path/libdata" + ;; + esac + for cf_config in $cf_test_path + do + test -d "$cf_config/pkgconfig" && cf_search_path="$cf_search_path $cf_config/pkgconfig" + done + fi + + AC_MSG_RESULT($cf_search_path) - CF_VERBOSE(list...) - for cf_config in $cf_search_path - do - CF_VERBOSE(checking $cf_config/pkgconfig) - if test -d "$cf_config/pkgconfig" - then - PKG_CONFIG_LIBDIR=$cf_config/pkgconfig - AC_MSG_CHECKING(done) - break - fi - done ;; (*) ;; esac -if test "x$PKG_CONFIG_LIBDIR" != xno ; then - AC_MSG_RESULT($PKG_CONFIG_LIBDIR) +AC_MSG_CHECKING(for first directory) +cf_pkg_config_path=none +for cf_config in $cf_search_path +do + if test -d "$cf_config" + then + cf_pkg_config_path=$cf_config + break + fi +done +AC_MSG_RESULT($cf_pkg_config_path) + +if test "x$cf_pkg_config_path" != xnone ; then + # limit this to the first directory found + PKG_CONFIG_LIBDIR="$cf_pkg_config_path" fi AC_SUBST(PKG_CONFIG_LIBDIR)