X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=59b81a2aa62b6418865deead973fec7d70b4c7e0;hp=b2bfcd5fe9746c895ec37f95d4b7e37de33487bd;hb=0af9283ca273c267ee6036c3b88115d9ba6d55a6;hpb=7f4b9f390624835ceb0849965a7f6ff2dcb39d00 diff --git a/aclocal.m4 b/aclocal.m4 index b2bfcd5f..59b81a2a 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.958 2021/04/18 18:12:13 tom Exp $ +dnl $Id: aclocal.m4,v 1.972 2021/08/07 21:01:11 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -1328,21 +1328,34 @@ if test "$cf_cv_check_gpm_wgetch" != yes ; then fi ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_LIBTOOL_VERSION version: 1 updated: 2013/04/06 18:03:09 +dnl CF_CHECK_LIBTOOL_VERSION version: 2 updated: 2021/05/01 16:24:34 dnl ------------------------ dnl Show the version of libtool dnl dnl Save the version in a cache variable - this is not entirely a good thing, dnl but the version string from libtool is very ugly, and for bug reports it dnl might be useful to have the original string. +dnl +dnl There is an imitation in OpenBSD, which has no apparent use other than to +dnl deny that it is GNU libtool. Just ignore it. AC_DEFUN([CF_CHECK_LIBTOOL_VERSION],[ if test -n "$LIBTOOL" && test "$LIBTOOL" != none then AC_MSG_CHECKING(version of $LIBTOOL) CF_LIBTOOL_VERSION AC_MSG_RESULT($cf_cv_libtool_version) - if test -z "$cf_cv_libtool_version" ; then - AC_MSG_ERROR(This is not GNU libtool) + 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'` + case "x$cf_check_libtool_version" in + (*...GNU-libtool...*) + ;; + (*) + AC_MSG_ERROR(This is not GNU libtool) + ;; + esac + else + AC_MSG_ERROR(No version found for $LIBTOOL) fi else AC_MSG_ERROR(GNU libtool has not been found) @@ -1590,7 +1603,7 @@ if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_CONST_X_STRING version: 6 updated: 2021/01/01 13:31:04 +dnl CF_CONST_X_STRING version: 7 updated: 2021/06/07 17:39:17 dnl ----------------- dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most dnl character-strings. @@ -1620,7 +1633,7 @@ AC_TRY_COMPILE( #include #include ], -[String foo = malloc(1); (void)foo],[ +[String foo = malloc(1); free((void*)foo)],[ AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ AC_TRY_COMPILE( @@ -2951,7 +2964,7 @@ rm -rf ./conftest* AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GETOPT_HEADER version: 7 updated: 2021/01/01 13:31:04 +dnl CF_GETOPT_HEADER version: 8 updated: 2021/06/19 19:16:16 dnl ---------------- dnl Check for getopt's variables which are commonly defined in stdlib.h, dnl unistd.h or (nonstandard) in getopt.h @@ -2964,7 +2977,7 @@ for cf_header in stdio.h stdlib.h unistd.h getopt.h do AC_TRY_COMPILE([ #include <$cf_header>], -[int x = optind; char *y = optarg], +[int x = optind; char *y = optarg; (void)x; (void)y], [cf_cv_getopt_header=$cf_header break]) done @@ -4289,7 +4302,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 95 updated: 2021/03/20 12:00:25 +dnl CF_LIB_RULES version: 97 updated: 2021/07/17 13:10:54 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 @@ -4306,6 +4319,7 @@ dnl 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 cf_prefix=$LIB_PREFIX AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) @@ -4626,6 +4640,9 @@ CF_EOF traces=$LIB_TRACING \ MODEL=$cf_ITEM \ CXX_MODEL=$CXX_MODEL \ + LIB_SUFFIX=$LIB_SUFFIX \ + USE_LIB_SUFFIX=$USE_LIB_SUFFIX \ + make_phony="${cf_cv_make_PHONY:-no}" \ model=$cf_subdir \ prefix=$cf_prefix \ suffix=$cf_suffix \ @@ -4673,6 +4690,21 @@ CF_EOF echo ' ( cd '$cf_dir' && ${MAKE} ${TOP_MFLAGS} [$]@ )' >>Makefile done +echo >> Makefile +echo '# generated by CF_LIB_RULES' >> Makefile + +if test "x$cf_cv_make_PHONY" = xyes ; then + cat >> Makefile <<-CF_EOF + + .PHONY : libs + .PHONY : lintlib + .PHONY : install.includes + .PHONY : uninstall.includes + .PHONY : install.libs + .PHONY : uninstall.libs +CF_EOF +fi + for cf_dir in $SRC_SUBDIRS do if test ! -d "$srcdir/$cf_dir" ; then @@ -4691,6 +4723,15 @@ do fi if test -f "$srcdir/$cf_dir/modules" ; then + + if test "x$cf_cv_make_PHONY" = xyes ; then + cat >> Makefile <<-CF_EOF + + .PHONY : install.$cf_dir + .PHONY : uninstall.$cf_dir +CF_EOF + fi + echo >> Makefile if test -f "$srcdir/$cf_dir/headers" ; then cat >> Makefile <> Makefile - cat >> Makefile <> Makefile <<-CF_EOF + + .PHONY : install.data + .PHONY : uninstall.data +CF_EOF +fi + if test "x$cf_with_db_install" = xyes; then cat >> Makefile <> Makefile <<-CF_EOF + + .PHONY : install.man + .PHONY : uninstall.man +CF_EOF +fi + cat >> Makefile <> $cf_dir/Makefile <<-CF_EOF + + .PHONY : depend +CF_EOF + fi + cat >>$cf_dir/Makefile <<"CF_EOF" depend : ${AUTO_SRC} makedepend -- ${CPPFLAGS} -- ${C_SRC} @@ -5208,6 +5272,89 @@ CF_EOF AC_SUBST(cf_cv_makeflags) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_MAKE_PHONY version: 3 updated: 2021/01/08 16:08:21 +dnl ------------- +dnl Check if the make-program handles a ".PHONY" target, e.g,. a target which +dnl acts as a placeholder. +dnl +dnl The ".PHONY" feature was proposed in 2011 here +dnl https://www.austingroupbugs.net/view.php?id=523 +dnl and is scheduled for release in P1003.1 Issue 8 (late 2022). +dnl +dnl This is not supported by SVr4 make (or SunOS 4, 4.3SD, etc), but works with +dnl a few others (i.e., GNU make and the non-POSIX "BSD" make): +dnl +dnl + This is a GNU make feature (since April 1988, but in turn from binutils, +dnl date unspecified). +dnl +dnl + It was adopted in NetBSD make in June 1995. +dnl +dnl + The other BSD make programs are derived from the NetBSD make (and for +dnl that reason are not actually different "implementations"). +dnl +dnl + Some features of NetBSD make were actually adapted from pmake, which +dnl began as a modified GNU make starting in 1993. +dnl +dnl + Version 3.8 of the dmake program in January 1992 also implemented this +dnl GNU make extension, but is less well known than the BSD make. +AC_DEFUN([CF_MAKE_PHONY],[ +AC_CACHE_CHECK(for \".PHONY\" make-support, cf_cv_make_PHONY,[ + rm -rf conftest* + ( + mkdir conftest || exit 1 + cd conftest + cat >makefile <<'CF_EOF' +.PHONY: always +DATA=0 +always: always.out + @echo "** making [$]@ [$](DATA)" +once: once.out + @echo "** making [$]@ [$](DATA)" +always.out: + @echo "** making [$]@ [$](DATA)" + echo [$](DATA) > [$]@ +once.out: + @echo "** making [$]@ [$](DATA)" + echo [$](DATA) > [$]@ +CF_EOF + for cf_data in 1 2 3 + do + ${MAKE:-make} always DATA=$cf_data + ${MAKE:-make} once DATA=$cf_data + ${MAKE:-make} -t always once + if test -f always ; then + echo "no (case 1)" > ../conftest.tmp + elif test ! -f always.out ; then + echo "no (case 2)" > ../conftest.tmp + elif test ! -f once.out ; then + echo "no (case 3)" > ../conftest.tmp + elif ! cmp -s always.out once.out ; then + echo "no (case 4)" > ../conftest.tmp + diff always.out once.out + else + cf_check="`cat always.out`" + if test "x$cf_check" != "x$cf_data" ; then + echo "no (case 5)" > ../conftest.tmp + else + echo yes > ../conftest.tmp + rm -f ./*.out + continue + fi + fi + break + done + ) >&AC_FD_CC 2>&1 + cf_cv_make_PHONY="`cat conftest.tmp`" + rm -rf conftest* +]) +MAKE_NO_PHONY="#" +MAKE_PHONY="#" +test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY= +test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY= +AC_SUBST(MAKE_NO_PHONY) +AC_SUBST(MAKE_PHONY) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 dnl ------------ dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have @@ -5973,19 +6120,29 @@ then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NO_LEAKS_OPTION version: 8 updated: 2021/01/05 20:05:09 +dnl CF_NO_LEAKS_OPTION version: 9 updated: 2021/06/13 19:45:41 dnl ------------------ dnl see CF_WITH_NO_LEAKS +dnl +dnl $1 = option/name +dnl $2 = help-text +dnl $3 = symbol to define if the option is set +dnl $4 = additional actions to take if the option is set AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], - [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ + [case "x$withval" in + (x|xno) ;; + (*) + : "${with_cflags:=-g}" + : "${enable_leaks:=no}" + with_$1=yes + AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ $4 ]) - : "${with_cflags:=-g}" - : "${enable_leaks:=no}" - with_$1=yes], + ;; + esac], [with_$1=]) AC_MSG_RESULT(${with_$1:-no}) @@ -6870,7 +7027,7 @@ do done ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 105 updated: 2021/01/02 17:09:14 +dnl CF_SHARED_OPTS version: 106 updated: 2021/08/07 16:59:57 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -7041,6 +7198,10 @@ CF_EOF LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; + (haiku*) + CF_SHARED_SONAME + MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' + ;; (hpux[[7-8]]*) # HP-UX 8.07 ld lacks "+b" option used for libdir search-list if test "$GCC" != yes; then @@ -8128,15 +8289,21 @@ AC_DEFUN([CF_UPPER], $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTF8_LIB version: 8 updated: 2012/10/06 08:57:51 +dnl CF_UTF8_LIB version: 9 updated: 2021/05/19 19:35:25 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], [ +AC_HAVE_HEADERS(wchar.h) AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ cf_save_LIBS="$LIBS" AC_TRY_LINK([ -#include ],[putwc(0,0);], +#include +#include +#ifdef HAVE_WCHAR_H +#include +#endif +],[putwc(0,0);], [cf_cv_utf8_lib=yes], [CF_FIND_LINKAGE([ #include ],[putwc(0,0);],utf8, @@ -9430,7 +9597,7 @@ fi AC_SUBST(no_x11_rgb) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 57 updated: 2021/01/01 16:53:59 +dnl CF_XOPEN_SOURCE version: 58 updated: 2021/05/01 17:49:36 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, @@ -9495,7 +9662,15 @@ case "$host_os" in (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; -(openbsd[[4-9]]*) +(openbsd[[6-9]]*) + # OpenBSD 6.x has broken locale support, both compile-time and runtime. + # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html + # Abusing the conformance level is a workaround. + AC_MSG_WARN(this system does not provide usable locale support) + cf_xopen_source="-D_BSD_SOURCE" + cf_XOPEN_SOURCE=700 + ;; +(openbsd[[4-5]]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600