Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
snapshot of project "my-autoconf", label t20221202
  • Loading branch information
ThomasDickey committed Dec 3, 2022
1 parent 46cb6c9 commit fef663d
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 20 deletions.
4 changes: 2 additions & 2 deletions AcSplit/CF_CURSES_HEADER
@@ -1,4 +1,4 @@
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.
Expand All @@ -12,7 +12,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
])
Expand Down
6 changes: 3 additions & 3 deletions AcSplit/CF_CURSES_LIBS
@@ -1,4 +1,4 @@
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.
Expand All @@ -7,7 +7,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)
Expand Down Expand Up @@ -108,7 +108,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"
Expand Down
4 changes: 2 additions & 2 deletions AcSplit/CF_FUNC_SIGACTION
@@ -1,4 +1,4 @@
dnl CF_FUNC_SIGACTION version: 3 updated: 2012/11/08 20:57:52
dnl CF_FUNC_SIGACTION version: 4 updated: 2022/12/02 19:55:38
dnl -----------------
dnl Check if we have the sigaction function and related structures.
AC_DEFUN([CF_FUNC_SIGACTION],[
Expand All @@ -9,7 +9,7 @@ AC_TRY_LINK([
[struct sigaction act;
act.sa_handler = SIG_DFL;
#ifdef SA_RESTART
act.sa_flags |= SA_RESTART;
act.sa_flags = SA_RESTART;
#endif /* SA_RESTART */
sigaction(1, &act, 0);
],
Expand Down
1 change: 1 addition & 0 deletions AcSplit/CF_GCC_ATTRIBUTES
Expand Up @@ -28,6 +28,7 @@ then
AC_CHECKING([for $CC __attribute__ directives])
cat > "conftest.$ac_ext" <<EOF
#line __oline__ "${as_me:-configure}"
#include <stdio.h>
#include "confdefs.h"
#include "conftest.h"
#include "conftest.i"
Expand Down
6 changes: 2 additions & 4 deletions AcSplit/CF_SRAND
@@ -1,4 +1,4 @@
dnl CF_SRAND version: 16 updated: 2021/06/08 18:08:14
dnl CF_SRAND version: 17 updated: 2022/12/02 19:55:38
dnl --------
dnl Check for functions similar to srand() and rand(). lrand48() and random()
dnl return a 31-bit value, while rand() returns a value less than RAND_MAX
Expand All @@ -18,9 +18,7 @@ do
CF_SRAND_PARSE($cf_func,cf_srand_func,cf_rand_func)

AC_TRY_LINK([
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
$ac_includes_default
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
Expand Down
6 changes: 3 additions & 3 deletions AcSplit/CF_TERMCAP_LIBS
@@ -1,4 +1,4 @@
dnl CF_TERMCAP_LIBS version: 15 updated: 2015/04/15 19:08:48
dnl CF_TERMCAP_LIBS version: 16 updated: 2022/12/02 20:06:52
dnl ---------------
dnl Look for termcap libraries, or the equivalent in terminfo.
dnl
Expand All @@ -7,8 +7,8 @@ AC_DEFUN([CF_TERMCAP_LIBS],
[
AC_CACHE_VAL(cf_cv_termlib,[
cf_cv_termlib=none
AC_TRY_LINK([],[char *x=(char*)tgoto("",0,0)],
[AC_TRY_LINK([],[int x=tigetstr("")],
AC_TRY_LINK([extern char *tgoto(const char*,int,int);],[char *x=tgoto("",0,0)],
[AC_TRY_LINK([extern char *tigetstr(const char *)],[char *x=tigetstr("")],
[cf_cv_termlib=terminfo],
[cf_cv_termlib=termcap])
CF_VERBOSE(using functions in predefined $cf_cv_termlib LIBS)
Expand Down
12 changes: 8 additions & 4 deletions AcSplit/CF_TERMIO_AND_CURSES
@@ -1,21 +1,25 @@
dnl CF_TERMIO_AND_CURSES version: 6 updated: 2021/01/02 09:31:20
dnl CF_TERMIO_AND_CURSES version: 7 updated: 2022/12/02 19:55:38
dnl --------------------
dnl Check if including termio.h with <curses.h> dies like on sysv68
dnl FIXME: this is too Lynx-specific
dnl
dnl $1 = application header which must include <stdio.h>
dnl $2 = optional, defaulting to config.h
dnl
dnl FIXME: CPPFLAGS is Lynx-specific.
AC_DEFUN([CF_TERMIO_AND_CURSES],
[
AC_CACHE_CHECK(if we can include termio.h with curses,cf_cv_termio_and_curses,[
cf_save_CFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H -I. -I${srcdir:-.} -I${srcdir:-.}/src -I${srcdir:-.}/WWW/Library/Implementation"
touch lynx_cfg.h
touch ifelse([$2],,config.h,[$2])
AC_TRY_COMPILE([
#include <$1>
#include <termio.h>],
[putchar(0x0a)],
[cf_cv_termio_and_curses=yes],
[cf_cv_termio_and_curses=no])
CPPFLAGS="$cf_save_CFLAGS"
rm -f lynx_cfg.h
rm -f ifelse([$2],,config.h,[$2])
])

test "$cf_cv_termio_and_curses" = yes && AC_DEFINE(TERMIO_AND_CURSES,1,[Define to 1 if we can include termio.h with curses.h])
Expand Down
3 changes: 2 additions & 1 deletion AcSplit/CF_TERMIO_AND_TERMIOS
@@ -1,11 +1,12 @@
dnl CF_TERMIO_AND_TERMIOS version: 4 updated: 2021/01/02 09:31:20
dnl CF_TERMIO_AND_TERMIOS version: 5 updated: 2022/12/02 19:55:38
dnl ---------------------
dnl Check if including both termio.h and termios.h die like on DG.UX
AC_DEFUN([CF_TERMIO_AND_TERMIOS],
[
AC_MSG_CHECKING([termio.h and termios.h])
AC_CACHE_VAL(cf_cv_termio_and_termios,[
AC_TRY_COMPILE([
#include <stdio.h>
#if HAVE_TERMIO_H
#include <termio.h>
#endif
Expand Down
27 changes: 27 additions & 0 deletions CHANGES
@@ -1,3 +1,30 @@
2022-12-02 Thomas E. Dickey <dickey@invisible-island.net>

* AcSplit/CF_CURSES_HEADER, AcSplit/CF_CURSES_LIBS:
drop tgoto() from the sample code used for checking if a given header declares
curses functions, since the prototype for it in X/Open lives in term.h (tested
later in configure scripts, to resolve <term.h> vs <ncurses/term.h>, etc).

* AcSplit/CF_TERMCAP_LIBS:
make the try-link checks less likely to generate compiler warnings by
providing a suitable prototype for tgoto() and tigetstr(). The former
had no header-file in BSD curses, while both (for which there are other
configure checks) have prototypes in term.h (AT&T / X/Open / ncurses).
Since we only need to check for existence, using our own prototype is okay.

* AcSplit/CF_FUNC_SIGACTION: fix a compiler-warning

* AcSplit/CF_TERMIO_AND_CURSES:
fix one of the Lynx-specific issues using an optional parameter

* AcSplit/CF_TERMIO_AND_TERMIOS:
include stdio.h, to prototype putchar (report by Florian Weimer)

* AcSplit/CF_SRAND: prefer $ac_includes_default to just stdlib.h

* AcSplit/CF_GCC_ATTRIBUTES:
include stdio.h to help with getting proper attributes for printflike

2022-11-17 Thomas E. Dickey <dickey@invisible-island.net>

* AcSplit/CF_GCC_OPT_RDYNAMIC:
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST
@@ -1,4 +1,4 @@
MANIFEST for my-autoconf, version t20221117
MANIFEST for my-autoconf, version t20221202
--------------------------------------------------------------------------------
MANIFEST this file
COPYING copyright notice
Expand Down

0 comments on commit fef663d

Please sign in to comment.