X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Faclocal.m4;h=f39f5e846e5353c14bdeb83329348ebff9674ad7;hb=2632b47fdcf4dcd101962c92acafaac69630388f;hp=80bf48a4747d7ed33b5df6029bf6490a2f4737c0;hpb=00351a08b43e8b1c62e2c2d79b62ddca8531cfba;p=ncurses.git diff --git a/test/aclocal.m4 b/test/aclocal.m4 index 80bf48a4..f39f5e84 100644 --- a/test/aclocal.m4 +++ b/test/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright 2018-2021,2022 Thomas E. Dickey * +dnl Copyright 2018-2022,2023 Thomas E. Dickey * dnl Copyright 2003-2017,2018 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * @@ -27,7 +27,7 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl $Id: aclocal.m4,v 1.206 2022/08/20 20:13:23 tom Exp $ +dnl $Id: aclocal.m4,v 1.209 2023/01/07 17:54:26 tom Exp $ dnl dnl Author: Thomas E. Dickey dnl @@ -939,7 +939,7 @@ if (foo + 1234L > 5678L) done ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CURSES_HEADER version: 5 updated: 2015/04/23 20:35:30 +dnl CF_CURSES_HEADER version: 6 updated: 2022/12/02 20:06:52 dnl ---------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. @@ -953,7 +953,7 @@ for cf_header in \ curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h ncurses/curses.h]) do AC_TRY_COMPILE([#include <${cf_header}>], - [initscr(); tgoto("?", 0,0)], + [initscr(); endwin()], [cf_cv_ncurses_header=$cf_header; break],[]) done ]) @@ -966,7 +966,7 @@ fi AC_CHECK_HEADERS($cf_cv_ncurses_header) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CURSES_LIBS version: 44 updated: 2021/01/02 09:31:20 +dnl CF_CURSES_LIBS version: 45 updated: 2022/12/02 20:06:52 dnl -------------- dnl Look for the curses libraries. Older curses implementations may require dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first. @@ -975,7 +975,7 @@ AC_DEFUN([CF_CURSES_LIBS],[ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_MSG_CHECKING(if we have identified curses libraries) AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], - [initscr(); tgoto("?", 0,0)], + [initscr(); endwin()], cf_result=yes, cf_result=no) AC_MSG_RESULT($cf_result) @@ -1076,7 +1076,7 @@ if test ".$ac_cv_func_initscr" != .yes ; then elif test "$cf_term_lib" != predefined ; then AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries) AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], - [initscr(); tgoto((char *)0, 0, 0);], + [initscr(); endwin();], [cf_result=no], [ LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" @@ -1658,7 +1658,7 @@ fi AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_CURSES_VERSION version: 8 updated: 2021/01/02 09:31:20 +dnl CF_FUNC_CURSES_VERSION version: 9 updated: 2023/01/05 18:06:10 dnl ---------------------- dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS. dnl It's a character string "SVR4", not documented. @@ -1666,11 +1666,14 @@ AC_DEFUN([CF_FUNC_CURSES_VERSION], [ AC_CACHE_CHECK(for function curses_version, cf_cv_func_curses_version,[ AC_TRY_RUN([ +$ac_includes_default + #include <${cf_cv_ncurses_header:-curses.h}> + int main(void) { char temp[1024]; - sprintf(temp, "%s\\n", curses_version()); + sprintf(temp, "%.999s\\n", curses_version()); ${cf_cv_main_return:-return}(0); }] ,[cf_cv_func_curses_version=yes] @@ -1738,6 +1741,7 @@ then AC_CHECKING([for $CC __attribute__ directives]) cat > "conftest.$ac_ext" < #include "confdefs.h" #include "conftest.h" #include "conftest.i" @@ -2973,7 +2977,7 @@ then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_VERSION version: 16 updated: 2020/12/31 20:19:42 +dnl CF_NCURSES_VERSION version: 17 updated: 2023/01/05 18:54:02 dnl ------------------ dnl Check for the version of ncurses, to aid in reporting bugs, etc. dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use @@ -2986,8 +2990,10 @@ AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[ cf_tempfile=out$$ rm -f "$cf_tempfile" AC_TRY_RUN([ +$ac_includes_default + #include <${cf_cv_ncurses_header:-curses.h}> -#include + int main(void) { FILE *fp = fopen("$cf_tempfile", "w"); @@ -3902,34 +3908,20 @@ else fi ]) dnl --------------------------------------------------------------------------- -dnl CF_TRY_XOPEN_SOURCE version: 3 updated: 2021/08/28 15:20:37 +dnl CF_TRY_XOPEN_SOURCE version: 4 updated: 2022/09/10 15:16:16 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. AC_DEFUN([CF_TRY_XOPEN_SOURCE],[ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ - AC_TRY_COMPILE([ -#include -#include -#include -],[ -#ifndef _XOPEN_SOURCE -make an error -#endif], + AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY, [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE) - AC_TRY_COMPILE([ -#include -#include -#include -],[ -#ifdef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) - CPPFLAGS="$cf_save" + AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY, + [cf_cv_xopen_source=no], + [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) + CPPFLAGS="$cf_save" ]) ]) @@ -4361,7 +4353,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 59 updated: 2021/08/28 15:20:37 +dnl CF_XOPEN_SOURCE version: 63 updated: 2022/12/29 10:10:26 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, @@ -4412,7 +4404,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) +(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) @@ -4461,7 +4453,15 @@ case "$host_os" in ;; (*) CF_TRY_XOPEN_SOURCE + cf_save_xopen_cppflags="$CPPFLAGS" CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) + # Some of these niche implementations use copy/paste, double-check... + if test "$cf_cv_xopen_source" != no ; then + CF_VERBOSE(checking if _POSIX_C_SOURCE inteferes) + AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY,,[ + AC_MSG_WARN(_POSIX_C_SOURCE definition is not usable) + CPPFLAGS="$cf_save_xopen_cppflags"]) + fi ;; esac @@ -4867,3 +4867,23 @@ char * XCursesProgramName = "test"; #endif #endif ]) +dnl --------------------------------------------------------------------------- +dnl CF__XOPEN_SOURCE_BODY version: 1 updated: 2022/09/10 15:17:35 +dnl --------------------- +dnl body of test when test-compiling for _XOPEN_SOURCE check +define([CF__XOPEN_SOURCE_BODY], +[ +#ifndef _XOPEN_SOURCE +make an error +#endif +]) +dnl --------------------------------------------------------------------------- +dnl CF__XOPEN_SOURCE_HEAD version: 1 updated: 2022/09/10 15:17:03 +dnl --------------------- +dnl headers to include when test-compiling for _XOPEN_SOURCE check +define([CF__XOPEN_SOURCE_HEAD], +[ +#include +#include +#include +])