summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in19
-rw-r--r--test/README52
-rw-r--r--test/aclocal.m41283
-rw-r--r--test/background.c228
-rw-r--r--test/blue.c12
-rw-r--r--test/bs.c46
-rw-r--r--test/cardfile.c28
-rw-r--r--test/chgat.c6
-rw-r--r--test/clip_printw.c11
-rw-r--r--test/color_name.h103
-rw-r--r--test/color_set.c10
-rwxr-xr-xtest/configure9148
-rw-r--r--test/configure.in195
-rw-r--r--test/demo_defkey.c12
-rw-r--r--test/demo_forms.c224
-rw-r--r--test/demo_forms.txt20
-rw-r--r--test/demo_menus.c318
-rw-r--r--test/demo_panels.c6
-rw-r--r--test/demo_termcap.c758
-rw-r--r--test/demo_terminfo.c799
-rw-r--r--test/ditto.c10
-rw-r--r--test/dots.c24
-rw-r--r--test/dots_curses.c151
-rw-r--r--test/dots_mvcur.c25
-rw-r--r--test/dots_termcap.c254
-rw-r--r--test/echochar.c4
-rw-r--r--test/edit_field.c69
-rw-r--r--test/edit_field.h8
-rw-r--r--test/filter.c10
-rw-r--r--test/firework.c18
-rw-r--r--test/form_driver_w.c150
-rw-r--r--test/gdc.c143
-rw-r--r--test/hanoi.c33
-rw-r--r--test/hashtest.c6
-rw-r--r--test/inchs.c16
-rw-r--r--test/ins_wide.c38
-rw-r--r--test/insdelln.c10
-rw-r--r--test/inserts.c29
-rw-r--r--test/key_names.c6
-rw-r--r--test/knight.c70
-rw-r--r--test/linedata.h6
-rwxr-xr-xtest/make-tar.sh13
-rw-r--r--test/modules11
-rw-r--r--test/movewindow.c227
-rw-r--r--test/ncurses.c1183
-rw-r--r--test/newdemo.c23
-rw-r--r--test/package/debian/source/format2
-rw-r--r--test/package/mingw-ncurses-examples.spec109
-rw-r--r--test/package/ncurses-examples.spec4
-rw-r--r--test/programs9
-rw-r--r--test/railroad.c12
-rw-r--r--test/rain.c13
-rw-r--r--test/redraw.c6
-rw-r--r--test/tclock.c14
-rw-r--r--test/test.priv.h175
-rw-r--r--test/test_add_wchstr.c37
-rw-r--r--test/test_addchstr.c31
-rw-r--r--test/test_addstr.c29
-rw-r--r--test/test_addwstr.c38
-rw-r--r--test/test_getstr.c15
-rw-r--r--test/test_vid_puts.c148
-rw-r--r--test/test_vidputs.c148
-rw-r--r--test/testaddch.c16
-rw-r--r--test/testcurs.c66
-rw-r--r--test/view.c88
-rw-r--r--test/widechars.h71
-rw-r--r--test/worm.c31
-rw-r--r--test/xmas.c6
68 files changed, 11483 insertions, 5400 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 9fde0ad..15928eb 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.108 2010/11/28 16:39:40 tom Exp $
+# $Id: Makefile.in,v 1.114 2014/11/15 00:46:05 tom Exp $
##############################################################################
-# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@@ -44,18 +44,25 @@ x = @EXEEXT@
o = .@OBJEXT@
MODEL = ../@DFT_OBJ_SUBDIR@
+top_srcdir = @top_srcdir@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
+includesubdir = @includesubdir@
BINDIR = $(DESTDIR)$(bindir)
LIBDIR = $(DESTDIR)$(libdir)
-INCLUDEDIR = $(DESTDIR)$(includedir)
+INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir)
+
+PACKAGE = @PACKAGE@
LIBTOOL = @LIBTOOL@
+LIBTOOL_OPTS = @LIBTOOL_OPTS@
LIBTOOL_CLEAN = @LIB_CLEAN@
LIBTOOL_COMPILE = @LIB_COMPILE@
LIBTOOL_LINK = @LIB_LINK@
@@ -102,7 +109,7 @@ LDFLAGS_DEBUG = $(LDFLAGS) $(CFLAGS_DEBUG)
LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE)
LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@
-TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@
+TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@
# use these for linking with all of the libraries
LIBS_DEFAULT = $(TEST_ARGS) @LIBS@ $(TEST_LIBS) $(MATH_LIB)
@@ -117,8 +124,8 @@ LIBS_CURSES = `echo "$(TEST_ARGS) @LIBS@" | sed -e 's/-lform.*-lpanel[^ ]*//'` $
LDFLAGS_CURSES = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_CURSES)
# use these for linking with the tinfo library if we have it, or curses library if not
-LIBS_TINFO = @LDFLAGS_STATIC@ @TINFO_ARGS@ @LDFLAGS_SHARED@ @LIBS@ $(TEST_LIBS) $(MATH_LIB)
-LDFLAGS_TINFO = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO)
+LIBS_TINFO = @LDFLAGS_STATIC@ @TINFO_LIBS@ @LDFLAGS_SHARED@ @LIBS@ $(TEST_LIBS) $(MATH_LIB)
+LDFLAGS_TINFO = @TINFO_LDFLAGS@ $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO)
LINT = @LINT@
LINT_OPTS = @LINT_OPTS@
diff --git a/test/README b/test/README
index 8a016ec..62b6dff 100644
--- a/test/README
+++ b/test/README
@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: README,v 1.44 2011/02/26 00:09:25 tom Exp $
+-- $Id: README,v 1.48 2013/01/19 21:30:38 tom Exp $
-------------------------------------------------------------------------------
The programs in this directory are designed to test your newest toy :-)
@@ -223,18 +223,18 @@ PC lib: ncurses
SP lib: form
TABSIZE test: test_opaque
UP -
-acs_map test: gdc ins_wide inserts knight movewindow ncurses newdemo test_add_wchstr test_addchstr test_addstr test_addwstr testcurs
+acs_map test: background gdc ins_wide inserts knight movewindow ncurses newdemo test_add_wchstr test_addchstr test_addstr test_addwstr testcurs
add_wch test: demo_panels ncurses test_add_wchstr test_addwstr
add_wchnstr test: test_add_wchstr
add_wchstr test: test_add_wchstr view
-addch test: blue bs echochar hashtest ncurses savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm
+addch test: background blue bs echochar hashtest ncurses savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm
addchnstr test: test_addchstr
addchstr test: test_addchstr
addnstr test: test_addstr
addnwstr test: ncurses test_addwstr
addstr test: blue bs cardfile gdc hanoi lrtest ncurses savescreen test_addstr
addwstr test: ncurses test_addwstr
-assume_default_colors test: ncurses
+assume_default_colors test: background ncurses
assume_default_colors_sp -
attr_get test: ncurses
attr_off test: ncurses
@@ -271,7 +271,7 @@ color_content test: ncurses
color_content_sp -
color_set test: color_set ncurses
copywin test: ncurses testcurs
-cur_term test: demo_terminfo dots dots_mvcur lrtest progs: clear tabs tput tset
+cur_term test: demo_terminfo dots dots_mvcur lrtest test_vid_puts test_vidputs progs: clear tabs tput tset
curs_set test: echochar firework gdc hanoi lrtest ncurses newdemo rain savescreen tclock testcurs worm xmas
curs_set_sp lib: ncurses
curscr test: demo_panels edit_field knight lrtest ncurses savescreen tclock view
@@ -306,7 +306,7 @@ erasechar_sp lib: ncurses
erasewchar -
filter test: filter
filter_sp -
-flash test: cardfile lrtest ncurses tclock testcurs
+flash test: cardfile lrtest movewindow ncurses tclock testcurs
flash_sp -
flushinp test: ncurses newdemo testcurs
flushinp_sp lib: ncurses
@@ -399,7 +399,7 @@ key_defined_sp lib: ncurses
key_name test: key_names ncurses
keybound test: demo_altkeys demo_defkey
keybound_sp lib: ncurses
-keyname test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses redraw testcurs view progs: tic
+keyname test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses redraw test_getstr testcurs view progs: tic
keyname_sp lib: ncurses
keyok test: demo_keyok foldkeys
keyok_sp lib: ncurses
@@ -430,7 +430,7 @@ mvaddstr test: bs demo_forms gdc hanoi knight ncurses rain tclock test_addstr
mvaddwstr test: test_addwstr
mvchgat test: chgat
mvcur test: dots_mvcur redraw
-mvcur_sp lib: ncurses
+mvcur_sp -
mvdelch -
mvderwin test: movewindow
mvget_wch -
@@ -457,7 +457,7 @@ mvinsnstr test: inserts
mvinsstr test: inserts
mvinstr test: test_instr
mvinwstr test: test_inwstr
-mvprintw test: bs demo_menus firework hanoi ncurses tclock view
+mvprintw test: background bs demo_menus firework hanoi ncurses tclock view
mvscanw -
mvvline test: ncurses
mvvline_set test: ncurses
@@ -542,13 +542,13 @@ pnoutrefresh test: edit_field ncurses
prefresh test: testcurs
printw test: background blue bs color_set demo_altkeys demo_defkey demo_keyok demo_menus filter foldkeys ncurses savescreen testcurs testscanw view
putp progs: tput
-putp_sp lib: ncurses
+putp_sp -
putwin test: ncurses
qiflush -
qiflush_sp -
raw test: demo_forms ncurses redraw testcurs
raw_sp lib: ncurses
-redrawwin test: redraw
+redrawwin test: redraw view
refresh test: blue bs demo_defkey demo_forms demo_keyok demo_menus demo_panels echochar filter firstlast gdc hanoi hashtest lrtest movewindow ncurses savescreen tclock testcurs view xmas
reset_prog_mode test: filter ncurses
reset_prog_mode_sp lib: ncurses
@@ -586,7 +586,7 @@ set_tabsize_sp -
set_term lib: ncurses
setcchar test: demo_panels ins_wide ncurses test_add_wchstr test_addwstr view
setscrreg test: view
-setupterm test: demo_termcap demo_terminfo dots progs: clear tabs tput tset
+setupterm test: demo_termcap demo_terminfo dots test_vid_puts test_vidputs progs: clear tabs tput tset
slk_attr -
slk_attr_off -
slk_attr_on -
@@ -644,20 +644,20 @@ tgetnum_sp -
tgetstr test: demo_termcap railroad
tgetstr_sp -
tgoto test: railroad
-tigetflag test: demo_terminfo progs: tput
+tigetflag test: demo_terminfo progs: tic tput
tigetflag_sp -
tigetnum test: demo_terminfo ncurses progs: tput
tigetnum_sp -
-tigetstr test: blue demo_defkey demo_terminfo foldkeys testcurs progs: tput
+tigetstr test: demo_defkey demo_terminfo foldkeys testcurs progs: tput
tigetstr_sp -
timeout test: rain savescreen
tiparm -
touchline test: chgat clip_printw insdelln
touchwin test: chgat clip_printw demo_menus edit_field filter firstlast inch_wide inchs ins_wide insdelln inserts movewindow ncurses redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas
tparm test: dots dots_mvcur progs: tabs tic tput
-tputs test: dots dots_mvcur railroad progs: clear tabs tset
+tputs test: dots dots_mvcur railroad test_vid_puts test_vidputs progs: clear tabs tset
tputs_sp lib: ncurses
-trace test: demo_menus hanoi hashtest lrtest ncurses testcurs view worm
+trace test: demo_menus hashtest lrtest ncurses testcurs view worm
ttytype lib: ncurses
typeahead test: testcurs
typeahead_sp lib: ncurses
@@ -670,22 +670,24 @@ ungetch_sp lib: ncurses
ungetmouse -
ungetmouse_sp -
untouchwin lib: form
-use_default_colors test: filter firework gdc hanoi knight ncurses rain tclock worm xmas
+use_default_colors test: background filter firework gdc hanoi knight ncurses rain tclock worm xmas
use_default_colors_sp -
-use_env progs: tput
+use_env test: ncurses progs: tput
use_env_sp -
-use_extended_names test: demo_terminfo progs: infocmp tic
+use_extended_names test: demo_termcap demo_terminfo progs: infocmp tic
use_legacy_coding -
use_legacy_coding_sp -
use_screen test: ditto
+use_tioctl test: ncurses
+use_tioctl_sp -
use_window test: rain worm
-vid_attr -
+vid_attr test: test_vid_puts
vid_attr_sp -
-vid_puts -
+vid_puts test: test_vid_puts
vid_puts_sp -
-vidattr -
-vidattr_sp lib: ncurses
-vidputs -
+vidattr test: test_vidputs
+vidattr_sp -
+vidputs test: test_vidputs
vidputs_sp lib: ncurses
vline test: gdc ncurses
vline_set -
diff --git a/test/aclocal.m4 b/test/aclocal.m4
index 4e33431..a9a5045 100644
--- a/test/aclocal.m4
+++ b/test/aclocal.m4
@@ -1,5 +1,5 @@
dnl***************************************************************************
-dnl Copyright (c) 2003-2010,2011 Free Software Foundation, Inc. *
+dnl Copyright (c) 2003-2013,2014 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written *
dnl authorization. *
dnl***************************************************************************
dnl
-dnl $Id: aclocal.m4,v 1.50 2011/03/24 08:28:07 tom Exp $
+dnl $Id: aclocal.m4,v 1.102 2014/12/06 13:39:47 tom Exp $
dnl
dnl Author: Thomas E. Dickey
dnl
@@ -40,7 +40,33 @@ dnl See http://invisible-island.net/autoconf/ for additional information.
dnl
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
+dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49
+dnl ------------------
+dnl Conditionally generate script according to whether we're using a given autoconf.
+dnl
+dnl $1 = version to compare against
+dnl $2 = code to use if AC_ACVERSION is at least as high as $1.
+dnl $3 = code to use if AC_ACVERSION is older than $1.
+define([CF_ACVERSION_CHECK],
+[
+ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl
+ifdef([m4_version_compare],
+[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])],
+[CF_ACVERSION_COMPARE(
+AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),
+AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53
+dnl --------------------
+dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1,
+dnl MAJOR2, MINOR2, TERNARY2,
+dnl PRINTABLE2, not FOUND, FOUND)
+define([CF_ACVERSION_COMPARE],
+[ifelse(builtin([eval], [$2 < $5]), 1,
+[ifelse([$8], , ,[$8])],
+[ifelse([$9], , ,[$9])])])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_CFLAGS version: 11 updated: 2014/07/22 05:32:57
dnl -------------
dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
dnl The second parameter if given makes this macro verbose.
@@ -65,7 +91,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -102,7 +128,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -229,15 +255,33 @@ if test -n "$1" ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05
+dnl CF_ADD_LIBS version: 2 updated: 2014/07/13 14:33:27
dnl -----------
-dnl Add one or more libraries, used to enforce consistency.
+dnl Add one or more libraries, used to enforce consistency. Libraries are
+dnl prepended to an existing list, since their dependencies are assumed to
+dnl already exist in the list.
dnl
dnl $1 = libraries to add, with the "-l", etc.
dnl $2 = variable to update (default $LIBS)
-AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl
+AC_DEFUN([CF_ADD_LIBS],[
+cf_add_libs="$1"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in [$]ifelse($2,,LIBS,[$2])
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+ifelse($2,,LIBS,[$2])="$cf_add_libs"
+])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIB_AFTER version: 2 updated: 2010/11/08 20:33:46
+dnl CF_ADD_LIB_AFTER version: 3 updated: 2013/07/09 21:27:22
dnl ----------------
dnl Add a given library after another, e.g., following the one it satisfies a
dnl dependency for.
@@ -246,11 +290,11 @@ dnl $1 = the first library
dnl $2 = its dependency
AC_DEFUN([CF_ADD_LIB_AFTER],[
CF_VERBOSE(...before $LIBS)
-LIBS=`echo "$LIBS" | sed -e "s/[[ ]][[ ]]*/ /g" -e "s,$1 ,$1 $2 ," -e 's/ / /g'`
+LIBS=`echo "$LIBS" | sed -e "s/[[ ]][[ ]]*/ /g" -e "s%$1 %$1 $2 %" -e 's% % %g'`
CF_VERBOSE(...after $LIBS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12
+dnl CF_ADD_SUBDIR_PATH version: 4 updated: 2013/10/08 17:47:05
dnl ------------------
dnl Append to a search-list for a nonstandard header/lib-file
dnl $1 = the variable to return as result
@@ -260,9 +304,9 @@ dnl $4 = the directory under which we will test for subdirectories
dnl $5 = a directory that we do not want $4 to match
AC_DEFUN([CF_ADD_SUBDIR_PATH],
[
-test "$4" != "$5" && \
+test "x$4" != "x$5" && \
test -d "$4" && \
-ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) {
+ifelse([$5],NONE,,[(test -z "$5" || test x$5 = xNONE || test "x$4" != "x$5") &&]) {
test -n "$verbose" && echo " ... testing for $3-directories under $4"
test -d $4/$3 && $1="[$]$1 $4/$3"
test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2"
@@ -272,76 +316,6 @@ ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) {
}
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32
-dnl ----------------
-dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
-dnl in the sharutils 4.2 distribution.
-AC_DEFUN([CF_ANSI_CC_CHECK],
-[
-AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[
-cf_cv_ansi_cc=no
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
-# SVR4 -Xc
-# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
-for cf_arg in "-DCC_HAS_PROTOS" \
- "" \
- -qlanglvl=ansi \
- -std1 \
- -Ae \
- "-Aa -D_HPUX_SOURCE" \
- -Xc
-do
- CF_ADD_CFLAGS($cf_arg)
- AC_TRY_COMPILE(
-[
-#ifndef CC_HAS_PROTOS
-#if !defined(__STDC__) || (__STDC__ != 1)
-choke me
-#endif
-#endif
-],[
- int test (int i, double x);
- struct s1 {int (*f) (int a);};
- struct s2 {int (*f) (double a);};],
- [cf_cv_ansi_cc="$cf_arg"; break])
-done
-CFLAGS="$cf_save_CFLAGS"
-CPPFLAGS="$cf_save_CPPFLAGS"
-])
-
-if test "$cf_cv_ansi_cc" != "no"; then
-if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
- CF_ADD_CFLAGS($cf_cv_ansi_cc)
-else
- AC_DEFINE(CC_HAS_PROTOS)
-fi
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54
-dnl ---------------
-dnl For programs that must use an ANSI compiler, obtain compiler options that
-dnl will make it recognize prototypes. We'll do preprocessor checks in other
-dnl macros, since tools such as unproto can fake prototypes, but only part of
-dnl the preprocessor.
-AC_DEFUN([CF_ANSI_CC_REQD],
-[AC_REQUIRE([CF_ANSI_CC_CHECK])
-if test "$cf_cv_ansi_cc" = "no"; then
- AC_MSG_ERROR(
-[Your compiler does not appear to recognize prototypes.
-You have the following choices:
- a. adjust your compiler options
- b. get an up-to-date compiler
- c. use a wrapper such as unproto])
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
dnl --------------
dnl Allow user to disable a normally-on option.
@@ -377,7 +351,33 @@ ifelse([$3],,[ :]dnl
])dnl
])])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59
+dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49
+dnl ---------------
+dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
+dnl into CC. This will not help with broken scripts that wrap the compiler with
+dnl options, but eliminates a more common category of user confusion.
+AC_DEFUN([CF_CC_ENV_FLAGS],
+[
+# This should have been defined by AC_PROG_CC
+: ${CC:=cc}
+
+AC_MSG_CHECKING(\$CC variable)
+case "$CC" in #(vi
+*[[\ \ ]]-[[IUD]]*)
+ AC_MSG_RESULT(broken)
+ AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
+ # humor him...
+ cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'`
+ CC=`echo "$CC" | sed -e 's/[[ ]].*//'`
+ CF_ADD_CFLAGS($cf_flags)
+ ;;
+*)
+ AC_MSG_RESULT(ok)
+ ;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03
dnl --------------
dnl Check if we're accidentally using a cache from a different machine.
dnl Derive the system name, as a check for reusing the autoconf cache.
@@ -400,7 +400,7 @@ else
system_name="`(hostname) 2>/dev/null`"
fi
fi
-test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
+test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.])
AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
test -z "$system_name" && system_name="$cf_cv_system_name"
@@ -412,7 +412,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_CFLAGS version: 2 updated: 2001/12/30 19:09:58
+dnl CF_CHECK_CFLAGS version: 3 updated: 2014/07/22 05:32:57
dnl ---------------
dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from
dnl a build-configuration such as imake. These have the pitfall that they
@@ -424,17 +424,50 @@ CF_VERBOSE(checking additions to CFLAGS)
cf_check_cflags="$CFLAGS"
cf_check_cppflags="$CPPFLAGS"
CF_ADD_CFLAGS($1,yes)
-if test "$cf_check_cflags" != "$CFLAGS" ; then
+if test "x$cf_check_cflags" != "x$CFLAGS" ; then
AC_TRY_LINK([#include <stdio.h>],[printf("Hello world");],,
[CF_VERBOSE(test-compile failed. Undoing change to \$CFLAGS)
- if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
+ if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
CF_VERBOSE(but keeping change to \$CPPFLAGS)
fi
CFLAGS="$cf_check_flags"])
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_ACS_MAP version: 6 updated: 2010/10/23 15:54:49
+dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35
+dnl -----------------
+dnl Check if the given compiler is really clang. clang's C driver defines
+dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
+dnl not ignore some gcc options.
+dnl
+dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
+dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
+dnl the wrappers for gcc and g++ warnings.
+dnl
+dnl $1 = GCC (default) or GXX
+dnl $2 = CLANG_COMPILER (default)
+dnl $3 = CFLAGS (default) or CXXFLAGS
+AC_DEFUN([CF_CLANG_COMPILER],[
+ifelse([$2],,CLANG_COMPILER,[$2])=no
+
+if test "$ifelse([$1],,[$1],GCC)" = yes ; then
+ AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
+ cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
+ ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments"
+ AC_TRY_COMPILE([],[
+#ifdef __clang__
+#else
+make an error
+#endif
+],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
+],[])
+ ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
+ AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
+fi
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_CURSES_ACS_MAP version: 7 updated: 2012/10/06 16:39:58
dnl -----------------
dnl Check for likely values of acs_map[]:
AC_DEFUN([CF_CURSES_ACS_MAP],
@@ -452,10 +485,10 @@ $name['k'] = ACS_PLUS
done
])
-test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map)
+test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map,[Define as needed to override ncurses prefix _nc_])
])
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CHECK_DATA version: 4 updated: 2011/01/15 16:39:24
+dnl CF_CURSES_CHECK_DATA version: 5 updated: 2014/07/19 18:41:17
dnl --------------------
dnl Check if curses.h defines the given data/variable.
dnl Use this after CF_NCURSES_CONFIG or CF_CURSES_CONFIG.
@@ -480,6 +513,7 @@ extern char $1;
int main(void)
{
void *foo = &($1);
+ fprintf(stderr, "testing linkage of $1:%p\n", foo);
${cf_cv_main_return:-return}(foo == 0);
}],[cf_result=yes],[cf_result=no],[
# cross-compiling
@@ -487,6 +521,7 @@ int main(void)
[extern char $1;],[
do {
void *foo = &($1);
+ fprintf(stderr, "testing linkage of $1:%p\n", foo);
${cf_cv_main_return:-return}(foo == 0);
} while (0)
],[cf_result=yes],[cf_result=no])
@@ -499,7 +534,7 @@ int main(void)
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CHECK_TYPE version: 3 updated: 2010/10/23 15:54:49
+dnl CF_CURSES_CHECK_TYPE version: 4 updated: 2012/10/06 16:39:58
dnl --------------------
dnl Check if curses.h defines the given type
AC_DEFUN([CF_CURSES_CHECK_TYPE],
@@ -515,9 +550,9 @@ $1 foo
AC_MSG_RESULT($cf_result)
if test $cf_result = yes ; then
CF_UPPER(cf_result,have_type_$1)
- AC_DEFINE_UNQUOTED($cf_result)
+ AC_DEFINE_UNQUOTED($cf_result,1,[Define to 1 if we have type $1])
else
- AC_DEFINE_UNQUOTED($1,$2)
+ AC_DEFINE_UNQUOTED($1,$2,[Define to appropriate type if $1 is not declared])
fi
])dnl
dnl ---------------------------------------------------------------------------
@@ -533,7 +568,7 @@ CF_NCURSES_VERSION
CF_CURSES_LIBS
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CPPFLAGS version: 10 updated: 2009/01/06 19:34:11
+dnl CF_CURSES_CPPFLAGS version: 11 updated: 2011/04/09 14:51:08
dnl ------------------
dnl Look for the curses headers.
AC_DEFUN([CF_CURSES_CPPFLAGS],[
@@ -542,13 +577,19 @@ AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
cf_cv_curses_incdir=no
case $host_os in #(vi
hpux10.*) #(vi
- test -d /usr/include/curses_colr && \
- cf_cv_curses_incdir="-I/usr/include/curses_colr"
+ if test "x$cf_cv_screen" = "xcurses_colr"
+ then
+ test -d /usr/include/curses_colr && \
+ cf_cv_curses_incdir="-I/usr/include/curses_colr"
+ fi
;;
sunos3*|sunos4*)
- test -d /usr/5lib && \
- test -d /usr/5include && \
- cf_cv_curses_incdir="-I/usr/5include"
+ if test "x$cf_cv_screen" = "xcurses_5lib"
+ then
+ test -d /usr/5lib && \
+ test -d /usr/5include && \
+ cf_cv_curses_incdir="-I/usr/5include"
+ fi
;;
esac
])
@@ -558,7 +599,7 @@ CF_CURSES_HEADER
CF_TERM_HEADER
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_FUNCS version: 15 updated: 2010/10/23 15:52:32
+dnl CF_CURSES_FUNCS version: 18 updated: 2014/07/19 18:44:41
dnl ---------------
dnl Curses-functions are a little complicated, since a lot of them are macros.
AC_DEFUN([CF_CURSES_FUNCS],
@@ -566,6 +607,7 @@ AC_DEFUN([CF_CURSES_FUNCS],
AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
AC_REQUIRE([CF_XOPEN_CURSES])
AC_REQUIRE([CF_CURSES_TERM_H])
+AC_REQUIRE([CF_CURSES_UNCTRL_H])
for cf_func in $1
do
CF_UPPER(cf_tr_func,$cf_func)
@@ -578,7 +620,9 @@ do
[
#ifndef ${cf_func}
long foo = (long)(&${cf_func});
-${cf_cv_main_return:-return}(foo == 0);
+fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
+if (foo + 1234 > 5678)
+ ${cf_cv_main_return:-return}(foo);
#endif
],
[cf_result=yes],
@@ -595,7 +639,7 @@ ${cf_cv_main_return:-return}(foo == 0);
done
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16
+dnl CF_CURSES_HEADER version: 3 updated: 2011/05/01 19:47:45
dnl ----------------
dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
dnl variations of ncurses' installs.
@@ -605,10 +649,10 @@ AC_DEFUN([CF_CURSES_HEADER],[
AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
cf_cv_ncurses_header=none
for cf_header in ifelse($1,,,[ \
- $1/curses.h \
- $1/ncurses.h]) \
- curses.h \
- ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h])
+ $1/ncurses.h \
+ $1/curses.h]) \
+ ncurses.h \
+ curses.h ifelse($1,,[ncurses/ncurses.h ncurses/curses.h])
do
AC_TRY_COMPILE([#include <${cf_header}>],
[initscr(); tgoto("?", 0,0)],
@@ -624,7 +668,7 @@ fi
AC_CHECK_HEADERS($cf_cv_ncurses_header)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_LIBS version: 33 updated: 2011/03/06 12:37:18
+dnl CF_CURSES_LIBS version: 37 updated: 2013/02/09 17:33:50
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.
@@ -644,17 +688,24 @@ freebsd*) #(vi
AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
;;
hpux10.*) #(vi
- AC_CHECK_LIB(cur_colr,initscr,[
- CF_ADD_LIBS(-lcur_colr)
- ac_cv_func_initscr=yes
- ],[
- AC_CHECK_LIB(Hcurses,initscr,[
- # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
- CF_ADD_LIBS(-lHcurses)
- CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
- ac_cv_func_initscr=yes
- ])])
- ;;
+ # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
+ # next (1998), and xcurses "newer" (2000). There is no header file for
+ # Hcurses; the subdirectory curses_colr has the headers (curses.h and
+ # term.h) for cur_colr
+ if test "x$cf_cv_screen" = "xcurses_colr"
+ then
+ AC_CHECK_LIB(cur_colr,initscr,[
+ CF_ADD_LIBS(-lcur_colr)
+ ac_cv_func_initscr=yes
+ ],[
+ AC_CHECK_LIB(Hcurses,initscr,[
+ # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
+ CF_ADD_LIBS(-lHcurses)
+ CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
+ ac_cv_func_initscr=yes
+ ])])
+ fi
+ ;;
linux*)
case `arch 2>/dev/null` in
x86_64)
@@ -669,76 +720,83 @@ linux*)
CF_ADD_LIBDIR(/lib)
;;
esac
- ;;
+ ;;
sunos3*|sunos4*)
- if test -d /usr/5lib ; then
- CF_ADD_LIBDIR(/usr/5lib)
- CF_ADD_LIBS(-lcurses -ltermcap)
+ if test "x$cf_cv_screen" = "xcurses_5lib"
+ then
+ if test -d /usr/5lib ; then
+ CF_ADD_LIBDIR(/usr/5lib)
+ CF_ADD_LIBS(-lcurses -ltermcap)
+ fi
fi
ac_cv_func_initscr=yes
;;
esac
if test ".$ac_cv_func_initscr" != .yes ; then
- cf_save_LIBS="$LIBS"
- cf_term_lib=""
- cf_curs_lib=""
+ cf_save_LIBS="$LIBS"
- if test ".${cf_cv_ncurses_version:-no}" != .no
- then
- cf_check_list="ncurses curses cursesX"
- else
- cf_check_list="cursesX curses ncurses"
- fi
+ if test ".${cf_cv_ncurses_version:-no}" != .no
+ then
+ cf_check_list="ncurses curses cursesX"
+ else
+ cf_check_list="cursesX curses ncurses"
+ fi
- # Check for library containing tgoto. Do this before curses library
- # because it may be needed to link the test-case for initscr.
- AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
- for cf_term_lib in $cf_check_list termcap termlib unknown
- do
- AC_CHECK_LIB($cf_term_lib,tgoto,[break])
- done
- ])
+ # Check for library containing tgoto. Do this before curses library
+ # because it may be needed to link the test-case for initscr.
+ if test "x$cf_term_lib" = x
+ then
+ AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
+ for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
+ do
+ AC_CHECK_LIB($cf_term_lib,tgoto,[break])
+ done
+ ])
+ fi
- # Check for library containing initscr
- test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
- for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
- do
- AC_CHECK_LIB($cf_curs_lib,initscr,[break])
- done
- test $cf_curs_lib = unknown && AC_MSG_ERROR(no curses library found)
-
- LIBS="-l$cf_curs_lib $cf_save_LIBS"
- if test "$cf_term_lib" = unknown ; then
- AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
- AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
- [initscr()],
- [cf_result=yes],
- [cf_result=no])
- AC_MSG_RESULT($cf_result)
- test $cf_result = no && AC_MSG_ERROR(Cannot link curses library)
- elif test "$cf_curs_lib" = "$cf_term_lib" ; 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);],
- [cf_result=no],
- [
- LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
- AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
- [initscr()],
- [cf_result=yes],
- [cf_result=error])
- ])
- AC_MSG_RESULT($cf_result)
- fi
+ # Check for library containing initscr
+ test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
+ if test "x$cf_curs_lib" = x
+ then
+ for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
+ do
+ AC_CHECK_LIB($cf_curs_lib,initscr,[break])
+ done
+ fi
+ test $cf_curs_lib = unknown && AC_MSG_ERROR(no curses library found)
+
+ LIBS="-l$cf_curs_lib $cf_save_LIBS"
+ if test "$cf_term_lib" = unknown ; then
+ AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
+ AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+ [initscr()],
+ [cf_result=yes],
+ [cf_result=no])
+ AC_MSG_RESULT($cf_result)
+ test $cf_result = no && AC_MSG_ERROR(Cannot link curses library)
+ elif test "$cf_curs_lib" = "$cf_term_lib" ; 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);],
+ [cf_result=no],
+ [
+ LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+ AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+ [initscr()],
+ [cf_result=yes],
+ [cf_result=error])
+ ])
+ AC_MSG_RESULT($cf_result)
+ fi
fi
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_TERM_H version: 8 updated: 2010/10/23 15:54:49
+dnl CF_CURSES_TERM_H version: 10 updated: 2012/10/06 08:57:51
dnl ----------------
dnl SVr4 curses should have term.h as well (where it puts the definitions of
dnl the low-level interface). This may not be true in old/broken implementations,
@@ -752,9 +810,17 @@ AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
# for <term.h> if we do not find the variant.
-for cf_header in \
- `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \
- term.h
+
+cf_header_list="term.h ncurses/term.h ncursesw/term.h"
+
+case ${cf_cv_ncurses_header:-curses.h} in #(vi
+*/*)
+ cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
+ cf_header_list="$cf_header_item $cf_header_list"
+ ;;
+esac
+
+for cf_header in $cf_header_list
do
AC_TRY_COMPILE([
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -789,18 +855,73 @@ esac
case $cf_cv_term_header in #(vi
term.h) #(vi
- AC_DEFINE(HAVE_TERM_H)
+ AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
;;
ncurses/term.h) #(vi
- AC_DEFINE(HAVE_NCURSES_TERM_H)
+ AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
;;
ncursesw/term.h)
- AC_DEFINE(HAVE_NCURSESW_TERM_H)
+ AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
+ ;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CURSES_UNCTRL_H version: 3 updated: 2013/11/03 06:26:10
+dnl ------------------
+dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
+dnl may put it in a subdirectory (along with ncurses' other headers, of
+dnl course). Packages which put the headers in inconsistent locations are
+dnl broken).
+AC_DEFUN([CF_CURSES_UNCTRL_H],
+[
+AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
+
+AC_CACHE_CHECK(for unctrl.h, cf_cv_unctrl_header,[
+
+# If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
+# for <unctrl.h> if we do not find the variant.
+
+cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
+
+case ${cf_cv_ncurses_header:-curses.h} in #(vi
+*/*)
+ cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
+ cf_header_list="$cf_header_item $cf_header_list"
+ ;;
+esac
+
+for cf_header in $cf_header_list
+do
+ AC_TRY_COMPILE([
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <${cf_header}>],
+ [WINDOW *x],
+ [cf_cv_unctrl_header=$cf_header
+ break],
+ [cf_cv_unctrl_header=no])
+done
+])
+
+case $cf_cv_unctrl_header in #(vi
+no)
+ AC_MSG_WARN(unctrl.h header not found)
+ ;;
+esac
+
+case $cf_cv_unctrl_header in #(vi
+unctrl.h) #(vi
+ AC_DEFINE(HAVE_UNCTRL_H,1,[Define to 1 if we have unctrl.h])
+ ;;
+ncurses/unctrl.h) #(vi
+ AC_DEFINE(HAVE_NCURSES_UNCTRL_H,1,[Define to 1 if we have ncurses/unctrl.h])
+ ;;
+ncursesw/unctrl.h)
+ AC_DEFINE(HAVE_NCURSESW_UNCTRL_H,1,[Define to 1 if we have ncursesw/unctrl.h])
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_WACS_MAP version: 5 updated: 2011/01/15 11:28:59
+dnl CF_CURSES_WACS_MAP version: 6 updated: 2012/10/06 08:57:51
dnl ------------------
dnl Check for likely values of wacs_map[].
AC_DEFUN([CF_CURSES_WACS_MAP],
@@ -819,10 +940,10 @@ AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[
break])
done])
-test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map)
+test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map,[Define to name of (n)curses wide-character array])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_WACS_SYMBOLS version: 1 updated: 2011/01/15 11:28:59
+dnl CF_CURSES_WACS_SYMBOLS version: 2 updated: 2012/10/06 08:57:51
dnl ----------------------
dnl Do a check to see if the WACS_xxx constants are defined compatibly with
dnl X/Open Curses. In particular, NetBSD's implementation of the WACS_xxx
@@ -854,7 +975,7 @@ else
fi
])
-test "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS)
+test "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS,1,[Define to 1 if (n)curses supports wide-character WACS_ symbols])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
@@ -862,7 +983,7 @@ dnl ----------
dnl "dirname" is not portable, so we fake it with a shell script.
AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57
+dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28
dnl ---------------
dnl You can always use "make -n" to see the actual options, but it's hard to
dnl pick out/analyze warning messages when the compile-line is long.
@@ -877,7 +998,7 @@ dnl
AC_DEFUN([CF_DISABLE_ECHO],[
AC_MSG_CHECKING(if you want to see long compiling messages)
CF_ARG_DISABLE(echo,
- [ --disable-echo display "compiling" commands],
+ [ --disable-echo do not display "compiling" commands],
[
ECHO_LT='--silent'
ECHO_LD='@echo linking [$]@;'
@@ -899,7 +1020,7 @@ AC_SUBST(SHOW_CC)
AC_SUBST(ECHO_CC)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32
+dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03
dnl ----------------
dnl Combine no-leak checks with the libraries or tools that are used for the
dnl checks.
@@ -917,11 +1038,30 @@ AC_ARG_ENABLE(leaks,
AC_MSG_RESULT($with_no_leaks)
if test "$with_no_leaks" = yes ; then
- AC_DEFINE(NO_LEAKS)
- AC_DEFINE(YY_NO_LEAKS)
+ AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
+ AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
fi
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_DISABLE_RPATH_HACK version: 2 updated: 2011/02/13 13:31:33
+dnl ---------------------
+dnl The rpath-hack makes it simpler to build programs, particularly with the
+dnl *BSD ports which may have essential libraries in unusual places. But it
+dnl can interfere with building an executable for the base system. Use this
+dnl option in that case.
+AC_DEFUN([CF_DISABLE_RPATH_HACK],
+[
+AC_MSG_CHECKING(if rpath-hack should be disabled)
+CF_ARG_DISABLE(rpath-hack,
+ [ --disable-rpath-hack don't add rpath options for additional libraries],
+ [cf_disable_rpath_hack=yes],
+ [cf_disable_rpath_hack=no])
+AC_MSG_RESULT($cf_disable_rpath_hack)
+if test "$cf_disable_rpath_hack" = no ; then
+ CF_RPATH_HACK
+fi
+])
+dnl ---------------------------------------------------------------------------
dnl CF_ENABLE_WARNINGS version: 4 updated: 2009/07/26 17:53:03
dnl ------------------
dnl Configure-option to enable gcc warnings
@@ -1122,7 +1262,7 @@ ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_FUNC_CURSES_VERSION version: 5 updated: 2010/10/23 15:54:49
+dnl CF_FUNC_CURSES_VERSION version: 6 updated: 2012/10/06 16:39:58
dnl ----------------------
dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS.
dnl It's a character string "SVR4", not documented.
@@ -1141,10 +1281,10 @@ int main()
,[cf_cv_func_curses_version=no]
,[cf_cv_func_curses_version=unknown])
rm -f core])
-test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION)
+test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION,1,[Define to 1 if we have curses_version function])
])
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32
+dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
@@ -1222,27 +1362,27 @@ EOF
test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
cat conftest.h >>confdefs.h
case $cf_attribute in #(vi
+ noreturn) #(vi
+ AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
+ ;;
printf) #(vi
- if test "$cf_printf_attribute" = no ; then
- cat >>confdefs.h <<EOF
-#define GCC_PRINTFLIKE(fmt,var) /* nothing */
-EOF
- else
- cat >>confdefs.h <<EOF
-#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
-EOF
+ cf_value='/* nothing */'
+ if test "$cf_printf_attribute" != no ; then
+ cf_value='__attribute__((format(printf,fmt,var)))'
+ AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.])
fi
+ AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc])
;;
scanf) #(vi
- if test "$cf_scanf_attribute" = no ; then
- cat >>confdefs.h <<EOF
-#define GCC_SCANFLIKE(fmt,var) /* nothing */
-EOF
- else
- cat >>confdefs.h <<EOF
-#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
-EOF
+ cf_value='/* nothing */'
+ if test "$cf_scanf_attribute" != no ; then
+ cf_value='__attribute__((format(scanf,fmt,var)))'
+ AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.])
fi
+ AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc])
+ ;;
+ unused) #(vi
+ AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc])
;;
esac
fi
@@ -1254,7 +1394,7 @@ rm -rf conftest*
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
+dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33
dnl --------------
dnl Find version of gcc
AC_DEFUN([CF_GCC_VERSION],[
@@ -1262,13 +1402,13 @@ AC_REQUIRE([AC_PROG_CC])
GCC_VERSION=none
if test "$GCC" = yes ; then
AC_MSG_CHECKING(version of $CC)
- GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+ GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
test -z "$GCC_VERSION" && GCC_VERSION=unknown
AC_MSG_RESULT($GCC_VERSION)
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32
+dnl CF_GCC_WARNINGS version: 31 updated: 2013/11/19 19:23:35
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
@@ -1291,6 +1431,7 @@ AC_DEFUN([CF_GCC_WARNINGS],
[
AC_REQUIRE([CF_GCC_VERSION])
CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
+CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
cat > conftest.$ac_ext <<EOF
#line __oline__ "${as_me:-configure}"
@@ -1339,10 +1480,14 @@ then
EXTRA_CFLAGS=
cf_warn_CONST=""
test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
+ cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
+ test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
for cf_opt in W Wall \
Wbad-function-cast \
Wcast-align \
Wcast-qual \
+ Wdeclaration-after-statement \
+ Wextra \
Winline \
Wmissing-declarations \
Wmissing-prototypes \
@@ -1350,7 +1495,7 @@ then
Wpointer-arith \
Wshadow \
Wstrict-prototypes \
- Wundef $cf_warn_CONST $1
+ Wundef $cf_gcc_warnings $cf_warn_CONST $1
do
CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
if AC_TRY_EVAL(ac_compile); then
@@ -1366,6 +1511,13 @@ then
continue;;
esac
;;
+ Wpointer-arith) #(vi
+ case $GCC_VERSION in
+ [[12]].*)
+ CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
+ continue;;
+ esac
+ ;;
esac
EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
fi
@@ -1377,6 +1529,32 @@ rm -rf conftest*
AC_SUBST(EXTRA_CFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_GETOPT_HEADER version: 6 updated: 2014/07/22 14:45:54
+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_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
+do
+AC_TRY_COMPILE([
+#include <$cf_header>],
+[int x = optind; char *y = optarg],
+[cf_cv_getopt_header=$cf_header
+ break])
+done
+])
+if test $cf_cv_getopt_header != none ; then
+ AC_DEFINE(HAVE_GETOPT_HEADER,1,[Define to 1 if getopt variables are declared in header])
+fi
+if test $cf_cv_getopt_header = getopt.h ; then
+ AC_DEFINE(NEED_GETOPT_H,1,[Define to 1 if we must include getopt.h])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
dnl -------------
dnl Check if we must define _GNU_SOURCE to get a reasonable value for
@@ -1453,6 +1631,13 @@ test -d "$oldincludedir" && {
$1="[$]$1 $cf_header_path_list"
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
+dnl ---------------
+dnl Insert text into the help-message, for readability, from AC_ARG_WITH.
+AC_DEFUN([CF_HELP_MESSAGE],
+[AC_DIVERT_HELP([$1])dnl
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_INHERIT_SCRIPT version: 2 updated: 2003/03/01 23:50:42
dnl -----------------
dnl If we do not have a given script, look for it in the parent directory.
@@ -1461,7 +1646,7 @@ AC_DEFUN([CF_INHERIT_SCRIPT],
test -f $1 || ( test -f ../$1 && cp ../$1 ./ )
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42
+dnl CF_INTEL_COMPILER version: 6 updated: 2014/03/17 13:13:07
dnl -----------------
dnl Check if the given compiler is really the Intel compiler for Linux. It
dnl tries to imitate gcc, but does not return an error when it finds a mismatch
@@ -1475,6 +1660,7 @@ dnl $1 = GCC (default) or GXX
dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
dnl $3 = CFLAGS (default) or CXXFLAGS
AC_DEFUN([CF_INTEL_COMPILER],[
+AC_REQUIRE([AC_CANONICAL_HOST])
ifelse([$2],,INTEL_COMPILER,[$2])=no
if test "$ifelse([$1],,[$1],GCC)" = yes ; then
@@ -1489,7 +1675,7 @@ if test "$ifelse([$1],,[$1],GCC)" = yes ; then
make an error
#endif
],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
+cf_save_CFLAGS="$cf_save_CFLAGS -we147"
],[])
ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
@@ -1498,6 +1684,60 @@ cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
fi
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_LD_RPATH_OPT version: 5 updated: 2011/07/17 14:48:41
+dnl ---------------
+dnl For the given system and compiler, find the compiler flags to pass to the
+dnl loader to use the "rpath" feature.
+AC_DEFUN([CF_LD_RPATH_OPT],
+[
+AC_REQUIRE([CF_CHECK_CACHE])
+
+LD_RPATH_OPT=
+AC_MSG_CHECKING(for an rpath option)
+case $cf_cv_system_name in #(vi
+irix*) #(vi
+ if test "$GCC" = yes; then
+ LD_RPATH_OPT="-Wl,-rpath,"
+ else
+ LD_RPATH_OPT="-rpath "
+ fi
+ ;;
+linux*|gnu*|k*bsd*-gnu) #(vi
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+openbsd[[2-9]].*|mirbsd*) #(vi
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+dragonfly*|freebsd*) #(vi
+ LD_RPATH_OPT="-rpath "
+ ;;
+netbsd*) #(vi
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+osf*|mls+*) #(vi
+ LD_RPATH_OPT="-rpath "
+ ;;
+solaris2*) #(vi
+ LD_RPATH_OPT="-R"
+ ;;
+*)
+ ;;
+esac
+AC_MSG_RESULT($LD_RPATH_OPT)
+
+case "x$LD_RPATH_OPT" in #(vi
+x-R*)
+ AC_MSG_CHECKING(if we need a space after rpath option)
+ cf_save_LIBS="$LIBS"
+ CF_ADD_LIBS(${LD_RPATH_OPT}$libdir)
+ AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
+ LIBS="$cf_save_LIBS"
+ AC_MSG_RESULT($cf_rpath_space)
+ test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+ ;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50
dnl ---------------
dnl Construct a search-list of directories for a nonstandard library-file
@@ -1588,38 +1828,7 @@ ifelse($1,,[
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_MIN_GETCCHAR version: 3 updated: 2010/10/23 15:54:49
-dnl ---------------
-dnl CF_MIN_GETCCHAR
-dnl Check whether getcchar's return value counts the trailing null in a wchar_t
-dnl string, or not. X/Open says it does, but Tru64 and Solaris do not do this.
-AC_DEFUN([CF_MIN_GETCCHAR],[
-AC_CACHE_CHECK(if getcchar counts trailing null,cf_cv_min_getcchar,[
-AC_TRY_RUN([
-#include <stdlib.h>
-#include <stdarg.h>
-#include <${cf_cv_ncurses_header:-curses.h}>
-
-int main()
-{
- wchar_t data[2];
- cchar_t temp[2];
- int count;
- data[0] = L'\0';
- setcchar(temp, data, 0, 0, (void *)0);
- count = getcchar(temp, (wchar_t *)0, (attr_t *)0, (short *)0, (void *)0);
- ${cf_cv_main_return:-return}(count != 0);
-}],
- [cf_cv_min_getcchar=no],
- [cf_cv_min_getcchar=yes],
- [cf_cv_min_getcchar=yes])
-])
-if test "$cf_cv_min_getcchar" = yes ; then
- AC_DEFINE(MIN_GETCCHAR,1)
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
+dnl CF_MIXEDCASE_FILENAMES version: 6 updated: 2013/10/08 17:47:05
dnl ----------------------
dnl Check if the file-system supports mixed-case filenames. If we're able to
dnl create a lowercase name and see it as uppercase, it doesn't support that.
@@ -1628,7 +1837,7 @@ AC_DEFUN([CF_MIXEDCASE_FILENAMES],
AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
if test "$cross_compiling" = yes ; then
case $target_alias in #(vi
- *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+ *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi
cf_cv_mixedcase=no
;;
*)
@@ -1646,7 +1855,7 @@ else
rm -f conftest CONFTEST
fi
])
-test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
+test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
@@ -1690,7 +1899,7 @@ printf("old\n");
,[$1=no])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CONFIG version: 8 updated: 2010/07/08 05:17:30
+dnl CF_NCURSES_CONFIG version: 10 updated: 2012/10/06 08:57:51
dnl -----------------
dnl Tie together the configure-script macros for ncurses.
dnl Prefer the "-config" script from ncurses 6.x, to simplify analysis.
@@ -1702,7 +1911,10 @@ AC_DEFUN([CF_NCURSES_CONFIG],
cf_ncuconfig_root=ifelse($1,,ncurses,$1)
echo "Looking for ${cf_ncuconfig_root}-config"
-AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none)
+
+CF_ACVERSION_CHECK(2.52,
+ [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)],
+ [AC_PATH_PROGS(NCURSES_CONFIG, ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)])
if test "$NCURSES_CONFIG" != none ; then
@@ -1713,7 +1925,7 @@ CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
dnl like CF_NCURSES_CPPFLAGS
-AC_DEFINE(NCURSES)
+AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
dnl like CF_NCURSES_LIBS
CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
@@ -1730,7 +1942,7 @@ CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38
+dnl CF_NCURSES_CPPFLAGS version: 21 updated: 2012/10/06 08:57:51
dnl -------------------
dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
dnl the CPPFLAGS variable so we can include its header.
@@ -1776,12 +1988,12 @@ CF_NCURSES_HEADER
CF_TERM_HEADER
# some applications need this, but should check for NCURSES_VERSION
-AC_DEFINE(NCURSES)
+AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
CF_NCURSES_VERSION
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_EXT_FUNCS version: 3 updated: 2010/11/13 19:43:23
+dnl CF_NCURSES_EXT_FUNCS version: 4 updated: 2012/10/06 16:39:58
dnl --------------------
dnl Since 2007/11/17, ncurses has defined NCURSES_EXT_FUNCS; earlier versions
dnl may provide these functions. Define the symbol if it is not defined, and
@@ -1813,10 +2025,10 @@ AC_TRY_LINK([
[cf_cv_ncurses_ext_funcs=no])
])
])
-test "$cf_cv_ncurses_ext_funcs" = yes && AC_DEFINE(NCURSES_EXT_FUNCS)
+test "$cf_cv_ncurses_ext_funcs" = yes && AC_DEFINE(NCURSES_EXT_FUNCS,1,[Define to 1 if we have ncurses extensions])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54
+dnl CF_NCURSES_HEADER version: 3 updated: 2012/10/06 08:57:51
dnl -----------------
dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
dnl variations of ncurses' installs.
@@ -1867,16 +2079,16 @@ fi
case $cf_cv_ncurses_header in # (vi
*ncurses.h)
- AC_DEFINE(HAVE_NCURSES_H)
+ AC_DEFINE(HAVE_NCURSES_H,1,[Define to 1 if we have ncurses.h])
;;
esac
case $cf_cv_ncurses_header in # (vi
ncurses/curses.h|ncurses/ncurses.h)
- AC_DEFINE(HAVE_NCURSES_NCURSES_H)
+ AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Define to 1 if we have ncurses/ncurses.h])
;;
ncursesw/curses.h|ncursesw/ncurses.h)
- AC_DEFINE(HAVE_NCURSESW_NCURSES_H)
+ AC_DEFINE(HAVE_NCURSESW_NCURSES_H,1,[Define to 1 if we have ncursesw/ncurses.h])
;;
esac
@@ -1950,7 +2162,7 @@ CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_VERSION version: 13 updated: 2010/10/23 15:54:49
+dnl CF_NCURSES_VERSION version: 14 updated: 2012/10/06 08:57:51
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
@@ -2009,7 +2221,7 @@ EOF
])
rm -f $cf_tempfile
])
-test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
+test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_NCURSES_WRAP_PREFIX version: 1 updated: 2009/03/28 16:08:10
@@ -2028,7 +2240,7 @@ AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
AC_SUBST(NCURSES_WRAP_PREFIX)
])
dnl ---------------------------------------------------------------------------
-dnl CF_NETBSD_FORM_H version: 1 updated: 2011/01/15 14:59:18
+dnl CF_NETBSD_FORM_H version: 2 updated: 2012/10/06 16:39:58
dnl ----------------
dnl Check for NetBSD's form.h, which is incompatible with SVr4 and ncurses.
dnl Some workarounds are needed in client programs to allow them to compile.
@@ -2045,10 +2257,10 @@ AC_TRY_COMPILE([
],[cf_cv_netbsd_form_h=no])
])
-test "$cf_cv_netbsd_form_h" = yes && AC_DEFINE(HAVE_NETBSD_FORM_H)
+test "$cf_cv_netbsd_form_h" = yes && AC_DEFINE(HAVE_NETBSD_FORM_H,1,[Define to 1 if we appear to be using NetBSD form.h])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NETBSD_MENU_H version: 1 updated: 2011/01/15 14:59:18
+dnl CF_NETBSD_MENU_H version: 2 updated: 2012/10/06 16:39:58
dnl ----------------
dnl Check for NetBSD's menu.h, which is incompatible with SVr4 and ncurses.
dnl Some workarounds are needed in client programs to allow them to compile.
@@ -2064,17 +2276,17 @@ AC_TRY_COMPILE([
],[cf_cv_netbsd_menu_h=no])
])
-test "$cf_cv_netbsd_menu_h" = yes && AC_DEFINE(HAVE_NETBSD_MENU_H)
+test "$cf_cv_netbsd_menu_h" = yes && AC_DEFINE(HAVE_NETBSD_MENU_H,1,[Define to 1 if we appear to be using NetBSD menu.h])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05
+dnl CF_NO_LEAKS_OPTION version: 5 updated: 2012/10/02 20:55:03
dnl ------------------
dnl see CF_WITH_NO_LEAKS
AC_DEFUN([CF_NO_LEAKS_OPTION],[
AC_MSG_CHECKING(if you want to use $1 for testing)
AC_ARG_WITH($1,
[$2],
- [AC_DEFINE($3)ifelse([$4],,[
+ [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[
$4
])
: ${with_cflags:=-g}
@@ -2096,7 +2308,7 @@ case .$with_cflags in #(vi
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42
+dnl CF_PATH_SYNTAX version: 14 updated: 2012/06/19 20:58:54
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
@@ -2116,7 +2328,7 @@ case ".[$]$1" in #(vi
;;
.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
;;
-.\[$]{*prefix}*) #(vi
+.\[$]{*prefix}*|.\[$]{*dir}*) #(vi
eval $1="[$]$1"
case ".[$]$1" in #(vi
.NONE/*)
@@ -2133,13 +2345,15 @@ case ".[$]$1" in #(vi
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PDCURSES_X11 version: 11 updated: 2011/01/15 18:45:38
+dnl CF_PDCURSES_X11 version: 13 updated: 2012/10/06 16:39:58
dnl ---------------
dnl Configure for PDCurses' X11 library
AC_DEFUN([CF_PDCURSES_X11],[
AC_REQUIRE([CF_X_ATHENA])
-AC_PATH_PROGS(XCURSES_CONFIG,xcurses-config,none)
+CF_ACVERSION_CHECK(2.52,
+ [AC_CHECK_TOOLS(XCURSES_CONFIG, xcurses-config, none)],
+ [AC_PATH_PROGS(XCURSES_CONFIG, xcurses-config, none)])
if test "$XCURSES_CONFIG" != none ; then
@@ -2168,15 +2382,15 @@ char *XCursesProgramName = "test";
fi
if test $cf_cv_lib_XCurses = yes ; then
- AC_DEFINE(UNIX)
- AC_DEFINE(XCURSES)
- AC_CHECK_HEADER(xcurses.h, AC_DEFINE(HAVE_XCURSES))
+ AC_DEFINE(UNIX,1,[Define to 1 if using PDCurses on Unix])
+ AC_DEFINE(XCURSES,1,[Define to 1 if using PDCurses on Unix])
+ AC_CHECK_HEADER(xcurses.h, AC_DEFINE(HAVE_XCURSES,1,[Define to 1 if using PDCurses on Unix]))
else
AC_MSG_ERROR(Cannot link with XCurses)
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PKG_CONFIG version: 4 updated: 2011/02/18 20:26:24
+dnl CF_PKG_CONFIG version: 7 updated: 2011/04/29 04:53:22
dnl -------------
dnl Check for the package-config program, unless disabled by command-line.
AC_DEFUN([CF_PKG_CONFIG],
@@ -2193,7 +2407,9 @@ no) #(vi
PKG_CONFIG=none
;;
yes) #(vi
- AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)
+ CF_ACVERSION_CHECK(2.52,
+ [AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)],
+ [AC_PATH_PROG(PKG_CONFIG, pkg-config, none)])
;;
*)
PKG_CONFIG=$withval
@@ -2305,29 +2521,17 @@ done
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PROG_CC_U_D version: 1 updated: 2005/07/14 16:59:30
-dnl --------------
-dnl Check if C (preprocessor) -U and -D options are processed in the order
-dnl given rather than by type of option. Some compilers insist on apply all
-dnl of the -U options after all of the -D options. Others allow mixing them,
-dnl and may predefine symbols that conflict with those we define.
-AC_DEFUN([CF_PROG_CC_U_D],
-[
-AC_CACHE_CHECK(if $CC -U and -D options work together,cf_cv_cc_u_d_options,[
- cf_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
- AC_TRY_COMPILE([],[
-#ifndef U_D_OPTIONS
-make an undefined-error
-#endif
-#ifdef D_U_OPTIONS
-make a defined-error
-#endif
- ],[
- cf_cv_cc_u_d_options=yes],[
- cf_cv_cc_u_d_options=no])
- CPPFLAGS="$cf_save_CPPFLAGS"
-])
+dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58
+dnl ----------
+dnl standard check for CC, plus followup sanity checks
+dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name
+AC_DEFUN([CF_PROG_CC],[
+ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)])
+CF_GCC_VERSION
+CF_ACVERSION_CHECK(2.52,
+ [AC_PROG_CC_STDC],
+ [CF_ANSI_CC_REQD])
+CF_CC_ENV_FLAGS
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07
@@ -2373,7 +2577,124 @@ $1=`echo "$2" | \
-e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'`
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_SIG_ATOMIC_T version: 2 updated: 2005/09/18 17:27:12
+dnl CF_RPATH_HACK version: 11 updated: 2013/09/01 13:02:00
+dnl -------------
+AC_DEFUN([CF_RPATH_HACK],
+[
+AC_REQUIRE([CF_LD_RPATH_OPT])
+AC_MSG_CHECKING(for updated LDFLAGS)
+if test -n "$LD_RPATH_OPT" ; then
+ AC_MSG_RESULT(maybe)
+
+ AC_CHECK_PROGS(cf_ldd_prog,ldd,no)
+ cf_rpath_list="/usr/lib /lib"
+ if test "$cf_ldd_prog" != no
+ then
+ cf_rpath_oops=
+
+AC_TRY_LINK([#include <stdio.h>],
+ [printf("Hello");],
+ [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
+ cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort | uniq`])
+
+ # If we passed the link-test, but get a "not found" on a given library,
+ # this could be due to inept reconfiguration of gcc to make it only
+ # partly honor /usr/local/lib (or whatever). Sometimes this behavior
+ # is intentional, e.g., installing gcc in /usr/bin and suppressing the
+ # /usr/local libraries.
+ if test -n "$cf_rpath_oops"
+ then
+ for cf_rpath_src in $cf_rpath_oops
+ do
+ for cf_rpath_dir in \
+ /usr/local \
+ /usr/pkg \
+ /opt/sfw
+ do
+ if test -f $cf_rpath_dir/lib/$cf_rpath_src
+ then
+ CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src)
+ LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
+ break
+ fi
+ done
+ done
+ fi
+ fi
+
+ CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS)
+
+ CF_RPATH_HACK_2(LDFLAGS)
+ CF_RPATH_HACK_2(LIBS)
+
+ CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST(EXTRA_LDFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24
+dnl ---------------
+dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to
+dnl EXTRA_LDFLAGS for each -L option found.
+dnl
+dnl $cf_rpath_list contains a list of directories to ignore.
+dnl
+dnl $1 = variable name to update. The LDFLAGS variable should be the only one,
+dnl but LIBS often has misplaced -L options.
+AC_DEFUN([CF_RPATH_HACK_2],
+[
+CF_VERBOSE(...checking $1 [$]$1)
+
+cf_rpath_dst=
+for cf_rpath_src in [$]$1
+do
+ case $cf_rpath_src in #(vi
+ -L*) #(vi
+
+ # check if this refers to a directory which we will ignore
+ cf_rpath_skip=no
+ if test -n "$cf_rpath_list"
+ then
+ for cf_rpath_item in $cf_rpath_list
+ do
+ if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
+ then
+ cf_rpath_skip=yes
+ break
+ fi
+ done
+ fi
+
+ if test "$cf_rpath_skip" = no
+ then
+ # transform the option
+ if test "$LD_RPATH_OPT" = "-R " ; then
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
+ else
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
+ fi
+
+ # if we have not already added this, add it now
+ cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
+ if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
+ then
+ CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp)
+ EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+ fi
+ fi
+ ;;
+ esac
+ cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
+done
+$1=$cf_rpath_dst
+
+CF_VERBOSE(...checked $1 [$]$1)
+AC_SUBST(EXTRA_LDFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_SIG_ATOMIC_T version: 3 updated: 2012/10/04 20:12:20
dnl ---------------
dnl signal handler, but there are some gcc depedencies in that recommendation.
dnl Try anyway.
@@ -2405,10 +2726,10 @@ static void handler(int sig)
done
])
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)
+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_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50
+dnl CF_SUBDIR_PATH version: 7 updated: 2014/12/04 04:33:06
dnl --------------
dnl Construct a search-list for a nonstandard header/lib-file
dnl $1 = the variable to return as result
@@ -2418,14 +2739,21 @@ AC_DEFUN([CF_SUBDIR_PATH],
[
$1=
-CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix)
CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
-CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix)
-CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix)
-CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix)
+
+for cf_subdir_prefix in \
+ /usr \
+ /usr/local \
+ /usr/pkg \
+ /opt \
+ /opt/local \
+ [$]HOME
+do
+ CF_ADD_SUBDIR_PATH($1,$2,$3,$cf_subdir_prefix,$prefix)
+done
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_SYS_TIME_SELECT version: 4 updated: 2000/10/04 09:18:40
+dnl CF_SYS_TIME_SELECT version: 5 updated: 2012/10/04 05:24:07
dnl ------------------
dnl Check if we can include <sys/time.h> with <sys/select.h>; this breaks on
dnl older SCO configurations.
@@ -2445,10 +2773,10 @@ AC_TRY_COMPILE([
[cf_cv_sys_time_select=no])
])
AC_MSG_RESULT($cf_cv_sys_time_select)
-test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT)
+test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT,1,[Define to 1 if we can include <sys/time.h> with <sys/select.h>])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_TERM_HEADER version: 2 updated: 2010/10/23 15:54:49
+dnl CF_TERM_HEADER version: 3 updated: 2012/10/06 08:57:51
dnl --------------
dnl Look for term.h, which is part of X/Open curses. It defines the interface
dnl to terminfo database. Usually it is in the same include-path as curses.h,
@@ -2481,21 +2809,90 @@ done
case $cf_cv_term_header in # (vi
*term.h)
- AC_DEFINE(HAVE_TERM_H)
+ AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
;;
esac
case $cf_cv_term_header in # (vi
ncurses/term.h) #(vi
- AC_DEFINE(HAVE_NCURSES_TERM_H)
+ AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
;;
ncursesw/term.h)
- AC_DEFINE(HAVE_NCURSESW_TERM_H)
+ AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_TRY_PKG_CONFIG version: 4 updated: 2010/06/14 17:42:30
+dnl CF_TOP_BUILDDIR version: 2 updated: 2013/07/27 17:38:32
+dnl ---------------
+dnl Define a top_builddir symbol, for applications that need an absolute path.
+AC_DEFUN([CF_TOP_BUILDDIR],
+[
+top_builddir=ifelse($1,,`pwd`,$1)
+AC_SUBST(top_builddir)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_TPUTS_PROTO version: 2 updated: 2011/04/23 19:25:50
+dnl --------------
+dnl Check for type of function-pointer passed to tputs. Some old
+dnl implementations used functions that had different prototypes, making it
+dnl hard to compile portable programs using tputs.
+AC_DEFUN([CF_TPUTS_PROTO],[
+CF_CURSES_FUNCS(tputs)
+if test x$cf_cv_func_tputs = xyes
+then
+ cf_done=no
+ for cf_arg in int char
+ do
+ for cf_ret in int void
+ do
+ if test $cf_ret = void
+ then
+ cf_return="/* nothing */"
+ else
+ cf_return="return value"
+ fi
+ AC_TRY_COMPILE([
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_cv_term_header>
+
+static $cf_ret outc($cf_arg value) { $cf_return; }
+],[
+ tputs("hello", 0, outc);
+ ${cf_cv_main_return:-return}(0);
+],[
+ CF_VERBOSE([prototype $cf_ret func($cf_arg value)])
+ cat >>confdefs.h <<EOF
+#define TPUTS_ARG $cf_arg
+#define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
+#define TPUTS_RETURN(value) $cf_return
+EOF
+ cf_done=yes
+ break
+])
+ done
+ test $cf_done = yes && break
+ done
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_TRIM_X_LIBS version: 2 updated: 2013/07/09 21:27:22
+dnl --------------
+dnl Trim extra base X libraries added as a workaround for inconsistent library
+dnl dependencies returned by "new" pkg-config files.
+AC_DEFUN([CF_TRIM_X_LIBS],[
+ for cf_trim_lib in Xmu Xt X11
+ do
+ case "$LIBS" in
+ *-l$cf_trim_lib\ *-l$cf_trim_lib*)
+ LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
+ CF_VERBOSE(..trimmed $LIBS)
+ ;;
+ esac
+ done
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_TRY_PKG_CONFIG version: 5 updated: 2013/07/06 21:27:06
dnl -----------------
dnl This is a simple wrapper to use for pkg-config, for libraries which may be
dnl available in that form.
@@ -2516,10 +2913,51 @@ if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $1; then
CF_ADD_LIBS($cf_pkgconfig_libs)
ifelse([$2],,:,[$2])
else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
ifelse([$3],,:,[$3])
fi
])
dnl ---------------------------------------------------------------------------
+dnl CF_TRY_XOPEN_SOURCE version: 1 updated: 2011/10/30 17:09:50
+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 <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+],[
+#ifndef _XOPEN_SOURCE
+make an error
+#endif],
+ [cf_cv_xopen_source=no],
+ [cf_save="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+],[
+#ifdef _XOPEN_SOURCE
+make an error
+#endif],
+ [cf_cv_xopen_source=no],
+ [cf_cv_xopen_source=$cf_XOPEN_SOURCE])
+ CPPFLAGS="$cf_save"
+ ])
+])
+
+if test "$cf_cv_xopen_source" != no ; then
+ CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
+ CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
+ cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+ CF_ADD_CFLAGS($cf_temp_xopen_source)
+fi
+])
+dnl ---------------------------------------------------------------------------
dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
dnl --------
dnl Make an uppercase version of a variable
@@ -2529,7 +2967,7 @@ AC_DEFUN([CF_UPPER],
$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28
+dnl CF_UTF8_LIB version: 8 updated: 2012/10/06 08:57:51
dnl -----------
dnl Check for multibyte support, and if not found, utf8 compatibility library
AC_DEFUN([CF_UTF8_LIB],
@@ -2548,7 +2986,7 @@ AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
# ncurses/ncursesw:
if test "$cf_cv_utf8_lib" = "add-on" ; then
- AC_DEFINE(HAVE_LIBUTF8_H)
+ AC_DEFINE(HAVE_LIBUTF8_H,1,[Define to 1 if we should include libutf8.h])
CF_ADD_INCDIR($cf_cv_header_path_utf8)
CF_ADD_LIBDIR($cf_cv_library_path_utf8)
CF_ADD_LIBS($cf_cv_library_file_utf8)
@@ -2563,7 +3001,7 @@ AC_DEFUN([CF_VERBOSE],
CF_MSG_LOG([$1])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_WCHAR_TYPE version: 3 updated: 2010/05/26 16:44:57
+dnl CF_WCHAR_TYPE version: 4 updated: 2012/10/06 16:39:58
dnl -------------
dnl Check if type wide-character type $1 is declared, and if so, which header
dnl file is needed. The second parameter is used to set a shell variable when
@@ -2595,7 +3033,7 @@ AC_TRY_COMPILE([
[cf_cv_$1=unknown])])])
if test "$cf_cv_$1" = yes ; then
- AC_DEFINE(NEED_WCHAR_H)
+ AC_DEFINE(NEED_WCHAR_H,1,[Define to 1 if we must include wchar.h])
NEED_WCHAR_H=1
fi
@@ -2667,6 +3105,60 @@ if test "$with_dmalloc" = yes ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_WITH_NCURSES_ETC version: 2 updated: 2012/01/13 10:49:00
+dnl -------------------
+dnl Use this macro for programs which use any variant of "curses", e.g.,
+dnl "ncurses", and "PDCurses". Programs that can use curses and some unrelated
+dnl library (such as slang) should use a "--with-screen=XXX" option.
+dnl
+dnl This does not use AC_DEFUN, because that would tell autoconf to run each
+dnl of the macros inside this one - before this macro.
+define([CF_WITH_NCURSES_ETC],[
+CF_WITH_CURSES_DIR
+
+cf_cv_screen=curses
+
+AC_MSG_CHECKING(for specified curses library type)
+AC_ARG_WITH(ncursesw,
+ [ --with-ncursesw use wide ncurses-libraries],
+ [cf_cv_screen=ncursesw],[
+
+AC_ARG_WITH(ncurses,
+ [ --with-ncurses use ncurses-libraries],
+ [cf_cv_screen=ncurses],[
+
+AC_ARG_WITH(pdcurses,
+ [ --with-pdcurses compile/link with pdcurses X11 library],
+ [cf_cv_screen=pdcurses],[
+
+AC_ARG_WITH(curses-colr,
+ [ --with-curses-colr compile/link with HPUX 10.x color-curses],
+ [cf_cv_screen=curses_colr],[
+
+AC_ARG_WITH(curses-5lib,
+ [ --with-curses-5lib compile/link with SunOS 5lib curses],
+ [cf_cv_screen=curses_5lib])])])])])
+
+AC_MSG_RESULT($cf_cv_screen)
+
+case $cf_cv_screen in #(vi
+curses|curses_*) #(vi
+ CF_CURSES_CONFIG
+ ;;
+ncurses) #(vi
+ CF_NCURSES_CONFIG
+ ;;
+ncursesw) #(vi
+ CF_UTF8_LIB
+ CF_NCURSES_CONFIG(ncursesw)
+ ;;
+pdcurses)
+ CF_PDCURSES_X11
+ ;;
+esac
+
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21
dnl ----------------
AC_DEFUN([CF_WITH_VALGRIND],[
@@ -2714,7 +3206,7 @@ AC_TRY_LINK([
test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37
+dnl CF_XOPEN_SOURCE version: 48 updated: 2014/09/01 12:29:14
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,
@@ -2724,16 +3216,17 @@ dnl Parameters:
dnl $1 is the nominal value for _XOPEN_SOURCE
dnl $2 is the nominal value for _POSIX_C_SOURCE
AC_DEFUN([CF_XOPEN_SOURCE],[
+AC_REQUIRE([AC_CANONICAL_HOST])
cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
cf_xopen_source=
case $host_os in #(vi
-aix[[456]]*) #(vi
+aix[[4-7]]*) #(vi
cf_xopen_source="-D_ALL_SOURCE"
;;
-cygwin) #(vi
+cygwin|msys) #(vi
cf_XOPEN_SOURCE=600
;;
darwin[[0-8]].*) #(vi
@@ -2741,6 +3234,7 @@ darwin[[0-8]].*) #(vi
;;
darwin*) #(vi
cf_xopen_source="-D_DARWIN_C_SOURCE"
+ cf_XOPEN_SOURCE=
;;
freebsd*|dragonfly*) #(vi
# 5.x headers associate
@@ -2758,15 +3252,26 @@ hpux*) #(vi
;;
irix[[56]].*) #(vi
cf_xopen_source="-D_SGI_SOURCE"
+ cf_XOPEN_SOURCE=
;;
linux*|gnu*|mint*|k*bsd*-gnu) #(vi
CF_GNU_SOURCE
;;
+minix*) #(vi
+ cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
+ ;;
mirbsd*) #(vi
- # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
+ # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
+ cf_XOPEN_SOURCE=
+ CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
;;
netbsd*) #(vi
- # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+ 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]]*) #(vi
+ # 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
;;
openbsd*) #(vi
# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
@@ -2780,46 +3285,55 @@ nto-qnx*) #(vi
sco*) #(vi
# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
;;
-solaris2.1[[0-9]]) #(vi
- cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
- ;;
-solaris2.[[1-9]]) #(vi
+solaris2.*) #(vi
cf_xopen_source="-D__EXTENSIONS__"
+ cf_cv_xopen_source=broken
+ ;;
+sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
+ cf_XOPEN_SOURCE=
+ cf_POSIX_C_SOURCE=
;;
*)
- AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
- AC_TRY_COMPILE([#include <sys/types.h>],[
+ CF_TRY_XOPEN_SOURCE
+ CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
+ ;;
+esac
+
+if test -n "$cf_xopen_source" ; then
+ CF_ADD_CFLAGS($cf_xopen_source,true)
+fi
+
+dnl In anything but the default case, we may have system-specific setting
+dnl which is still not guaranteed to provide all of the entrypoints that
+dnl _XOPEN_SOURCE would yield.
+if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
+ AC_MSG_CHECKING(if _XOPEN_SOURCE really is set)
+ AC_TRY_COMPILE([#include <stdlib.h>],[
#ifndef _XOPEN_SOURCE
make an error
#endif],
- [cf_cv_xopen_source=no],
- [cf_save="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
- AC_TRY_COMPILE([#include <sys/types.h>],[
-#ifdef _XOPEN_SOURCE
+ [cf_XOPEN_SOURCE_set=yes],
+ [cf_XOPEN_SOURCE_set=no])
+ AC_MSG_RESULT($cf_XOPEN_SOURCE_set)
+ if test $cf_XOPEN_SOURCE_set = yes
+ then
+ AC_TRY_COMPILE([#include <stdlib.h>],[
+#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
make an error
#endif],
- [cf_cv_xopen_source=no],
- [cf_cv_xopen_source=$cf_XOPEN_SOURCE])
- CPPFLAGS="$cf_save"
- ])
-])
- if test "$cf_cv_xopen_source" != no ; then
- CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
- CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
- cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
- CF_ADD_CFLAGS($cf_temp_xopen_source)
+ [cf_XOPEN_SOURCE_set_ok=yes],
+ [cf_XOPEN_SOURCE_set_ok=no])
+ if test $cf_XOPEN_SOURCE_set_ok = no
+ then
+ AC_MSG_WARN(_XOPEN_SOURCE is lower than requested)
+ fi
+ else
+ CF_TRY_XOPEN_SOURCE
fi
- CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
- ;;
-esac
-
-if test -n "$cf_xopen_source" ; then
- CF_ADD_CFLAGS($cf_xopen_source)
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA version: 20 updated: 2010/11/09 05:18:02
+dnl CF_X_ATHENA version: 22 updated: 2014/07/12 18:57:58
dnl -----------
dnl Check for Xaw (Athena) libraries
dnl
@@ -2839,6 +3353,17 @@ else
AC_MSG_RESULT(no)
fi
+AC_MSG_CHECKING(if you want to link with Xaw 3d xft library)
+withval=
+AC_ARG_WITH(Xaw3dxft,
+ [ --with-Xaw3dxft link with Xaw 3d xft library])
+if test "$withval" = yes ; then
+ cf_x_athena=Xaw3dxft
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
AC_MSG_CHECKING(if you want to link with neXT Athena library)
withval=
AC_ARG_WITH(neXtaw,
@@ -2878,6 +3403,8 @@ if test "$PKG_CONFIG" != none ; then
CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
+ CF_TRIM_X_LIBS
+
AC_CACHE_CHECK(for usable $cf_x_athena/Xmu package,cf_cv_xaw_compat,[
AC_TRY_LINK([
#include <X11/Xmu/CharSet.h>
@@ -2893,7 +3420,15 @@ int check = XmuCompareISOLatin1("big", "small")
;;
*)
CF_VERBOSE(work around broken package)
- CF_TRY_PKG_CONFIG(xmu,,[CF_ADD_LIB_AFTER(-lXt,-lXmu)])
+ cf_save_xmu="$LIBS"
+ cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^[ ][ ]*//' -e 's/ .*//'`
+ CF_TRY_PKG_CONFIG(xmu,[
+ LIBS="$cf_save_xmu"
+ CF_ADD_LIB_AFTER($cf_first_lib,$cf_pkgconfig_libs)
+ ],[
+ CF_ADD_LIB_AFTER($cf_first_lib,-lXmu)
+ ])
+ CF_TRIM_X_LIBS
;;
esac
fi
@@ -2957,7 +3492,7 @@ elif test "$cf_x_athena_inc" != default ; then
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA_LIBS version: 10 updated: 2011/02/13 13:31:33
+dnl CF_X_ATHENA_LIBS version: 12 updated: 2011/07/17 19:55:02
dnl ----------------
dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
@@ -2973,19 +3508,24 @@ for cf_path in default \
/usr/local
do
for cf_lib in \
- "-l$cf_x_athena_root -lXmu" \
- "-l$cf_x_athena_root -lXpm -lXmu" \
- "-l${cf_x_athena_root}_s -lXmu_s"
+ ${cf_x_athena_root} \
+ ${cf_x_athena_root}7 \
+ ${cf_x_athena_root}6
+ do
+ for cf_libs in \
+ "-l$cf_lib -lXmu" \
+ "-l$cf_lib -lXpm -lXmu" \
+ "-l${cf_lib}_s -lXmu_s"
do
if test -z "$cf_x_athena_lib" ; then
cf_save="$LIBS"
cf_test=XawSimpleMenuAddGlobalActions
if test $cf_path != default ; then
- CF_ADD_LIBS(-L$cf_path/lib $cf_lib)
- AC_MSG_CHECKING(for $cf_lib in $cf_path)
+ CF_ADD_LIBS(-L$cf_path/lib $cf_libs)
+ AC_MSG_CHECKING(for $cf_libs in $cf_path)
else
- CF_ADD_LIBS($cf_lib)
- AC_MSG_CHECKING(for $cf_test in $cf_lib)
+ CF_ADD_LIBS($cf_libs)
+ AC_MSG_CHECKING(for $cf_test in $cf_libs)
fi
AC_TRY_LINK([
#include <X11/Intrinsic.h>
@@ -2996,12 +3536,14 @@ $cf_test((XtAppContext) 0)],
[cf_result=no])
AC_MSG_RESULT($cf_result)
if test "$cf_result" = yes ; then
- cf_x_athena_lib="$cf_lib"
+ cf_x_athena_lib="$cf_libs"
break
fi
LIBS="$cf_save"
fi
- done
+ done # cf_libs
+ test -n "$cf_x_athena_lib" && break
+ done # cf_lib
done
if test -z "$cf_x_athena_lib" ; then
@@ -3021,15 +3563,28 @@ CF_TRY_PKG_CONFIG(Xext,,[
[CF_ADD_LIB(Xext)])])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_X_TOOLKIT version: 20 updated: 2010/11/19 05:43:04
+dnl CF_X_TOOLKIT version: 22 updated: 2014/07/13 14:33:27
dnl ------------
dnl Check for X Toolkit libraries
-dnl
AC_DEFUN([CF_X_TOOLKIT],
[
AC_REQUIRE([AC_PATH_XTRA])
AC_REQUIRE([CF_CHECK_CACHE])
+# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
+# in some cases has installed dummy files in the former, other cases replaced
+# it with a link to the new location). This complicates the configure script.
+# Check for that pitfall, and recover using pkg-config
+#
+# If none of these are set, the configuration is almost certainly broken.
+if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
+then
+ CF_TRY_PKG_CONFIG(x11,,[AC_MSG_WARN(unable to find X11 library)])
+ CF_TRY_PKG_CONFIG(ice,,[AC_MSG_WARN(unable to find ICE library)])
+ CF_TRY_PKG_CONFIG(sm,,[AC_MSG_WARN(unable to find SM library)])
+ CF_TRY_PKG_CONFIG(xt,,[AC_MSG_WARN(unable to find Xt library)])
+fi
+
cf_have_X_LIBS=no
CF_TRY_PKG_CONFIG(xt,[
@@ -3095,7 +3650,7 @@ AC_TRY_LINK([
AC_CHECK_FUNC(XtAppInitialize,,[
AC_CHECK_LIB(Xt, XtAppInitialize,
- [AC_DEFINE(HAVE_LIBXT)
+ [AC_DEFINE(HAVE_LIBXT,1,[Define to 1 if we can compile with the Xt library])
cf_have_X_LIBS=Xt
LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"],,
[$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
diff --git a/test/background.c b/test/background.c
index afbe5f5..291851b 100644
--- a/test/background.c
+++ b/test/background.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2003,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,64 +26,204 @@
* authorization. *
****************************************************************************/
/*
- * $Id: background.c,v 1.3 2006/06/03 16:43:08 tom Exp $
+ * $Id: background.c,v 1.15 2014/08/09 22:31:23 tom Exp $
*/
-#include <test.priv.h>
+#define NEED_COLOR_CODE 1
+#define NEED_COLOR_NAME 1
+#include <color_name.h>
-int
-main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+static int default_bg = COLOR_BLACK;
+static int default_fg = COLOR_WHITE;
+
+static void
+test_background(void)
{
- short f, b;
+ NCURSES_COLOR_T f, b;
+ int row;
+ int chr;
- initscr();
- cbreak();
- noecho();
+ if (pair_content(0, &f, &b) == ERR) {
+ printw("pair 0 contains no data\n");
+ } else {
+ printw("pair 0 contains (%d,%d)\n", (int) f, (int) b);
+ }
+ getch();
- if (has_colors()) {
- start_color();
+ printw("Initializing pair 1 to red/%s\n", color_name(default_bg));
+ init_pair(1, COLOR_RED, (NCURSES_COLOR_T) default_bg);
+ bkgdset((chtype) (' ' | COLOR_PAIR(1)));
+ printw("RED/BLACK\n");
+ getch();
- pair_content(0, &f, &b);
- printw("pair 0 contains (%d,%d)\n", f, b);
- getch();
+ printw("Initializing pair 2 to %s/blue\n", color_name(default_fg));
+ init_pair(2, (NCURSES_COLOR_T) default_fg, COLOR_BLUE);
+ bkgdset((chtype) (' ' | COLOR_PAIR(2)));
+ printw("This line should be %s/blue\n", color_name(default_fg));
+ getch();
- printw("Initializing pair 1 to red/black\n");
- init_pair(1, COLOR_RED, COLOR_BLACK);
- bkgdset(' ' | COLOR_PAIR(1));
- printw("RED/BLACK\n");
- getch();
+ printw("Initializing pair 3 to %s/cyan (ACS_HLINE)\n", color_name(default_fg));
+ init_pair(3, (NCURSES_COLOR_T) default_fg, COLOR_CYAN);
+ printw("...and drawing a box which should be followed by lines\n");
+ bkgdset(ACS_HLINE | (attr_t) COLOR_PAIR(3));
+ /*
+ * Characters from vt100 line-drawing should be mapped to line-drawing,
+ * since A_ALTCHARSET is set in the background, and the character part
+ * of the background is replaced by the nonblank characters written.
+ *
+ * Characters not in the line-drawing range are usually sent as-is.
+ *
+ * With SVr4 curses it is possible to rely on this to mix uppercase text
+ * with the (lowercase) line-drawing characters. ncurses uses some of
+ * the uppercase characters for encoding thick- and double-lines.
+ */
+ row = 7;
+ mvprintw(row++, 10, "l");
+ for (chr = 0; chr < 32; ++chr)
+ addch(' ');
+ printw("x\n");
+ chr = 32;
+ while (chr < 128) {
+ if ((chr % 32) == 0)
+ mvprintw(row++, 10, "x");
+ addch((chtype) ((chr == 127) ? ' ' : chr));
+ if ((++chr % 32) == 0)
+ printw("x\n");
+ }
+ mvprintw(row++, 10, "m");
+ for (chr = 0; chr < 32; ++chr)
+ addch(' ');
+ printw("j\n");
+ getch();
- printw("Initializing pair 2 to white/blue\n");
- init_pair(2, COLOR_WHITE, COLOR_BLUE);
- bkgdset(' ' | COLOR_PAIR(2));
- printw("WHITE/BLUE\n");
- getch();
+ bkgdset((chtype) (' ' | COLOR_PAIR(0)));
+ printw("Default Colors\n");
+ getch();
- printw("Resetting colors to pair 0\n");
- bkgdset(' ' | COLOR_PAIR(0));
- printw("Default Colors\n");
- getch();
+ printw("Resetting colors to pair 1\n");
+ bkgdset((chtype) (' ' | COLOR_PAIR(1)));
+ printw("This line should be red/%s\n", color_name(default_bg));
+ getch();
- printw("Resetting colors to pair 1\n");
- bkgdset(' ' | COLOR_PAIR(1));
- printw("RED/BLACK\n");
- getch();
+ printw("Setting screen to pair 0\n");
+ bkgd((chtype) (' ' | COLOR_PAIR(0)));
+ getch();
- printw("Setting screen to pair 0\n");
- bkgd(' ' | COLOR_PAIR(0));
- getch();
+ printw("Setting screen to pair 1\n");
+ bkgd((chtype) (' ' | COLOR_PAIR(1)));
+ getch();
- printw("Setting screen to pair 1\n");
- bkgd(' ' | COLOR_PAIR(1));
- getch();
+ printw("Setting screen to pair 2\n");
+ bkgd((chtype) (' ' | COLOR_PAIR(2)));
+ getch();
- printw("Setting screen to pair 2\n");
- bkgd(' ' | COLOR_PAIR(2));
- getch();
+ printw("Setting screen to pair 3\n");
+ bkgd((chtype) (' ' | COLOR_PAIR(3)));
+ getch();
- printw("Setting screen to pair 0\n");
- bkgd(' ' | COLOR_PAIR(0));
- getch();
+ printw("Setting screen to pair 0\n");
+ bkgd((chtype) (' ' | COLOR_PAIR(0)));
+ getch();
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: background [options]"
+ ,""
+ ,"Options:"
+#if HAVE_ASSUME_DEFAULT_COLORS
+ ," -a invoke assume_default_colors, repeat to use in init_pair"
+#endif
+ ," -b XXX specify background color"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors, repeat to use in init_pair"
+#endif
+ ," -f XXX specify foreground color"
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+#if HAVE_ASSUME_DEFAULT_COLORS
+ int a_option = 0;
+#endif
+#if HAVE_USE_DEFAULT_COLORS
+ int d_option = 0;
+#endif
+ int n;
+
+ setlocale(LC_ALL, "");
+
+ while ((n = getopt(argc, argv, "ab:df:")) != -1) {
+ switch (n) {
+#if HAVE_ASSUME_DEFAULT_COLORS
+ case 'a':
+ ++a_option;
+ break;
+#endif
+ case 'b':
+ default_bg = color_code(optarg);
+ break;
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ ++d_option;
+ break;
+#endif
+ case 'f':
+ default_fg = color_code(optarg);
+ break;
+ default:
+ usage();
+ }
+ }
+#if HAVE_USE_DEFAULT_COLORS && HAVE_ASSUME_DEFAULT_COLORS
+ if (a_option && d_option) {
+ fprintf(stderr, "Use either -a or -d option, but not both\n");
+ ExitProgram(EXIT_FAILURE);
+ }
+#endif
+
+ initscr();
+ cbreak();
+ noecho();
+
+ if (has_colors()) {
+ start_color();
+
+#if HAVE_USE_DEFAULT_COLORS
+ if (d_option) {
+ printw("Using default colors...\n");
+ use_default_colors();
+ if (d_option > 1) {
+ default_fg = -1;
+ default_bg = -1;
+ }
+ }
+#endif
+#if HAVE_ASSUME_DEFAULT_COLORS
+ if (a_option) {
+ printw("Using assumed colors %s/%s...\n",
+ color_name(default_fg),
+ color_name(default_bg));
+ assume_default_colors(default_fg, default_bg);
+ if (a_option > 1) {
+ default_fg = -1;
+ default_bg = -1;
+ }
+ }
+#endif
+
+ test_background();
} else {
printw("This demo requires a color terminal");
diff --git a/test/blue.c b/test/blue.c
index dfe6abf..50d48b1 100644
--- a/test/blue.c
+++ b/test/blue.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -40,7 +40,7 @@
* results, use the ncurses(3) library. On non-Intel machines, SVr4 curses is
* just as good.
*
- * $Id: blue.c,v 1.33 2009/10/24 21:03:35 tom Exp $
+ * $Id: blue.c,v 1.35 2013/04/27 19:46:53 tom Exp $
*/
#include <test.priv.h>
@@ -70,7 +70,7 @@
#define BLACK_ON_WHITE 2
#define BLUE_ON_WHITE 3
-static RETSIGTYPE die(int onsig) GCC_NORETURN;
+static void die(int onsig) GCC_NORETURN;
static int deck_size = PACK_SIZE; /* initial deck */
static int deck[PACK_SIZE];
@@ -132,7 +132,7 @@ static chtype glyphs[] =
static chtype *suits = letters; /* this may change to glyphs below */
-static RETSIGTYPE
+static void
die(int onsig)
{
(void) signal(onsig, SIG_IGN);
@@ -202,8 +202,8 @@ printcard(int value)
if (value == NOCARD)
(void) addstr(" ");
else {
- addch(ranks[value % SUIT_LENGTH][0] | COLOR_PAIR(BLUE_ON_WHITE));
- addch(ranks[value % SUIT_LENGTH][1] | COLOR_PAIR(BLUE_ON_WHITE));
+ addch(ranks[value % SUIT_LENGTH][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
+ addch(ranks[value % SUIT_LENGTH][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
addch(suits[value / SUIT_LENGTH]);
}
(void) addch(' ');
diff --git a/test/bs.c b/test/bs.c
index ee7f227..a74f643 100644
--- a/test/bs.c
+++ b/test/bs.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -34,7 +34,7 @@
* v2.0 featuring strict ANSI/POSIX conformance, November 1993.
* v2.1 with ncurses mouse support, September 1995
*
- * $Id: bs.c,v 1.52 2010/11/13 20:07:52 tom Exp $
+ * $Id: bs.c,v 1.63 2014/08/09 22:27:12 tom Exp $
*/
#include <test.priv.h>
@@ -110,7 +110,7 @@ static char sub[] = "Submarine";
static char destroy[] = "Destroyer";
static char ptboat[] = "PT Boat";
-static char name[40];
+static char *your_name;
static char dftname[] = "stranger";
/* direction constants */
@@ -174,9 +174,9 @@ static int salvo, blitz, closepack;
#define PR (void)addstr
-static RETSIGTYPE uninitgame(int sig) GCC_NORETURN;
+static void uninitgame(int sig) GCC_NORETURN;
-static RETSIGTYPE
+static void
uninitgame(int sig GCC_UNUSED)
/* end the game, either normally or due to signal */
{
@@ -220,11 +220,12 @@ intro(void)
CATCHALL(uninitgame);
- if ((tmpname = getlogin()) != 0) {
- (void) strcpy(name, tmpname);
- name[0] = (char) toupper(UChar(name[0]));
- } else
- (void) strcpy(name, dftname);
+ if ((tmpname = getlogin()) != 0 &&
+ (your_name = strdup(tmpname)) != 0) {
+ your_name[0] = (char) toupper(UChar(your_name[0]));
+ } else {
+ your_name = dftname;
+ }
(void) initscr();
keypad(stdscr, TRUE);
@@ -426,10 +427,11 @@ initgame(void)
placeship(COMPUTER, ss, FALSE);
}
- ss = (ship_t *) NULL;
do {
char c, docked[SHIPTYPES + 2], *cp = docked;
+ ss = (ship_t *) NULL;
+
/* figure which ships still wait to be placed */
*cp++ = 'R';
for (i = 0; i < SHIPTYPES; i++)
@@ -442,7 +444,7 @@ initgame(void)
do {
c = (char) getcoord(PLAYER);
} while
- (!strchr(docked, c));
+ (!(strchr) (docked, c));
if (c == 'R')
(void) ungetch('R');
@@ -459,13 +461,14 @@ initgame(void)
do {
c = (char) getch();
} while
- (!(strchr("hjklrR", c) || c == FF));
+ (!(strchr("hjkl8462rR", c) || c == FF));
if (c == FF) {
(void) clearok(stdscr, TRUE);
(void) refresh();
+ } else if (ss == 0) {
+ beep(); /* simple to verify, unlikely to happen */
} else if (c == 'r') {
- assert(ss != 0);
prompt(1, "Random-placing your %s", ss->name);
randomplace(PLAYER, ss);
placeship(PLAYER, ss, TRUE);
@@ -481,7 +484,6 @@ initgame(void)
}
error((char *) NULL);
} else if (strchr("hjkl8462", c)) {
- assert(ss != 0);
ss->x = curx;
ss->y = cury;
@@ -863,7 +865,9 @@ plyturn(void)
m = " You'll pick up survivors from my %s, I hope...!";
break;
}
- (void) printw(m, ss->name);
+ if (m != 0) {
+ (void) printw(m, ss->name);
+ }
(void) beep();
}
return (hit);
@@ -952,8 +956,8 @@ cpufire(int x, int y)
bool hit, sunk;
ship_t *ss = NULL;
- hit = board[PLAYER][x][y] ? MARK_HIT : MARK_MISS;
- hits[COMPUTER][x][y] = (char) hit;
+ hit = (bool) board[PLAYER][x][y];
+ hits[COMPUTER][x][y] = (hit ? MARK_HIT : MARK_MISS);
MvPrintw(PROMPTLINE, 0,
"I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" :
"miss");
@@ -1130,16 +1134,16 @@ playagain(void)
++cpuwon;
else
++plywon;
- j = 18 + (int) strlen(name);
+ j = 18 + (int) strlen(your_name);
if (plywon >= 10)
++j;
if (cpuwon >= 10)
++j;
MvPrintw(1, (COLWIDTH - j) / 2,
- "%s: %d Computer: %d", name, plywon, cpuwon);
+ "%s: %d Computer: %d", your_name, plywon, cpuwon);
prompt(2, (awinna())? "Want to be humiliated again, %s [yn]? "
- : "Going to give me a chance for revenge, %s [yn]? ", name);
+ : "Going to give me a chance for revenge, %s [yn]? ", your_name);
return (sgetc("YN") == 'Y');
}
diff --git a/test/cardfile.c b/test/cardfile.c
index f9557bd..b750241 100644
--- a/test/cardfile.c
+++ b/test/cardfile.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1999-2008,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1999-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,7 +29,7 @@
/*
* Author: Thomas E. Dickey
*
- * $Id: cardfile.c,v 1.38 2010/11/14 00:58:45 tom Exp $
+ * $Id: cardfile.c,v 1.42 2013/09/28 22:02:17 tom Exp $
*
* File format: text beginning in column 1 is a title; other text is content.
*/
@@ -68,17 +68,13 @@ static CARD *all_cards;
static bool try_color = FALSE;
static char default_name[] = "cardfile.dat";
-#if !HAVE_STRDUP
-#define strdup my_strdup
-static char *
-strdup(const char *s)
+static void
+failed(const char *s)
{
- char *p = typeMalloc(char, strlen(s) + 1);
- if (p)
- strcpy(p, s);
- return (p);
+ perror(s);
+ endwin();
+ ExitProgram(EXIT_FAILURE);
}
-#endif /* not HAVE_STRDUP */
static const char *
skip(const char *buffer)
@@ -111,7 +107,7 @@ add_title(const char *title)
break;
}
- card = typeCalloc(CARD, 1);
+ card = typeCalloc(CARD, (size_t) 1);
card->title = strdup(title);
card->content = strdup("");
@@ -146,6 +142,8 @@ add_content(CARD * card, const char *content)
}
if (card->content)
strcpy(card->content + offset, content);
+ else
+ failed("add_content");
}
}
@@ -337,7 +335,7 @@ form_virtualize(WINDOW *w)
static FIELD **
make_fields(CARD * p, int form_high, int form_wide)
{
- FIELD **f = typeCalloc(FIELD *, 3);
+ FIELD **f = typeCalloc(FIELD *, (size_t) 3);
f[0] = new_field(1, form_wide, 0, 0, 0, 0);
set_field_back(f[0], A_REVERSE);
@@ -414,7 +412,7 @@ cardfile(char *fname)
if ((win = newwin(panel_high, panel_wide, y, x)) == 0)
break;
- wbkgd(win, COLOR_PAIR(pair_2));
+ wbkgd(win, (chtype) COLOR_PAIR(pair_2));
keypad(win, TRUE);
p->panel = new_panel(win);
box(win, 0, 0);
@@ -588,7 +586,7 @@ main(int argc, char *argv[])
start_color();
init_pair(pair_1, COLOR_WHITE, COLOR_BLUE);
init_pair(pair_2, COLOR_WHITE, COLOR_CYAN);
- bkgd(COLOR_PAIR(pair_1));
+ bkgd((chtype) COLOR_PAIR(pair_1));
} else {
try_color = FALSE;
}
diff --git a/test/chgat.c b/test/chgat.c
index 53ecfd7..919b5c9 100644
--- a/test/chgat.c
+++ b/test/chgat.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2006-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: chgat.c,v 1.11 2010/05/01 19:12:26 tom Exp $
+ * $Id: chgat.c,v 1.12 2012/11/18 01:55:35 tom Exp $
*
* test-driver for chgat/wchgat/mvchgat/mvwchgat
*/
@@ -176,6 +176,8 @@ do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
delwin(win1);
touchwin(win);
} else {
+ if (win1 != 0)
+ delwin(win1);
beep();
}
}
diff --git a/test/clip_printw.c b/test/clip_printw.c
index 5b279e9..d40bf01 100644
--- a/test/clip_printw.c
+++ b/test/clip_printw.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2008-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2008-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: clip_printw.c,v 1.7 2010/11/13 20:48:48 tom Exp $
+ * $Id: clip_printw.c,v 1.10 2014/08/02 23:13:29 tom Exp $
*
* demonstrate how to use printw without wrapping.
*/
@@ -207,6 +207,8 @@ do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
delwin(win1);
touchwin(win);
} else {
+ if (win1)
+ delwin(win1);
beep();
}
}
@@ -329,7 +331,7 @@ test_clipping(WINDOW *win)
do {
switch (st.ch) {
case '.': /* change from current position */
- (void) wattrset(win, st.attr | (chtype) COLOR_PAIR(st.pair));
+ (void) wattrset(win, AttrArg(COLOR_PAIR(st.pair), st.attr));
if (st.count > 0) {
need = (unsigned) st.count + 1;
sprintf(fmt, "%%c%%%ds%%c", st.count);
@@ -337,12 +339,13 @@ test_clipping(WINDOW *win)
need = (unsigned) getmaxx(win) - 1;
strcpy(fmt, "%c%s%c");
}
- if ((buffer = typeMalloc(char, need)) != 0) {
+ if ((buffer = typeMalloc(char, need + 1)) != 0) {
for (j = 0; j < need; ++j) {
buffer[j] = (char) ('A' + (j % 26));
}
buffer[need - 1] = '\0';
st.status = clip_wprintw(win, fmt, '[', buffer, ']');
+ free(buffer);
}
break;
case 'w':
diff --git a/test/color_name.h b/test/color_name.h
new file mode 100644
index 0000000..81a3b31
--- /dev/null
+++ b/test/color_name.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+ * Copyright (c) 2011,2012 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/*
+ * $Id: color_name.h,v 1.4 2012/11/18 01:59:32 tom Exp $
+ */
+
+#ifndef __COLORNAME_H
+#define __COLORNAME_H 1
+
+#ifndef __TEST_PRIV_H
+#include <test.priv.h>
+#endif
+
+static NCURSES_CONST char *the_color_names[] =
+{
+ "black",
+ "red",
+ "green",
+ "yellow",
+ "blue",
+ "magenta",
+ "cyan",
+ "white",
+ "BLACK",
+ "RED",
+ "GREEN",
+ "YELLOW",
+ "BLUE",
+ "MAGENTA",
+ "CYAN",
+ "WHITE"
+};
+
+#ifdef NEED_COLOR_CODE
+static int
+color_code(const char *color)
+{
+ int result = 0;
+ char *endp = 0;
+ size_t n;
+
+ if ((result = (int) strtol(color, &endp, 0)) >= 0
+ && (endp == 0 || *endp == 0)) {
+ ;
+ } else if (!strcmp(color, "default")) {
+ result = -1;
+ } else {
+ for (n = 0; n < SIZEOF(the_color_names); ++n) {
+ if (!strcmp(the_color_names[n], color)) {
+ result = (int) n;
+ break;
+ }
+ }
+ }
+ return result;
+}
+#endif /* NEED_COLOR_NAME */
+
+#ifdef NEED_COLOR_NAME
+static const char *
+color_name(int color)
+{
+ static char temp[20];
+ const char *result = 0;
+
+ if (color >= (int) SIZEOF(the_color_names)) {
+ sprintf(temp, "%d", color);
+ result = temp;
+ } else if (color < 0) {
+ result = "default";
+ } else {
+ result = the_color_names[color];
+ }
+ return result;
+}
+#endif /* NEED_COLOR_NAME */
+
+#endif /* __COLORNAME_H */
diff --git a/test/color_set.c b/test/color_set.c
index 2e981cb..477d049 100644
--- a/test/color_set.c
+++ b/test/color_set.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2003-2006,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: color_set.c,v 1.6 2008/02/10 00:18:01 tom Exp $
+ * $Id: color_set.c,v 1.8 2014/02/01 22:10:42 tom Exp $
*/
#include <test.priv.h>
@@ -38,7 +38,7 @@
int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
- short f, b;
+ NCURSES_COLOR_T f, b;
int i;
initscr();
@@ -48,8 +48,8 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
if (has_colors()) {
start_color();
- pair_content(0, &f, &b);
- printw("pair 0 contains (%d,%d)\n", f, b);
+ (void) pair_content(0, &f, &b);
+ printw("pair 0 contains (%d,%d)\n", (int) f, (int) b);
getch();
printw("Initializing pair 1 to red/black\n");
diff --git a/test/configure b/test/configure
index 2937235..51dd2d0 100755
--- a/test/configure
+++ b/test/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.52.20101002.
+# Generated by Autoconf 2.52.20141204.
#
# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
@@ -105,42 +105,6 @@ SHELL=${CONFIG_SHELL-/bin/sh}
: ${ac_max_here_lines=38}
ac_unique_file="ncurses.c"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
# Initialize some variables set by options.
ac_init_help=
@@ -170,15 +134,16 @@ x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+infodir='${datarootdir}/info'
+mandir='${datarootdir}/man'
# Identity of this package.
PACKAGE_NAME=
@@ -229,6 +194,13 @@ do
| --da=*)
datadir=$ac_optarg ;;
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
-disable-* | --disable-*)
ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
@@ -504,7 +476,7 @@ do
done
# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
localstatedir libdir includedir oldincludedir infodir mandir
do
eval ac_val=$`echo $ac_var`
@@ -641,15 +613,16 @@ Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --datarootdir=DIR read-only architecture-independent data [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
EOF
cat <<\EOF
@@ -673,31 +646,38 @@ if test -n "$ac_init_help"; then
cat <<\EOF
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
-
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --disable-echo display "compiling" commands
- --enable-warnings test: turn on gcc compiler warnings
- --with-dmalloc test: use Gray Watson's dmalloc library
- --with-dbmalloc test: use Conor Cahill's dbmalloc library
- --with-valgrind test: use valgrind
- --disable-leaks test: free permanent memory, analyze leaks
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+
+General Options:
+ --with-pkg-config{=path} enable/disable use of pkg-config
+ --disable-echo do not display "compiling" commands
+Curses Version-dependent Options:
+ --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
+ --disable-widec disable checks for wide-character functions
--with-curses-dir=DIR directory in which (n)curses is installed
- --with-5lib use SunOS sysv-libraries
- --with-ncursesw use wide ncurses-libraries (installed)
- --with-ncurses use ncurses-libraries (installed)
+ --with-ncursesw use wide ncurses-libraries
+ --with-ncurses use ncurses-libraries
--with-pdcurses compile/link with pdcurses X11 library
+ --with-curses-colr compile/link with HPUX 10.x color-curses
+ --with-curses-5lib compile/link with SunOS 5lib curses
--with-Xaw3d link with Xaw 3d library
+ --with-Xaw3dxft link with Xaw 3d xft library
--with-neXtaw link with neXT Athena library
--with-XawPlus link with Athena-Plus library
- --with-pkg-config{=path} enable/disable use of pkg-config
--with-x use the X Window System
- --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
+Testing/development Options:
+ --enable-warnings test: turn on gcc compiler warnings
+ --with-dmalloc test: use Gray Watson's dmalloc library
+ --with-dbmalloc test: use Conor Cahill's dbmalloc library
+ --with-valgrind test: use valgrind
+ --disable-leaks test: free permanent memory, analyze leaks
+ --disable-rpath-hack don't add rpath options for additional libraries
Some influential environment variables:
CC C compiler command
@@ -767,7 +747,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.52.20101002. Invocation command line was
+generated by GNU Autoconf 2.52.20141204. Invocation command line was
$ $0 $@
@@ -891,7 +871,7 @@ if test -z "$CONFIG_SITE"; then
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- { echo "$as_me:894: loading site script $ac_site_file" >&5
+ { echo "$as_me:874: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
cat "$ac_site_file" >&5
. "$ac_site_file"
@@ -902,7 +882,7 @@ if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special
# files actually), so we avoid doing that.
if test -f "$cache_file"; then
- { echo "$as_me:905: loading cache $cache_file" >&5
+ { echo "$as_me:885: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . $cache_file;;
@@ -910,7 +890,7 @@ echo "$as_me: loading cache $cache_file" >&6;}
esac
fi
else
- { echo "$as_me:913: creating cache $cache_file" >&5
+ { echo "$as_me:893: creating cache $cache_file" >&5
echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
@@ -926,21 +906,21 @@ for ac_var in `(set) 2>&1 |
eval ac_new_val="\$ac_env_${ac_var}_value"
case $ac_old_set,$ac_new_set in
set,)
- { echo "$as_me:929: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+ { echo "$as_me:909: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { echo "$as_me:933: error: \`$ac_var' was not set in the previous run" >&5
+ { echo "$as_me:913: error: \`$ac_var' was not set in the previous run" >&5
echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:939: error: \`$ac_var' has changed since the previous run:" >&5
+ { echo "$as_me:919: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:941: former value: $ac_old_val" >&5
+ { echo "$as_me:921: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:943: current value: $ac_new_val" >&5
+ { echo "$as_me:923: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
ac_cache_corrupted=:
fi;;
@@ -959,9 +939,9 @@ echo "$as_me: current value: $ac_new_val" >&2;}
fi
done
if $ac_cache_corrupted; then
- { echo "$as_me:962: error: changes in the environment can compromise the build" >&5
+ { echo "$as_me:942: error: changes in the environment can compromise the build" >&5
echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:964: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+ { { echo "$as_me:944: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -973,19 +953,19 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_main_return=return
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
+case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway
+ ECHO_T=' ' ;;
*c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
*) ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac
echo "#! $SHELL" >conftest.sh
echo "exit 0" >>conftest.sh
chmod +x conftest.sh
-if { (echo "$as_me:985: PATH=\".;.\"; conftest.sh") >&5
+if { (echo "$as_me:965: PATH=\".;.\"; conftest.sh") >&5
(PATH=".;."; conftest.sh) 2>&5
ac_status=$?
- echo "$as_me:988: \$? = $ac_status" >&5
+ echo "$as_me:968: \$? = $ac_status" >&5
(exit $ac_status); }; then
ac_path_separator=';'
else
@@ -1017,7 +997,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
fi
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:1020: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+ { { echo "$as_me:1000: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -1027,11 +1007,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# Make sure we can run config.sub.
$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:1030: error: cannot run $ac_config_sub" >&5
+ { { echo "$as_me:1010: error: cannot run $ac_config_sub" >&5
echo "$as_me: error: cannot run $ac_config_sub" >&2;}
{ (exit 1); exit 1; }; }
-echo "$as_me:1034: checking build system type" >&5
+echo "$as_me:1014: checking build system type" >&5
echo $ECHO_N "checking build system type... $ECHO_C" >&6
if test "${ac_cv_build+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1040,16 +1020,16 @@ else
test -z "$ac_cv_build_alias" &&
ac_cv_build_alias=`$ac_config_guess`
test -z "$ac_cv_build_alias" &&
- { { echo "$as_me:1043: error: cannot guess build type; you must specify one" >&5
+ { { echo "$as_me:1023: error: cannot guess build type; you must specify one" >&5
echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
{ (exit 1); exit 1; }; }
ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:1047: error: $ac_config_sub $ac_cv_build_alias failed." >&5
+ { { echo "$as_me:1027: error: $ac_config_sub $ac_cv_build_alias failed." >&5
echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:1052: result: $ac_cv_build" >&5
+echo "$as_me:1032: result: $ac_cv_build" >&5
echo "${ECHO_T}$ac_cv_build" >&6
build=$ac_cv_build
build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1057,7 +1037,7 @@ build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
- echo "$as_me:1060: checking host system type" >&5
+ echo "$as_me:1040: checking host system type" >&5
echo $ECHO_N "checking host system type... $ECHO_C" >&6
if test "${ac_cv_host+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1066,12 +1046,12 @@ else
test -z "$ac_cv_host_alias" &&
ac_cv_host_alias=$ac_cv_build_alias
ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:1069: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+ { { echo "$as_me:1049: error: $ac_config_sub $ac_cv_host_alias failed" >&5
echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:1074: result: $ac_cv_host" >&5
+echo "$as_me:1054: result: $ac_cv_host" >&5
echo "${ECHO_T}$ac_cv_host" >&6
host=$ac_cv_host
host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1085,7 +1065,8 @@ else
system_name="`(hostname) 2>/dev/null`"
fi
fi
-test -n "$system_name" && cat >>confdefs.h <<EOF
+test -n "$system_name" &&
+cat >>confdefs.h <<EOF
#define SYSTEM_NAME "$system_name"
EOF
@@ -1096,13 +1077,13 @@ else
fi
test -z "$system_name" && system_name="$cf_cv_system_name"
-test -n "$cf_cv_system_name" && echo "$as_me:1099: result: Configuring for $cf_cv_system_name" >&5
+test -n "$cf_cv_system_name" && echo "$as_me:1080: result: Configuring for $cf_cv_system_name" >&5
echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
if test ".$system_name" != ".$cf_cv_system_name" ; then
- echo "$as_me:1103: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
+ echo "$as_me:1084: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
- { { echo "$as_me:1105: error: \"Please remove config.cache and try again.\"" >&5
+ { { echo "$as_me:1086: error: \"Please remove config.cache and try again.\"" >&5
echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -1120,7 +1101,7 @@ _ACEOF
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
rm conftest.sed
-echo "$as_me:1123: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "$as_me:1104: checking whether ${MAKE-make} sets \${MAKE}" >&5
echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
@@ -1140,11 +1121,11 @@ fi
rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:1143: result: yes" >&5
+ echo "$as_me:1124: result: yes" >&5
echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- echo "$as_me:1147: result: no" >&5
+ echo "$as_me:1128: result: no" >&5
echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -1158,7 +1139,7 @@ ac_main_return=return
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:1161: checking for $ac_word" >&5
+echo "$as_me:1142: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1173,7 +1154,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_CC="${ac_tool_prefix}gcc"
-echo "$as_me:1176: found $ac_dir/$ac_word" >&5
+echo "$as_me:1157: found $ac_dir/$ac_word" >&5
break
done
@@ -1181,10 +1162,10 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1184: result: $CC" >&5
+ echo "$as_me:1165: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1187: result: no" >&5
+ echo "$as_me:1168: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1193,7 +1174,7 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo "$as_me:1196: checking for $ac_word" >&5
+echo "$as_me:1177: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1208,7 +1189,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ac_ct_CC="gcc"
-echo "$as_me:1211: found $ac_dir/$ac_word" >&5
+echo "$as_me:1192: found $ac_dir/$ac_word" >&5
break
done
@@ -1216,10 +1197,10 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:1219: result: $ac_ct_CC" >&5
+ echo "$as_me:1200: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$as_me:1222: result: no" >&5
+ echo "$as_me:1203: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1232,7 +1213,7 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:1235: checking for $ac_word" >&5
+echo "$as_me:1216: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1247,7 +1228,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_CC="${ac_tool_prefix}cc"
-echo "$as_me:1250: found $ac_dir/$ac_word" >&5
+echo "$as_me:1231: found $ac_dir/$ac_word" >&5
break
done
@@ -1255,10 +1236,10 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1258: result: $CC" >&5
+ echo "$as_me:1239: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1261: result: no" >&5
+ echo "$as_me:1242: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1267,7 +1248,7 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo "$as_me:1270: checking for $ac_word" >&5
+echo "$as_me:1251: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1282,7 +1263,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ac_ct_CC="cc"
-echo "$as_me:1285: found $ac_dir/$ac_word" >&5
+echo "$as_me:1266: found $ac_dir/$ac_word" >&5
break
done
@@ -1290,10 +1271,10 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:1293: result: $ac_ct_CC" >&5
+ echo "$as_me:1274: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$as_me:1296: result: no" >&5
+ echo "$as_me:1277: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1306,7 +1287,7 @@ fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo "$as_me:1309: checking for $ac_word" >&5
+echo "$as_me:1290: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1326,7 +1307,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
continue
fi
ac_cv_prog_CC="cc"
-echo "$as_me:1329: found $ac_dir/$ac_word" >&5
+echo "$as_me:1310: found $ac_dir/$ac_word" >&5
break
done
@@ -1348,10 +1329,10 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1351: result: $CC" >&5
+ echo "$as_me:1332: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1354: result: no" >&5
+ echo "$as_me:1335: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1362,7 +1343,7 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:1365: checking for $ac_word" >&5
+echo "$as_me:1346: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1377,7 +1358,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-echo "$as_me:1380: found $ac_dir/$ac_word" >&5
+echo "$as_me:1361: found $ac_dir/$ac_word" >&5
break
done
@@ -1385,10 +1366,10 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1388: result: $CC" >&5
+ echo "$as_me:1369: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1391: result: no" >&5
+ echo "$as_me:1372: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1401,7 +1382,7 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:1404: checking for $ac_word" >&5
+echo "$as_me:1385: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1416,7 +1397,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ac_ct_CC="$ac_prog"
-echo "$as_me:1419: found $ac_dir/$ac_word" >&5
+echo "$as_me:1400: found $ac_dir/$ac_word" >&5
break
done
@@ -1424,10 +1405,10 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:1427: result: $ac_ct_CC" >&5
+ echo "$as_me:1408: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$as_me:1430: result: no" >&5
+ echo "$as_me:1411: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1439,32 +1420,32 @@ fi
fi
-test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
+test -z "$CC" && { { echo "$as_me:1423: error: no acceptable cc found in \$PATH" >&5
echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
{ (exit 1); exit 1; }; }
# Provide some information about the compiler.
-echo "$as_me:1447:" \
+echo "$as_me:1428:" \
"checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1431: \"$ac_compiler --version </dev/null >&5\"") >&5
(eval $ac_compiler --version </dev/null >&5) 2>&5
ac_status=$?
- echo "$as_me:1453: \$? = $ac_status" >&5
+ echo "$as_me:1434: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1436: \"$ac_compiler -v </dev/null >&5\"") >&5
(eval $ac_compiler -v </dev/null >&5) 2>&5
ac_status=$?
- echo "$as_me:1458: \$? = $ac_status" >&5
+ echo "$as_me:1439: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1441: \"$ac_compiler -V </dev/null >&5\"") >&5
(eval $ac_compiler -V </dev/null >&5) 2>&5
ac_status=$?
- echo "$as_me:1463: \$? = $ac_status" >&5
+ echo "$as_me:1444: \$? = $ac_status" >&5
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
-#line 1467 "configure"
+#line 1448 "configure"
#include "confdefs.h"
int
@@ -1480,13 +1461,13 @@ ac_clean_files="$ac_clean_files a.out a.exe"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:1483: checking for C compiler default output" >&5
+echo "$as_me:1464: checking for C compiler default output" >&5
echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
+if { (eval echo "$as_me:1467: \"$ac_link_default\"") >&5
(eval $ac_link_default) 2>&5
ac_status=$?
- echo "$as_me:1489: \$? = $ac_status" >&5
+ echo "$as_me:1470: \$? = $ac_status" >&5
(exit $ac_status); }; then
# Find the output, starting from the most likely. This scheme is
# not robust to junk in `.', hence go to wildcards (a.*) only as a last
@@ -1509,34 +1490,34 @@ done
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-{ { echo "$as_me:1512: error: C compiler cannot create executables" >&5
+{ { echo "$as_me:1493: error: C compiler cannot create executables" >&5
echo "$as_me: error: C compiler cannot create executables" >&2;}
{ (exit 77); exit 77; }; }
fi
ac_exeext=$ac_cv_exeext
-echo "$as_me:1518: result: $ac_file" >&5
+echo "$as_me:1499: result: $ac_file" >&5
echo "${ECHO_T}$ac_file" >&6
# Check the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:1523: checking whether the C compiler works" >&5
+echo "$as_me:1504: checking whether the C compiler works" >&5
echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
if { ac_try='./$ac_file'
- { (eval echo "$as_me:1529: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1510: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1532: \$? = $ac_status" >&5
+ echo "$as_me:1513: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { echo "$as_me:1539: error: cannot run C compiled programs.
+ { { echo "$as_me:1520: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'." >&5
echo "$as_me: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'." >&2;}
@@ -1544,24 +1525,24 @@ If you meant to cross compile, use \`--host'." >&2;}
fi
fi
fi
-echo "$as_me:1547: result: yes" >&5
+echo "$as_me:1528: result: yes" >&5
echo "${ECHO_T}yes" >&6
rm -f a.out a.exe conftest$ac_cv_exeext
ac_clean_files=$ac_clean_files_save
# Check the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:1554: checking whether we are cross compiling" >&5
+echo "$as_me:1535: checking whether we are cross compiling" >&5
echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:1556: result: $cross_compiling" >&5
+echo "$as_me:1537: result: $cross_compiling" >&5
echo "${ECHO_T}$cross_compiling" >&6
-echo "$as_me:1559: checking for executable suffix" >&5
+echo "$as_me:1540: checking for executable suffix" >&5
echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
-if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
+if { (eval echo "$as_me:1542: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:1564: \$? = $ac_status" >&5
+ echo "$as_me:1545: \$? = $ac_status" >&5
(exit $ac_status); }; then
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
@@ -1577,25 +1558,25 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
esac
done
else
- { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
+ { { echo "$as_me:1561: error: cannot compute EXEEXT: cannot compile and link" >&5
echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest$ac_cv_exeext
-echo "$as_me:1586: result: $ac_cv_exeext" >&5
+echo "$as_me:1567: result: $ac_cv_exeext" >&5
echo "${ECHO_T}$ac_cv_exeext" >&6
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-echo "$as_me:1592: checking for object suffix" >&5
+echo "$as_me:1573: checking for object suffix" >&5
echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
if test "${ac_cv_objext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 1598 "configure"
+#line 1579 "configure"
#include "confdefs.h"
int
@@ -1607,10 +1588,10 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1591: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1613: \$? = $ac_status" >&5
+ echo "$as_me:1594: \$? = $ac_status" >&5
(exit $ac_status); }; then
for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
case $ac_file in
@@ -1622,24 +1603,24 @@ done
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-{ { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
+{ { echo "$as_me:1606: error: cannot compute OBJEXT: cannot compile" >&5
echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-echo "$as_me:1632: result: $ac_cv_objext" >&5
+echo "$as_me:1613: result: $ac_cv_objext" >&5
echo "${ECHO_T}$ac_cv_objext" >&6
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
+echo "$as_me:1617: checking whether we are using the GNU C compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
if test "${ac_cv_c_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 1642 "configure"
+#line 1623 "configure"
#include "confdefs.h"
int
@@ -1654,16 +1635,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1638: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1660: \$? = $ac_status" >&5
+ echo "$as_me:1641: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1663: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1644: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1666: \$? = $ac_status" >&5
+ echo "$as_me:1647: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_compiler_gnu=yes
else
@@ -1675,19 +1656,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
+echo "$as_me:1659: result: $ac_cv_c_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
CFLAGS="-g"
-echo "$as_me:1684: checking whether $CC accepts -g" >&5
+echo "$as_me:1665: checking whether $CC accepts -g" >&5
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 1690 "configure"
+#line 1671 "configure"
#include "confdefs.h"
int
@@ -1699,16 +1680,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1683: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1705: \$? = $ac_status" >&5
+ echo "$as_me:1686: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1708: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1689: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1711: \$? = $ac_status" >&5
+ echo "$as_me:1692: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
@@ -1718,7 +1699,7 @@ ac_cv_prog_cc_g=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
+echo "$as_me:1702: result: $ac_cv_prog_cc_g" >&5
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
@@ -1745,16 +1726,16 @@ cat >conftest.$ac_ext <<_ACEOF
#endif
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1729: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1751: \$? = $ac_status" >&5
+ echo "$as_me:1732: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1754: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1735: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1757: \$? = $ac_status" >&5
+ echo "$as_me:1738: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
for ac_declaration in \
''\
@@ -1766,7 +1747,7 @@ if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
-#line 1769 "configure"
+#line 1750 "configure"
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
@@ -1779,16 +1760,16 @@ exit (42);
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1763: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1785: \$? = $ac_status" >&5
+ echo "$as_me:1766: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1788: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1769: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1791: \$? = $ac_status" >&5
+ echo "$as_me:1772: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -1798,7 +1779,7 @@ continue
fi
rm -f conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
-#line 1801 "configure"
+#line 1782 "configure"
#include "confdefs.h"
$ac_declaration
int
@@ -1810,16 +1791,16 @@ exit (42);
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1794: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1816: \$? = $ac_status" >&5
+ echo "$as_me:1797: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1819: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1800: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1822: \$? = $ac_status" >&5
+ echo "$as_me:1803: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
break
else
@@ -1847,13 +1828,214 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_main_return=return
+GCC_VERSION=none
+if test "$GCC" = yes ; then
+ echo "$as_me:1833: checking version of $CC" >&5
+echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
+ GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
+ test -z "$GCC_VERSION" && GCC_VERSION=unknown
+ echo "$as_me:1837: result: $GCC_VERSION" >&5
+echo "${ECHO_T}$GCC_VERSION" >&6
+fi
+
+echo "$as_me:1841: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line 1849 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1898: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:1901: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:1904: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:1907: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:1924: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:1927: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# This should have been defined by AC_PROG_CC
+: ${CC:=cc}
+
+echo "$as_me:1935: checking \$CC variable" >&5
+echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
+case "$CC" in #(vi
+*[\ \ ]-[IUD]*)
+ echo "$as_me:1939: result: broken" >&5
+echo "${ECHO_T}broken" >&6
+ { echo "$as_me:1941: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
+echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
+ # humor him...
+ cf_flags=`echo "$CC" | sed -e 's/^[^ ]*[ ]//'`
+ CC=`echo "$CC" | sed -e 's/[ ].*//'`
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_flags
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ case $cf_add_cflags in #(vi
+ -D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+ ;;
+*)
+ echo "$as_me:2027: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+ ;;
+esac
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_main_return=return
-echo "$as_me:1856: checking how to run the C preprocessor" >&5
+echo "$as_me:2038: checking how to run the C preprocessor" >&5
echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
@@ -1874,18 +2056,18 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line 1877 "configure"
+#line 2059 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax error
_ACEOF
-if { (eval echo "$as_me:1882: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2064: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:1888: \$? = $ac_status" >&5
+ echo "$as_me:2070: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1908,17 +2090,17 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line 1911 "configure"
+#line 2093 "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:1915: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2097: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:1921: \$? = $ac_status" >&5
+ echo "$as_me:2103: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1955,7 +2137,7 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-echo "$as_me:1958: result: $CPP" >&5
+echo "$as_me:2140: result: $CPP" >&5
echo "${ECHO_T}$CPP" >&6
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
@@ -1965,18 +2147,18 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line 1968 "configure"
+#line 2150 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax error
_ACEOF
-if { (eval echo "$as_me:1973: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2155: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:1979: \$? = $ac_status" >&5
+ echo "$as_me:2161: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1999,17 +2181,17 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line 2002 "configure"
+#line 2184 "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:2006: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2188: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:2012: \$? = $ac_status" >&5
+ echo "$as_me:2194: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2037,7 +2219,7 @@ rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
- { { echo "$as_me:2040: error: C preprocessor \"$CPP\" fails sanity check" >&5
+ { { echo "$as_me:2222: error: C preprocessor \"$CPP\" fails sanity check" >&5
echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -2053,7 +2235,7 @@ for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:2056: checking for $ac_word" >&5
+echo "$as_me:2238: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_AWK+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2068,7 +2250,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_AWK="$ac_prog"
-echo "$as_me:2071: found $ac_dir/$ac_word" >&5
+echo "$as_me:2253: found $ac_dir/$ac_word" >&5
break
done
@@ -2076,10 +2258,10 @@ fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- echo "$as_me:2079: result: $AWK" >&5
+ echo "$as_me:2261: result: $AWK" >&5
echo "${ECHO_T}$AWK" >&6
else
- echo "$as_me:2082: result: no" >&5
+ echo "$as_me:2264: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -2098,7 +2280,7 @@ done
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:2101: checking for a BSD compatible install" >&5
+echo "$as_me:2283: checking for a BSD compatible install" >&5
echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
@@ -2147,7 +2329,7 @@ fi
INSTALL=$ac_install_sh
fi
fi
-echo "$as_me:2150: result: $INSTALL" >&5
+echo "$as_me:2332: result: $INSTALL" >&5
echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -2172,7 +2354,7 @@ for ac_prog in tdlint lint alint splint lclint
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:2175: checking for $ac_word" >&5
+echo "$as_me:2357: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_LINT+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2187,7 +2369,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_LINT="$ac_prog"
-echo "$as_me:2190: found $ac_dir/$ac_word" >&5
+echo "$as_me:2372: found $ac_dir/$ac_word" >&5
break
done
@@ -2195,17 +2377,17 @@ fi
fi
LINT=$ac_cv_prog_LINT
if test -n "$LINT"; then
- echo "$as_me:2198: result: $LINT" >&5
+ echo "$as_me:2380: result: $LINT" >&5
echo "${ECHO_T}$LINT" >&6
else
- echo "$as_me:2201: result: no" >&5
+ echo "$as_me:2383: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$LINT" && break
done
-echo "$as_me:2208: checking if filesystem supports mixed-case filenames" >&5
+echo "$as_me:2390: checking if filesystem supports mixed-case filenames" >&5
echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
if test "${cf_cv_mixedcase+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2213,7 +2395,7 @@ else
if test "$cross_compiling" = yes ; then
case $target_alias in #(vi
- *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+ *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi
cf_cv_mixedcase=no
;;
*)
@@ -2232,9 +2414,10 @@ else
fi
fi
-echo "$as_me:2235: result: $cf_cv_mixedcase" >&5
+echo "$as_me:2417: result: $cf_cv_mixedcase" >&5
echo "${ECHO_T}$cf_cv_mixedcase" >&6
-test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
+test "$cf_cv_mixedcase" = yes &&
+cat >>confdefs.h <<\EOF
#define MIXEDCASE_FILENAMES 1
EOF
@@ -2242,7 +2425,7 @@ for ac_prog in exctags ctags
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:2245: checking for $ac_word" >&5
+echo "$as_me:2428: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CTAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2257,7 +2440,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_CTAGS="$ac_prog"
-echo "$as_me:2260: found $ac_dir/$ac_word" >&5
+echo "$as_me:2443: found $ac_dir/$ac_word" >&5
break
done
@@ -2265,10 +2448,10 @@ fi
fi
CTAGS=$ac_cv_prog_CTAGS
if test -n "$CTAGS"; then
- echo "$as_me:2268: result: $CTAGS" >&5
+ echo "$as_me:2451: result: $CTAGS" >&5
echo "${ECHO_T}$CTAGS" >&6
else
- echo "$as_me:2271: result: no" >&5
+ echo "$as_me:2454: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -2279,7 +2462,7 @@ for ac_prog in exetags etags
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:2282: checking for $ac_word" >&5
+echo "$as_me:2465: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ETAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2294,7 +2477,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ETAGS="$ac_prog"
-echo "$as_me:2297: found $ac_dir/$ac_word" >&5
+echo "$as_me:2480: found $ac_dir/$ac_word" >&5
break
done
@@ -2302,10 +2485,10 @@ fi
fi
ETAGS=$ac_cv_prog_ETAGS
if test -n "$ETAGS"; then
- echo "$as_me:2305: result: $ETAGS" >&5
+ echo "$as_me:2488: result: $ETAGS" >&5
echo "${ECHO_T}$ETAGS" >&6
else
- echo "$as_me:2308: result: no" >&5
+ echo "$as_me:2491: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -2314,7 +2497,7 @@ done
# Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
set dummy ${CTAGS:-ctags}; ac_word=$2
-echo "$as_me:2317: checking for $ac_word" >&5
+echo "$as_me:2500: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2329,7 +2512,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_MAKE_LOWER_TAGS="yes"
-echo "$as_me:2332: found $ac_dir/$ac_word" >&5
+echo "$as_me:2515: found $ac_dir/$ac_word" >&5
break
done
@@ -2338,17 +2521,17 @@ fi
fi
MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
if test -n "$MAKE_LOWER_TAGS"; then
- echo "$as_me:2341: result: $MAKE_LOWER_TAGS" >&5
+ echo "$as_me:2524: result: $MAKE_LOWER_TAGS" >&5
echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
else
- echo "$as_me:2344: result: no" >&5
+ echo "$as_me:2527: result: no" >&5
echo "${ECHO_T}no" >&6
fi
if test "$cf_cv_mixedcase" = yes ; then
# Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
set dummy ${ETAGS:-etags}; ac_word=$2
-echo "$as_me:2351: checking for $ac_word" >&5
+echo "$as_me:2534: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2363,7 +2546,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_MAKE_UPPER_TAGS="yes"
-echo "$as_me:2366: found $ac_dir/$ac_word" >&5
+echo "$as_me:2549: found $ac_dir/$ac_word" >&5
break
done
@@ -2372,10 +2555,10 @@ fi
fi
MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
if test -n "$MAKE_UPPER_TAGS"; then
- echo "$as_me:2375: result: $MAKE_UPPER_TAGS" >&5
+ echo "$as_me:2558: result: $MAKE_UPPER_TAGS" >&5
echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
else
- echo "$as_me:2378: result: no" >&5
+ echo "$as_me:2561: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -2395,14 +2578,14 @@ else
MAKE_LOWER_TAGS="#"
fi
-echo "$as_me:2398: checking if -lm needed for math functions" >&5
+echo "$as_me:2581: checking if -lm needed for math functions" >&5
echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
if test "${cf_cv_need_libm+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 2405 "configure"
+#line 2588 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2411,22 +2594,22 @@ else
int
main ()
{
-double x = rand(); printf("result = %g\n", sin(x))
+double x = rand(); printf("result = %g\n", pow(sin(x),x))
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2420: \"$ac_link\"") >&5
+if { (eval echo "$as_me:2603: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2423: \$? = $ac_status" >&5
+ echo "$as_me:2606: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2426: \"$ac_try\"") >&5
+ { (eval echo "$as_me:2609: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2429: \$? = $ac_status" >&5
+ echo "$as_me:2612: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_need_libm=no
else
@@ -2436,13 +2619,15 @@ cf_cv_need_libm=yes
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:2439: result: $cf_cv_need_libm" >&5
+echo "$as_me:2622: result: $cf_cv_need_libm" >&5
echo "${ECHO_T}$cf_cv_need_libm" >&6
if test "$cf_cv_need_libm" = yes
then
MATH_LIB=-lm
fi
+top_builddir=`pwd`
+
CC_G_OPT="-g"
CC_SHARED_OPTS=unknown
CPPFLAGS="$CPPFLAGS"
@@ -2464,266 +2649,15 @@ PTHREAD="-lm"
TEST_ARGS=""
TEST_DEPS=""
TEST_LIBS=""
-TINFO_ARGS='$(LIBS_CURSES)'
+TINFO_LDFLAGS=''
+TINFO_LIBS='$(LIBS_CURSES)'
cf_cv_abi_version=""
cf_cv_rel_version=""
+includesubdir=""
cf_cv_screen=curses
cf_cv_libtype=
-echo "$as_me:2474: checking for ${CC:-cc} option to accept ANSI C" >&5
-echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
-if test "${cf_cv_ansi_cc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-cf_cv_ansi_cc=no
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
-# SVR4 -Xc
-# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
-for cf_arg in "-DCC_HAS_PROTOS" \
- "" \
- -qlanglvl=ansi \
- -std1 \
- -Ae \
- "-Aa -D_HPUX_SOURCE" \
- -Xc
-do
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-cf_new_extra_cppflags=
-
-for cf_add_cflags in $cf_arg
-do
-case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
- case $cf_add_cflags in
- -D*)
- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
- && test -z "${cf_tst_cflags}" \
- && cf_fix_cppflags=yes
-
- if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
- continue
- elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
- continue
- fi
- ;;
- esac
- case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
- ;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
- cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
-
-CPPFLAGS=`echo "$CPPFLAGS" | \
- sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
- -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
-
- ;;
- esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
- ;;
- esac
- ;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
- ;;
- esac
- ;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
-
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
- && test -z "${cf_tst_cflags}" \
- && cf_fix_cppflags=no
- ;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-
- CFLAGS="$CFLAGS $cf_new_cflags"
-fi
-
-if test -n "$cf_new_cppflags" ; then
-
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
-
-if test -n "$cf_new_extra_cppflags" ; then
-
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
-
- cat >conftest.$ac_ext <<_ACEOF
-#line 2578 "configure"
-#include "confdefs.h"
-
-#ifndef CC_HAS_PROTOS
-#if !defined(__STDC__) || (__STDC__ != 1)
-choke me
-#endif
-#endif
-
-int
-main ()
-{
-
- int test (int i, double x);
- struct s1 {int (*f) (int a);};
- struct s2 {int (*f) (double a);};
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2599: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:2602: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:2605: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:2608: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cf_cv_ansi_cc="$cf_arg"; break
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-done
-CFLAGS="$cf_save_CFLAGS"
-CPPFLAGS="$cf_save_CPPFLAGS"
-
-fi
-echo "$as_me:2621: result: $cf_cv_ansi_cc" >&5
-echo "${ECHO_T}$cf_cv_ansi_cc" >&6
-
-if test "$cf_cv_ansi_cc" != "no"; then
-if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-cf_new_extra_cppflags=
-
-for cf_add_cflags in $cf_cv_ansi_cc
-do
-case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
- case $cf_add_cflags in
- -D*)
- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
- && test -z "${cf_tst_cflags}" \
- && cf_fix_cppflags=yes
-
- if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
- continue
- elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
- continue
- fi
- ;;
- esac
- case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
- ;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
- cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
-
-CPPFLAGS=`echo "$CPPFLAGS" | \
- sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
- -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
-
- ;;
- esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
- ;;
- esac
- ;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
- ;;
- esac
- ;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
-
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
- && test -z "${cf_tst_cflags}" \
- && cf_fix_cppflags=no
- ;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-
- CFLAGS="$CFLAGS $cf_new_cflags"
-fi
-
-if test -n "$cf_new_cppflags" ; then
-
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
-
-if test -n "$cf_new_extra_cppflags" ; then
-
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
-
-else
- cat >>confdefs.h <<\EOF
-#define CC_HAS_PROTOS 1
-EOF
-
-fi
-fi
-
-if test "$cf_cv_ansi_cc" = "no"; then
- { { echo "$as_me:2714: error: Your compiler does not appear to recognize prototypes.
-You have the following choices:
- a. adjust your compiler options
- b. get an up-to-date compiler
- c. use a wrapper such as unproto" >&5
-echo "$as_me: error: Your compiler does not appear to recognize prototypes.
-You have the following choices:
- a. adjust your compiler options
- b. get an up-to-date compiler
- c. use a wrapper such as unproto" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
if test "$GCC" = yes
then
cat > conftest.i <<EOF
@@ -2742,10 +2676,10 @@ cat > conftest.i <<EOF
EOF
if test "$GCC" = yes
then
- { echo "$as_me:2745: checking for $CC __attribute__ directives..." >&5
+ { echo "$as_me:2679: checking for $CC __attribute__ directives..." >&5
echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
cat > conftest.$ac_ext <<EOF
-#line 2748 "${as_me:-configure}"
+#line 2682 "${as_me:-configure}"
#include "confdefs.h"
#include "conftest.h"
#include "conftest.i"
@@ -2794,36 +2728,60 @@ EOF
;;
esac
- if { (eval echo "$as_me:2797: \"$ac_compile\"") >&5
+ if { (eval echo "$as_me:2731: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:2800: \$? = $ac_status" >&5
+ echo "$as_me:2734: \$? = $ac_status" >&5
(exit $ac_status); }; then
- test -n "$verbose" && echo "$as_me:2802: result: ... $cf_attribute" >&5
+ test -n "$verbose" && echo "$as_me:2736: result: ... $cf_attribute" >&5
echo "${ECHO_T}... $cf_attribute" >&6
cat conftest.h >>confdefs.h
case $cf_attribute in #(vi
- printf) #(vi
- if test "$cf_printf_attribute" = no ; then
- cat >>confdefs.h <<EOF
-#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+ noreturn) #(vi
+
+cat >>confdefs.h <<EOF
+#define GCC_NORETURN $cf_directive
EOF
- else
- cat >>confdefs.h <<EOF
-#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+
+ ;;
+ printf) #(vi
+ cf_value='/* nothing */'
+ if test "$cf_printf_attribute" != no ; then
+ cf_value='__attribute__((format(printf,fmt,var)))'
+
+cat >>confdefs.h <<\EOF
+#define GCC_PRINTF 1
EOF
+
fi
+
+cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) $cf_value
+EOF
+
;;
scanf) #(vi
- if test "$cf_scanf_attribute" = no ; then
- cat >>confdefs.h <<EOF
-#define GCC_SCANFLIKE(fmt,var) /* nothing */
-EOF
- else
- cat >>confdefs.h <<EOF
-#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
+ cf_value='/* nothing */'
+ if test "$cf_scanf_attribute" != no ; then
+ cf_value='__attribute__((format(scanf,fmt,var)))'
+
+cat >>confdefs.h <<\EOF
+#define GCC_SCANF 1
EOF
+
fi
+
+cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) $cf_value
+EOF
+
+ ;;
+ unused) #(vi
+
+cat >>confdefs.h <<EOF
+#define GCC_UNUSED $cf_directive
+EOF
+
;;
esac
fi
@@ -2839,10 +2797,10 @@ cf_POSIX_C_SOURCE=199506L
cf_xopen_source=
case $host_os in #(vi
-aix[456]*) #(vi
+aix[4-7]*) #(vi
cf_xopen_source="-D_ALL_SOURCE"
;;
-cygwin) #(vi
+cygwin|msys) #(vi
cf_XOPEN_SOURCE=600
;;
darwin[0-8].*) #(vi
@@ -2850,6 +2808,7 @@ darwin[0-8].*) #(vi
;;
darwin*) #(vi
cf_xopen_source="-D_DARWIN_C_SOURCE"
+ cf_XOPEN_SOURCE=
;;
freebsd*|dragonfly*) #(vi
# 5.x headers associate
@@ -2867,17 +2826,18 @@ hpux*) #(vi
;;
irix[56].*) #(vi
cf_xopen_source="-D_SGI_SOURCE"
+ cf_XOPEN_SOURCE=
;;
linux*|gnu*|mint*|k*bsd*-gnu) #(vi
-echo "$as_me:2873: checking if we must define _GNU_SOURCE" >&5
+echo "$as_me:2833: checking if we must define _GNU_SOURCE" >&5
echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
if test "${cf_cv_gnu_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 2880 "configure"
+#line 2840 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
@@ -2892,16 +2852,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2895: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2855: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:2898: \$? = $ac_status" >&5
+ echo "$as_me:2858: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:2901: \"$ac_try\"") >&5
+ { (eval echo "$as_me:2861: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2904: \$? = $ac_status" >&5
+ echo "$as_me:2864: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_gnu_source=no
else
@@ -2910,7 +2870,7 @@ cat conftest.$ac_ext >&5
cf_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
cat >conftest.$ac_ext <<_ACEOF
-#line 2913 "configure"
+#line 2873 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
@@ -2925,16 +2885,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2928: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2888: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:2931: \$? = $ac_status" >&5
+ echo "$as_me:2891: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:2934: \"$ac_try\"") >&5
+ { (eval echo "$as_me:2894: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2937: \$? = $ac_status" >&5
+ echo "$as_me:2897: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_gnu_source=no
else
@@ -2949,16 +2909,263 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:2952: result: $cf_cv_gnu_source" >&5
+echo "$as_me:2912: result: $cf_cv_gnu_source" >&5
echo "${ECHO_T}$cf_cv_gnu_source" >&6
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
;;
+minix*) #(vi
+ cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
+ ;;
mirbsd*) #(vi
- # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
+ # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
+ cf_XOPEN_SOURCE=
+
+cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+
+cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
+ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
+
+cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
+ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
+
+echo "$as_me:2937: checking if we should define _POSIX_C_SOURCE" >&5
+echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_posix_c_source+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+echo "${as_me:-configure}:2943: testing if the symbol is already defined go no further ..." 1>&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2946 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2961: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2964: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2967: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2970: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_posix_c_source=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_want_posix_source=no
+ case .$cf_POSIX_C_SOURCE in #(vi
+ .[12]??*) #(vi
+ cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+ ;;
+ .2) #(vi
+ cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+ cf_want_posix_source=yes
+ ;;
+ .*)
+ cf_want_posix_source=yes
+ ;;
+ esac
+ if test "$cf_want_posix_source" = yes ; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2991 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _POSIX_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3006: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3009: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3012: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3015: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
+
+echo "${as_me:-configure}:3026: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+
+ CFLAGS="$cf_trim_CFLAGS"
+ CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+
+echo "${as_me:-configure}:3031: testing if the second compile does not leave our definition intact error ..." 1>&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3034 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3049: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3052: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3055: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3058: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$cf_save_CFLAGS"
+ CPPFLAGS="$cf_save_CPPFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3074: result: $cf_cv_posix_c_source" >&5
+echo "${ECHO_T}$cf_cv_posix_c_source" >&6
+
+if test "$cf_cv_posix_c_source" != no ; then
+ CFLAGS="$cf_trim_CFLAGS"
+ CPPFLAGS="$cf_trim_CPPFLAGS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_cv_posix_c_source
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ case $cf_add_cflags in #(vi
+ -D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
;;
netbsd*) #(vi
- # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+ 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]*) #(vi
+ # 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
;;
openbsd*) #(vi
# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
@@ -2972,23 +3179,30 @@ nto-qnx*) #(vi
sco*) #(vi
# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
;;
-solaris2.1[0-9]) #(vi
- cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
- ;;
-solaris2.[1-9]) #(vi
+solaris2.*) #(vi
cf_xopen_source="-D__EXTENSIONS__"
+ cf_cv_xopen_source=broken
+ ;;
+sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
+ cf_XOPEN_SOURCE=
+ cf_POSIX_C_SOURCE=
;;
*)
- echo "$as_me:2982: checking if we should define _XOPEN_SOURCE" >&5
+
+echo "$as_me:3192: checking if we should define _XOPEN_SOURCE" >&5
echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
if test "${cf_cv_xopen_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 2989 "configure"
+#line 3199 "configure"
#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
+
int
main ()
{
@@ -3001,16 +3215,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3004: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3218: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3007: \$? = $ac_status" >&5
+ echo "$as_me:3221: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3010: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3224: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3013: \$? = $ac_status" >&5
+ echo "$as_me:3227: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
@@ -3019,9 +3233,13 @@ cat conftest.$ac_ext >&5
cf_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
cat >conftest.$ac_ext <<_ACEOF
-#line 3022 "configure"
+#line 3236 "configure"
#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
+
int
main ()
{
@@ -3034,16 +3252,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3037: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3255: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3040: \$? = $ac_status" >&5
+ echo "$as_me:3258: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3043: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3261: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3046: \$? = $ac_status" >&5
+ echo "$as_me:3264: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
@@ -3058,9 +3276,10 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:3061: result: $cf_cv_xopen_source" >&5
+echo "$as_me:3279: result: $cf_cv_xopen_source" >&5
echo "${ECHO_T}$cf_cv_xopen_source" >&6
- if test "$cf_cv_xopen_source" != no ; then
+
+if test "$cf_cv_xopen_source" != no ; then
CFLAGS=`echo "$CFLAGS" | \
sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
@@ -3070,7 +3289,7 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
- cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+ cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
cf_fix_cppflags=no
cf_new_cflags=
@@ -3087,7 +3306,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -3128,7 +3347,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -3150,7 +3369,7 @@ if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
- fi
+fi
cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
@@ -3165,16 +3384,16 @@ cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
-echo "$as_me:3168: checking if we should define _POSIX_C_SOURCE" >&5
+echo "$as_me:3387: checking if we should define _POSIX_C_SOURCE" >&5
echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
if test "${cf_cv_posix_c_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-echo "${as_me:-configure}:3174: testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me:-configure}:3393: testing if the symbol is already defined go no further ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
-#line 3177 "configure"
+#line 3396 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
@@ -3189,16 +3408,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3192: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3411: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3195: \$? = $ac_status" >&5
+ echo "$as_me:3414: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3198: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3417: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3201: \$? = $ac_status" >&5
+ echo "$as_me:3420: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_posix_c_source=no
else
@@ -3219,7 +3438,7 @@ cf_want_posix_source=no
esac
if test "$cf_want_posix_source" = yes ; then
cat >conftest.$ac_ext <<_ACEOF
-#line 3222 "configure"
+#line 3441 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
@@ -3234,16 +3453,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3237: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3456: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3240: \$? = $ac_status" >&5
+ echo "$as_me:3459: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3243: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3462: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3246: \$? = $ac_status" >&5
+ echo "$as_me:3465: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -3254,15 +3473,15 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "${as_me:-configure}:3257: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me:-configure}:3476: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
CFLAGS="$cf_trim_CFLAGS"
CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
-echo "${as_me:-configure}:3262: testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me:-configure}:3481: testing if the second compile does not leave our definition intact error ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
-#line 3265 "configure"
+#line 3484 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
@@ -3277,16 +3496,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3280: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3499: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3283: \$? = $ac_status" >&5
+ echo "$as_me:3502: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3286: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3505: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3289: \$? = $ac_status" >&5
+ echo "$as_me:3508: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -3302,7 +3521,7 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:3305: result: $cf_cv_posix_c_source" >&5
+echo "$as_me:3524: result: $cf_cv_posix_c_source" >&5
echo "${ECHO_T}$cf_cv_posix_c_source" >&6
if test "$cf_cv_posix_c_source" != no ; then
@@ -3324,7 +3543,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -3365,7 +3584,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -3409,7 +3628,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -3450,7 +3669,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -3458,636 +3677,221 @@ esac
done
if test -n "$cf_new_cflags" ; then
+ test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
+
+echo "${as_me:-configure}:3682: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
+ test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
+
+echo "${as_me:-configure}:3690: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
+ test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
+
+echo "${as_me:-configure}:3698: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
fi
-echo "$as_me:3477: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-#line 3485 "configure"
+if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
+ echo "$as_me:3706: checking if _XOPEN_SOURCE really is set" >&5
+echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3709 "configure"
#include "confdefs.h"
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
+#include <stdlib.h>
int
main ()
{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
;
return 0;
}
_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3534: \"$ac_compile\"") >&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3724: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3537: \$? = $ac_status" >&5
+ echo "$as_me:3727: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3540: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3730: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3543: \$? = $ac_status" >&5
+ echo "$as_me:3733: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
+ cf_XOPEN_SOURCE_set=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
+cf_XOPEN_SOURCE_set=no
fi
-rm -f conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:3560: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
- *)
- echo "$as_me:3563: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-echo "$as_me:3568: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
-if test "${ac_cv_c_const+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line 3574 "configure"
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:3742: result: $cf_XOPEN_SOURCE_set" >&5
+echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
+ if test $cf_XOPEN_SOURCE_set = yes
+ then
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3747 "configure"
#include "confdefs.h"
-
+#include <stdlib.h>
int
main ()
{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
- typedef int charset[2];
- const charset x;
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *ccp;
- char **p;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- ccp = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++ccp;
- p = (char**) ccp;
- ccp = (char const *const *) p;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- }
-#endif
+#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
+make an error
+#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3632: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3762: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3635: \$? = $ac_status" >&5
+ echo "$as_me:3765: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3638: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3768: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3641: \$? = $ac_status" >&5
+ echo "$as_me:3771: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_c_const=yes
+ cf_XOPEN_SOURCE_set_ok=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-ac_cv_c_const=no
+cf_XOPEN_SOURCE_set_ok=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:3651: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\EOF
-#define const
-EOF
-
-fi
+ if test $cf_XOPEN_SOURCE_set_ok = no
+ then
+ { echo "$as_me:3782: WARNING: _XOPEN_SOURCE is lower than requested" >&5
+echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
+ fi
+ else
-echo "$as_me:3661: checking for signal global datatype" >&5
-echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
-if test "${cf_cv_sig_atomic_t+set}" = set; then
+echo "$as_me:3787: checking if we should define _XOPEN_SOURCE" >&5
+echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_xopen_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- for cf_type in \
- "volatile sig_atomic_t" \
- "sig_atomic_t" \
- "int"
- do
cat >conftest.$ac_ext <<_ACEOF
-#line 3673 "configure"
+#line 3794 "configure"
#include "confdefs.h"
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
-#include <signal.h>
-#include <stdio.h>
-extern $cf_type x;
-$cf_type x;
-static void handler(int sig)
-{
- x = 5;
-}
int
main ()
{
-signal(SIGINT, handler);
- x = 1
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3696: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3813: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3699: \$? = $ac_status" >&5
+ echo "$as_me:3816: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3702: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3819: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3705: \$? = $ac_status" >&5
+ echo "$as_me:3822: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- cf_cv_sig_atomic_t=$cf_type
+ cf_cv_xopen_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-cf_cv_sig_atomic_t=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
- test "$cf_cv_sig_atomic_t" != no && break
- done
-
-fi
-
-echo "$as_me:3719: result: $cf_cv_sig_atomic_t" >&5
-echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
-test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
-#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
-EOF
-
-echo "$as_me:3725: checking if you want to see long compiling messages" >&5
-echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
-
-# Check whether --enable-echo or --disable-echo was given.
-if test "${enable_echo+set}" = set; then
- enableval="$enable_echo"
- test "$enableval" != no && enableval=yes
- if test "$enableval" != "yes" ; then
-
- ECHO_LT='--silent'
- ECHO_LD='@echo linking $@;'
- RULE_CC='@echo compiling $<'
- SHOW_CC='@echo compiling $@'
- ECHO_CC='@'
-
- else
-
- ECHO_LT=''
- ECHO_LD=''
- RULE_CC=''
- SHOW_CC=''
- ECHO_CC=''
-
- fi
-else
- enableval=yes
-
- ECHO_LT=''
- ECHO_LD=''
- RULE_CC=''
- SHOW_CC=''
- ECHO_CC=''
-
-fi;
-echo "$as_me:3759: result: $enableval" >&5
-echo "${ECHO_T}$enableval" >&6
-
-GCC_VERSION=none
-if test "$GCC" = yes ; then
- echo "$as_me:3764: checking version of $CC" >&5
-echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
- GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
- test -z "$GCC_VERSION" && GCC_VERSION=unknown
- echo "$as_me:3768: result: $GCC_VERSION" >&5
-echo "${ECHO_T}$GCC_VERSION" >&6
-fi
-
-if ( test "$GCC" = yes || test "$GXX" = yes )
-then
-echo "$as_me:3774: checking if you want to turn on gcc warnings" >&5
-echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
-
-# Check whether --enable-warnings or --disable-warnings was given.
-if test "${enable_warnings+set}" = set; then
- enableval="$enable_warnings"
- test "$enableval" != yes && enableval=no
- if test "$enableval" != "no" ; then
- with_warnings=yes
- else
- with_warnings=no
- fi
-else
- enableval=no
- with_warnings=no
-
-fi;
-echo "$as_me:3791: result: $with_warnings" >&5
-echo "${ECHO_T}$with_warnings" >&6
-if test "$with_warnings" = "yes"
-then
-
-if test "$GCC" = yes
-then
-cat > conftest.i <<EOF
-#ifndef GCC_PRINTF
-#define GCC_PRINTF 0
-#endif
-#ifndef GCC_SCANF
-#define GCC_SCANF 0
-#endif
-#ifndef GCC_NORETURN
-#define GCC_NORETURN /* nothing */
-#endif
-#ifndef GCC_UNUSED
-#define GCC_UNUSED /* nothing */
-#endif
-EOF
-if test "$GCC" = yes
-then
- { echo "$as_me:3814: checking for $CC __attribute__ directives..." >&5
-echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
-cat > conftest.$ac_ext <<EOF
-#line 3817 "${as_me:-configure}"
+cf_save="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3831 "configure"
#include "confdefs.h"
-#include "conftest.h"
-#include "conftest.i"
-#if GCC_PRINTF
-#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
-#else
-#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
-#endif
-#if GCC_SCANF
-#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
-#else
-#define GCC_SCANFLIKE(fmt,var) /*nothing*/
-#endif
-extern void wow(char *,...) GCC_SCANFLIKE(1,2);
-extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
-extern void foo(void) GCC_NORETURN;
-int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
-EOF
- cf_printf_attribute=no
- cf_scanf_attribute=no
- for cf_attribute in scanf printf unused noreturn
- do
-
-cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
- cf_directive="__attribute__(($cf_attribute))"
- echo "checking for $CC $cf_directive" 1>&5
-
- case $cf_attribute in #(vi
- printf) #(vi
- cf_printf_attribute=yes
- cat >conftest.h <<EOF
-#define GCC_$cf_ATTRIBUTE 1
-EOF
- ;;
- scanf) #(vi
- cf_scanf_attribute=yes
- cat >conftest.h <<EOF
-#define GCC_$cf_ATTRIBUTE 1
-EOF
- ;;
- *) #(vi
- cat >conftest.h <<EOF
-#define GCC_$cf_ATTRIBUTE $cf_directive
-EOF
- ;;
- esac
-
- if { (eval echo "$as_me:3866: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:3869: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- test -n "$verbose" && echo "$as_me:3871: result: ... $cf_attribute" >&5
-echo "${ECHO_T}... $cf_attribute" >&6
- cat conftest.h >>confdefs.h
- case $cf_attribute in #(vi
- printf) #(vi
- if test "$cf_printf_attribute" = no ; then
- cat >>confdefs.h <<EOF
-#define GCC_PRINTFLIKE(fmt,var) /* nothing */
-EOF
- else
- cat >>confdefs.h <<EOF
-#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
-EOF
- fi
- ;;
- scanf) #(vi
- if test "$cf_scanf_attribute" = no ; then
- cat >>confdefs.h <<EOF
-#define GCC_SCANFLIKE(fmt,var) /* nothing */
-EOF
- else
- cat >>confdefs.h <<EOF
-#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
-EOF
- fi
- ;;
- esac
- fi
- done
-else
- fgrep define conftest.i >>confdefs.h
-fi
-rm -rf conftest*
-fi
-
-INTEL_COMPILER=no
-if test "$GCC" = yes ; then
- case $host_os in
- linux*|gnu*)
- echo "$as_me:3911: checking if this is really Intel C compiler" >&5
-echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
- cf_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -no-gcc"
- cat >conftest.$ac_ext <<_ACEOF
-#line 3916 "configure"
-#include "confdefs.h"
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
int
main ()
{
-#ifdef __INTEL_COMPILER
-#else
+#ifdef _XOPEN_SOURCE
make an error
#endif
-
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3933: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3850: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3936: \$? = $ac_status" >&5
+ echo "$as_me:3853: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3939: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3856: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3942: \$? = $ac_status" >&5
+ echo "$as_me:3859: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- INTEL_COMPILER=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
-
+ cf_cv_xopen_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
+cf_cv_xopen_source=$cf_XOPEN_SOURCE
fi
rm -f conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$cf_save_CFLAGS"
- echo "$as_me:3953: result: $INTEL_COMPILER" >&5
-echo "${ECHO_T}$INTEL_COMPILER" >&6
- ;;
- esac
-fi
-
-cat > conftest.$ac_ext <<EOF
-#line 3960 "${as_me:-configure}"
-int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
-EOF
-
-if test "$INTEL_COMPILER" = yes
-then
-# The "-wdXXX" options suppress warnings:
-# remark #1419: external declaration in primary source file
-# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
-# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
-# remark #193: zero used for undefined preprocessing identifier
-# remark #593: variable "curs_sb_left_arrow" was set but never used
-# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
-# remark #869: parameter "tw" was never referenced
-# remark #981: operands are evaluated in unspecified order
-# warning #279: controlling expression is constant
-
- { echo "$as_me:3977: checking for $CC warning options..." >&5
-echo "$as_me: checking for $CC warning options..." >&6;}
- cf_save_CFLAGS="$CFLAGS"
- EXTRA_CFLAGS="-Wall"
- for cf_opt in \
- wd1419 \
- wd1683 \
- wd1684 \
- wd193 \
- wd593 \
- wd279 \
- wd810 \
- wd869 \
- wd981
- do
- CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
- if { (eval echo "$as_me:3993: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:3996: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- test -n "$verbose" && echo "$as_me:3998: result: ... -$cf_opt" >&5
-echo "${ECHO_T}... -$cf_opt" >&6
- EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
- fi
- done
- CFLAGS="$cf_save_CFLAGS"
-
-elif test "$GCC" = yes
-then
- { echo "$as_me:4007: checking for $CC warning options..." >&5
-echo "$as_me: checking for $CC warning options..." >&6;}
- cf_save_CFLAGS="$CFLAGS"
- EXTRA_CFLAGS=
- cf_warn_CONST=""
- test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
- for cf_opt in W Wall \
- Wbad-function-cast \
- Wcast-align \
- Wcast-qual \
- Winline \
- Wmissing-declarations \
- Wmissing-prototypes \
- Wnested-externs \
- Wpointer-arith \
- Wshadow \
- Wstrict-prototypes \
- Wundef $cf_warn_CONST
- do
- CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
- if { (eval echo "$as_me:4027: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:4030: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- test -n "$verbose" && echo "$as_me:4032: result: ... -$cf_opt" >&5
-echo "${ECHO_T}... -$cf_opt" >&6
- case $cf_opt in #(vi
- Wcast-qual) #(vi
- CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
- ;;
- Winline) #(vi
- case $GCC_VERSION in
- [34].*)
- test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
-
-echo "${as_me:-configure}:4043: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+ CPPFLAGS="$cf_save"
- continue;;
- esac
- ;;
- esac
- EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
- fi
- done
- CFLAGS="$cf_save_CFLAGS"
fi
-rm -rf conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-fi
+echo "$as_me:3874: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
-echo "$as_me:4059: checking if you want to use dmalloc for testing" >&5
-echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
+if test "$cf_cv_xopen_source" != no ; then
-# Check whether --with-dmalloc or --without-dmalloc was given.
-if test "${with_dmalloc+set}" = set; then
- withval="$with_dmalloc"
- cat >>confdefs.h <<\EOF
-#define USE_DMALLOC 1
-EOF
+CFLAGS=`echo "$CFLAGS" | \
+ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
- : ${with_cflags:=-g}
- : ${with_no_leaks:=yes}
- with_dmalloc=yes
-else
- with_dmalloc=
-fi;
-echo "$as_me:4075: result: ${with_dmalloc:-no}" >&5
-echo "${ECHO_T}${with_dmalloc:-no}" >&6
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
-case .$with_cflags in #(vi
-.*-g*)
- case .$CFLAGS in #(vi
- .*-g*) #(vi
- ;;
- *)
+ cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
-for cf_add_cflags in -g
+for cf_add_cflags in $cf_temp_xopen_source
do
case $cf_fix_cppflags in
no)
@@ -4097,7 +3901,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -4138,7 +3942,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -4160,458 +3964,292 @@ if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
- ;;
- esac
- ;;
-esac
-
-if test "$with_dmalloc" = yes ; then
- echo "$as_me:4169: checking for dmalloc.h" >&5
-echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
-if test "${ac_cv_header_dmalloc_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line 4175 "configure"
-#include "confdefs.h"
-#include <dmalloc.h>
-_ACEOF
-if { (eval echo "$as_me:4179: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- egrep -v '^ *\+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:4185: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_cv_header_dmalloc_h=yes
-else
- echo "$as_me: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_header_dmalloc_h=no
fi
-rm -f conftest.err conftest.$ac_ext
+
+ fi
fi
-echo "$as_me:4204: result: $ac_cv_header_dmalloc_h" >&5
-echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
-if test $ac_cv_header_dmalloc_h = yes; then
-echo "$as_me:4208: checking for dmalloc_debug in -ldmalloc" >&5
-echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
-if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
+echo "$as_me:3972: checking for signal global datatype" >&5
+echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
+if test "${cf_cv_sig_atomic_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldmalloc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 4216 "configure"
+
+ for cf_type in \
+ "volatile sig_atomic_t" \
+ "sig_atomic_t" \
+ "int"
+ do
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3984 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dmalloc_debug ();
+#include <sys/types.h>
+#include <signal.h>
+#include <stdio.h>
+
+extern $cf_type x;
+$cf_type x;
+static void handler(int sig)
+{
+ x = 5;
+}
int
main ()
{
-dmalloc_debug ();
+signal(SIGINT, handler);
+ x = 1
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4235: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4007: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:4238: \$? = $ac_status" >&5
+ echo "$as_me:4010: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4241: \"$ac_try\"") >&5
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:4013: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4244: \$? = $ac_status" >&5
+ echo "$as_me:4016: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_dmalloc_dmalloc_debug=yes
+ cf_cv_sig_atomic_t=$cf_type
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-ac_cv_lib_dmalloc_dmalloc_debug=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:4255: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
-echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
-if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
- cat >>confdefs.h <<EOF
-#define HAVE_LIBDMALLOC 1
-EOF
-
- LIBS="-ldmalloc $LIBS"
-
-fi
-
+cf_cv_sig_atomic_t=no
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ test "$cf_cv_sig_atomic_t" != no && break
+ done
fi
-echo "$as_me:4270: checking if you want to use dbmalloc for testing" >&5
-echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
-
-# Check whether --with-dbmalloc or --without-dbmalloc was given.
-if test "${with_dbmalloc+set}" = set; then
- withval="$with_dbmalloc"
- cat >>confdefs.h <<\EOF
-#define USE_DBMALLOC 1
+echo "$as_me:4030: result: $cf_cv_sig_atomic_t" >&5
+echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
+test "$cf_cv_sig_atomic_t" != no &&
+cat >>confdefs.h <<EOF
+#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
EOF
- : ${with_cflags:=-g}
- : ${with_no_leaks:=yes}
- with_dbmalloc=yes
+echo "$as_me:4037: checking if you want to use pkg-config" >&5
+echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
+
+# Check whether --with-pkg-config or --without-pkg-config was given.
+if test "${with_pkg_config+set}" = set; then
+ withval="$with_pkg_config"
+ cf_pkg_config=$withval
else
- with_dbmalloc=
+ cf_pkg_config=yes
fi;
-echo "$as_me:4286: result: ${with_dbmalloc:-no}" >&5
-echo "${ECHO_T}${with_dbmalloc:-no}" >&6
-
-case .$with_cflags in #(vi
-.*-g*)
- case .$CFLAGS in #(vi
- .*-g*) #(vi
- ;;
- *)
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-cf_new_extra_cppflags=
-
-for cf_add_cflags in -g
-do
-case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
- case $cf_add_cflags in
- -D*)
- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
- && test -z "${cf_tst_cflags}" \
- && cf_fix_cppflags=yes
-
- if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
- continue
- elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
- continue
- fi
- ;;
- esac
- case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
- ;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
- cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
-
-CPPFLAGS=`echo "$CPPFLAGS" | \
- sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
- -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
-
- ;;
- esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
- ;;
- esac
- ;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
- ;;
- esac
- ;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+echo "$as_me:4047: result: $cf_pkg_config" >&5
+echo "${ECHO_T}$cf_pkg_config" >&6
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
- && test -z "${cf_tst_cflags}" \
- && cf_fix_cppflags=no
+case $cf_pkg_config in #(vi
+no) #(vi
+ PKG_CONFIG=none
;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-
- CFLAGS="$CFLAGS $cf_new_cflags"
-fi
-
-if test -n "$cf_new_cppflags" ; then
-
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
-
-if test -n "$cf_new_extra_cppflags" ; then
+yes) #(vi
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+echo "$as_me:4059: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ if $as_executable_p "$ac_dir/$ac_word"; then
+ ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
+ echo "$as_me:4076: found $ac_dir/$ac_word" >&5
+ break
fi
+done
- ;;
- esac
- ;;
+ ;;
esac
-
-if test "$with_dbmalloc" = yes ; then
- echo "$as_me:4380: checking for dbmalloc.h" >&5
-echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
-if test "${ac_cv_header_dbmalloc_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line 4386 "configure"
-#include "confdefs.h"
-#include <dbmalloc.h>
-_ACEOF
-if { (eval echo "$as_me:4390: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- egrep -v '^ *\+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:4396: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
fi
-if test -z "$ac_cpp_err"; then
- ac_cv_header_dbmalloc_h=yes
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+ echo "$as_me:4087: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
else
- echo "$as_me: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_header_dbmalloc_h=no
-fi
-rm -f conftest.err conftest.$ac_ext
+ echo "$as_me:4090: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo "$as_me:4415: result: $ac_cv_header_dbmalloc_h" >&5
-echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
-if test $ac_cv_header_dbmalloc_h = yes; then
-echo "$as_me:4419: checking for debug_malloc in -ldbmalloc" >&5
-echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
-if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:4099: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldbmalloc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 4427 "configure"
-#include "confdefs.h"
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char debug_malloc ();
-int
-main ()
-{
-debug_malloc ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4446: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:4449: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4452: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:4455: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dbmalloc_debug_malloc=yes
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_dbmalloc_debug_malloc=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ if $as_executable_p "$ac_dir/$ac_word"; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
+ echo "$as_me:4116: found $ac_dir/$ac_word" >&5
+ break
fi
-echo "$as_me:4466: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
-echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
-if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
- cat >>confdefs.h <<EOF
-#define HAVE_LIBDBMALLOC 1
-EOF
-
- LIBS="-ldbmalloc $LIBS"
+done
+ test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
+ ;;
+esac
fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ echo "$as_me:4128: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
+else
+ echo "$as_me:4131: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
-echo "$as_me:4481: checking if you want to use valgrind for testing" >&5
-echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
+ ;;
+*)
+ PKG_CONFIG=$withval
+ ;;
+esac
-# Check whether --with-valgrind or --without-valgrind was given.
-if test "${with_valgrind+set}" = set; then
- withval="$with_valgrind"
- cat >>confdefs.h <<\EOF
-#define USE_VALGRIND 1
-EOF
+test -z "$PKG_CONFIG" && PKG_CONFIG=none
+if test "$PKG_CONFIG" != none ; then
- : ${with_cflags:=-g}
- : ${with_no_leaks:=yes}
- with_valgrind=yes
+if test "x$prefix" != xNONE; then
+ cf_path_syntax="$prefix"
else
- with_valgrind=
-fi;
-echo "$as_me:4497: result: ${with_valgrind:-no}" >&5
-echo "${ECHO_T}${with_valgrind:-no}" >&6
-
-case .$with_cflags in #(vi
-.*-g*)
- case .$CFLAGS in #(vi
- .*-g*) #(vi
- ;;
- *)
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-cf_new_extra_cppflags=
-
-for cf_add_cflags in -g
-do
-case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
- case $cf_add_cflags in
- -D*)
- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
- && test -z "${cf_tst_cflags}" \
- && cf_fix_cppflags=yes
-
- if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
- continue
- elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
- continue
- fi
- ;;
- esac
- case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
- ;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
- cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
-
-CPPFLAGS=`echo "$CPPFLAGS" | \
- sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
- -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+ cf_path_syntax="$ac_default_prefix"
+fi
- ;;
- esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
- ;;
- esac
- ;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
- ;;
- esac
- ;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+case ".$PKG_CONFIG" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+ ;;
+..|./*|.\\*) #(vi
+ ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+ ;;
+.\${*prefix}*|.\${*dir}*) #(vi
+ eval PKG_CONFIG="$PKG_CONFIG"
+ case ".$PKG_CONFIG" in #(vi
+ .NONE/*)
+ PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+ esac
+ ;; #(vi
+.no|.NONE/*)
+ PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+*)
+ { { echo "$as_me:4174: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
+echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+fi
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
- && test -z "${cf_tst_cflags}" \
- && cf_fix_cppflags=no
- ;;
-esac
-done
+echo "$as_me:4182: checking if you want to see long compiling messages" >&5
+echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
-if test -n "$cf_new_cflags" ; then
+# Check whether --enable-echo or --disable-echo was given.
+if test "${enable_echo+set}" = set; then
+ enableval="$enable_echo"
+ test "$enableval" != no && enableval=yes
+ if test "$enableval" != "yes" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
-fi
+ ECHO_LT='--silent'
+ ECHO_LD='@echo linking $@;'
+ RULE_CC='@echo compiling $<'
+ SHOW_CC='@echo compiling $@'
+ ECHO_CC='@'
-if test -n "$cf_new_cppflags" ; then
+ else
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
+ ECHO_LT=''
+ ECHO_LD=''
+ RULE_CC=''
+ SHOW_CC=''
+ ECHO_CC=''
-if test -n "$cf_new_extra_cppflags" ; then
+ fi
+else
+ enableval=yes
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
+ ECHO_LT=''
+ ECHO_LD=''
+ RULE_CC=''
+ SHOW_CC=''
+ ECHO_CC=''
- ;;
- esac
- ;;
-esac
+fi;
+echo "$as_me:4216: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
-echo "$as_me:4590: checking if you want to perform memory-leak testing" >&5
-echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
+echo "$as_me:4219: checking for ncurses wrap-prefix" >&5
+echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
-# Check whether --enable-leaks or --disable-leaks was given.
-if test "${enable_leaks+set}" = set; then
- enableval="$enable_leaks"
- if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
+# Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
+if test "${with_ncurses_wrap_prefix+set}" = set; then
+ withval="$with_ncurses_wrap_prefix"
+ NCURSES_WRAP_PREFIX=$withval
else
- : ${with_no_leaks:=no}
+ NCURSES_WRAP_PREFIX=_nc_
fi;
-echo "$as_me:4600: result: $with_no_leaks" >&5
-echo "${ECHO_T}$with_no_leaks" >&6
+echo "$as_me:4229: result: $NCURSES_WRAP_PREFIX" >&5
+echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
-if test "$with_no_leaks" = yes ; then
- cat >>confdefs.h <<\EOF
-#define NO_LEAKS 1
-EOF
+echo "$as_me:4232: checking if you want to check for wide-character functions" >&5
+echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
- cat >>confdefs.h <<\EOF
-#define YY_NO_LEAKS 1
-EOF
+# Check whether --enable-widec or --disable-widec was given.
+if test "${enable_widec+set}" = set; then
+ enableval="$enable_widec"
+ test "$enableval" != no && enableval=yes
+ if test "$enableval" != "yes" ; then
+ cf_enable_widec=no
+ else
+ cf_enable_widec=yes
+ fi
+else
+ enableval=yes
+ cf_enable_widec=yes
-fi
+fi;
+echo "$as_me:4249: result: $cf_enable_widec" >&5
+echo "${ECHO_T}$cf_enable_widec" >&6
-echo "$as_me:4614: checking for specific curses-directory" >&5
+echo "$as_me:4252: checking for specific curses-directory" >&5
echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
# Check whether --with-curses-dir or --without-curses-dir was given.
@@ -4621,7 +4259,7 @@ if test "${with_curses_dir+set}" = set; then
else
cf_cv_curses_dir=no
fi;
-echo "$as_me:4624: result: $cf_cv_curses_dir" >&5
+echo "$as_me:4262: result: $cf_cv_curses_dir" >&5
echo "${ECHO_T}$cf_cv_curses_dir" >&6
if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
@@ -4640,7 +4278,7 @@ case ".$withval" in #(vi
;;
.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
;;
-.\${*prefix}*) #(vi
+.\${*prefix}*|.\${*dir}*) #(vi
eval withval="$withval"
case ".$withval" in #(vi
.NONE/*)
@@ -4652,7 +4290,7 @@ case ".$withval" in #(vi
withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
;;
*)
- { { echo "$as_me:4655: error: expected a pathname, not \"$withval\"" >&5
+ { { echo "$as_me:4293: error: expected a pathname, not \"$withval\"" >&5
echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
{ (exit 1); exit 1; }; }
;;
@@ -4685,7 +4323,7 @@ if test -n "$cf_cv_curses_dir/include" ; then
cf_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
cat >conftest.$ac_ext <<_ACEOF
-#line 4688 "configure"
+#line 4326 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -4697,16 +4335,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4700: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4338: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:4703: \$? = $ac_status" >&5
+ echo "$as_me:4341: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:4706: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4344: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4709: \$? = $ac_status" >&5
+ echo "$as_me:4347: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -4723,7 +4361,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:4726: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:4364: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -4757,7 +4395,7 @@ if test -n "$cf_cv_curses_dir/lib" ; then
if test "$cf_have_libdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:4760: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:4398: testing adding $cf_add_libdir to library-path ..." 1>&5
LDFLAGS="-L$cf_add_libdir $LDFLAGS"
fi
@@ -4768,12 +4406,10 @@ fi
fi
fi
-# Check whether --with-5lib or --without-5lib was given.
-if test "${with_5lib+set}" = set; then
- withval="$with_5lib"
- LIBS="-L/usr/5lib $LIBS"
- CPPFLAGS="$CPPFLAGS -I/usr/5include"
-fi;
+cf_cv_screen=curses
+
+echo "$as_me:4411: checking for specified curses library type" >&5
+echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
# Check whether --with-ncursesw or --without-ncursesw was given.
if test "${with_ncursesw+set}" = set; then
@@ -4791,14 +4427,31 @@ else
if test "${with_pdcurses+set}" = set; then
withval="$with_pdcurses"
cf_cv_screen=pdcurses
+else
+
+# Check whether --with-curses-colr or --without-curses-colr was given.
+if test "${with_curses_colr+set}" = set; then
+ withval="$with_curses_colr"
+ cf_cv_screen=curses_colr
+else
+
+# Check whether --with-curses-5lib or --without-curses-5lib was given.
+if test "${with_curses_5lib+set}" = set; then
+ withval="$with_curses_5lib"
+ cf_cv_screen=curses_5lib
+fi;
+fi;
fi;
fi;
fi;
-case $cf_cv_screen in
-curses)
+echo "$as_me:4448: result: $cf_cv_screen" >&5
+echo "${ECHO_T}$cf_cv_screen" >&6
+
+case $cf_cv_screen in #(vi
+curses|curses_*) #(vi
-echo "$as_me:4801: checking for extra include directories" >&5
+echo "$as_me:4454: checking for extra include directories" >&5
echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
if test "${cf_cv_curses_incdir+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4807,22 +4460,28 @@ else
cf_cv_curses_incdir=no
case $host_os in #(vi
hpux10.*) #(vi
- test -d /usr/include/curses_colr && \
- cf_cv_curses_incdir="-I/usr/include/curses_colr"
+ if test "x$cf_cv_screen" = "xcurses_colr"
+ then
+ test -d /usr/include/curses_colr && \
+ cf_cv_curses_incdir="-I/usr/include/curses_colr"
+ fi
;;
sunos3*|sunos4*)
- test -d /usr/5lib && \
- test -d /usr/5include && \
- cf_cv_curses_incdir="-I/usr/5include"
+ if test "x$cf_cv_screen" = "xcurses_5lib"
+ then
+ test -d /usr/5lib && \
+ test -d /usr/5include && \
+ cf_cv_curses_incdir="-I/usr/5include"
+ fi
;;
esac
fi
-echo "$as_me:4821: result: $cf_cv_curses_incdir" >&5
+echo "$as_me:4480: result: $cf_cv_curses_incdir" >&5
echo "${ECHO_T}$cf_cv_curses_incdir" >&6
test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
-echo "$as_me:4825: checking if we have identified curses headers" >&5
+echo "$as_me:4484: checking if we have identified curses headers" >&5
echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
if test "${cf_cv_ncurses_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4830,11 +4489,11 @@ else
cf_cv_ncurses_header=none
for cf_header in \
- curses.h \
- ncurses.h ncurses/curses.h ncurses/ncurses.h
+ ncurses.h \
+ curses.h ncurses/ncurses.h ncurses/curses.h
do
cat >conftest.$ac_ext <<_ACEOF
-#line 4837 "configure"
+#line 4496 "configure"
#include "confdefs.h"
#include <${cf_header}>
int
@@ -4846,16 +4505,16 @@ initscr(); tgoto("?", 0,0)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4849: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4508: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:4852: \$? = $ac_status" >&5
+ echo "$as_me:4511: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:4855: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4514: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4858: \$? = $ac_status" >&5
+ echo "$as_me:4517: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_header=$cf_header; break
else
@@ -4866,11 +4525,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:4869: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:4528: result: $cf_cv_ncurses_header" >&5
echo "${ECHO_T}$cf_cv_ncurses_header" >&6
if test "$cf_cv_ncurses_header" = none ; then
- { { echo "$as_me:4873: error: No curses header-files found" >&5
+ { { echo "$as_me:4532: error: No curses header-files found" >&5
echo "$as_me: error: No curses header-files found" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -4880,23 +4539,23 @@ fi
for ac_header in $cf_cv_ncurses_header
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:4883: checking for $ac_header" >&5
+echo "$as_me:4542: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 4889 "configure"
+#line 4548 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:4893: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:4552: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:4899: \$? = $ac_status" >&5
+ echo "$as_me:4558: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -4915,7 +4574,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:4918: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:4577: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -4925,7 +4584,7 @@ EOF
fi
done
-echo "$as_me:4928: checking for terminfo header" >&5
+echo "$as_me:4587: checking for terminfo header" >&5
echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
if test "${cf_cv_term_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4943,7 +4602,7 @@ esac
for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
do
cat >conftest.$ac_ext <<_ACEOF
-#line 4946 "configure"
+#line 4605 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -4958,16 +4617,16 @@ int x = auto_left_margin
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4961: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4620: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:4964: \$? = $ac_status" >&5
+ echo "$as_me:4623: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:4967: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4626: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4970: \$? = $ac_status" >&5
+ echo "$as_me:4629: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header="$cf_test"
@@ -4983,14 +4642,15 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:4986: result: $cf_cv_term_header" >&5
+echo "$as_me:4645: result: $cf_cv_term_header" >&5
echo "${ECHO_T}$cf_cv_term_header" >&6
# Set definitions to allow ifdef'ing to accommodate subdirectories
case $cf_cv_term_header in # (vi
*term.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_TERM_H 1
EOF
@@ -4999,20 +4659,22 @@ esac
case $cf_cv_term_header in # (vi
ncurses/term.h) #(vi
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_TERM_H 1
EOF
;;
ncursesw/term.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_TERM_H 1
EOF
;;
esac
-echo "$as_me:5015: checking for ncurses version" >&5
+echo "$as_me:4677: checking for ncurses version" >&5
echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
if test "${cf_cv_ncurses_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5038,10 +4700,10 @@ Autoconf "old"
#endif
EOF
cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
- { (eval echo "$as_me:5041: \"$cf_try\"") >&5
+ { (eval echo "$as_me:4703: \"$cf_try\"") >&5
(eval $cf_try) 2>&5
ac_status=$?
- echo "$as_me:5044: \$? = $ac_status" >&5
+ echo "$as_me:4706: \$? = $ac_status" >&5
(exit $ac_status); }
if test -f conftest.out ; then
cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -5051,7 +4713,7 @@ EOF
else
cat >conftest.$ac_ext <<_ACEOF
-#line 5054 "configure"
+#line 4716 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -5076,15 +4738,15 @@ int main()
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:5079: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4741: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5082: \$? = $ac_status" >&5
+ echo "$as_me:4744: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:5084: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4746: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5087: \$? = $ac_status" >&5
+ echo "$as_me:4749: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -5098,16 +4760,17 @@ fi
rm -f $cf_tempfile
fi
-echo "$as_me:5101: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:4763: result: $cf_cv_ncurses_version" >&5
echo "${ECHO_T}$cf_cv_ncurses_version" >&6
-test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
+test "$cf_cv_ncurses_version" = no ||
+cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
-echo "$as_me:5107: checking if we have identified curses libraries" >&5
+echo "$as_me:4770: checking if we have identified curses libraries" >&5
echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 5110 "configure"
+#line 4773 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -5119,16 +4782,16 @@ initscr(); tgoto("?", 0,0)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5122: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4785: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5125: \$? = $ac_status" >&5
+ echo "$as_me:4788: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5128: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4791: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5131: \$? = $ac_status" >&5
+ echo "$as_me:4794: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -5137,13 +4800,13 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-echo "$as_me:5140: result: $cf_result" >&5
+echo "$as_me:4803: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test "$cf_result" = no ; then
case $host_os in #(vi
freebsd*) #(vi
- echo "$as_me:5146: checking for tgoto in -lmytinfo" >&5
+ echo "$as_me:4809: checking for tgoto in -lmytinfo" >&5
echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5151,7 +4814,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmytinfo $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 5154 "configure"
+#line 4817 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -5170,16 +4833,16 @@ tgoto ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5173: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4836: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5176: \$? = $ac_status" >&5
+ echo "$as_me:4839: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5179: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4842: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5182: \$? = $ac_status" >&5
+ echo "$as_me:4845: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_mytinfo_tgoto=yes
else
@@ -5190,15 +4853,37 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:5193: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:4856: result: $ac_cv_lib_mytinfo_tgoto" >&5
echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
if test $ac_cv_lib_mytinfo_tgoto = yes; then
- LIBS="-lmytinfo $LIBS"
+
+cf_add_libs="-lmytinfo"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
fi
;;
hpux10.*) #(vi
- echo "$as_me:5201: checking for initscr in -lcur_colr" >&5
+ # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
+ # next (1998), and xcurses "newer" (2000). There is no header file for
+ # Hcurses; the subdirectory curses_colr has the headers (curses.h and
+ # term.h) for cur_colr
+ if test "x$cf_cv_screen" = "xcurses_colr"
+ then
+ echo "$as_me:4886: checking for initscr in -lcur_colr" >&5
echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5206,7 +4891,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcur_colr $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 5209 "configure"
+#line 4894 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -5225,16 +4910,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5228: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4913: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5231: \$? = $ac_status" >&5
+ echo "$as_me:4916: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5234: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4919: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5237: \$? = $ac_status" >&5
+ echo "$as_me:4922: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_cur_colr_initscr=yes
else
@@ -5245,16 +4930,31 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:5248: result: $ac_cv_lib_cur_colr_initscr" >&5
+echo "$as_me:4933: result: $ac_cv_lib_cur_colr_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
if test $ac_cv_lib_cur_colr_initscr = yes; then
- LIBS="-lcur_colr $LIBS"
- ac_cv_func_initscr=yes
+cf_add_libs="-lcur_colr"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ ac_cv_func_initscr=yes
else
- echo "$as_me:5257: checking for initscr in -lHcurses" >&5
+ echo "$as_me:4957: checking for initscr in -lHcurses" >&5
echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5262,7 +4962,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lHcurses $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 5265 "configure"
+#line 4965 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -5281,16 +4981,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5284: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4984: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5287: \$? = $ac_status" >&5
+ echo "$as_me:4987: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5290: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4990: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5293: \$? = $ac_status" >&5
+ echo "$as_me:4993: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Hcurses_initscr=yes
else
@@ -5301,20 +5001,37 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:5304: result: $ac_cv_lib_Hcurses_initscr" >&5
+echo "$as_me:5004: result: $ac_cv_lib_Hcurses_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
if test $ac_cv_lib_Hcurses_initscr = yes; then
- # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
- LIBS="-lHcurses $LIBS"
- CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
- ac_cv_func_initscr=yes
+ # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
+
+cf_add_libs="-lHcurses"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
+ ac_cv_func_initscr=yes
fi
fi
- ;;
+ fi
+ ;;
linux*)
case `arch 2>/dev/null` in
x86_64)
@@ -5340,7 +5057,7 @@ if test -n "/lib64" ; then
if test "$cf_have_libdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:5343: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5060: testing adding $cf_add_libdir to library-path ..." 1>&5
LDFLAGS="-L$cf_add_libdir $LDFLAGS"
fi
@@ -5369,7 +5086,7 @@ if test -n "/lib" ; then
if test "$cf_have_libdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:5372: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5089: testing adding $cf_add_libdir to library-path ..." 1>&5
LDFLAGS="-L$cf_add_libdir $LDFLAGS"
fi
@@ -5400,7 +5117,7 @@ if test -n "/lib" ; then
if test "$cf_have_libdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:5403: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5120: testing adding $cf_add_libdir to library-path ..." 1>&5
LDFLAGS="-L$cf_add_libdir $LDFLAGS"
fi
@@ -5410,9 +5127,11 @@ fi
;;
esac
- ;;
+ ;;
sunos3*|sunos4*)
- if test -d /usr/5lib ; then
+ if test "x$cf_cv_screen" = "xcurses_5lib"
+ then
+ if test -d /usr/5lib ; then
if test -n "/usr/5lib" ; then
for cf_add_libdir in /usr/5lib
@@ -5433,7 +5152,7 @@ if test -n "/usr/5lib" ; then
if test "$cf_have_libdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:5436: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5155: testing adding $cf_add_libdir to library-path ..." 1>&5
LDFLAGS="-L$cf_add_libdir $LDFLAGS"
fi
@@ -5441,33 +5160,49 @@ echo "${as_me:-configure}:5436: testing adding $cf_add_libdir to library-path ..
done
fi
- LIBS="-lcurses -ltermcap $LIBS"
+cf_add_libs="-lcurses -ltermcap"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ fi
fi
ac_cv_func_initscr=yes
;;
esac
if test ".$ac_cv_func_initscr" != .yes ; then
- cf_save_LIBS="$LIBS"
- cf_term_lib=""
- cf_curs_lib=""
+ cf_save_LIBS="$LIBS"
- if test ".${cf_cv_ncurses_version:-no}" != .no
- then
- cf_check_list="ncurses curses cursesX"
- else
- cf_check_list="cursesX curses ncurses"
- fi
+ if test ".${cf_cv_ncurses_version:-no}" != .no
+ then
+ cf_check_list="ncurses curses cursesX"
+ else
+ cf_check_list="cursesX curses ncurses"
+ fi
- # Check for library containing tgoto. Do this before curses library
- # because it may be needed to link the test-case for initscr.
- echo "$as_me:5464: checking for tgoto" >&5
+ # Check for library containing tgoto. Do this before curses library
+ # because it may be needed to link the test-case for initscr.
+ if test "x$cf_term_lib" = x
+ then
+ echo "$as_me:5199: checking for tgoto" >&5
echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
if test "${ac_cv_func_tgoto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 5470 "configure"
+#line 5205 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char tgoto (); below. */
@@ -5490,7 +5225,7 @@ main ()
#if defined (__stub_tgoto) || defined (__stub___tgoto)
choke me
#else
-f = tgoto;
+f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -5498,16 +5233,16 @@ f = tgoto;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5501: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5236: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5504: \$? = $ac_status" >&5
+ echo "$as_me:5239: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5507: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5242: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5510: \$? = $ac_status" >&5
+ echo "$as_me:5245: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_tgoto=yes
else
@@ -5517,16 +5252,16 @@ ac_cv_func_tgoto=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:5520: result: $ac_cv_func_tgoto" >&5
+echo "$as_me:5255: result: $ac_cv_func_tgoto" >&5
echo "${ECHO_T}$ac_cv_func_tgoto" >&6
if test $ac_cv_func_tgoto = yes; then
cf_term_lib=predefined
else
- for cf_term_lib in $cf_check_list termcap termlib unknown
- do
- as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
-echo "$as_me:5529: checking for tgoto in -l$cf_term_lib" >&5
+ for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
+ do
+ as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
+echo "$as_me:5264: checking for tgoto in -l$cf_term_lib" >&5
echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5534,7 +5269,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-l$cf_term_lib $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 5537 "configure"
+#line 5272 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -5553,16 +5288,16 @@ tgoto ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5556: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5291: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5559: \$? = $ac_status" >&5
+ echo "$as_me:5294: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5562: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5297: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5565: \$? = $ac_status" >&5
+ echo "$as_me:5300: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_Lib=yes"
else
@@ -5573,22 +5308,26 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:5576: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:5311: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
break
fi
- done
+ done
fi
- # Check for library containing initscr
- test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
- for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
- do
- as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
-echo "$as_me:5591: checking for initscr in -l$cf_curs_lib" >&5
+ fi
+
+ # Check for library containing initscr
+ test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
+ if test "x$cf_curs_lib" = x
+ then
+ for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
+ do
+ as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
+echo "$as_me:5330: checking for initscr in -l$cf_curs_lib" >&5
echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5596,7 +5335,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-l$cf_curs_lib $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 5599 "configure"
+#line 5338 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -5615,16 +5354,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5618: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5357: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5621: \$? = $ac_status" >&5
+ echo "$as_me:5360: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5624: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5363: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5627: \$? = $ac_status" >&5
+ echo "$as_me:5366: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_Lib=yes"
else
@@ -5635,23 +5374,24 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:5638: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:5377: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
break
fi
- done
- test $cf_curs_lib = unknown && { { echo "$as_me:5645: error: no curses library found" >&5
+ done
+ fi
+ test $cf_curs_lib = unknown && { { echo "$as_me:5385: error: no curses library found" >&5
echo "$as_me: error: no curses library found" >&2;}
{ (exit 1); exit 1; }; }
- LIBS="-l$cf_curs_lib $cf_save_LIBS"
- if test "$cf_term_lib" = unknown ; then
- echo "$as_me:5651: checking if we can link with $cf_curs_lib library" >&5
+ LIBS="-l$cf_curs_lib $cf_save_LIBS"
+ if test "$cf_term_lib" = unknown ; then
+ echo "$as_me:5391: checking if we can link with $cf_curs_lib library" >&5
echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-#line 5654 "configure"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5394 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -5663,16 +5403,16 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5666: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5406: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5669: \$? = $ac_status" >&5
+ echo "$as_me:5409: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5672: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5412: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5675: \$? = $ac_status" >&5
+ echo "$as_me:5415: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -5681,18 +5421,18 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- echo "$as_me:5684: result: $cf_result" >&5
+ echo "$as_me:5424: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
- test $cf_result = no && { { echo "$as_me:5686: error: Cannot link curses library" >&5
+ test $cf_result = no && { { echo "$as_me:5426: error: Cannot link curses library" >&5
echo "$as_me: error: Cannot link curses library" >&2;}
{ (exit 1); exit 1; }; }
- elif test "$cf_curs_lib" = "$cf_term_lib" ; then
- :
- elif test "$cf_term_lib" != predefined ; then
- echo "$as_me:5692: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+ elif test "$cf_curs_lib" = "$cf_term_lib" ; then
+ :
+ elif test "$cf_term_lib" != predefined ; then
+ echo "$as_me:5432: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-#line 5695 "configure"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5435 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -5704,25 +5444,25 @@ initscr(); tgoto((char *)0, 0, 0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5707: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5447: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5710: \$? = $ac_status" >&5
+ echo "$as_me:5450: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5713: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5453: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5716: \$? = $ac_status" >&5
+ echo "$as_me:5456: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
- LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
- cat >conftest.$ac_ext <<_ACEOF
-#line 5725 "configure"
+ LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5465 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -5734,16 +5474,16 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5737: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5477: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5740: \$? = $ac_status" >&5
+ echo "$as_me:5480: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5743: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5483: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5746: \$? = $ac_status" >&5
+ echo "$as_me:5486: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -5755,176 +5495,123 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- echo "$as_me:5758: result: $cf_result" >&5
+ echo "$as_me:5498: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
- fi
+ fi
fi
fi
-echo "$as_me:5764: checking for NetBSD form.h" >&5
-echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
-if test "${cf_cv_netbsd_form_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 5771 "configure"
-#include "confdefs.h"
-
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include <form.h>
-
-int
-main ()
-{
-
- FORM *form;
- int y = current_field(form)->cursor_ypos;
- int x = current_field(form)->cursor_xpos;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5790: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:5793: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:5796: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:5799: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cf_cv_netbsd_form_h=yes
-
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_netbsd_form_h=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+ ;;
+ncurses) #(vi
-fi
-echo "$as_me:5811: result: $cf_cv_netbsd_form_h" >&5
-echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
+cf_ncuconfig_root=ncurses
-test "$cf_cv_netbsd_form_h" = yes && cat >>confdefs.h <<\EOF
-#define HAVE_NETBSD_FORM_H 1
-EOF
+echo "Looking for ${cf_ncuconfig_root}-config"
-echo "$as_me:5818: checking for NetBSD menu.h" >&5
-echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
-if test "${cf_cv_netbsd_menu_h+set}" = set; then
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:5516: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
+ if test -n "$NCURSES_CONFIG"; then
+ ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
+echo "$as_me:5531: found $ac_dir/$ac_word" >&5
+break
+done
-cat >conftest.$ac_ext <<_ACEOF
-#line 5825 "configure"
-#include "confdefs.h"
-
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include <menu.h>
-
-int
-main ()
-{
-
- MENU *menu;
- int y = menu->max_item_width;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5843: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:5846: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:5849: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:5852: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cf_cv_netbsd_menu_h=yes
-
+fi
+fi
+NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
+if test -n "$NCURSES_CONFIG"; then
+ echo "$as_me:5539: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_netbsd_menu_h=no
+ echo "$as_me:5542: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+ test -n "$NCURSES_CONFIG" && break
+ done
fi
-echo "$as_me:5864: result: $cf_cv_netbsd_menu_h" >&5
-echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
-
-test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
-#define HAVE_NETBSD_MENU_H 1
-EOF
-
- ;;
-ncurses)
-
-cf_ncuconfig_root=ncurses
-
-echo "Looking for ${cf_ncuconfig_root}-config"
-for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+if test -z "$NCURSES_CONFIG"; then
+ ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
+ for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:5881: checking for $ac_word" >&5
+echo "$as_me:5555: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case $NCURSES_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
- ;;
- *)
+ if test -n "$ac_ct_NCURSES_CONFIG"; then
+ ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
+else
ac_save_IFS=$IFS; IFS=$ac_path_separator
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
IFS=$ac_save_IFS
test -z "$ac_dir" && ac_dir=.
- if $as_executable_p "$ac_dir/$ac_word"; then
- ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
- echo "$as_me:5898: found $ac_dir/$ac_word" >&5
- break
-fi
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
+echo "$as_me:5570: found $ac_dir/$ac_word" >&5
+break
done
- ;;
-esac
fi
-NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
-
-if test -n "$NCURSES_CONFIG"; then
- echo "$as_me:5909: result: $NCURSES_CONFIG" >&5
-echo "${ECHO_T}$NCURSES_CONFIG" >&6
+fi
+ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
+if test -n "$ac_ct_NCURSES_CONFIG"; then
+ echo "$as_me:5578: result: $ac_ct_NCURSES_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
else
- echo "$as_me:5912: result: no" >&5
+ echo "$as_me:5581: result: no" >&5
echo "${ECHO_T}no" >&6
fi
- test -n "$NCURSES_CONFIG" && break
+ test -n "$ac_ct_NCURSES_CONFIG" && break
done
-test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
+
+ NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
+fi
if test "$NCURSES_CONFIG" != none ; then
CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
-LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+cf_add_libs="`$NCURSES_CONFIG --libs`"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
# even with config script, some packages use no-override for curses.h
-echo "$as_me:5927: checking if we have identified curses headers" >&5
+echo "$as_me:5614: checking if we have identified curses headers" >&5
echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
if test "${cf_cv_ncurses_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5932,13 +5619,13 @@ else
cf_cv_ncurses_header=none
for cf_header in \
- ncurses/curses.h \
- ncurses/ncurses.h \
- curses.h \
- ncurses.h
+ ncurses/ncurses.h \
+ ncurses/curses.h \
+ ncurses.h \
+ curses.h
do
cat >conftest.$ac_ext <<_ACEOF
-#line 5941 "configure"
+#line 5628 "configure"
#include "confdefs.h"
#include <${cf_header}>
int
@@ -5950,16 +5637,16 @@ initscr(); tgoto("?", 0,0)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5953: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5640: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:5956: \$? = $ac_status" >&5
+ echo "$as_me:5643: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:5959: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5646: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5962: \$? = $ac_status" >&5
+ echo "$as_me:5649: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_header=$cf_header; break
else
@@ -5970,11 +5657,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:5973: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:5660: result: $cf_cv_ncurses_header" >&5
echo "${ECHO_T}$cf_cv_ncurses_header" >&6
if test "$cf_cv_ncurses_header" = none ; then
- { { echo "$as_me:5977: error: No curses header-files found" >&5
+ { { echo "$as_me:5664: error: No curses header-files found" >&5
echo "$as_me: error: No curses header-files found" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -5984,23 +5671,23 @@ fi
for ac_header in $cf_cv_ncurses_header
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:5987: checking for $ac_header" >&5
+echo "$as_me:5674: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 5993 "configure"
+#line 5680 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:5997: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:5684: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:6003: \$? = $ac_status" >&5
+ echo "$as_me:5690: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -6019,7 +5706,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:6022: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:5709: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -6072,7 +5759,7 @@ if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
cf_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
cat >conftest.$ac_ext <<_ACEOF
-#line 6075 "configure"
+#line 5762 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -6084,16 +5771,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6087: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5774: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6090: \$? = $ac_status" >&5
+ echo "$as_me:5777: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6093: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5780: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6096: \$? = $ac_status" >&5
+ echo "$as_me:5783: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -6110,7 +5797,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:6113: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:5800: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -6127,7 +5814,7 @@ fi
}
-echo "$as_me:6130: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:5817: checking for $cf_ncuhdr_root header in include-path" >&5
echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
if test "${cf_cv_ncurses_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6139,7 +5826,7 @@ else
do
cat >conftest.$ac_ext <<_ACEOF
-#line 6142 "configure"
+#line 5829 "configure"
#include "confdefs.h"
#include <$cf_header>
@@ -6163,16 +5850,16 @@ printf("old\n");
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6166: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5853: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6169: \$? = $ac_status" >&5
+ echo "$as_me:5856: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6172: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5859: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6175: \$? = $ac_status" >&5
+ echo "$as_me:5862: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_h=$cf_header
@@ -6187,14 +5874,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:6190: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:5877: result: $cf_cv_ncurses_h" >&5
echo "${ECHO_T}$cf_cv_ncurses_h" >&6
if test "$cf_cv_ncurses_h" != no ; then
cf_cv_ncurses_header=$cf_cv_ncurses_h
else
-echo "$as_me:6197: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:5884: checking for $cf_ncuhdr_root include-path" >&5
echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
if test "${cf_cv_ncurses_h2+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6213,7 +5900,7 @@ if test -n "${CFLAGS}${CPPFLAGS}" ; then
-I*)
cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
-test "$cf_header_path" != "NONE" && \
+test "x$cf_header_path" != "xNONE" && \
test -d "$cf_header_path" && \
{
test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
@@ -6234,18 +5921,7 @@ fi
cf_search=
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under /usr"
- test -d /usr/include && cf_search="$cf_search /usr/include"
- test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
- test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
- test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
- test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "$prefix" != "NONE" && \
+test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
{
test -n "$verbose" && echo " ... testing for include-directories under $prefix"
@@ -6256,38 +5932,27 @@ test -d "$prefix" && \
test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under /usr/local"
- test -d /usr/local/include && cf_search="$cf_search /usr/local/include"
- test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
- test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
- test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
- test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
+for cf_subdir_prefix in \
+ /usr \
+ /usr/local \
+ /usr/pkg \
+ /opt \
+ /opt/local \
+ $HOME
+do
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under /opt"
- test -d /opt/include && cf_search="$cf_search /opt/include"
- test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
- test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
- test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
- test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+test "x$cf_subdir_prefix" != "x$prefix" && \
+test -d "$cf_subdir_prefix" && \
+(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
+ test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
+ test -d $cf_subdir_prefix/include && cf_search="$cf_search $cf_subdir_prefix/include"
+ test -d $cf_subdir_prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
+ test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
+ test -d $cf_subdir_prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
+ test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under $HOME"
- test -d $HOME/include && cf_search="$cf_search $HOME/include"
- test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
- test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
- test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
- test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
+done
test "$includedir" != NONE && \
test "$includedir" != "/usr/include" && \
@@ -6334,7 +5999,7 @@ if test -n "$cf_incdir" ; then
cf_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
cat >conftest.$ac_ext <<_ACEOF
-#line 6337 "configure"
+#line 6002 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -6346,16 +6011,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6349: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6014: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6352: \$? = $ac_status" >&5
+ echo "$as_me:6017: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6355: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6020: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6358: \$? = $ac_status" >&5
+ echo "$as_me:6023: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -6372,7 +6037,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:6375: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:6040: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -6393,7 +6058,7 @@ fi
do
cat >conftest.$ac_ext <<_ACEOF
-#line 6396 "configure"
+#line 6061 "configure"
#include "confdefs.h"
#include <$cf_header>
@@ -6417,16 +6082,16 @@ printf("old\n");
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6420: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6085: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6423: \$? = $ac_status" >&5
+ echo "$as_me:6088: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6426: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6091: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6429: \$? = $ac_status" >&5
+ echo "$as_me:6094: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_h2=$cf_header
@@ -6447,12 +6112,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
CPPFLAGS="$cf_save2_CPPFLAGS"
test "$cf_cv_ncurses_h2" != no && break
done
- test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6450: error: not found" >&5
+ test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6115: error: not found" >&5
echo "$as_me: error: not found" >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:6455: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:6120: result: $cf_cv_ncurses_h2" >&5
echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -6485,7 +6150,7 @@ if test -n "$cf_1st_incdir" ; then
cf_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
cat >conftest.$ac_ext <<_ACEOF
-#line 6488 "configure"
+#line 6153 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -6497,16 +6162,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6500: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6165: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6503: \$? = $ac_status" >&5
+ echo "$as_me:6168: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6506: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6171: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6509: \$? = $ac_status" >&5
+ echo "$as_me:6174: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -6523,7 +6188,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:6526: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:6191: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -6544,7 +6209,8 @@ fi
case $cf_cv_ncurses_header in # (vi
*ncurses.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_H 1
EOF
@@ -6553,20 +6219,22 @@ esac
case $cf_cv_ncurses_header in # (vi
ncurses/curses.h|ncurses/ncurses.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_NCURSES_H 1
EOF
;;
ncursesw/curses.h|ncursesw/ncurses.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_NCURSES_H 1
EOF
;;
esac
-echo "$as_me:6569: checking for terminfo header" >&5
+echo "$as_me:6237: checking for terminfo header" >&5
echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
if test "${cf_cv_term_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6584,7 +6252,7 @@ esac
for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
do
cat >conftest.$ac_ext <<_ACEOF
-#line 6587 "configure"
+#line 6255 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -6599,16 +6267,16 @@ int x = auto_left_margin
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6602: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6270: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6605: \$? = $ac_status" >&5
+ echo "$as_me:6273: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6608: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6276: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6611: \$? = $ac_status" >&5
+ echo "$as_me:6279: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header="$cf_test"
@@ -6624,14 +6292,15 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:6627: result: $cf_cv_term_header" >&5
+echo "$as_me:6295: result: $cf_cv_term_header" >&5
echo "${ECHO_T}$cf_cv_term_header" >&6
# Set definitions to allow ifdef'ing to accommodate subdirectories
case $cf_cv_term_header in # (vi
*term.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_TERM_H 1
EOF
@@ -6640,13 +6309,15 @@ esac
case $cf_cv_term_header in # (vi
ncurses/term.h) #(vi
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_TERM_H 1
EOF
;;
ncursesw/term.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_TERM_H 1
EOF
@@ -6654,11 +6325,12 @@ EOF
esac
# some applications need this, but should check for NCURSES_VERSION
+
cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
-echo "$as_me:6661: checking for ncurses version" >&5
+echo "$as_me:6333: checking for ncurses version" >&5
echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
if test "${cf_cv_ncurses_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6684,10 +6356,10 @@ Autoconf "old"
#endif
EOF
cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
- { (eval echo "$as_me:6687: \"$cf_try\"") >&5
+ { (eval echo "$as_me:6359: \"$cf_try\"") >&5
(eval $cf_try) 2>&5
ac_status=$?
- echo "$as_me:6690: \$? = $ac_status" >&5
+ echo "$as_me:6362: \$? = $ac_status" >&5
(exit $ac_status); }
if test -f conftest.out ; then
cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -6697,7 +6369,7 @@ EOF
else
cat >conftest.$ac_ext <<_ACEOF
-#line 6700 "configure"
+#line 6372 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -6722,15 +6394,15 @@ int main()
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:6725: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6397: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6728: \$? = $ac_status" >&5
+ echo "$as_me:6400: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:6730: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6402: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6733: \$? = $ac_status" >&5
+ echo "$as_me:6405: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -6744,9 +6416,10 @@ fi
rm -f $cf_tempfile
fi
-echo "$as_me:6747: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:6419: result: $cf_cv_ncurses_version" >&5
echo "${ECHO_T}$cf_cv_ncurses_version" >&6
-test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
+test "$cf_cv_ncurses_version" = no ||
+cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
@@ -6756,7 +6429,7 @@ cf_nculib_root=ncurses
# to link gpm.
cf_ncurses_LIBS=""
cf_ncurses_SAVE="$LIBS"
-echo "$as_me:6759: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:6432: checking for Gpm_Open in -lgpm" >&5
echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6764,7 +6437,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgpm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 6767 "configure"
+#line 6440 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -6783,16 +6456,16 @@ Gpm_Open ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6786: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6459: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6789: \$? = $ac_status" >&5
+ echo "$as_me:6462: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6792: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6465: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6795: \$? = $ac_status" >&5
+ echo "$as_me:6468: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gpm_Gpm_Open=yes
else
@@ -6803,10 +6476,10 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:6806: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:6479: result: $ac_cv_lib_gpm_Gpm_Open" >&5
echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
if test $ac_cv_lib_gpm_Gpm_Open = yes; then
- echo "$as_me:6809: checking for initscr in -lgpm" >&5
+ echo "$as_me:6482: checking for initscr in -lgpm" >&5
echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
if test "${ac_cv_lib_gpm_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6814,7 +6487,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgpm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 6817 "configure"
+#line 6490 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -6833,16 +6506,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6836: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6509: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6839: \$? = $ac_status" >&5
+ echo "$as_me:6512: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6842: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6515: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6845: \$? = $ac_status" >&5
+ echo "$as_me:6518: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gpm_initscr=yes
else
@@ -6853,7 +6526,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:6856: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:6529: result: $ac_cv_lib_gpm_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
if test $ac_cv_lib_gpm_initscr = yes; then
LIBS="$cf_ncurses_SAVE"
@@ -6868,7 +6541,7 @@ freebsd*)
# This is only necessary if you are linking against an obsolete
# version of ncurses (but it should do no harm, since it's static).
if test "$cf_nculib_root" = ncurses ; then
- echo "$as_me:6871: checking for tgoto in -lmytinfo" >&5
+ echo "$as_me:6544: checking for tgoto in -lmytinfo" >&5
echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6876,7 +6549,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmytinfo $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 6879 "configure"
+#line 6552 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -6895,16 +6568,16 @@ tgoto ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6898: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6571: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6901: \$? = $ac_status" >&5
+ echo "$as_me:6574: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6904: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6577: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6907: \$? = $ac_status" >&5
+ echo "$as_me:6580: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_mytinfo_tgoto=yes
else
@@ -6915,7 +6588,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:6918: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:6591: result: $ac_cv_lib_mytinfo_tgoto" >&5
echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
if test $ac_cv_lib_mytinfo_tgoto = yes; then
cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -6925,22 +6598,52 @@ fi
;;
esac
-LIBS="$cf_ncurses_LIBS $LIBS"
+cf_add_libs="$cf_ncurses_LIBS"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
- LIBS="-l$cf_nculib_root $LIBS"
+
+cf_add_libs="-l$cf_nculib_root"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
else
eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
cf_libdir=""
- echo "$as_me:6937: checking for initscr" >&5
+ echo "$as_me:6640: checking for initscr" >&5
echo $ECHO_N "checking for initscr... $ECHO_C" >&6
if test "${ac_cv_func_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 6943 "configure"
+#line 6646 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char initscr (); below. */
@@ -6963,7 +6666,7 @@ main ()
#if defined (__stub_initscr) || defined (__stub___initscr)
choke me
#else
-f = initscr;
+f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -6971,16 +6674,16 @@ f = initscr;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6974: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6677: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6977: \$? = $ac_status" >&5
+ echo "$as_me:6680: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6980: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6683: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6983: \$? = $ac_status" >&5
+ echo "$as_me:6686: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_initscr=yes
else
@@ -6990,18 +6693,18 @@ ac_cv_func_initscr=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:6993: result: $ac_cv_func_initscr" >&5
+echo "$as_me:6696: result: $ac_cv_func_initscr" >&5
echo "${ECHO_T}$ac_cv_func_initscr" >&6
if test $ac_cv_func_initscr = yes; then
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
cf_save_LIBS="$LIBS"
- echo "$as_me:7000: checking for initscr in -l$cf_nculib_root" >&5
+ echo "$as_me:6703: checking for initscr in -l$cf_nculib_root" >&5
echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
LIBS="-l$cf_nculib_root $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 7004 "configure"
+#line 6707 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -7013,25 +6716,25 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7016: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6719: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:7019: \$? = $ac_status" >&5
+ echo "$as_me:6722: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:7022: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6725: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7025: \$? = $ac_status" >&5
+ echo "$as_me:6728: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:7027: result: yes" >&5
+ echo "$as_me:6730: result: yes" >&5
echo "${ECHO_T}yes" >&6
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:7034: result: no" >&5
+echo "$as_me:6737: result: no" >&5
echo "${ECHO_T}no" >&6
cf_search=
@@ -7043,7 +6746,7 @@ if test -n "${LDFLAGS}${LIBS}" ; then
-L*)
cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
-test "$cf_library_path" != "NONE" && \
+test "x$cf_library_path" != "xNONE" && \
test -d "$cf_library_path" && \
{
test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
@@ -7062,18 +6765,7 @@ fi
cf_search=
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under /usr"
- test -d /usr/lib && cf_search="$cf_search /usr/lib"
- test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root"
- test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
- test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib"
- test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "$prefix" != "NONE" && \
+test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
{
test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
@@ -7084,48 +6776,37 @@ test -d "$prefix" && \
test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
}
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under /usr/local"
- test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib"
- test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
- test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
- test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
- test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
-}
+for cf_subdir_prefix in \
+ /usr \
+ /usr/local \
+ /usr/pkg \
+ /opt \
+ /opt/local \
+ $HOME
+do
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under /opt"
- test -d /opt/lib && cf_search="$cf_search /opt/lib"
- test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root"
- test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
- test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib"
- test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+test "x$cf_subdir_prefix" != "x$prefix" && \
+test -d "$cf_subdir_prefix" && \
+(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
+ test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
+ test -d $cf_subdir_prefix/lib && cf_search="$cf_search $cf_subdir_prefix/lib"
+ test -d $cf_subdir_prefix/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
+ test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
+ test -d $cf_subdir_prefix/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
+ test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
}
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under $HOME"
- test -d $HOME/lib && cf_search="$cf_search $HOME/lib"
- test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root"
- test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
- test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib"
- test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
-}
+done
cf_search="$cf_library_path_list $cf_search"
for cf_libdir in $cf_search
do
- echo "$as_me:7124: checking for -l$cf_nculib_root in $cf_libdir" >&5
+ echo "$as_me:6805: checking for -l$cf_nculib_root in $cf_libdir" >&5
echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 7128 "configure"
+#line 6809 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -7137,25 +6818,25 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7140: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6821: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:7143: \$? = $ac_status" >&5
+ echo "$as_me:6824: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:7146: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6827: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7149: \$? = $ac_status" >&5
+ echo "$as_me:6830: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:7151: result: yes" >&5
+ echo "$as_me:6832: result: yes" >&5
echo "${ECHO_T}yes" >&6
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
break
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:7158: result: no" >&5
+echo "$as_me:6839: result: no" >&5
echo "${ECHO_T}no" >&6
LIBS="$cf_save_LIBS"
fi
@@ -7170,7 +6851,7 @@ fi
eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
if test $cf_found_library = no ; then
- { { echo "$as_me:7173: error: Cannot link $cf_nculib_root library" >&5
+ { { echo "$as_me:6854: error: Cannot link $cf_nculib_root library" >&5
echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -7178,7 +6859,7 @@ fi
fi
if test -n "$cf_ncurses_LIBS" ; then
- echo "$as_me:7181: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+ echo "$as_me:6862: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
cf_ncurses_SAVE="$LIBS"
for p in $cf_ncurses_LIBS ; do
@@ -7188,7 +6869,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
fi
done
cat >conftest.$ac_ext <<_ACEOF
-#line 7191 "configure"
+#line 6872 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -7200,23 +6881,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7203: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6884: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:7206: \$? = $ac_status" >&5
+ echo "$as_me:6887: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:7209: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6890: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7212: \$? = $ac_status" >&5
+ echo "$as_me:6893: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:7214: result: yes" >&5
+ echo "$as_me:6895: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:7219: result: no" >&5
+echo "$as_me:6900: result: no" >&5
echo "${ECHO_T}no" >&6
LIBS="$cf_ncurses_SAVE"
fi
@@ -7232,10 +6913,9 @@ EOF
fi
;;
-ncursesw)
- cf_cv_libtype=w
+ncursesw) #(vi
-echo "$as_me:7238: checking for multibyte character support" >&5
+echo "$as_me:6918: checking for multibyte character support" >&5
echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
if test "${cf_cv_utf8_lib+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7243,7 +6923,7 @@ else
cf_save_LIBS="$LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 7246 "configure"
+#line 6926 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -7256,16 +6936,16 @@ putwc(0,0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7259: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6939: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:7262: \$? = $ac_status" >&5
+ echo "$as_me:6942: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:7265: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6945: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7268: \$? = $ac_status" >&5
+ echo "$as_me:6948: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_utf8_lib=yes
else
@@ -7277,12 +6957,12 @@ cat conftest.$ac_ext >&5
cf_cv_header_path_utf8=
cf_cv_library_path_utf8=
-echo "${as_me:-configure}:7280: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:6960: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
cf_save_LIBS="$LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 7285 "configure"
+#line 6965 "configure"
#include "confdefs.h"
#include <libutf8.h>
@@ -7295,16 +6975,16 @@ putwc(0,0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7298: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6978: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:7301: \$? = $ac_status" >&5
+ echo "$as_me:6981: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:7304: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6984: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7307: \$? = $ac_status" >&5
+ echo "$as_me:6987: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_find_linkage_utf8=yes
@@ -7318,7 +6998,7 @@ cat conftest.$ac_ext >&5
LIBS="-lutf8 $cf_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 7321 "configure"
+#line 7001 "configure"
#include "confdefs.h"
#include <libutf8.h>
@@ -7331,16 +7011,16 @@ putwc(0,0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7334: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7014: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:7337: \$? = $ac_status" >&5
+ echo "$as_me:7017: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:7340: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7020: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7343: \$? = $ac_status" >&5
+ echo "$as_me:7023: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_find_linkage_utf8=yes
@@ -7357,9 +7037,9 @@ cat conftest.$ac_ext >&5
test -n "$verbose" && echo " find linkage for utf8 library" 1>&6
-echo "${as_me:-configure}:7360: testing find linkage for utf8 library ..." 1>&5
+echo "${as_me:-configure}:7040: testing find linkage for utf8 library ..." 1>&5
-echo "${as_me:-configure}:7362: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7042: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
cf_save_CPPFLAGS="$CPPFLAGS"
cf_test_CPPFLAGS="$CPPFLAGS"
@@ -7375,7 +7055,7 @@ if test -n "${CFLAGS}${CPPFLAGS}" ; then
-I*)
cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
-test "$cf_header_path" != "NONE" && \
+test "x$cf_header_path" != "xNONE" && \
test -d "$cf_header_path" && \
{
test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
@@ -7396,18 +7076,7 @@ fi
cf_search=
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under /usr"
- test -d /usr/include && cf_search="$cf_search /usr/include"
- test -d /usr/include/utf8 && cf_search="$cf_search /usr/include/utf8"
- test -d /usr/include/utf8/include && cf_search="$cf_search /usr/include/utf8/include"
- test -d /usr/utf8/include && cf_search="$cf_search /usr/utf8/include"
- test -d /usr/utf8/include/utf8 && cf_search="$cf_search /usr/utf8/include/utf8"
-}
-
-test "$prefix" != "NONE" && \
+test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
{
test -n "$verbose" && echo " ... testing for include-directories under $prefix"
@@ -7418,38 +7087,27 @@ test -d "$prefix" && \
test -d $prefix/utf8/include/utf8 && cf_search="$cf_search $prefix/utf8/include/utf8"
}
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under /usr/local"
- test -d /usr/local/include && cf_search="$cf_search /usr/local/include"
- test -d /usr/local/include/utf8 && cf_search="$cf_search /usr/local/include/utf8"
- test -d /usr/local/include/utf8/include && cf_search="$cf_search /usr/local/include/utf8/include"
- test -d /usr/local/utf8/include && cf_search="$cf_search /usr/local/utf8/include"
- test -d /usr/local/utf8/include/utf8 && cf_search="$cf_search /usr/local/utf8/include/utf8"
-}
+for cf_subdir_prefix in \
+ /usr \
+ /usr/local \
+ /usr/pkg \
+ /opt \
+ /opt/local \
+ $HOME
+do
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under /opt"
- test -d /opt/include && cf_search="$cf_search /opt/include"
- test -d /opt/include/utf8 && cf_search="$cf_search /opt/include/utf8"
- test -d /opt/include/utf8/include && cf_search="$cf_search /opt/include/utf8/include"
- test -d /opt/utf8/include && cf_search="$cf_search /opt/utf8/include"
- test -d /opt/utf8/include/utf8 && cf_search="$cf_search /opt/utf8/include/utf8"
+test "x$cf_subdir_prefix" != "x$prefix" && \
+test -d "$cf_subdir_prefix" && \
+(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
+ test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
+ test -d $cf_subdir_prefix/include && cf_search="$cf_search $cf_subdir_prefix/include"
+ test -d $cf_subdir_prefix/include/utf8 && cf_search="$cf_search $cf_subdir_prefix/include/utf8"
+ test -d $cf_subdir_prefix/include/utf8/include && cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
+ test -d $cf_subdir_prefix/utf8/include && cf_search="$cf_search $cf_subdir_prefix/utf8/include"
+ test -d $cf_subdir_prefix/utf8/include/utf8 && cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
}
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under $HOME"
- test -d $HOME/include && cf_search="$cf_search $HOME/include"
- test -d $HOME/include/utf8 && cf_search="$cf_search $HOME/include/utf8"
- test -d $HOME/include/utf8/include && cf_search="$cf_search $HOME/include/utf8/include"
- test -d $HOME/utf8/include && cf_search="$cf_search $HOME/utf8/include"
- test -d $HOME/utf8/include/utf8 && cf_search="$cf_search $HOME/utf8/include/utf8"
-}
+done
test "$includedir" != NONE && \
test "$includedir" != "/usr/include" && \
@@ -7472,11 +7130,11 @@ cf_search="$cf_search $cf_header_path_list"
if test -d $cf_cv_header_path_utf8 ; then
test -n "$verbose" && echo " ... testing $cf_cv_header_path_utf8" 1>&6
-echo "${as_me:-configure}:7475: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7133: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
cat >conftest.$ac_ext <<_ACEOF
-#line 7479 "configure"
+#line 7137 "configure"
#include "confdefs.h"
#include <libutf8.h>
@@ -7489,21 +7147,21 @@ putwc(0,0);
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7492: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7150: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:7495: \$? = $ac_status" >&5
+ echo "$as_me:7153: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:7498: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7156: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7501: \$? = $ac_status" >&5
+ echo "$as_me:7159: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
test -n "$verbose" && echo " ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
-echo "${as_me:-configure}:7506: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7164: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
cf_cv_find_linkage_utf8=maybe
cf_test_CPPFLAGS="$CPPFLAGS"
@@ -7521,7 +7179,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_cv_find_linkage_utf8" = maybe ; then
-echo "${as_me:-configure}:7524: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7182: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
cf_save_LIBS="$LIBS"
cf_save_LDFLAGS="$LDFLAGS"
@@ -7537,7 +7195,7 @@ if test -n "${LDFLAGS}${LIBS}" ; then
-L*)
cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
-test "$cf_library_path" != "NONE" && \
+test "x$cf_library_path" != "xNONE" && \
test -d "$cf_library_path" && \
{
test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
@@ -7556,18 +7214,7 @@ fi
cf_search=
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under /usr"
- test -d /usr/lib && cf_search="$cf_search /usr/lib"
- test -d /usr/lib/utf8 && cf_search="$cf_search /usr/lib/utf8"
- test -d /usr/lib/utf8/lib && cf_search="$cf_search /usr/lib/utf8/lib"
- test -d /usr/utf8/lib && cf_search="$cf_search /usr/utf8/lib"
- test -d /usr/utf8/lib/utf8 && cf_search="$cf_search /usr/utf8/lib/utf8"
-}
-
-test "$prefix" != "NONE" && \
+test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
{
test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
@@ -7578,38 +7225,27 @@ test -d "$prefix" && \
test -d $prefix/utf8/lib/utf8 && cf_search="$cf_search $prefix/utf8/lib/utf8"
}
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under /usr/local"
- test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib"
- test -d /usr/local/lib/utf8 && cf_search="$cf_search /usr/local/lib/utf8"
- test -d /usr/local/lib/utf8/lib && cf_search="$cf_search /usr/local/lib/utf8/lib"
- test -d /usr/local/utf8/lib && cf_search="$cf_search /usr/local/utf8/lib"
- test -d /usr/local/utf8/lib/utf8 && cf_search="$cf_search /usr/local/utf8/lib/utf8"
-}
+for cf_subdir_prefix in \
+ /usr \
+ /usr/local \
+ /usr/pkg \
+ /opt \
+ /opt/local \
+ $HOME
+do
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under /opt"
- test -d /opt/lib && cf_search="$cf_search /opt/lib"
- test -d /opt/lib/utf8 && cf_search="$cf_search /opt/lib/utf8"
- test -d /opt/lib/utf8/lib && cf_search="$cf_search /opt/lib/utf8/lib"
- test -d /opt/utf8/lib && cf_search="$cf_search /opt/utf8/lib"
- test -d /opt/utf8/lib/utf8 && cf_search="$cf_search /opt/utf8/lib/utf8"
+test "x$cf_subdir_prefix" != "x$prefix" && \
+test -d "$cf_subdir_prefix" && \
+(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
+ test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
+ test -d $cf_subdir_prefix/lib && cf_search="$cf_search $cf_subdir_prefix/lib"
+ test -d $cf_subdir_prefix/lib/utf8 && cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
+ test -d $cf_subdir_prefix/lib/utf8/lib && cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
+ test -d $cf_subdir_prefix/utf8/lib && cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
+ test -d $cf_subdir_prefix/utf8/lib/utf8 && cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
}
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under $HOME"
- test -d $HOME/lib && cf_search="$cf_search $HOME/lib"
- test -d $HOME/lib/utf8 && cf_search="$cf_search $HOME/lib/utf8"
- test -d $HOME/lib/utf8/lib && cf_search="$cf_search $HOME/lib/utf8/lib"
- test -d $HOME/utf8/lib && cf_search="$cf_search $HOME/utf8/lib"
- test -d $HOME/utf8/lib/utf8 && cf_search="$cf_search $HOME/utf8/lib/utf8"
-}
+done
cf_search="$cf_library_path_list $cf_search"
@@ -7618,13 +7254,13 @@ cf_search="$cf_library_path_list $cf_search"
if test -d $cf_cv_library_path_utf8 ; then
test -n "$verbose" && echo " ... testing $cf_cv_library_path_utf8" 1>&6
-echo "${as_me:-configure}:7621: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7257: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
CPPFLAGS="$cf_test_CPPFLAGS"
LIBS="-lutf8 $cf_save_LIBS"
LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
cat >conftest.$ac_ext <<_ACEOF
-#line 7627 "configure"
+#line 7263 "configure"
#include "confdefs.h"
#include <libutf8.h>
@@ -7637,21 +7273,21 @@ putwc(0,0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7640: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7276: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:7643: \$? = $ac_status" >&5
+ echo "$as_me:7279: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:7646: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7282: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7649: \$? = $ac_status" >&5
+ echo "$as_me:7285: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
test -n "$verbose" && echo " ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
-echo "${as_me:-configure}:7654: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7290: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
cf_cv_find_linkage_utf8=yes
cf_cv_library_file_utf8="-lutf8"
@@ -7693,13 +7329,14 @@ fi
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:7696: result: $cf_cv_utf8_lib" >&5
+echo "$as_me:7332: result: $cf_cv_utf8_lib" >&5
echo "${ECHO_T}$cf_cv_utf8_lib" >&6
# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
# ncurses/ncursesw:
if test "$cf_cv_utf8_lib" = "add-on" ; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_LIBUTF8_H 1
EOF
@@ -7727,7 +7364,7 @@ if test -n "$cf_cv_header_path_utf8" ; then
cf_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
cat >conftest.$ac_ext <<_ACEOF
-#line 7730 "configure"
+#line 7367 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -7739,16 +7376,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7742: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7379: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:7745: \$? = $ac_status" >&5
+ echo "$as_me:7382: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:7748: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7385: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7751: \$? = $ac_status" >&5
+ echo "$as_me:7388: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -7765,7 +7402,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:7768: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:7405: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -7799,7 +7436,7 @@ if test -n "$cf_cv_library_path_utf8" ; then
if test "$cf_have_libdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:7802: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:7439: testing adding $cf_add_libdir to library-path ..." 1>&5
LDFLAGS="-L$cf_add_libdir $LDFLAGS"
fi
@@ -7807,63 +7444,132 @@ echo "${as_me:-configure}:7802: testing adding $cf_add_libdir to library-path ..
done
fi
- LIBS="$cf_cv_library_file_utf8 $LIBS"
+cf_add_libs="$cf_cv_library_file_utf8"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
fi
cf_ncuconfig_root=ncursesw
echo "Looking for ${cf_ncuconfig_root}-config"
-for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:7474: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$NCURSES_CONFIG"; then
+ ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
+echo "$as_me:7489: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
+if test -n "$NCURSES_CONFIG"; then
+ echo "$as_me:7497: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+ echo "$as_me:7500: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$NCURSES_CONFIG" && break
+ done
+fi
+if test -z "$NCURSES_CONFIG"; then
+ ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
+ for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:7820: checking for $ac_word" >&5
+echo "$as_me:7513: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case $NCURSES_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
- ;;
- *)
+ if test -n "$ac_ct_NCURSES_CONFIG"; then
+ ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
+else
ac_save_IFS=$IFS; IFS=$ac_path_separator
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
IFS=$ac_save_IFS
test -z "$ac_dir" && ac_dir=.
- if $as_executable_p "$ac_dir/$ac_word"; then
- ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
- echo "$as_me:7837: found $ac_dir/$ac_word" >&5
- break
-fi
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
+echo "$as_me:7528: found $ac_dir/$ac_word" >&5
+break
done
- ;;
-esac
fi
-NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
-
-if test -n "$NCURSES_CONFIG"; then
- echo "$as_me:7848: result: $NCURSES_CONFIG" >&5
-echo "${ECHO_T}$NCURSES_CONFIG" >&6
+fi
+ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
+if test -n "$ac_ct_NCURSES_CONFIG"; then
+ echo "$as_me:7536: result: $ac_ct_NCURSES_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
else
- echo "$as_me:7851: result: no" >&5
+ echo "$as_me:7539: result: no" >&5
echo "${ECHO_T}no" >&6
fi
- test -n "$NCURSES_CONFIG" && break
+ test -n "$ac_ct_NCURSES_CONFIG" && break
done
-test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
+
+ NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
+fi
if test "$NCURSES_CONFIG" != none ; then
CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
-LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+cf_add_libs="`$NCURSES_CONFIG --libs`"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
# even with config script, some packages use no-override for curses.h
-echo "$as_me:7866: checking if we have identified curses headers" >&5
+echo "$as_me:7572: checking if we have identified curses headers" >&5
echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
if test "${cf_cv_ncurses_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7871,13 +7577,13 @@ else
cf_cv_ncurses_header=none
for cf_header in \
- ncursesw/curses.h \
- ncursesw/ncurses.h \
- curses.h \
- ncurses.h
+ ncursesw/ncurses.h \
+ ncursesw/curses.h \
+ ncurses.h \
+ curses.h
do
cat >conftest.$ac_ext <<_ACEOF
-#line 7880 "configure"
+#line 7586 "configure"
#include "confdefs.h"
#include <${cf_header}>
int
@@ -7889,16 +7595,16 @@ initscr(); tgoto("?", 0,0)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7892: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7598: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:7895: \$? = $ac_status" >&5
+ echo "$as_me:7601: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:7898: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7604: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7901: \$? = $ac_status" >&5
+ echo "$as_me:7607: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_header=$cf_header; break
else
@@ -7909,11 +7615,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:7912: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:7618: result: $cf_cv_ncurses_header" >&5
echo "${ECHO_T}$cf_cv_ncurses_header" >&6
if test "$cf_cv_ncurses_header" = none ; then
- { { echo "$as_me:7916: error: No curses header-files found" >&5
+ { { echo "$as_me:7622: error: No curses header-files found" >&5
echo "$as_me: error: No curses header-files found" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -7923,23 +7629,23 @@ fi
for ac_header in $cf_cv_ncurses_header
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:7926: checking for $ac_header" >&5
+echo "$as_me:7632: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 7932 "configure"
+#line 7638 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:7936: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:7642: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:7942: \$? = $ac_status" >&5
+ echo "$as_me:7648: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -7958,7 +7664,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:7961: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:7667: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -8011,7 +7717,7 @@ if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
cf_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
cat >conftest.$ac_ext <<_ACEOF
-#line 8014 "configure"
+#line 7720 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -8023,16 +7729,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8026: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7732: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8029: \$? = $ac_status" >&5
+ echo "$as_me:7735: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8032: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7738: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8035: \$? = $ac_status" >&5
+ echo "$as_me:7741: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -8049,7 +7755,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:8052: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:7758: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -8066,7 +7772,7 @@ fi
}
-echo "$as_me:8069: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:7775: checking for $cf_ncuhdr_root header in include-path" >&5
echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
if test "${cf_cv_ncurses_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8078,7 +7784,7 @@ else
do
cat >conftest.$ac_ext <<_ACEOF
-#line 8081 "configure"
+#line 7787 "configure"
#include "confdefs.h"
#define _XOPEN_SOURCE_EXTENDED
@@ -8110,16 +7816,16 @@ printf("old\n");
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8113: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7819: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8116: \$? = $ac_status" >&5
+ echo "$as_me:7822: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8119: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7825: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8122: \$? = $ac_status" >&5
+ echo "$as_me:7828: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_h=$cf_header
@@ -8134,14 +7840,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:8137: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:7843: result: $cf_cv_ncurses_h" >&5
echo "${ECHO_T}$cf_cv_ncurses_h" >&6
if test "$cf_cv_ncurses_h" != no ; then
cf_cv_ncurses_header=$cf_cv_ncurses_h
else
-echo "$as_me:8144: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:7850: checking for $cf_ncuhdr_root include-path" >&5
echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
if test "${cf_cv_ncurses_h2+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8160,7 +7866,7 @@ if test -n "${CFLAGS}${CPPFLAGS}" ; then
-I*)
cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
-test "$cf_header_path" != "NONE" && \
+test "x$cf_header_path" != "xNONE" && \
test -d "$cf_header_path" && \
{
test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
@@ -8181,18 +7887,7 @@ fi
cf_search=
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under /usr"
- test -d /usr/include && cf_search="$cf_search /usr/include"
- test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
- test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
- test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
- test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "$prefix" != "NONE" && \
+test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
{
test -n "$verbose" && echo " ... testing for include-directories under $prefix"
@@ -8203,38 +7898,27 @@ test -d "$prefix" && \
test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under /usr/local"
- test -d /usr/local/include && cf_search="$cf_search /usr/local/include"
- test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
- test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
- test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
- test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
+for cf_subdir_prefix in \
+ /usr \
+ /usr/local \
+ /usr/pkg \
+ /opt \
+ /opt/local \
+ $HOME
+do
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under /opt"
- test -d /opt/include && cf_search="$cf_search /opt/include"
- test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
- test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
- test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
- test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+test "x$cf_subdir_prefix" != "x$prefix" && \
+test -d "$cf_subdir_prefix" && \
+(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
+ test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
+ test -d $cf_subdir_prefix/include && cf_search="$cf_search $cf_subdir_prefix/include"
+ test -d $cf_subdir_prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
+ test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
+ test -d $cf_subdir_prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
+ test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under $HOME"
- test -d $HOME/include && cf_search="$cf_search $HOME/include"
- test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
- test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
- test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
- test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
+done
test "$includedir" != NONE && \
test "$includedir" != "/usr/include" && \
@@ -8281,7 +7965,7 @@ if test -n "$cf_incdir" ; then
cf_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
cat >conftest.$ac_ext <<_ACEOF
-#line 8284 "configure"
+#line 7968 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -8293,16 +7977,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8296: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7980: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8299: \$? = $ac_status" >&5
+ echo "$as_me:7983: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8302: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7986: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8305: \$? = $ac_status" >&5
+ echo "$as_me:7989: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -8319,7 +8003,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:8322: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8006: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -8340,7 +8024,7 @@ fi
do
cat >conftest.$ac_ext <<_ACEOF
-#line 8343 "configure"
+#line 8027 "configure"
#include "confdefs.h"
#include <$cf_header>
@@ -8364,16 +8048,16 @@ printf("old\n");
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8367: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8051: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8370: \$? = $ac_status" >&5
+ echo "$as_me:8054: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8373: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8057: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8376: \$? = $ac_status" >&5
+ echo "$as_me:8060: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_h2=$cf_header
@@ -8394,12 +8078,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
CPPFLAGS="$cf_save2_CPPFLAGS"
test "$cf_cv_ncurses_h2" != no && break
done
- test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8397: error: not found" >&5
+ test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8081: error: not found" >&5
echo "$as_me: error: not found" >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:8402: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:8086: result: $cf_cv_ncurses_h2" >&5
echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -8432,7 +8116,7 @@ if test -n "$cf_1st_incdir" ; then
cf_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
cat >conftest.$ac_ext <<_ACEOF
-#line 8435 "configure"
+#line 8119 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -8444,16 +8128,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8447: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8131: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8450: \$? = $ac_status" >&5
+ echo "$as_me:8134: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8453: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8137: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8456: \$? = $ac_status" >&5
+ echo "$as_me:8140: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -8470,7 +8154,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:8473: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8157: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -8491,7 +8175,8 @@ fi
case $cf_cv_ncurses_header in # (vi
*ncurses.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_H 1
EOF
@@ -8500,20 +8185,22 @@ esac
case $cf_cv_ncurses_header in # (vi
ncurses/curses.h|ncurses/ncurses.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_NCURSES_H 1
EOF
;;
ncursesw/curses.h|ncursesw/ncurses.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_NCURSES_H 1
EOF
;;
esac
-echo "$as_me:8516: checking for terminfo header" >&5
+echo "$as_me:8203: checking for terminfo header" >&5
echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
if test "${cf_cv_term_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8531,7 +8218,7 @@ esac
for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
do
cat >conftest.$ac_ext <<_ACEOF
-#line 8534 "configure"
+#line 8221 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -8546,16 +8233,16 @@ int x = auto_left_margin
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8549: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8236: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8552: \$? = $ac_status" >&5
+ echo "$as_me:8239: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8555: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8242: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8558: \$? = $ac_status" >&5
+ echo "$as_me:8245: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header="$cf_test"
@@ -8571,14 +8258,15 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:8574: result: $cf_cv_term_header" >&5
+echo "$as_me:8261: result: $cf_cv_term_header" >&5
echo "${ECHO_T}$cf_cv_term_header" >&6
# Set definitions to allow ifdef'ing to accommodate subdirectories
case $cf_cv_term_header in # (vi
*term.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_TERM_H 1
EOF
@@ -8587,13 +8275,15 @@ esac
case $cf_cv_term_header in # (vi
ncurses/term.h) #(vi
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_TERM_H 1
EOF
;;
ncursesw/term.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_TERM_H 1
EOF
@@ -8601,11 +8291,12 @@ EOF
esac
# some applications need this, but should check for NCURSES_VERSION
+
cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
-echo "$as_me:8608: checking for ncurses version" >&5
+echo "$as_me:8299: checking for ncurses version" >&5
echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
if test "${cf_cv_ncurses_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8631,10 +8322,10 @@ Autoconf "old"
#endif
EOF
cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
- { (eval echo "$as_me:8634: \"$cf_try\"") >&5
+ { (eval echo "$as_me:8325: \"$cf_try\"") >&5
(eval $cf_try) 2>&5
ac_status=$?
- echo "$as_me:8637: \$? = $ac_status" >&5
+ echo "$as_me:8328: \$? = $ac_status" >&5
(exit $ac_status); }
if test -f conftest.out ; then
cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -8644,7 +8335,7 @@ EOF
else
cat >conftest.$ac_ext <<_ACEOF
-#line 8647 "configure"
+#line 8338 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -8669,15 +8360,15 @@ int main()
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:8672: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8363: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8675: \$? = $ac_status" >&5
+ echo "$as_me:8366: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:8677: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8368: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8680: \$? = $ac_status" >&5
+ echo "$as_me:8371: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -8691,9 +8382,10 @@ fi
rm -f $cf_tempfile
fi
-echo "$as_me:8694: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:8385: result: $cf_cv_ncurses_version" >&5
echo "${ECHO_T}$cf_cv_ncurses_version" >&6
-test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
+test "$cf_cv_ncurses_version" = no ||
+cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
@@ -8703,7 +8395,7 @@ cf_nculib_root=ncursesw
# to link gpm.
cf_ncurses_LIBS=""
cf_ncurses_SAVE="$LIBS"
-echo "$as_me:8706: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:8398: checking for Gpm_Open in -lgpm" >&5
echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8711,7 +8403,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgpm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8714 "configure"
+#line 8406 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -8730,16 +8422,16 @@ Gpm_Open ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8733: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8425: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8736: \$? = $ac_status" >&5
+ echo "$as_me:8428: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8739: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8431: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8742: \$? = $ac_status" >&5
+ echo "$as_me:8434: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gpm_Gpm_Open=yes
else
@@ -8750,10 +8442,10 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:8753: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:8445: result: $ac_cv_lib_gpm_Gpm_Open" >&5
echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
if test $ac_cv_lib_gpm_Gpm_Open = yes; then
- echo "$as_me:8756: checking for initscr in -lgpm" >&5
+ echo "$as_me:8448: checking for initscr in -lgpm" >&5
echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
if test "${ac_cv_lib_gpm_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8761,7 +8453,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgpm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8764 "configure"
+#line 8456 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -8780,16 +8472,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8783: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8475: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8786: \$? = $ac_status" >&5
+ echo "$as_me:8478: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8789: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8481: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8792: \$? = $ac_status" >&5
+ echo "$as_me:8484: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gpm_initscr=yes
else
@@ -8800,7 +8492,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:8803: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:8495: result: $ac_cv_lib_gpm_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
if test $ac_cv_lib_gpm_initscr = yes; then
LIBS="$cf_ncurses_SAVE"
@@ -8815,7 +8507,7 @@ freebsd*)
# This is only necessary if you are linking against an obsolete
# version of ncurses (but it should do no harm, since it's static).
if test "$cf_nculib_root" = ncurses ; then
- echo "$as_me:8818: checking for tgoto in -lmytinfo" >&5
+ echo "$as_me:8510: checking for tgoto in -lmytinfo" >&5
echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8823,7 +8515,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmytinfo $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8826 "configure"
+#line 8518 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -8842,16 +8534,16 @@ tgoto ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8845: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8537: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8848: \$? = $ac_status" >&5
+ echo "$as_me:8540: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8851: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8543: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8854: \$? = $ac_status" >&5
+ echo "$as_me:8546: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_mytinfo_tgoto=yes
else
@@ -8862,7 +8554,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:8865: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:8557: result: $ac_cv_lib_mytinfo_tgoto" >&5
echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
if test $ac_cv_lib_mytinfo_tgoto = yes; then
cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -8872,22 +8564,52 @@ fi
;;
esac
-LIBS="$cf_ncurses_LIBS $LIBS"
+cf_add_libs="$cf_ncurses_LIBS"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
- LIBS="-l$cf_nculib_root $LIBS"
+
+cf_add_libs="-l$cf_nculib_root"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
else
eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
cf_libdir=""
- echo "$as_me:8884: checking for initscr" >&5
+ echo "$as_me:8606: checking for initscr" >&5
echo $ECHO_N "checking for initscr... $ECHO_C" >&6
if test "${ac_cv_func_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 8890 "configure"
+#line 8612 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char initscr (); below. */
@@ -8910,7 +8632,7 @@ main ()
#if defined (__stub_initscr) || defined (__stub___initscr)
choke me
#else
-f = initscr;
+f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -8918,16 +8640,16 @@ f = initscr;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8921: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8643: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8924: \$? = $ac_status" >&5
+ echo "$as_me:8646: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8927: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8649: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8930: \$? = $ac_status" >&5
+ echo "$as_me:8652: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_initscr=yes
else
@@ -8937,18 +8659,18 @@ ac_cv_func_initscr=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:8940: result: $ac_cv_func_initscr" >&5
+echo "$as_me:8662: result: $ac_cv_func_initscr" >&5
echo "${ECHO_T}$ac_cv_func_initscr" >&6
if test $ac_cv_func_initscr = yes; then
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
cf_save_LIBS="$LIBS"
- echo "$as_me:8947: checking for initscr in -l$cf_nculib_root" >&5
+ echo "$as_me:8669: checking for initscr in -l$cf_nculib_root" >&5
echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
LIBS="-l$cf_nculib_root $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8951 "configure"
+#line 8673 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -8960,25 +8682,25 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8963: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8685: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8966: \$? = $ac_status" >&5
+ echo "$as_me:8688: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8969: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8691: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8972: \$? = $ac_status" >&5
+ echo "$as_me:8694: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:8974: result: yes" >&5
+ echo "$as_me:8696: result: yes" >&5
echo "${ECHO_T}yes" >&6
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:8981: result: no" >&5
+echo "$as_me:8703: result: no" >&5
echo "${ECHO_T}no" >&6
cf_search=
@@ -8990,7 +8712,7 @@ if test -n "${LDFLAGS}${LIBS}" ; then
-L*)
cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
-test "$cf_library_path" != "NONE" && \
+test "x$cf_library_path" != "xNONE" && \
test -d "$cf_library_path" && \
{
test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
@@ -9009,18 +8731,7 @@ fi
cf_search=
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under /usr"
- test -d /usr/lib && cf_search="$cf_search /usr/lib"
- test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root"
- test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
- test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib"
- test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "$prefix" != "NONE" && \
+test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
{
test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
@@ -9031,48 +8742,37 @@ test -d "$prefix" && \
test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
}
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under /usr/local"
- test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib"
- test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
- test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
- test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
- test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
-}
+for cf_subdir_prefix in \
+ /usr \
+ /usr/local \
+ /usr/pkg \
+ /opt \
+ /opt/local \
+ $HOME
+do
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under /opt"
- test -d /opt/lib && cf_search="$cf_search /opt/lib"
- test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root"
- test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
- test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib"
- test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+test "x$cf_subdir_prefix" != "x$prefix" && \
+test -d "$cf_subdir_prefix" && \
+(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
+ test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
+ test -d $cf_subdir_prefix/lib && cf_search="$cf_search $cf_subdir_prefix/lib"
+ test -d $cf_subdir_prefix/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
+ test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
+ test -d $cf_subdir_prefix/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
+ test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
}
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under $HOME"
- test -d $HOME/lib && cf_search="$cf_search $HOME/lib"
- test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root"
- test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
- test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib"
- test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
-}
+done
cf_search="$cf_library_path_list $cf_search"
for cf_libdir in $cf_search
do
- echo "$as_me:9071: checking for -l$cf_nculib_root in $cf_libdir" >&5
+ echo "$as_me:8771: checking for -l$cf_nculib_root in $cf_libdir" >&5
echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9075 "configure"
+#line 8775 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -9084,25 +8784,25 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9087: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8787: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9090: \$? = $ac_status" >&5
+ echo "$as_me:8790: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9093: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8793: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9096: \$? = $ac_status" >&5
+ echo "$as_me:8796: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:9098: result: yes" >&5
+ echo "$as_me:8798: result: yes" >&5
echo "${ECHO_T}yes" >&6
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
break
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:9105: result: no" >&5
+echo "$as_me:8805: result: no" >&5
echo "${ECHO_T}no" >&6
LIBS="$cf_save_LIBS"
fi
@@ -9117,7 +8817,7 @@ fi
eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
if test $cf_found_library = no ; then
- { { echo "$as_me:9120: error: Cannot link $cf_nculib_root library" >&5
+ { { echo "$as_me:8820: error: Cannot link $cf_nculib_root library" >&5
echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -9125,7 +8825,7 @@ fi
fi
if test -n "$cf_ncurses_LIBS" ; then
- echo "$as_me:9128: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+ echo "$as_me:8828: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
cf_ncurses_SAVE="$LIBS"
for p in $cf_ncurses_LIBS ; do
@@ -9135,7 +8835,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
fi
done
cat >conftest.$ac_ext <<_ACEOF
-#line 9138 "configure"
+#line 8838 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
@@ -9147,23 +8847,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9150: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8850: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9153: \$? = $ac_status" >&5
+ echo "$as_me:8853: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9156: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8856: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9159: \$? = $ac_status" >&5
+ echo "$as_me:8859: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:9161: result: yes" >&5
+ echo "$as_me:8861: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:9166: result: no" >&5
+echo "$as_me:8866: result: no" >&5
echo "${ECHO_T}no" >&6
LIBS="$cf_ncurses_SAVE"
fi
@@ -9179,153 +8879,8 @@ EOF
fi
;;
-pdcurses) #(vi
-
-echo "$as_me:9184: checking if you want to use pkg-config" >&5
-echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
-
-# Check whether --with-pkg-config or --without-pkg-config was given.
-if test "${with_pkg_config+set}" = set; then
- withval="$with_pkg_config"
- cf_pkg_config=$withval
-else
- cf_pkg_config=yes
-fi;
-echo "$as_me:9194: result: $cf_pkg_config" >&5
-echo "${ECHO_T}$cf_pkg_config" >&6
-
-case $cf_pkg_config in #(vi
-no) #(vi
- PKG_CONFIG=none
- ;;
-yes) #(vi
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-echo "$as_me:9205: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- if $as_executable_p "$ac_dir/$ac_word"; then
- ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
- echo "$as_me:9222: found $ac_dir/$ac_word" >&5
- break
-fi
-done
-
- ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-
-if test -n "$PKG_CONFIG"; then
- echo "$as_me:9233: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6
-else
- echo "$as_me:9236: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
- ac_pt_PKG_CONFIG=$PKG_CONFIG
- # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-echo "$as_me:9245: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $ac_pt_PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
- IFS=$ac_save_IFS
- test -z "$ac_dir" && ac_dir=.
- if $as_executable_p "$ac_dir/$ac_word"; then
- ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
- echo "$as_me:9262: found $ac_dir/$ac_word" >&5
- break
-fi
-done
-
- test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
- ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-
-if test -n "$ac_pt_PKG_CONFIG"; then
- echo "$as_me:9274: result: $ac_pt_PKG_CONFIG" >&5
-echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
-else
- echo "$as_me:9277: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- PKG_CONFIG=$ac_pt_PKG_CONFIG
-else
- PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
- ;;
-*)
- PKG_CONFIG=$withval
- ;;
-esac
-
-test -z "$PKG_CONFIG" && PKG_CONFIG=none
-if test "$PKG_CONFIG" != none ; then
-
-if test "x$prefix" != xNONE; then
- cf_path_syntax="$prefix"
-else
- cf_path_syntax="$ac_default_prefix"
-fi
-
-case ".$PKG_CONFIG" in #(vi
-.\$\(*\)*|.\'*\'*) #(vi
- ;;
-..|./*|.\\*) #(vi
- ;;
-.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
- ;;
-.\${*prefix}*) #(vi
- eval PKG_CONFIG="$PKG_CONFIG"
- case ".$PKG_CONFIG" in #(vi
- .NONE/*)
- PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
- ;;
- esac
- ;; #(vi
-.no|.NONE/*)
- PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
- ;;
-*)
- { { echo "$as_me:9320: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
-echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
- { (exit 1); exit 1; }; }
- ;;
-esac
-
-fi
-
-echo "$as_me:9328: checking for X" >&5
+pdcurses)
+ echo "$as_me:8883: checking for X" >&5
echo $ECHO_N "checking for X... $ECHO_C" >&6
# Check whether --with-x or --without-x was given.
@@ -9422,17 +8977,17 @@ if test "$ac_x_includes" = no; then
# Guess where to find include files, by looking for Intrinsic.h.
# First, try using that file with no special directory specified.
cat >conftest.$ac_ext <<_ACEOF
-#line 9425 "configure"
+#line 8980 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
_ACEOF
-if { (eval echo "$as_me:9429: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:8984: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:9435: \$? = $ac_status" >&5
+ echo "$as_me:8990: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -9465,7 +9020,7 @@ if test "$ac_x_libraries" = no; then
ac_save_LIBS=$LIBS
LIBS="-lXt $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9468 "configure"
+#line 9023 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
int
@@ -9477,16 +9032,16 @@ XtMalloc (0)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9480: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9035: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9483: \$? = $ac_status" >&5
+ echo "$as_me:9038: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9486: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9041: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9489: \$? = $ac_status" >&5
+ echo "$as_me:9044: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
LIBS=$ac_save_LIBS
# We can link X programs with no special library path.
@@ -9524,7 +9079,7 @@ fi
fi # $with_x != no
if test "$have_x" != yes; then
- echo "$as_me:9527: result: $have_x" >&5
+ echo "$as_me:9082: result: $have_x" >&5
echo "${ECHO_T}$have_x" >&6
no_x=yes
else
@@ -9534,7 +9089,7 @@ else
# Update the cache value to reflect the command line values.
ac_cv_have_x="have_x=yes \
ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
- echo "$as_me:9537: result: libraries $x_libraries, headers $x_includes" >&5
+ echo "$as_me:9092: result: libraries $x_libraries, headers $x_includes" >&5
echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
fi
@@ -9558,11 +9113,11 @@ else
# others require no space. Words are not sufficient . . . .
case `(uname -sr) 2>/dev/null` in
"SunOS 5"*)
- echo "$as_me:9561: checking whether -R must be followed by a space" >&5
+ echo "$as_me:9116: checking whether -R must be followed by a space" >&5
echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
cat >conftest.$ac_ext <<_ACEOF
-#line 9565 "configure"
+#line 9120 "configure"
#include "confdefs.h"
int
@@ -9574,16 +9129,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9577: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9132: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9580: \$? = $ac_status" >&5
+ echo "$as_me:9135: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9583: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9138: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9586: \$? = $ac_status" >&5
+ echo "$as_me:9141: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_R_nospace=yes
else
@@ -9593,13 +9148,13 @@ ac_R_nospace=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
if test $ac_R_nospace = yes; then
- echo "$as_me:9596: result: no" >&5
+ echo "$as_me:9151: result: no" >&5
echo "${ECHO_T}no" >&6
X_LIBS="$X_LIBS -R$x_libraries"
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat >conftest.$ac_ext <<_ACEOF
-#line 9602 "configure"
+#line 9157 "configure"
#include "confdefs.h"
int
@@ -9611,16 +9166,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9614: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9169: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9617: \$? = $ac_status" >&5
+ echo "$as_me:9172: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9620: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9175: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9623: \$? = $ac_status" >&5
+ echo "$as_me:9178: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_R_space=yes
else
@@ -9630,11 +9185,11 @@ ac_R_space=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
if test $ac_R_space = yes; then
- echo "$as_me:9633: result: yes" >&5
+ echo "$as_me:9188: result: yes" >&5
echo "${ECHO_T}yes" >&6
X_LIBS="$X_LIBS -R $x_libraries"
else
- echo "$as_me:9637: result: neither works" >&5
+ echo "$as_me:9192: result: neither works" >&5
echo "${ECHO_T}neither works" >&6
fi
fi
@@ -9654,7 +9209,7 @@ echo "${ECHO_T}neither works" >&6
# the Alpha needs dnet_stub (dnet does not exist).
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
cat >conftest.$ac_ext <<_ACEOF
-#line 9657 "configure"
+#line 9212 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9673,22 +9228,22 @@ XOpenDisplay ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9676: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9231: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9679: \$? = $ac_status" >&5
+ echo "$as_me:9234: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9682: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9237: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9685: \$? = $ac_status" >&5
+ echo "$as_me:9240: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:9691: checking for dnet_ntoa in -ldnet" >&5
+echo "$as_me:9246: checking for dnet_ntoa in -ldnet" >&5
echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9696,7 +9251,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9699 "configure"
+#line 9254 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9715,16 +9270,16 @@ dnet_ntoa ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9718: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9273: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9721: \$? = $ac_status" >&5
+ echo "$as_me:9276: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9724: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9279: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9727: \$? = $ac_status" >&5
+ echo "$as_me:9282: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_dnet_dnet_ntoa=yes
else
@@ -9735,14 +9290,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9738: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "$as_me:9293: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
- echo "$as_me:9745: checking for dnet_ntoa in -ldnet_stub" >&5
+ echo "$as_me:9300: checking for dnet_ntoa in -ldnet_stub" >&5
echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9750,7 +9305,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet_stub $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9753 "configure"
+#line 9308 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9769,16 +9324,16 @@ dnet_ntoa ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9772: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9327: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9775: \$? = $ac_status" >&5
+ echo "$as_me:9330: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9778: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9333: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9781: \$? = $ac_status" >&5
+ echo "$as_me:9336: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_dnet_stub_dnet_ntoa=yes
else
@@ -9789,7 +9344,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9792: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "$as_me:9347: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
@@ -9808,13 +9363,13 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
# on Irix 5.2, according to T.E. Dickey.
# The functions gethostbyname, getservbyname, and inet_addr are
# in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
- echo "$as_me:9811: checking for gethostbyname" >&5
+ echo "$as_me:9366: checking for gethostbyname" >&5
echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
if test "${ac_cv_func_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 9817 "configure"
+#line 9372 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname (); below. */
@@ -9837,7 +9392,7 @@ main ()
#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
choke me
#else
-f = gethostbyname;
+f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -9845,16 +9400,16 @@ f = gethostbyname;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9848: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9403: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9851: \$? = $ac_status" >&5
+ echo "$as_me:9406: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9854: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9409: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9857: \$? = $ac_status" >&5
+ echo "$as_me:9412: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_gethostbyname=yes
else
@@ -9864,11 +9419,11 @@ ac_cv_func_gethostbyname=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:9867: result: $ac_cv_func_gethostbyname" >&5
+echo "$as_me:9422: result: $ac_cv_func_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
if test $ac_cv_func_gethostbyname = no; then
- echo "$as_me:9871: checking for gethostbyname in -lnsl" >&5
+ echo "$as_me:9426: checking for gethostbyname in -lnsl" >&5
echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9876,7 +9431,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9879 "configure"
+#line 9434 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9895,16 +9450,16 @@ gethostbyname ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9898: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9453: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9901: \$? = $ac_status" >&5
+ echo "$as_me:9456: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9904: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9459: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9907: \$? = $ac_status" >&5
+ echo "$as_me:9462: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_nsl_gethostbyname=yes
else
@@ -9915,14 +9470,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9918: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "$as_me:9473: result: $ac_cv_lib_nsl_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
if test $ac_cv_lib_nsl_gethostbyname = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
fi
if test $ac_cv_lib_nsl_gethostbyname = no; then
- echo "$as_me:9925: checking for gethostbyname in -lbsd" >&5
+ echo "$as_me:9480: checking for gethostbyname in -lbsd" >&5
echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9930,7 +9485,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9933 "configure"
+#line 9488 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9949,16 +9504,16 @@ gethostbyname ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9952: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9507: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9955: \$? = $ac_status" >&5
+ echo "$as_me:9510: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9958: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9513: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9961: \$? = $ac_status" >&5
+ echo "$as_me:9516: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_bsd_gethostbyname=yes
else
@@ -9969,7 +9524,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9972: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "$as_me:9527: result: $ac_cv_lib_bsd_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
if test $ac_cv_lib_bsd_gethostbyname = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
@@ -9985,13 +9540,13 @@ fi
# variants that don't use the nameserver (or something). -lsocket
# must be given before -lnsl if both are needed. We assume that
# if connect needs -lnsl, so does gethostbyname.
- echo "$as_me:9988: checking for connect" >&5
+ echo "$as_me:9543: checking for connect" >&5
echo $ECHO_N "checking for connect... $ECHO_C" >&6
if test "${ac_cv_func_connect+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 9994 "configure"
+#line 9549 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect (); below. */
@@ -10014,7 +9569,7 @@ main ()
#if defined (__stub_connect) || defined (__stub___connect)
choke me
#else
-f = connect;
+f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -10022,16 +9577,16 @@ f = connect;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10025: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9580: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10028: \$? = $ac_status" >&5
+ echo "$as_me:9583: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10031: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9586: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10034: \$? = $ac_status" >&5
+ echo "$as_me:9589: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_connect=yes
else
@@ -10041,11 +9596,11 @@ ac_cv_func_connect=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:10044: result: $ac_cv_func_connect" >&5
+echo "$as_me:9599: result: $ac_cv_func_connect" >&5
echo "${ECHO_T}$ac_cv_func_connect" >&6
if test $ac_cv_func_connect = no; then
- echo "$as_me:10048: checking for connect in -lsocket" >&5
+ echo "$as_me:9603: checking for connect in -lsocket" >&5
echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
if test "${ac_cv_lib_socket_connect+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10053,7 +9608,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 10056 "configure"
+#line 9611 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -10072,16 +9627,16 @@ connect ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10075: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9630: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10078: \$? = $ac_status" >&5
+ echo "$as_me:9633: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10081: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9636: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10084: \$? = $ac_status" >&5
+ echo "$as_me:9639: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_socket_connect=yes
else
@@ -10092,7 +9647,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:10095: result: $ac_cv_lib_socket_connect" >&5
+echo "$as_me:9650: result: $ac_cv_lib_socket_connect" >&5
echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
if test $ac_cv_lib_socket_connect = yes; then
X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
@@ -10101,13 +9656,13 @@ fi
fi
# Guillermo Gomez says -lposix is necessary on A/UX.
- echo "$as_me:10104: checking for remove" >&5
+ echo "$as_me:9659: checking for remove" >&5
echo $ECHO_N "checking for remove... $ECHO_C" >&6
if test "${ac_cv_func_remove+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 10110 "configure"
+#line 9665 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove (); below. */
@@ -10130,7 +9685,7 @@ main ()
#if defined (__stub_remove) || defined (__stub___remove)
choke me
#else
-f = remove;
+f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -10138,16 +9693,16 @@ f = remove;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10141: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9696: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10144: \$? = $ac_status" >&5
+ echo "$as_me:9699: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10147: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9702: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10150: \$? = $ac_status" >&5
+ echo "$as_me:9705: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_remove=yes
else
@@ -10157,11 +9712,11 @@ ac_cv_func_remove=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:10160: result: $ac_cv_func_remove" >&5
+echo "$as_me:9715: result: $ac_cv_func_remove" >&5
echo "${ECHO_T}$ac_cv_func_remove" >&6
if test $ac_cv_func_remove = no; then
- echo "$as_me:10164: checking for remove in -lposix" >&5
+ echo "$as_me:9719: checking for remove in -lposix" >&5
echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
if test "${ac_cv_lib_posix_remove+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10169,7 +9724,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lposix $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 10172 "configure"
+#line 9727 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -10188,16 +9743,16 @@ remove ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10191: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9746: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10194: \$? = $ac_status" >&5
+ echo "$as_me:9749: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10197: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9752: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10200: \$? = $ac_status" >&5
+ echo "$as_me:9755: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_posix_remove=yes
else
@@ -10208,7 +9763,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:10211: result: $ac_cv_lib_posix_remove" >&5
+echo "$as_me:9766: result: $ac_cv_lib_posix_remove" >&5
echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
if test $ac_cv_lib_posix_remove = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
@@ -10217,13 +9772,13 @@ fi
fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
- echo "$as_me:10220: checking for shmat" >&5
+ echo "$as_me:9775: checking for shmat" >&5
echo $ECHO_N "checking for shmat... $ECHO_C" >&6
if test "${ac_cv_func_shmat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 10226 "configure"
+#line 9781 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat (); below. */
@@ -10246,7 +9801,7 @@ main ()
#if defined (__stub_shmat) || defined (__stub___shmat)
choke me
#else
-f = shmat;
+f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -10254,16 +9809,16 @@ f = shmat;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10257: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9812: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10260: \$? = $ac_status" >&5
+ echo "$as_me:9815: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10263: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9818: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10266: \$? = $ac_status" >&5
+ echo "$as_me:9821: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_shmat=yes
else
@@ -10273,11 +9828,11 @@ ac_cv_func_shmat=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:10276: result: $ac_cv_func_shmat" >&5
+echo "$as_me:9831: result: $ac_cv_func_shmat" >&5
echo "${ECHO_T}$ac_cv_func_shmat" >&6
if test $ac_cv_func_shmat = no; then
- echo "$as_me:10280: checking for shmat in -lipc" >&5
+ echo "$as_me:9835: checking for shmat in -lipc" >&5
echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
if test "${ac_cv_lib_ipc_shmat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10285,7 +9840,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lipc $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 10288 "configure"
+#line 9843 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -10304,16 +9859,16 @@ shmat ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10307: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9862: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10310: \$? = $ac_status" >&5
+ echo "$as_me:9865: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10313: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9868: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10316: \$? = $ac_status" >&5
+ echo "$as_me:9871: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_ipc_shmat=yes
else
@@ -10324,7 +9879,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:10327: result: $ac_cv_lib_ipc_shmat" >&5
+echo "$as_me:9882: result: $ac_cv_lib_ipc_shmat" >&5
echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
if test $ac_cv_lib_ipc_shmat = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
@@ -10342,7 +9897,7 @@ fi
# These have to be linked with before -lX11, unlike the other
# libraries we check for below, so use a different variable.
# John Interrante, Karl Berry
- echo "$as_me:10345: checking for IceConnectionNumber in -lICE" >&5
+ echo "$as_me:9900: checking for IceConnectionNumber in -lICE" >&5
echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10350,7 +9905,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 10353 "configure"
+#line 9908 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -10369,16 +9924,16 @@ IceConnectionNumber ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10372: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9927: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10375: \$? = $ac_status" >&5
+ echo "$as_me:9930: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10378: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9933: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10381: \$? = $ac_status" >&5
+ echo "$as_me:9936: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_ICE_IceConnectionNumber=yes
else
@@ -10389,7 +9944,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:10392: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "$as_me:9947: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
@@ -10401,7 +9956,7 @@ fi
cf_x_athena=${cf_x_athena:-Xaw}
-echo "$as_me:10404: checking if you want to link with Xaw 3d library" >&5
+echo "$as_me:9959: checking if you want to link with Xaw 3d library" >&5
echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
withval=
@@ -10412,14 +9967,32 @@ if test "${with_Xaw3d+set}" = set; then
fi;
if test "$withval" = yes ; then
cf_x_athena=Xaw3d
- echo "$as_me:10415: result: yes" >&5
+ echo "$as_me:9970: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:9973: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+echo "$as_me:9977: checking if you want to link with Xaw 3d xft library" >&5
+echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
+withval=
+
+# Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
+if test "${with_Xaw3dxft+set}" = set; then
+ withval="$with_Xaw3dxft"
+
+fi;
+if test "$withval" = yes ; then
+ cf_x_athena=Xaw3dxft
+ echo "$as_me:9988: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
- echo "$as_me:10418: result: no" >&5
+ echo "$as_me:9991: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-echo "$as_me:10422: checking if you want to link with neXT Athena library" >&5
+echo "$as_me:9995: checking if you want to link with neXT Athena library" >&5
echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
withval=
@@ -10430,14 +10003,14 @@ if test "${with_neXtaw+set}" = set; then
fi;
if test "$withval" = yes ; then
cf_x_athena=neXtaw
- echo "$as_me:10433: result: yes" >&5
+ echo "$as_me:10006: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
- echo "$as_me:10436: result: no" >&5
+ echo "$as_me:10009: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-echo "$as_me:10440: checking if you want to link with Athena-Plus library" >&5
+echo "$as_me:10013: checking if you want to link with Athena-Plus library" >&5
echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
withval=
@@ -10448,10 +10021,10 @@ if test "${with_XawPlus+set}" = set; then
fi;
if test "$withval" = yes ; then
cf_x_athena=XawPlus
- echo "$as_me:10451: result: yes" >&5
+ echo "$as_me:10024: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
- echo "$as_me:10454: result: no" >&5
+ echo "$as_me:10027: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -10471,17 +10044,17 @@ if test "$PKG_CONFIG" != none ; then
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
test -n "$verbose" && echo " found package $cf_athena_pkg" 1>&6
-echo "${as_me:-configure}:10474: testing found package $cf_athena_pkg ..." 1>&5
+echo "${as_me:-configure}:10047: testing found package $cf_athena_pkg ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs $cf_athena_pkg 2>/dev/null`"
test -n "$verbose" && echo " package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10480: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:10053: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10484: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:10057: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10498,7 +10071,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -10539,7 +10112,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -10561,7 +10134,21 @@ if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
- LIBS="$cf_pkgconfig_libs $LIBS"
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
cf_x_athena_lib="$cf_pkgconfig_libs"
@@ -10571,14 +10158,27 @@ cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxy
#define $cf_x_athena_LIBS 1
EOF
-echo "$as_me:10574: checking for usable $cf_x_athena/Xmu package" >&5
+ for cf_trim_lib in Xmu Xt X11
+ do
+ case "$LIBS" in
+ *-l$cf_trim_lib\ *-l$cf_trim_lib*)
+ LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
+ test -n "$verbose" && echo " ..trimmed $LIBS" 1>&6
+
+echo "${as_me:-configure}:10168: testing ..trimmed $LIBS ..." 1>&5
+
+ ;;
+ esac
+ done
+
+echo "$as_me:10174: checking for usable $cf_x_athena/Xmu package" >&5
echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
if test "${cf_cv_xaw_compat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 10581 "configure"
+#line 10181 "configure"
#include "confdefs.h"
#include <X11/Xmu/CharSet.h>
@@ -10594,16 +10194,16 @@ int check = XmuCompareISOLatin1("big", "small")
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10597: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10197: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10600: \$? = $ac_status" >&5
+ echo "$as_me:10200: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10603: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10203: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10606: \$? = $ac_status" >&5
+ echo "$as_me:10206: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xaw_compat=yes
else
@@ -10613,7 +10213,7 @@ cf_cv_xaw_compat=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:10616: result: $cf_cv_xaw_compat" >&5
+echo "$as_me:10216: result: $cf_cv_xaw_compat" >&5
echo "${ECHO_T}$cf_cv_xaw_compat" >&6
if test "$cf_cv_xaw_compat" = no
@@ -10625,22 +10225,25 @@ echo "${ECHO_T}$cf_cv_xaw_compat" >&6
*)
test -n "$verbose" && echo " work around broken package" 1>&6
-echo "${as_me:-configure}:10628: testing work around broken package ..." 1>&5
+echo "${as_me:-configure}:10228: testing work around broken package ..." 1>&5
+
+ cf_save_xmu="$LIBS"
+ cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^ *//' -e 's/ .*//'`
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
test -n "$verbose" && echo " found package xmu" 1>&6
-echo "${as_me:-configure}:10633: testing found package xmu ..." 1>&5
+echo "${as_me:-configure}:10236: testing found package xmu ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs xmu 2>/dev/null`"
test -n "$verbose" && echo " package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10639: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:10242: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package xmu LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10643: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:10246: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10657,7 +10260,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -10698,7 +10301,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -10720,27 +10323,69 @@ if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
- LIBS="$cf_pkgconfig_libs $LIBS"
- :
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ LIBS="$cf_save_xmu"
+
+test -n "$verbose" && echo " ...before $LIBS" 1>&6
+
+echo "${as_me:-configure}:10346: testing ...before $LIBS ..." 1>&5
+
+LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's% % %g'`
+test -n "$verbose" && echo " ...after $LIBS" 1>&6
+
+echo "${as_me:-configure}:10351: testing ...after $LIBS ..." 1>&5
+
else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
test -n "$verbose" && echo " ...before $LIBS" 1>&6
-echo "${as_me:-configure}:10729: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:10359: testing ...before $LIBS ..." 1>&5
-LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/ / /g'`
+LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's% % %g'`
test -n "$verbose" && echo " ...after $LIBS" 1>&6
-echo "${as_me:-configure}:10734: testing ...after $LIBS ..." 1>&5
+echo "${as_me:-configure}:10364: testing ...after $LIBS ..." 1>&5
fi
+ for cf_trim_lib in Xmu Xt X11
+ do
+ case "$LIBS" in
+ *-l$cf_trim_lib\ *-l$cf_trim_lib*)
+ LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
+ test -n "$verbose" && echo " ..trimmed $LIBS" 1>&6
+
+echo "${as_me:-configure}:10375: testing ..trimmed $LIBS ..." 1>&5
+
+ ;;
+ esac
+ done
+
;;
esac
fi
break
else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
:
fi
@@ -10752,17 +10397,17 @@ if test -z "$cf_x_athena_lib" ; then
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
test -n "$verbose" && echo " found package Xext" 1>&6
-echo "${as_me:-configure}:10755: testing found package Xext ..." 1>&5
+echo "${as_me:-configure}:10400: testing found package Xext ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs Xext 2>/dev/null`"
test -n "$verbose" && echo " package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10761: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:10406: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package Xext LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10765: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:10410: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10779,7 +10424,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -10820,7 +10465,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -10842,11 +10487,28 @@ if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
- LIBS="$cf_pkgconfig_libs $LIBS"
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
:
else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
- echo "$as_me:10849: checking for XextCreateExtension in -lXext" >&5
+ echo "$as_me:10511: checking for XextCreateExtension in -lXext" >&5
echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10854,7 +10516,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXext $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 10857 "configure"
+#line 10519 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -10873,16 +10535,16 @@ XextCreateExtension ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10876: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10538: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10879: \$? = $ac_status" >&5
+ echo "$as_me:10541: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10882: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10544: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10885: \$? = $ac_status" >&5
+ echo "$as_me:10547: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xext_XextCreateExtension=yes
else
@@ -10893,10 +10555,505 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:10896: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
+echo "$as_me:10558: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
- LIBS="-lXext $LIBS"
+
+cf_add_libs="-lXext"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+fi
+
+fi
+
+# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
+# in some cases has installed dummy files in the former, other cases replaced
+# it with a link to the new location). This complicates the configure script.
+# Check for that pitfall, and recover using pkg-config
+#
+# If none of these are set, the configuration is almost certainly broken.
+if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
+then
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
+ test -n "$verbose" && echo " found package x11" 1>&6
+
+echo "${as_me:-configure}:10594: testing found package x11 ..." 1>&5
+
+ cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
+ cf_pkgconfig_libs="`$PKG_CONFIG --libs x11 2>/dev/null`"
+ test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:10600: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+ test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:10604: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ case $cf_add_cflags in #(vi
+ -D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ :
+else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
+ { echo "$as_me:10704: WARNING: unable to find X11 library" >&5
+echo "$as_me: WARNING: unable to find X11 library" >&2;}
+fi
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
+ test -n "$verbose" && echo " found package ice" 1>&6
+
+echo "${as_me:-configure}:10711: testing found package ice ..." 1>&5
+
+ cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
+ cf_pkgconfig_libs="`$PKG_CONFIG --libs ice 2>/dev/null`"
+ test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:10717: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+ test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:10721: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ case $cf_add_cflags in #(vi
+ -D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ :
+else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
+ { echo "$as_me:10821: WARNING: unable to find ICE library" >&5
+echo "$as_me: WARNING: unable to find ICE library" >&2;}
+fi
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
+ test -n "$verbose" && echo " found package sm" 1>&6
+
+echo "${as_me:-configure}:10828: testing found package sm ..." 1>&5
+
+ cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
+ cf_pkgconfig_libs="`$PKG_CONFIG --libs sm 2>/dev/null`"
+ test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:10834: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+ test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:10838: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ case $cf_add_cflags in #(vi
+ -D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ :
+else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
+ { echo "$as_me:10938: WARNING: unable to find SM library" >&5
+echo "$as_me: WARNING: unable to find SM library" >&2;}
+fi
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
+ test -n "$verbose" && echo " found package xt" 1>&6
+
+echo "${as_me:-configure}:10945: testing found package xt ..." 1>&5
+
+ cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
+ cf_pkgconfig_libs="`$PKG_CONFIG --libs xt 2>/dev/null`"
+ test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:10951: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+ test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:10955: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ case $cf_add_cflags in #(vi
+ -D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ :
+else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
+ { echo "$as_me:11055: WARNING: unable to find Xt library" >&5
+echo "$as_me: WARNING: unable to find Xt library" >&2;}
fi
fi
@@ -10906,17 +11063,17 @@ cf_have_X_LIBS=no
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
test -n "$verbose" && echo " found package xt" 1>&6
-echo "${as_me:-configure}:10909: testing found package xt ..." 1>&5
+echo "${as_me:-configure}:11066: testing found package xt ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs xt 2>/dev/null`"
test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10915: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:11072: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10919: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:11076: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10933,7 +11090,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -10974,7 +11131,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -10996,21 +11153,35 @@ if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
- LIBS="$cf_pkgconfig_libs $LIBS"
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
case "x$LIBS" in #(vi
*-lX11*) #(vi
;;
*)
# we have an "xt" package, but it may omit Xt's dependency on X11
-echo "$as_me:11006: checking for usable X dependency" >&5
+echo "$as_me:11177: checking for usable X dependency" >&5
echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
if test "${cf_cv_xt_x11_compat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 11013 "configure"
+#line 11184 "configure"
#include "confdefs.h"
#include <X11/Xlib.h>
@@ -11029,16 +11200,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11032: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11203: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11035: \$? = $ac_status" >&5
+ echo "$as_me:11206: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11038: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11209: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11041: \$? = $ac_status" >&5
+ echo "$as_me:11212: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xt_x11_compat=yes
else
@@ -11048,30 +11219,30 @@ cf_cv_xt_x11_compat=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:11051: result: $cf_cv_xt_x11_compat" >&5
+echo "$as_me:11222: result: $cf_cv_xt_x11_compat" >&5
echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
if test "$cf_cv_xt_x11_compat" = no
then
test -n "$verbose" && echo " work around broken X11 dependency" 1>&6
-echo "${as_me:-configure}:11057: testing work around broken X11 dependency ..." 1>&5
+echo "${as_me:-configure}:11228: testing work around broken X11 dependency ..." 1>&5
# 2010/11/19 - good enough until a working Xt on Xcb is delivered.
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
test -n "$verbose" && echo " found package x11" 1>&6
-echo "${as_me:-configure}:11064: testing found package x11 ..." 1>&5
+echo "${as_me:-configure}:11235: testing found package x11 ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs x11 2>/dev/null`"
test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:11070: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:11241: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:11074: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:11245: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -11088,7 +11259,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -11129,7 +11300,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -11151,18 +11322,35 @@ if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
- LIBS="$cf_pkgconfig_libs $LIBS"
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
:
else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
test -n "$verbose" && echo " ...before $LIBS" 1>&6
-echo "${as_me:-configure}:11160: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:11348: testing ...before $LIBS ..." 1>&5
-LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/ / /g'`
+LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's% % %g'`
test -n "$verbose" && echo " ...after $LIBS" 1>&6
-echo "${as_me:-configure}:11165: testing ...after $LIBS ..." 1>&5
+echo "${as_me:-configure}:11353: testing ...after $LIBS ..." 1>&5
fi
@@ -11170,14 +11358,14 @@ fi
;;
esac
-echo "$as_me:11173: checking for usable X Toolkit package" >&5
+echo "$as_me:11361: checking for usable X Toolkit package" >&5
echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
if test "${cf_cv_xt_ice_compat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 11180 "configure"
+#line 11368 "configure"
#include "confdefs.h"
#include <X11/Shell.h>
@@ -11192,16 +11380,16 @@ int num = IceConnectionNumber(0)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11195: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11383: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11198: \$? = $ac_status" >&5
+ echo "$as_me:11386: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11201: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11389: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11204: \$? = $ac_status" >&5
+ echo "$as_me:11392: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xt_ice_compat=yes
else
@@ -11211,7 +11399,7 @@ cf_cv_xt_ice_compat=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:11214: result: $cf_cv_xt_ice_compat" >&5
+echo "$as_me:11402: result: $cf_cv_xt_ice_compat" >&5
echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
if test "$cf_cv_xt_ice_compat" = no
@@ -11225,22 +11413,22 @@ echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
*)
test -n "$verbose" && echo " work around broken ICE dependency" 1>&6
-echo "${as_me:-configure}:11228: testing work around broken ICE dependency ..." 1>&5
+echo "${as_me:-configure}:11416: testing work around broken ICE dependency ..." 1>&5
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
test -n "$verbose" && echo " found package ice" 1>&6
-echo "${as_me:-configure}:11233: testing found package ice ..." 1>&5
+echo "${as_me:-configure}:11421: testing found package ice ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs ice 2>/dev/null`"
test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:11239: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:11427: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:11243: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:11431: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -11257,7 +11445,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -11298,7 +11486,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -11320,22 +11508,36 @@ if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
- LIBS="$cf_pkgconfig_libs $LIBS"
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
test -n "$verbose" && echo " found package sm" 1>&6
-echo "${as_me:-configure}:11328: testing found package sm ..." 1>&5
+echo "${as_me:-configure}:11530: testing found package sm ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs sm 2>/dev/null`"
test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:11334: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:11536: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:11338: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:11540: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -11352,7 +11554,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -11393,7 +11595,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -11415,22 +11617,41 @@ if test -n "$cf_new_extra_cppflags" ; then
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
- LIBS="$cf_pkgconfig_libs $LIBS"
+cf_add_libs="$cf_pkgconfig_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
:
else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
:
fi
else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
test -n "$verbose" && echo " ...before $LIBS" 1>&6
-echo "${as_me:-configure}:11428: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:11649: testing ...before $LIBS ..." 1>&5
-LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/ / /g'`
+LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's% % %g'`
test -n "$verbose" && echo " ...after $LIBS" 1>&6
-echo "${as_me:-configure}:11433: testing ...after $LIBS ..." 1>&5
+echo "${as_me:-configure}:11654: testing ...after $LIBS ..." 1>&5
fi
@@ -11443,12 +11664,14 @@ fi
cf_have_X_LIBS=yes
else
+ cf_pkgconfig_incs=
+ cf_pkgconfig_libs=
LDFLAGS="$X_LIBS $LDFLAGS"
test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6
-echo "${as_me:-configure}:11451: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:11674: testing checking additions to CFLAGS ..." 1>&5
cf_check_cflags="$CFLAGS"
cf_check_cppflags="$CPPFLAGS"
@@ -11468,7 +11691,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -11509,7 +11732,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -11519,7 +11742,7 @@ done
if test -n "$cf_new_cflags" ; then
test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
-echo "${as_me:-configure}:11522: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:11745: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
CFLAGS="$CFLAGS $cf_new_cflags"
fi
@@ -11527,7 +11750,7 @@ fi
if test -n "$cf_new_cppflags" ; then
test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
-echo "${as_me:-configure}:11530: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:11753: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
@@ -11535,14 +11758,14 @@ fi
if test -n "$cf_new_extra_cppflags" ; then
test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
-echo "${as_me:-configure}:11538: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:11761: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
-if test "$cf_check_cflags" != "$CFLAGS" ; then
+if test "x$cf_check_cflags" != "x$CFLAGS" ; then
cat >conftest.$ac_ext <<_ACEOF
-#line 11545 "configure"
+#line 11768 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -11554,16 +11777,16 @@ printf("Hello world");
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11557: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11780: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11560: \$? = $ac_status" >&5
+ echo "$as_me:11783: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11563: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11786: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11566: \$? = $ac_status" >&5
+ echo "$as_me:11789: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -11571,12 +11794,12 @@ else
cat conftest.$ac_ext >&5
test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6
-echo "${as_me:-configure}:11574: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:11797: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
- if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
+ if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6
-echo "${as_me:-configure}:11579: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:11802: testing but keeping change to \$CPPFLAGS ..." 1>&5
fi
CFLAGS="$cf_check_flags"
@@ -11584,13 +11807,13 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
- echo "$as_me:11587: checking for XOpenDisplay" >&5
+ echo "$as_me:11810: checking for XOpenDisplay" >&5
echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
if test "${ac_cv_func_XOpenDisplay+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 11593 "configure"
+#line 11816 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char XOpenDisplay (); below. */
@@ -11613,7 +11836,7 @@ main ()
#if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
choke me
#else
-f = XOpenDisplay;
+f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -11621,16 +11844,16 @@ f = XOpenDisplay;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11624: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11847: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11627: \$? = $ac_status" >&5
+ echo "$as_me:11850: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11630: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11853: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11633: \$? = $ac_status" >&5
+ echo "$as_me:11856: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_XOpenDisplay=yes
else
@@ -11640,13 +11863,13 @@ ac_cv_func_XOpenDisplay=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:11643: result: $ac_cv_func_XOpenDisplay" >&5
+echo "$as_me:11866: result: $ac_cv_func_XOpenDisplay" >&5
echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
if test $ac_cv_func_XOpenDisplay = yes; then
:
else
- echo "$as_me:11649: checking for XOpenDisplay in -lX11" >&5
+ echo "$as_me:11872: checking for XOpenDisplay in -lX11" >&5
echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11654,7 +11877,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 11657 "configure"
+#line 11880 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -11673,16 +11896,16 @@ XOpenDisplay ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11676: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11899: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11679: \$? = $ac_status" >&5
+ echo "$as_me:11902: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11682: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11905: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11685: \$? = $ac_status" >&5
+ echo "$as_me:11908: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_X11_XOpenDisplay=yes
else
@@ -11693,21 +11916,37 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:11696: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:11919: result: $ac_cv_lib_X11_XOpenDisplay" >&5
echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
if test $ac_cv_lib_X11_XOpenDisplay = yes; then
- LIBS="-lX11 $LIBS"
+
+cf_add_libs="-lX11"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
fi
fi
- echo "$as_me:11704: checking for XtAppInitialize" >&5
+ echo "$as_me:11943: checking for XtAppInitialize" >&5
echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
if test "${ac_cv_func_XtAppInitialize+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 11710 "configure"
+#line 11949 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char XtAppInitialize (); below. */
@@ -11730,7 +11969,7 @@ main ()
#if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
choke me
#else
-f = XtAppInitialize;
+f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -11738,16 +11977,16 @@ f = XtAppInitialize;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11741: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11980: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11744: \$? = $ac_status" >&5
+ echo "$as_me:11983: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11747: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11986: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11750: \$? = $ac_status" >&5
+ echo "$as_me:11989: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_XtAppInitialize=yes
else
@@ -11757,13 +11996,13 @@ ac_cv_func_XtAppInitialize=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:11760: result: $ac_cv_func_XtAppInitialize" >&5
+echo "$as_me:11999: result: $ac_cv_func_XtAppInitialize" >&5
echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
if test $ac_cv_func_XtAppInitialize = yes; then
:
else
- echo "$as_me:11766: checking for XtAppInitialize in -lXt" >&5
+ echo "$as_me:12005: checking for XtAppInitialize in -lXt" >&5
echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11771,7 +12010,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 11774 "configure"
+#line 12013 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -11790,16 +12029,16 @@ XtAppInitialize ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11793: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12032: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11796: \$? = $ac_status" >&5
+ echo "$as_me:12035: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11799: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12038: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11802: \$? = $ac_status" >&5
+ echo "$as_me:12041: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xt_XtAppInitialize=yes
else
@@ -11810,10 +12049,11 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:11813: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
+echo "$as_me:12052: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_LIBXT 1
EOF
@@ -11826,7 +12066,7 @@ fi
fi
if test $cf_have_X_LIBS = no ; then
- { echo "$as_me:11829: WARNING: Unable to successfully link X Toolkit library (-lXt) with
+ { echo "$as_me:12069: WARNING: Unable to successfully link X Toolkit library (-lXt) with
test program. You will have to check and add the proper libraries by hand
to makefile." >&5
echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
@@ -11848,14 +12088,14 @@ do
cf_test=X11/$cf_x_athena_root/SimpleMenu.h
if test $cf_path != default ; then
CPPFLAGS="$cf_save -I$cf_path/include"
- echo "$as_me:11851: checking for $cf_test in $cf_path" >&5
+ echo "$as_me:12091: checking for $cf_test in $cf_path" >&5
echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
else
- echo "$as_me:11854: checking for $cf_test" >&5
+ echo "$as_me:12094: checking for $cf_test" >&5
echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
fi
cat >conftest.$ac_ext <<_ACEOF
-#line 11858 "configure"
+#line 12098 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
@@ -11869,16 +12109,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11872: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12112: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:11875: \$? = $ac_status" >&5
+ echo "$as_me:12115: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:11878: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12118: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11881: \$? = $ac_status" >&5
+ echo "$as_me:12121: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -11887,7 +12127,7 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:11890: result: $cf_result" >&5
+ echo "$as_me:12130: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test "$cf_result" = yes ; then
cf_x_athena_inc=$cf_path
@@ -11899,7 +12139,7 @@ echo "${ECHO_T}$cf_result" >&6
done
if test -z "$cf_x_athena_inc" ; then
- { echo "$as_me:11902: WARNING: Unable to successfully find Athena header files with test program" >&5
+ { echo "$as_me:12142: WARNING: Unable to successfully find Athena header files with test program" >&5
echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
elif test "$cf_x_athena_inc" != default ; then
CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
@@ -11915,24 +12155,61 @@ for cf_path in default \
/usr/local
do
for cf_lib in \
- "-l$cf_x_athena_root -lXmu" \
- "-l$cf_x_athena_root -lXpm -lXmu" \
- "-l${cf_x_athena_root}_s -lXmu_s"
+ ${cf_x_athena_root} \
+ ${cf_x_athena_root}7 \
+ ${cf_x_athena_root}6
+ do
+ for cf_libs in \
+ "-l$cf_lib -lXmu" \
+ "-l$cf_lib -lXpm -lXmu" \
+ "-l${cf_lib}_s -lXmu_s"
do
if test -z "$cf_x_athena_lib" ; then
cf_save="$LIBS"
cf_test=XawSimpleMenuAddGlobalActions
if test $cf_path != default ; then
- LIBS="-L$cf_path/lib $cf_lib $LIBS"
- echo "$as_me:11927: checking for $cf_lib in $cf_path" >&5
-echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6
+
+cf_add_libs="-L$cf_path/lib $cf_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ echo "$as_me:12188: checking for $cf_libs in $cf_path" >&5
+echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
else
- LIBS="$cf_lib $LIBS"
- echo "$as_me:11931: checking for $cf_test in $cf_lib" >&5
-echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6
+
+cf_add_libs="$cf_libs"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ echo "$as_me:12208: checking for $cf_test in $cf_libs" >&5
+echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
fi
cat >conftest.$ac_ext <<_ACEOF
-#line 11935 "configure"
+#line 12212 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
@@ -11948,16 +12225,16 @@ $cf_test((XtAppContext) 0)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11951: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12228: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11954: \$? = $ac_status" >&5
+ echo "$as_me:12231: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11957: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12234: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11960: \$? = $ac_status" >&5
+ echo "$as_me:12237: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -11966,19 +12243,21 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- echo "$as_me:11969: result: $cf_result" >&5
+ echo "$as_me:12246: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test "$cf_result" = yes ; then
- cf_x_athena_lib="$cf_lib"
+ cf_x_athena_lib="$cf_libs"
break
fi
LIBS="$cf_save"
fi
- done
+ done # cf_libs
+ test -n "$cf_x_athena_lib" && break
+ done # cf_lib
done
if test -z "$cf_x_athena_lib" ; then
- { { echo "$as_me:11981: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
+ { { echo "$as_me:12260: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -11991,53 +12270,106 @@ EOF
fi
-for ac_prog in xcurses-config
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in xcurses-config
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:12278: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$XCURSES_CONFIG"; then
+ ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
+echo "$as_me:12293: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
+if test -n "$XCURSES_CONFIG"; then
+ echo "$as_me:12301: result: $XCURSES_CONFIG" >&5
+echo "${ECHO_T}$XCURSES_CONFIG" >&6
+else
+ echo "$as_me:12304: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$XCURSES_CONFIG" && break
+ done
+fi
+if test -z "$XCURSES_CONFIG"; then
+ ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
+ for ac_prog in xcurses-config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:11998: checking for $ac_word" >&5
+echo "$as_me:12317: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then
+if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case $XCURSES_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
- ;;
- *)
+ if test -n "$ac_ct_XCURSES_CONFIG"; then
+ ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
+else
ac_save_IFS=$IFS; IFS=$ac_path_separator
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
IFS=$ac_save_IFS
test -z "$ac_dir" && ac_dir=.
- if $as_executable_p "$ac_dir/$ac_word"; then
- ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
- echo "$as_me:12015: found $ac_dir/$ac_word" >&5
- break
-fi
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
+echo "$as_me:12332: found $ac_dir/$ac_word" >&5
+break
done
- ;;
-esac
fi
-XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG
-
-if test -n "$XCURSES_CONFIG"; then
- echo "$as_me:12026: result: $XCURSES_CONFIG" >&5
-echo "${ECHO_T}$XCURSES_CONFIG" >&6
+fi
+ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
+if test -n "$ac_ct_XCURSES_CONFIG"; then
+ echo "$as_me:12340: result: $ac_ct_XCURSES_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
else
- echo "$as_me:12029: result: no" >&5
+ echo "$as_me:12343: result: no" >&5
echo "${ECHO_T}no" >&6
fi
- test -n "$XCURSES_CONFIG" && break
+ test -n "$ac_ct_XCURSES_CONFIG" && break
done
-test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
+test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
+
+ XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
+fi
if test "$XCURSES_CONFIG" != none ; then
CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
-LIBS="`$XCURSES_CONFIG --libs` $LIBS"
+
+cf_add_libs="`$XCURSES_CONFIG --libs`"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
cf_cv_lib_XCurses=yes
@@ -12047,7 +12379,7 @@ LDFLAGS="$LDFLAGS $X_LIBS"
test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6
-echo "${as_me:-configure}:12050: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:12382: testing checking additions to CFLAGS ..." 1>&5
cf_check_cflags="$CFLAGS"
cf_check_cppflags="$CPPFLAGS"
@@ -12067,7 +12399,7 @@ no)
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
@@ -12108,7 +12440,7 @@ yes)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
@@ -12118,7 +12450,7 @@ done
if test -n "$cf_new_cflags" ; then
test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
-echo "${as_me:-configure}:12121: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:12453: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
CFLAGS="$CFLAGS $cf_new_cflags"
fi
@@ -12126,7 +12458,7 @@ fi
if test -n "$cf_new_cppflags" ; then
test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
-echo "${as_me:-configure}:12129: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:12461: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
@@ -12134,14 +12466,14 @@ fi
if test -n "$cf_new_extra_cppflags" ; then
test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
-echo "${as_me:-configure}:12137: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:12469: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
-if test "$cf_check_cflags" != "$CFLAGS" ; then
+if test "x$cf_check_cflags" != "x$CFLAGS" ; then
cat >conftest.$ac_ext <<_ACEOF
-#line 12144 "configure"
+#line 12476 "configure"
#include "confdefs.h"
#include <stdio.h>
int
@@ -12153,16 +12485,16 @@ printf("Hello world");
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12156: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12488: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12159: \$? = $ac_status" >&5
+ echo "$as_me:12491: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12162: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12494: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12165: \$? = $ac_status" >&5
+ echo "$as_me:12497: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -12170,12 +12502,12 @@ else
cat conftest.$ac_ext >&5
test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6
-echo "${as_me:-configure}:12173: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:12505: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
- if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
+ if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6
-echo "${as_me:-configure}:12178: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:12510: testing but keeping change to \$CPPFLAGS ..." 1>&5
fi
CFLAGS="$cf_check_flags"
@@ -12183,7 +12515,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:12186: checking for XOpenDisplay in -lX11" >&5
+echo "$as_me:12518: checking for XOpenDisplay in -lX11" >&5
echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12191,7 +12523,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 12194 "configure"
+#line 12526 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -12210,16 +12542,16 @@ XOpenDisplay ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12213: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12545: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12216: \$? = $ac_status" >&5
+ echo "$as_me:12548: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12219: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12551: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12222: \$? = $ac_status" >&5
+ echo "$as_me:12554: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_X11_XOpenDisplay=yes
else
@@ -12230,21 +12562,52 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:12233: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:12565: result: $ac_cv_lib_X11_XOpenDisplay" >&5
echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
if test $ac_cv_lib_X11_XOpenDisplay = yes; then
- LIBS="-lX11 $LIBS"
+
+cf_add_libs="-lX11"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
fi
-echo "$as_me:12239: checking for XCurses library" >&5
+echo "$as_me:12587: checking for XCurses library" >&5
echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
if test "${cf_cv_lib_XCurses+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-LIBS="-lXCurses $LIBS"
+cf_add_libs="-lXCurses"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 12247 "configure"
+#line 12610 "configure"
#include "confdefs.h"
#include <xcurses.h>
@@ -12259,16 +12622,16 @@ XCursesExit();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12262: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12625: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12265: \$? = $ac_status" >&5
+ echo "$as_me:12628: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12268: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12631: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12271: \$? = $ac_status" >&5
+ echo "$as_me:12634: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_lib_XCurses=yes
else
@@ -12279,37 +12642,38 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:12282: result: $cf_cv_lib_XCurses" >&5
+echo "$as_me:12645: result: $cf_cv_lib_XCurses" >&5
echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
fi
if test $cf_cv_lib_XCurses = yes ; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define UNIX 1
EOF
- cat >>confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
#define XCURSES 1
EOF
- echo "$as_me:12296: checking for xcurses.h" >&5
+ echo "$as_me:12660: checking for xcurses.h" >&5
echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
if test "${ac_cv_header_xcurses_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12302 "configure"
+#line 12666 "configure"
#include "confdefs.h"
#include <xcurses.h>
_ACEOF
-if { (eval echo "$as_me:12306: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:12670: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:12312: \$? = $ac_status" >&5
+ echo "$as_me:12676: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -12328,17 +12692,18 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:12331: result: $ac_cv_header_xcurses_h" >&5
+echo "$as_me:12695: result: $ac_cv_header_xcurses_h" >&5
echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
if test $ac_cv_header_xcurses_h = yes; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_XCURSES 1
EOF
fi
else
- { { echo "$as_me:12341: error: Cannot link with XCurses" >&5
+ { { echo "$as_me:12706: error: Cannot link with XCurses" >&5
echo "$as_me: error: Cannot link with XCurses" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -12346,22 +12711,143 @@ fi
;;
esac
+case $cf_cv_screen in
+curses|curses_*)
+
+echo "$as_me:12717: checking for NetBSD form.h" >&5
+echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
+if test "${cf_cv_netbsd_form_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 12724 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <form.h>
+
+int
+main ()
+{
+
+ FORM *form;
+ int y = current_field(form)->cursor_ypos;
+ int x = current_field(form)->cursor_xpos;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:12743: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:12746: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:12749: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:12752: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_netbsd_form_h=yes
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_netbsd_form_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:12764: result: $cf_cv_netbsd_form_h" >&5
+echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
+
+test "$cf_cv_netbsd_form_h" = yes &&
+cat >>confdefs.h <<\EOF
+#define HAVE_NETBSD_FORM_H 1
+EOF
+
+echo "$as_me:12772: checking for NetBSD menu.h" >&5
+echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
+if test "${cf_cv_netbsd_menu_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 12779 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <menu.h>
+
+int
+main ()
+{
+
+ MENU *menu;
+ int y = menu->max_item_width;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:12797: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:12800: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:12803: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:12806: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_netbsd_menu_h=yes
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_netbsd_menu_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:12818: result: $cf_cv_netbsd_menu_h" >&5
+echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
+
+test "$cf_cv_netbsd_menu_h" = yes &&
+cat >>confdefs.h <<\EOF
+#define HAVE_NETBSD_MENU_H 1
+EOF
+
+ ;;
+ncursesw)
+ cf_cv_libtype=w
+ ;;
+esac
+
case $cf_cv_screen in #(vi
pdcurses) #(vi
;;
*)
# look for curses-related libraries
+ : ${cf_panel_lib:=panel}
+ : ${cf_menu_lib:=menu}
+ : ${cf_form_lib:=form}
-as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
-echo "$as_me:12356: checking for new_panel in -lpanel$cf_cv_libtype" >&5
-echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
+as_ac_Lib=`echo "ac_cv_lib_$cf_panel_lib$cf_cv_libtype''_new_panel" | $as_tr_sh`
+echo "$as_me:12842: checking for new_panel in -l$cf_panel_lib$cf_cv_libtype" >&5
+echo $ECHO_N "checking for new_panel in -l$cf_panel_lib$cf_cv_libtype... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpanel$cf_cv_libtype $LIBS"
+LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 12364 "configure"
+#line 12850 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -12380,16 +12866,16 @@ new_panel ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12383: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12869: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12386: \$? = $ac_status" >&5
+ echo "$as_me:12872: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12389: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12875: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12392: \$? = $ac_status" >&5
+ echo "$as_me:12878: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_Lib=yes"
else
@@ -12400,27 +12886,27 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:12403: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:12889: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
cat >>confdefs.h <<EOF
-#define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
+#define `echo "HAVE_LIB$cf_panel_lib$cf_cv_libtype" | $as_tr_cpp` 1
EOF
- LIBS="-lpanel$cf_cv_libtype $LIBS"
+ LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
fi
-as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
-echo "$as_me:12415: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
-echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
+as_ac_Lib=`echo "ac_cv_lib_$cf_menu_lib$cf_cv_libtype''_menu_driver" | $as_tr_sh`
+echo "$as_me:12901: checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype" >&5
+echo $ECHO_N "checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmenu$cf_cv_libtype $LIBS"
+LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 12423 "configure"
+#line 12909 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -12439,16 +12925,16 @@ menu_driver ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12442: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12928: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12445: \$? = $ac_status" >&5
+ echo "$as_me:12931: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12448: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12934: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12451: \$? = $ac_status" >&5
+ echo "$as_me:12937: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_Lib=yes"
else
@@ -12459,27 +12945,27 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:12462: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:12948: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
cat >>confdefs.h <<EOF
-#define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
+#define `echo "HAVE_LIB$cf_menu_lib$cf_cv_libtype" | $as_tr_cpp` 1
EOF
- LIBS="-lmenu$cf_cv_libtype $LIBS"
+ LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
fi
-as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
-echo "$as_me:12474: checking for form_driver in -lform$cf_cv_libtype" >&5
-echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
+as_ac_Lib=`echo "ac_cv_lib_$cf_form_lib$cf_cv_libtype''_form_driver" | $as_tr_sh`
+echo "$as_me:12960: checking for form_driver in -l$cf_form_lib$cf_cv_libtype" >&5
+echo $ECHO_N "checking for form_driver in -l$cf_form_lib$cf_cv_libtype... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lform$cf_cv_libtype $LIBS"
+LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 12482 "configure"
+#line 12968 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -12498,16 +12984,16 @@ form_driver ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12501: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12987: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12504: \$? = $ac_status" >&5
+ echo "$as_me:12990: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12507: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12993: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12510: \$? = $ac_status" >&5
+ echo "$as_me:12996: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_Lib=yes"
else
@@ -12518,14 +13004,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:12521: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:13007: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
cat >>confdefs.h <<EOF
-#define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
+#define `echo "HAVE_LIB$cf_form_lib$cf_cv_libtype" | $as_tr_cpp` 1
EOF
- LIBS="-lform$cf_cv_libtype $LIBS"
+ LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
fi
@@ -12541,23 +13027,23 @@ for ac_header in \
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:12544: checking for $ac_header" >&5
+echo "$as_me:13030: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12550 "configure"
+#line 13036 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:12554: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:13040: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:12560: \$? = $ac_status" >&5
+ echo "$as_me:13046: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -12576,7 +13062,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:12579: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:13065: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -12589,67 +13075,13 @@ done
;;
esac
-echo "$as_me:12592: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
-if test "${ac_cv_type_signal+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line 12598 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-# undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int
-main ()
-{
-int i;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12620: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:12623: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:12626: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:12629: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_signal=void
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_type_signal=int
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:12639: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6
-
-cat >>confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-echo "$as_me:12646: checking for ANSI C header files" >&5
+echo "$as_me:13078: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12652 "configure"
+#line 13084 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -12657,13 +13089,13 @@ else
#include <float.h>
_ACEOF
-if { (eval echo "$as_me:12660: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:13092: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:12666: \$? = $ac_status" >&5
+ echo "$as_me:13098: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -12685,7 +13117,7 @@ rm -f conftest.err conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
-#line 12688 "configure"
+#line 13120 "configure"
#include "confdefs.h"
#include <string.h>
@@ -12703,7 +13135,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
-#line 12706 "configure"
+#line 13138 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -12724,7 +13156,7 @@ if test $ac_cv_header_stdc = yes; then
:
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12727 "configure"
+#line 13159 "configure"
#include "confdefs.h"
#include <ctype.h>
#if ((' ' & 0x0FF) == 0x020)
@@ -12750,15 +13182,15 @@ main ()
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:12753: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13185: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12756: \$? = $ac_status" >&5
+ echo "$as_me:13188: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:12758: \"$ac_try\"") >&5
+ { (eval echo "$as_me:13190: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12761: \$? = $ac_status" >&5
+ echo "$as_me:13193: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -12771,7 +13203,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
-echo "$as_me:12774: result: $ac_cv_header_stdc" >&5
+echo "$as_me:13206: result: $ac_cv_header_stdc" >&5
echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
@@ -12781,13 +13213,13 @@ EOF
fi
-echo "$as_me:12784: checking whether time.h and sys/time.h may both be included" >&5
+echo "$as_me:13216: checking whether time.h and sys/time.h may both be included" >&5
echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
if test "${ac_cv_header_time+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12790 "configure"
+#line 13222 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -12803,16 +13235,16 @@ return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12806: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13238: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:12809: \$? = $ac_status" >&5
+ echo "$as_me:13241: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:12812: \"$ac_try\"") >&5
+ { (eval echo "$as_me:13244: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12815: \$? = $ac_status" >&5
+ echo "$as_me:13247: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_header_time=yes
else
@@ -12822,7 +13254,7 @@ ac_cv_header_time=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:12825: result: $ac_cv_header_time" >&5
+echo "$as_me:13257: result: $ac_cv_header_time" >&5
echo "${ECHO_T}$ac_cv_header_time" >&6
if test $ac_cv_header_time = yes; then
@@ -12845,23 +13277,71 @@ unistd.h \
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:12848: checking for $ac_header" >&5
+echo "$as_me:13280: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 13286 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:13290: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:13296: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:13315: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+for ac_header in unistd.h getopt.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:13328: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12854 "configure"
+#line 13334 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:12858: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:13338: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:12864: \$? = $ac_status" >&5
+ echo "$as_me:13344: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -12880,7 +13360,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:12883: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:13363: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -12890,27 +13370,166 @@ EOF
fi
done
+echo "$as_me:13373: checking for header declaring getopt variables" >&5
+echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
+if test "${cf_cv_getopt_header+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_getopt_header=none
+for cf_header in stdio.h stdlib.h unistd.h getopt.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 13383 "configure"
+#include "confdefs.h"
+
+#include <$cf_header>
+int
+main ()
+{
+int x = optind; char *y = optarg
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13396: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:13399: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:13402: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:13405: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_getopt_header=$cf_header
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:13417: result: $cf_cv_getopt_header" >&5
+echo "${ECHO_T}$cf_cv_getopt_header" >&6
+if test $cf_cv_getopt_header != none ; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_GETOPT_HEADER 1
+EOF
+
+fi
+if test $cf_cv_getopt_header = getopt.h ; then
+
+cat >>confdefs.h <<\EOF
+#define NEED_GETOPT_H 1
+EOF
+
+fi
+
for ac_func in \
+getopt \
gettimeofday \
+
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:13440: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 13446 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13477: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:13480: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:13483: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:13486: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:13496: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+if test "x$ac_cv_func_getopt" = xno; then
+ { { echo "$as_me:13507: error: getopt is required for building programs" >&5
+echo "$as_me: error: getopt is required for building programs" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+if test "$cf_enable_widec" = yes; then
+
+for ac_func in \
mblen \
mbrlen \
mbrtowc \
mbsrtowcs \
mbstowcs \
mbtowc \
-strdup \
wcsrtombs \
wcstombs \
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:12907: checking for $ac_func" >&5
+echo "$as_me:13526: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12913 "configure"
+#line 13532 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below. */
@@ -12933,7 +13552,7 @@ main ()
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
#endif
;
@@ -12941,16 +13560,16 @@ f = $ac_func;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12944: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13563: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12947: \$? = $ac_status" >&5
+ echo "$as_me:13566: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12950: \"$ac_try\"") >&5
+ { (eval echo "$as_me:13569: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12953: \$? = $ac_status" >&5
+ echo "$as_me:13572: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
@@ -12960,7 +13579,7 @@ eval "$as_ac_var=no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:12963: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:13582: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -12970,14 +13589,16 @@ EOF
fi
done
-echo "$as_me:12973: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
+fi
+
+echo "$as_me:13594: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
if test "${cf_cv_need_xopen_extension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12980 "configure"
+#line 13601 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -12999,23 +13620,23 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13002: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13623: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13005: \$? = $ac_status" >&5
+ echo "$as_me:13626: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13008: \"$ac_try\"") >&5
+ { (eval echo "$as_me:13629: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13011: \$? = $ac_status" >&5
+ echo "$as_me:13632: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_need_xopen_extension=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line 13018 "configure"
+#line 13639 "configure"
#include "confdefs.h"
#define _XOPEN_SOURCE_EXTENDED
@@ -13037,16 +13658,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13040: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13661: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13043: \$? = $ac_status" >&5
+ echo "$as_me:13664: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13046: \"$ac_try\"") >&5
+ { (eval echo "$as_me:13667: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13049: \$? = $ac_status" >&5
+ echo "$as_me:13670: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_need_xopen_extension=yes
else
@@ -13058,11 +13679,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:13061: result: $cf_cv_need_xopen_extension" >&5
+echo "$as_me:13682: result: $cf_cv_need_xopen_extension" >&5
echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
-echo "$as_me:13065: checking for term.h" >&5
+echo "$as_me:13686: checking for term.h" >&5
echo $ECHO_N "checking for term.h... $ECHO_C" >&6
if test "${cf_cv_term_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13070,12 +13691,20 @@ else
# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
# for <term.h> if we do not find the variant.
-for cf_header in \
- `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \
- term.h
+
+cf_header_list="term.h ncurses/term.h ncursesw/term.h"
+
+case ${cf_cv_ncurses_header:-curses.h} in #(vi
+*/*)
+ cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
+ cf_header_list="$cf_header_item $cf_header_list"
+ ;;
+esac
+
+for cf_header in $cf_header_list
do
cat >conftest.$ac_ext <<_ACEOF
-#line 13078 "configure"
+#line 13707 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -13089,16 +13718,16 @@ WINDOW *x
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13092: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13721: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13095: \$? = $ac_status" >&5
+ echo "$as_me:13724: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13098: \"$ac_try\"") >&5
+ { (eval echo "$as_me:13727: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13101: \$? = $ac_status" >&5
+ echo "$as_me:13730: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header=$cf_header
break
@@ -13117,7 +13746,7 @@ no)
for cf_header in ncurses/term.h ncursesw/term.h
do
cat >conftest.$ac_ext <<_ACEOF
-#line 13120 "configure"
+#line 13749 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -13135,16 +13764,16 @@ WINDOW *x
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13138: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13767: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13141: \$? = $ac_status" >&5
+ echo "$as_me:13770: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13144: \"$ac_try\"") >&5
+ { (eval echo "$as_me:13773: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13147: \$? = $ac_status" >&5
+ echo "$as_me:13776: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header=$cf_header
break
@@ -13159,31 +13788,126 @@ rm -f conftest.$ac_objext conftest.$ac_ext
esac
fi
-echo "$as_me:13162: result: $cf_cv_term_header" >&5
+echo "$as_me:13791: result: $cf_cv_term_header" >&5
echo "${ECHO_T}$cf_cv_term_header" >&6
case $cf_cv_term_header in #(vi
term.h) #(vi
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_TERM_H 1
EOF
;;
ncurses/term.h) #(vi
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_TERM_H 1
EOF
;;
ncursesw/term.h)
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_TERM_H 1
EOF
;;
esac
+echo "$as_me:13818: checking for unctrl.h" >&5
+echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
+if test "${cf_cv_unctrl_header+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
+# for <unctrl.h> if we do not find the variant.
+
+cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
+
+case ${cf_cv_ncurses_header:-curses.h} in #(vi
+*/*)
+ cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
+ cf_header_list="$cf_header_item $cf_header_list"
+ ;;
+esac
+
+for cf_header in $cf_header_list
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line 13839 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <${cf_header}>
+int
+main ()
+{
+WINDOW *x
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13853: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:13856: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:13859: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:13862: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_unctrl_header=$cf_header
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_unctrl_header=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:13875: result: $cf_cv_unctrl_header" >&5
+echo "${ECHO_T}$cf_cv_unctrl_header" >&6
+
+case $cf_cv_unctrl_header in #(vi
+no)
+ { echo "$as_me:13880: WARNING: unctrl.h header not found" >&5
+echo "$as_me: WARNING: unctrl.h header not found" >&2;}
+ ;;
+esac
+
+case $cf_cv_unctrl_header in #(vi
+unctrl.h) #(vi
+
+cat >>confdefs.h <<\EOF
+#define HAVE_UNCTRL_H 1
+EOF
+
+ ;;
+ncurses/unctrl.h) #(vi
+
+cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_UNCTRL_H 1
+EOF
+
+ ;;
+ncursesw/unctrl.h)
+
+cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_UNCTRL_H 1
+EOF
+
+ ;;
+esac
+
for cf_func in \
+assume_default_colors \
chgat \
color_set \
filter \
@@ -13210,8 +13934,14 @@ tigetnum \
tigetstr \
typeahead \
use_default_colors \
-vw_printw \
+use_env \
+use_extended_names \
+use_screen \
+use_window \
+vid_puts \
+vidputs \
vsscanf \
+vw_printw \
wchgat \
winsstr \
wresize \
@@ -13221,10 +13951,95 @@ do
cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
- echo "$as_me:13224: checking for ${cf_func}" >&5
+ echo "$as_me:13954: checking for ${cf_func}" >&5
+echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
+
+echo "${as_me:-configure}:13957: testing ${cf_func} ..." 1>&5
+
+ if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ eval cf_result='$ac_cv_func_'$cf_func
+ if test ".$cf_result" != ".no"; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line 13966 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
+#include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
+#endif
+
+int
+main ()
+{
+
+#ifndef ${cf_func}
+long foo = (long)(&${cf_func});
+fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
+if (foo + 1234 > 5678)
+ ${cf_cv_main_return:-return}(foo);
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13999: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:14002: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:14005: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:14008: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_result=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+ eval 'cf_cv_func_'$cf_func'=$cf_result'
+
+fi
+
+ # use the computed/retrieved cache-value:
+ eval 'cf_result=$cf_cv_func_'$cf_func
+ echo "$as_me:14024: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+ if test $cf_result != no; then
+ cat >>confdefs.h <<EOF
+#define HAVE_${cf_tr_func} 1
+EOF
+
+ fi
+done
+
+for cf_func in tputs
+do
+
+cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+ echo "$as_me:14039: checking for ${cf_func}" >&5
echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
-echo "${as_me:-configure}:13227: testing ${cf_func} ..." 1>&5
+echo "${as_me:-configure}:14042: testing ${cf_func} ..." 1>&5
if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13233,7 +14048,7 @@ else
eval cf_result='$ac_cv_func_'$cf_func
if test ".$cf_result" != ".no"; then
cat >conftest.$ac_ext <<_ACEOF
-#line 13236 "configure"
+#line 14051 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -13256,7 +14071,9 @@ main ()
#ifndef ${cf_func}
long foo = (long)(&${cf_func});
-${cf_cv_main_return:-return}(foo == 0);
+fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
+if (foo + 1234 > 5678)
+ ${cf_cv_main_return:-return}(foo);
#endif
;
@@ -13264,16 +14081,16 @@ ${cf_cv_main_return:-return}(foo == 0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13267: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14084: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13270: \$? = $ac_status" >&5
+ echo "$as_me:14087: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13273: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14090: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13276: \$? = $ac_status" >&5
+ echo "$as_me:14093: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -13289,7 +14106,7 @@ fi
# use the computed/retrieved cache-value:
eval 'cf_result=$cf_cv_func_'$cf_func
- echo "$as_me:13292: result: $cf_result" >&5
+ echo "$as_me:14109: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result != no; then
cat >>confdefs.h <<EOF
@@ -13299,14 +14116,82 @@ EOF
fi
done
-echo "$as_me:13302: checking for ncurses extended functions" >&5
+if test x$cf_cv_func_tputs = xyes
+then
+ cf_done=no
+ for cf_arg in int char
+ do
+ for cf_ret in int void
+ do
+ if test $cf_ret = void
+ then
+ cf_return="/* nothing */"
+ else
+ cf_return="return value"
+ fi
+ cat >conftest.$ac_ext <<_ACEOF
+#line 14133 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_cv_term_header>
+
+static $cf_ret outc($cf_arg value) { $cf_return; }
+
+int
+main ()
+{
+
+ tputs("hello", 0, outc);
+ ${cf_cv_main_return:-return}(0);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14153: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:14156: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:14159: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:14162: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ test -n "$verbose" && echo " prototype $cf_ret func($cf_arg value)" 1>&6
+
+echo "${as_me:-configure}:14167: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
+
+ cat >>confdefs.h <<EOF
+#define TPUTS_ARG $cf_arg
+#define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
+#define TPUTS_RETURN(value) $cf_return
+EOF
+ cf_done=yes
+ break
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ done
+ test $cf_done = yes && break
+ done
+fi
+
+echo "$as_me:14187: checking for ncurses extended functions" >&5
echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13309 "configure"
+#line 14194 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -13321,16 +14206,16 @@ int x = NCURSES_EXT_FUNCS
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13324: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14209: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13327: \$? = $ac_status" >&5
+ echo "$as_me:14212: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13330: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14215: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13333: \$? = $ac_status" >&5
+ echo "$as_me:14218: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_ext_funcs=defined
else
@@ -13338,7 +14223,7 @@ else
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line 13341 "configure"
+#line 14226 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -13363,16 +14248,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13366: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14251: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13369: \$? = $ac_status" >&5
+ echo "$as_me:14254: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13372: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14257: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13375: \$? = $ac_status" >&5
+ echo "$as_me:14260: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_ext_funcs=yes
else
@@ -13386,515 +14271,170 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:13389: result: $cf_cv_ncurses_ext_funcs" >&5
+echo "$as_me:14274: result: $cf_cv_ncurses_ext_funcs" >&5
echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
-test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
+test "$cf_cv_ncurses_ext_funcs" = yes &&
+cat >>confdefs.h <<\EOF
#define NCURSES_EXT_FUNCS 1
EOF
-echo "$as_me:13395: checking for wide-character functions" >&5
-echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
-if test "${cf_cv_widechar_funcs+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+if test "$cf_enable_widec" = yes
+then
+ # workaround for systems with ncurses before 20111029, due to change of
+ # feature test macro from _XPG5 to _XOPEN_SOURCE
+ if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
+ then
+ cf_define_xpg5=no
+ echo "$as_me:14288: checking if _XPG5 should be defined to enable wide-characters" >&5
+echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 13402 "configure"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 14292 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
main ()
{
-
- static wchar_t src_wchar[2];
- static cchar_t dst_cchar;
- setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
-
+int x = _XPG5
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13419: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:13422: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13425: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:13428: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cf_cv_widechar_funcs=yes
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_widechar_funcs=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
-fi
-echo "$as_me:13439: result: $cf_cv_widechar_funcs" >&5
-echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
-if test "$cf_cv_widechar_funcs" != no ; then
- cat >>confdefs.h <<\EOF
-#define USE_WIDEC_SUPPORT 1
-EOF
-
-else
- cat >>confdefs.h <<\EOF
-#define USE_WIDEC_SUPPORT 0
-EOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:13459: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line 13465 "configure"
-#include "confdefs.h"
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13471: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14305: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13474: \$? = $ac_status" >&5
+ echo "$as_me:14308: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13477: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14311: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13480: \$? = $ac_status" >&5
+ echo "$as_me:14314: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
+ :
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:13490: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<EOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-EOF
-
-fi
-done
-
-echo "$as_me:13500: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
-if test "${ac_cv_type_pid_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line 13506 "configure"
+cf_save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -D_XPG5"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 14323 "configure"
#include "confdefs.h"
-$ac_includes_default
+
+#include <${cf_cv_ncurses_header:-curses.h}>
int
main ()
{
-if ((pid_t *) 0)
- return 0;
-if (sizeof (pid_t))
- return 0;
+int x = _XPG5
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13521: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14336: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13524: \$? = $ac_status" >&5
+ echo "$as_me:14339: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13527: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14342: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13530: \$? = $ac_status" >&5
+ echo "$as_me:14345: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_type_pid_t=yes
+ cf_define_xpg5=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-ac_cv_type_pid_t=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$cf_save_cppflags"
fi
-echo "$as_me:13540: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6
-if test $ac_cv_type_pid_t = yes; then
- :
-else
-
-cat >>confdefs.h <<EOF
-#define pid_t int
-EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:14356: result: $cf_define_xpg5" >&5
+echo "${ECHO_T}$cf_define_xpg5" >&6
-fi
+ if test "$cf_define_xpg5" = yes
+ then
+ CPPFLAGS="$CPPFLAGS -D_XPG5"
+ fi
+ fi
-for ac_header in unistd.h vfork.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:13555: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:14365: checking for wide-character functions" >&5
+echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
+if test "${cf_cv_widechar_funcs+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-#line 13561 "configure"
-#include "confdefs.h"
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:13565: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- egrep -v '^ *\+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:13571: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
- cat conftest.$ac_ext >&5
- eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_ext
-fi
-echo "$as_me:13590: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<EOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-EOF
-
-fi
-done
-for ac_func in fork vfork
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:13603: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line 13609 "configure"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 14372 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-char (*f) ();
+#include <${cf_cv_ncurses_header:-curses.h}>
int
main ()
{
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-f = $ac_func;
-#endif
+
+ static wchar_t src_wchar[2];
+ static cchar_t dst_cchar;
+ setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13640: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14389: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13643: \$? = $ac_status" >&5
+ echo "$as_me:14392: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13646: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14395: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13649: \$? = $ac_status" >&5
+ echo "$as_me:14398: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
+ cf_cv_widechar_funcs=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-eval "$as_ac_var=no"
+cf_cv_widechar_funcs=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:13659: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<EOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
-
-fi
-done
-
-ac_cv_func_fork_works=$ac_cv_func_fork
-if test "x$ac_cv_func_fork" = xyes; then
- echo "$as_me:13671: checking for working fork" >&5
-echo $ECHO_N "checking for working fork... $ECHO_C" >&6
-if test "${ac_cv_func_fork_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_fork_works=cross
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* By Rüdiger Kuhlmann. */
- #include <sys/types.h>
- #if HAVE_UNISTD_H
- # include <unistd.h>
- #endif
- /* Some systems only have a dummy stub for fork() */
- int main ()
- {
- if (fork() < 0)
- $ac_main_return (1);
- $ac_main_return (0);
- }
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13694: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:13697: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:13699: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:13702: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_fork_works=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func_fork_works=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:13714: result: $ac_cv_func_fork_works" >&5
-echo "${ECHO_T}$ac_cv_func_fork_works" >&6
-
-fi
-if test "x$ac_cv_func_fork_works" = xcross; then
- case $host in
- *-*-amigaos* | *-*-msdosdjgpp*)
- # Override, as these systems have only a dummy fork() stub
- ac_cv_func_fork_works=no
- ;;
- *)
- ac_cv_func_fork_works=yes
- ;;
- esac
- { echo "$as_me:13728: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
-echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;}
-fi
-ac_cv_func_vfork_works=$ac_cv_func_vfork
-if test "x$ac_cv_func_vfork" = xyes; then
- echo "$as_me:13733: checking for working vfork" >&5
-echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
-if test "${ac_cv_func_vfork_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_vfork_works=cross
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line 13742 "configure"
-#include "confdefs.h"
-/* Thanks to Paul Eggert for this test. */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_VFORK_H
-# include <vfork.h>
-#endif
-/* On some sparc systems, changes by the child to local and incoming
- argument registers are propagated back to the parent. The compiler
- is told about this with #include <vfork.h>, but some compilers
- (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
- static variable whose address is put into a register that is
- clobbered by the vfork. */
-static
-#ifdef __cplusplus
-sparc_address_test (int arg)
-# else
-sparc_address_test (arg) int arg;
-#endif
-{
- static pid_t child;
- if (!child) {
- child = vfork ();
- if (child < 0) {
- perror ("vfork");
- _exit(2);
- }
- if (!child) {
- arg = getpid();
- write(-1, "", 0);
- _exit (arg);
- }
- }
-}
-
-int
-main ()
-{
- pid_t parent = getpid ();
- pid_t child;
-
- sparc_address_test ();
-
- child = vfork ();
-
- if (child == 0) {
- /* Here is another test for sparc vfork register problems. This
- test uses lots of local variables, at least as many local
- variables as main has allocated so far including compiler
- temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
- 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
- reuse the register of parent for one of the local variables,
- since it will think that parent can't possibly be used any more
- in this routine. Assigning to the local variable will thus
- munge parent in the parent process. */
- pid_t
- p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
- p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
- /* Convince the compiler that p..p7 are live; otherwise, it might
- use the same hardware register for all 8 local variables. */
- if (p != p1 || p != p2 || p != p3 || p != p4
- || p != p5 || p != p6 || p != p7)
- _exit(1);
-
- /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
- from child file descriptors. If the child closes a descriptor
- before it execs or exits, this munges the parent's descriptor
- as well. Test for this by closing stdout in the child. */
- _exit(close(fileno(stdout)) != 0);
- } else {
- int status;
- struct stat st;
-
- while (wait(&status) != child)
- ;
- $ac_main_return(
- /* Was there some problem with vforking? */
- child < 0
-
- /* Did the child fail? (This shouldn't happen.) */
- || status
-
- /* Did the vfork/compiler bug occur? */
- || parent != getpid()
-
- /* Did the file descriptor bug occur? */
- || fstat(fileno(stdout), &st) != 0
- );
- }
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13839: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:13842: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:13844: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:13847: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_vfork_works=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func_vfork_works=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:13859: result: $ac_cv_func_vfork_works" >&5
-echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
-fi;
-if test "x$ac_cv_func_fork_works" = xcross; then
- ac_cv_func_vfork_works=ac_cv_func_vfork
- { echo "$as_me:13865: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
-echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;}
fi
-
-if test "x$ac_cv_func_vfork_works" = xyes; then
+echo "$as_me:14409: result: $cf_cv_widechar_funcs" >&5
+echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
+ if test "$cf_cv_widechar_funcs" != no ; then
cat >>confdefs.h <<\EOF
-#define HAVE_WORKING_VFORK 1
+#define USE_WIDEC_SUPPORT 1
EOF
-else
-
-cat >>confdefs.h <<\EOF
-#define vfork fork
+ else
+ cat >>confdefs.h <<\EOF
+#define USE_WIDEC_SUPPORT 0
EOF
-fi
-if test "x$ac_cv_func_fork_works" = xyes; then
-
-cat >>confdefs.h <<\EOF
-#define HAVE_WORKING_FORK 1
+ fi
+else
+ cat >>confdefs.h <<\EOF
+#define USE_WIDEC_SUPPORT 0
EOF
fi
-echo "$as_me:13890: checking if sys/time.h works with sys/select.h" >&5
+echo "$as_me:14430: checking if sys/time.h works with sys/select.h" >&5
echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
if test "${cf_cv_sys_time_select+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13897 "configure"
+#line 14437 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -13914,16 +14454,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13917: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14457: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13920: \$? = $ac_status" >&5
+ echo "$as_me:14460: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13923: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14463: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13926: \$? = $ac_status" >&5
+ echo "$as_me:14466: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_sys_time_select=yes
else
@@ -13935,13 +14475,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:13938: result: $cf_cv_sys_time_select" >&5
+echo "$as_me:14478: result: $cf_cv_sys_time_select" >&5
echo "${ECHO_T}$cf_cv_sys_time_select" >&6
-test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
+test "$cf_cv_sys_time_select" = yes &&
+cat >>confdefs.h <<\EOF
#define HAVE_SYS_TIME_SELECT 1
EOF
-echo "$as_me:13944: checking for function curses_version" >&5
+echo "$as_me:14485: checking for function curses_version" >&5
echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
if test "${cf_cv_func_curses_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13951,7 +14492,7 @@ if test "$cross_compiling" = yes; then
cf_cv_func_curses_version=unknown
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13954 "configure"
+#line 14495 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -13964,15 +14505,15 @@ int main()
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13967: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14508: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13970: \$? = $ac_status" >&5
+ echo "$as_me:14511: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:13972: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14513: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13975: \$? = $ac_status" >&5
+ echo "$as_me:14516: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_func_curses_version=yes
@@ -13987,26 +14528,14 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
rm -f core
fi
-echo "$as_me:13990: result: $cf_cv_func_curses_version" >&5
+echo "$as_me:14531: result: $cf_cv_func_curses_version" >&5
echo "${ECHO_T}$cf_cv_func_curses_version" >&6
-test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
+test "$cf_cv_func_curses_version" = yes &&
+cat >>confdefs.h <<\EOF
#define HAVE_CURSES_VERSION 1
EOF
-echo "$as_me:13996: checking for ncurses wrap-prefix" >&5
-echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
-
-# Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
-if test "${with_ncurses_wrap_prefix+set}" = set; then
- withval="$with_ncurses_wrap_prefix"
- NCURSES_WRAP_PREFIX=$withval
-else
- NCURSES_WRAP_PREFIX=_nc_
-fi;
-echo "$as_me:14006: result: $NCURSES_WRAP_PREFIX" >&5
-echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
-
-echo "$as_me:14009: checking for alternate character set array" >&5
+echo "$as_me:14538: checking for alternate character set array" >&5
echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
if test "${cf_cv_curses_acs_map+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14016,7 +14545,7 @@ cf_cv_curses_acs_map=unknown
for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
do
cat >conftest.$ac_ext <<_ACEOF
-#line 14019 "configure"
+#line 14548 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -14032,16 +14561,16 @@ $name['k'] = ACS_PLUS
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14035: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14564: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14038: \$? = $ac_status" >&5
+ echo "$as_me:14567: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14041: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14570: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14044: \$? = $ac_status" >&5
+ echo "$as_me:14573: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_curses_acs_map=$name; break
else
@@ -14052,14 +14581,17 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
done
fi
-echo "$as_me:14055: result: $cf_cv_curses_acs_map" >&5
+echo "$as_me:14584: result: $cf_cv_curses_acs_map" >&5
echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
-test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
+test "$cf_cv_curses_acs_map" != unknown &&
+cat >>confdefs.h <<EOF
#define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
EOF
-echo "$as_me:14062: checking for wide alternate character set array" >&5
+if test "$cf_enable_widec" = yes; then
+
+echo "$as_me:14594: checking for wide alternate character set array" >&5
echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
if test "${cf_cv_curses_wacs_map+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14069,7 +14601,7 @@ else
for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
do
cat >conftest.$ac_ext <<_ACEOF
-#line 14072 "configure"
+#line 14604 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14085,16 +14617,16 @@ void *foo = &($name['k'])
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14088: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14620: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14091: \$? = $ac_status" >&5
+ echo "$as_me:14623: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14094: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14626: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14097: \$? = $ac_status" >&5
+ echo "$as_me:14629: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_curses_wacs_map=$name
break
@@ -14105,14 +14637,15 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
done
fi
-echo "$as_me:14108: result: $cf_cv_curses_wacs_map" >&5
+echo "$as_me:14640: result: $cf_cv_curses_wacs_map" >&5
echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
-test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <<EOF
+test "$cf_cv_curses_wacs_map" != unknown &&
+cat >>confdefs.h <<EOF
#define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
EOF
-echo "$as_me:14115: checking for wide alternate character constants" >&5
+echo "$as_me:14648: checking for wide alternate character constants" >&5
echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
if test "${cf_cv_curses_wacs_symbols+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14122,7 +14655,7 @@ cf_cv_curses_wacs_symbols=no
if test "$cf_cv_curses_wacs_map" != unknown
then
cat >conftest.$ac_ext <<_ACEOF
-#line 14125 "configure"
+#line 14658 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14139,16 +14672,16 @@ cchar_t *foo = WACS_PLUS;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14142: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14675: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14145: \$? = $ac_status" >&5
+ echo "$as_me:14678: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14148: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14681: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14151: \$? = $ac_status" >&5
+ echo "$as_me:14684: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_curses_wacs_symbols=yes
else
@@ -14158,7 +14691,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14161 "configure"
+#line 14694 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14174,16 +14707,16 @@ cchar_t *foo = WACS_PLUS
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14177: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14710: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14180: \$? = $ac_status" >&5
+ echo "$as_me:14713: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14183: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14716: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14186: \$? = $ac_status" >&5
+ echo "$as_me:14719: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_curses_wacs_symbols=yes
else
@@ -14194,17 +14727,20 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
fi
-echo "$as_me:14197: result: $cf_cv_curses_wacs_symbols" >&5
+echo "$as_me:14730: result: $cf_cv_curses_wacs_symbols" >&5
echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
-test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
+test "$cf_cv_curses_wacs_symbols" != no &&
+cat >>confdefs.h <<\EOF
#define CURSES_WACS_SYMBOLS 1
EOF
-echo "$as_me:14204: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+fi
+
+echo "$as_me:14740: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 14207 "configure"
+#line 14743 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14222,16 +14758,16 @@ attr_t foo
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14225: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14761: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14228: \$? = $ac_status" >&5
+ echo "$as_me:14764: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14231: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14767: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14234: \$? = $ac_status" >&5
+ echo "$as_me:14770: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14240,32 +14776,35 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14243: result: $cf_result" >&5
+echo "$as_me:14779: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
- cat >>confdefs.h <<EOF
+cat >>confdefs.h <<EOF
#define $cf_result 1
EOF
else
- cat >>confdefs.h <<EOF
+
+cat >>confdefs.h <<EOF
#define attr_t long
EOF
fi
+if test "$cf_enable_widec" = yes; then
+
# This is needed on Tru64 5.0 to declare mbstate_t
-echo "$as_me:14261: checking if we must include wchar.h to declare mbstate_t" >&5
+echo "$as_me:14800: checking if we must include wchar.h to declare mbstate_t" >&5
echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
if test "${cf_cv_mbstate_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14268 "configure"
+#line 14807 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14283,23 +14822,23 @@ mbstate_t state
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14286: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14825: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14289: \$? = $ac_status" >&5
+ echo "$as_me:14828: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14292: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14831: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14295: \$? = $ac_status" >&5
+ echo "$as_me:14834: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_mbstate_t=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line 14302 "configure"
+#line 14841 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14318,16 +14857,16 @@ mbstate_t value
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14321: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14860: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14324: \$? = $ac_status" >&5
+ echo "$as_me:14863: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14327: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14866: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14330: \$? = $ac_status" >&5
+ echo "$as_me:14869: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_mbstate_t=yes
else
@@ -14339,11 +14878,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:14342: result: $cf_cv_mbstate_t" >&5
+echo "$as_me:14881: result: $cf_cv_mbstate_t" >&5
echo "${ECHO_T}$cf_cv_mbstate_t" >&6
if test "$cf_cv_mbstate_t" = yes ; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define NEED_WCHAR_H 1
EOF
@@ -14361,14 +14901,14 @@ if test "$cf_cv_mbstate_t" != unknown ; then
fi
# This is needed on Tru64 5.0 to declare wchar_t
-echo "$as_me:14364: checking if we must include wchar.h to declare wchar_t" >&5
+echo "$as_me:14904: checking if we must include wchar.h to declare wchar_t" >&5
echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
if test "${cf_cv_wchar_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14371 "configure"
+#line 14911 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14386,23 +14926,23 @@ wchar_t state
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14389: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14929: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14392: \$? = $ac_status" >&5
+ echo "$as_me:14932: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14395: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14935: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14398: \$? = $ac_status" >&5
+ echo "$as_me:14938: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_wchar_t=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line 14405 "configure"
+#line 14945 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14421,16 +14961,16 @@ wchar_t value
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14424: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14964: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14427: \$? = $ac_status" >&5
+ echo "$as_me:14967: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14430: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14970: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14433: \$? = $ac_status" >&5
+ echo "$as_me:14973: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_wchar_t=yes
else
@@ -14442,11 +14982,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:14445: result: $cf_cv_wchar_t" >&5
+echo "$as_me:14985: result: $cf_cv_wchar_t" >&5
echo "${ECHO_T}$cf_cv_wchar_t" >&6
if test "$cf_cv_wchar_t" = yes ; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define NEED_WCHAR_H 1
EOF
@@ -14464,14 +15005,14 @@ if test "$cf_cv_wchar_t" != unknown ; then
fi
# This is needed on Tru64 5.0 to declare wint_t
-echo "$as_me:14467: checking if we must include wchar.h to declare wint_t" >&5
+echo "$as_me:15008: checking if we must include wchar.h to declare wint_t" >&5
echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
if test "${cf_cv_wint_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14474 "configure"
+#line 15015 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14489,23 +15030,23 @@ wint_t state
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14492: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15033: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14495: \$? = $ac_status" >&5
+ echo "$as_me:15036: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14498: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15039: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14501: \$? = $ac_status" >&5
+ echo "$as_me:15042: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_wint_t=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line 14508 "configure"
+#line 15049 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14524,16 +15065,16 @@ wint_t value
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14527: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15068: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14530: \$? = $ac_status" >&5
+ echo "$as_me:15071: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14533: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15074: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14536: \$? = $ac_status" >&5
+ echo "$as_me:15077: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_wint_t=yes
else
@@ -14545,11 +15086,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:14548: result: $cf_cv_wint_t" >&5
+echo "$as_me:15089: result: $cf_cv_wint_t" >&5
echo "${ECHO_T}$cf_cv_wint_t" >&6
if test "$cf_cv_wint_t" = yes ; then
- cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
#define NEED_WCHAR_H 1
EOF
@@ -14566,12 +15108,12 @@ if test "$cf_cv_wint_t" != unknown ; then
NCURSES_OK_WINT_T=1
fi
-if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
+ if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
-echo "$as_me:14571: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15113: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 14574 "configure"
+#line 15116 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14589,16 +15131,16 @@ mbstate_t foo
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14592: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15134: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14595: \$? = $ac_status" >&5
+ echo "$as_me:15137: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14598: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15140: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14601: \$? = $ac_status" >&5
+ echo "$as_me:15143: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14607,31 +15149,32 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14610: result: $cf_result" >&5
+echo "$as_me:15152: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
- cat >>confdefs.h <<EOF
+cat >>confdefs.h <<EOF
#define $cf_result 1
EOF
else
- cat >>confdefs.h <<EOF
+
+cat >>confdefs.h <<EOF
#define mbstate_t long
EOF
fi
-fi
+ fi
-if test "$NCURSES_OK_WCHAR_T" = 0 ; then
+ if test "$NCURSES_OK_WCHAR_T" = 0 ; then
-echo "$as_me:14631: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15174: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 14634 "configure"
+#line 15177 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14649,16 +15192,16 @@ wchar_t foo
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14652: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15195: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14655: \$? = $ac_status" >&5
+ echo "$as_me:15198: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14658: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15201: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14661: \$? = $ac_status" >&5
+ echo "$as_me:15204: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14667,31 +15210,32 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14670: result: $cf_result" >&5
+echo "$as_me:15213: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
- cat >>confdefs.h <<EOF
+cat >>confdefs.h <<EOF
#define $cf_result 1
EOF
else
- cat >>confdefs.h <<EOF
+
+cat >>confdefs.h <<EOF
#define wchar_t long
EOF
fi
-fi
+ fi
-if test "$NCURSES_OK_WINT_T" = 0 ; then
+ if test "$NCURSES_OK_WINT_T" = 0 ; then
-echo "$as_me:14691: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15235: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 14694 "configure"
+#line 15238 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14709,16 +15253,16 @@ wint_t foo
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14712: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15256: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14715: \$? = $ac_status" >&5
+ echo "$as_me:15259: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14718: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15262: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14721: \$? = $ac_status" >&5
+ echo "$as_me:15265: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14727,30 +15271,32 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14730: result: $cf_result" >&5
+echo "$as_me:15274: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
- cat >>confdefs.h <<EOF
+cat >>confdefs.h <<EOF
#define $cf_result 1
EOF
else
- cat >>confdefs.h <<EOF
+
+cat >>confdefs.h <<EOF
#define wint_t long
EOF
fi
+ fi
fi
-echo "$as_me:14749: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15295: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 14753 "configure"
+#line 15299 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -14778,16 +15324,16 @@ void *foo = &(boolnames)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14781: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15327: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14784: \$? = $ac_status" >&5
+ echo "$as_me:15330: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14787: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15333: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14790: \$? = $ac_status" >&5
+ echo "$as_me:15336: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14796,7 +15342,7 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14799: result: $cf_result" >&5
+echo "$as_me:15345: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
@@ -14808,14 +15354,14 @@ cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz.
EOF
else
- echo "$as_me:14811: checking for data boolnames in library" >&5
+ echo "$as_me:15357: checking for data boolnames in library" >&5
echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
# BSD linkers insist on making weak linkage, but resolve at runtime.
if test "$cross_compiling" = yes; then
# cross-compiling
cat >conftest.$ac_ext <<_ACEOF
-#line 14818 "configure"
+#line 15364 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -14839,6 +15385,7 @@ main ()
do {
void *foo = &(boolnames);
+ fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
${cf_cv_main_return:-return}(foo == 0);
} while (0)
@@ -14847,16 +15394,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14850: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15397: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14853: \$? = $ac_status" >&5
+ echo "$as_me:15400: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14856: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15403: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14859: \$? = $ac_status" >&5
+ echo "$as_me:15406: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14868,7 +15415,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14871 "configure"
+#line 15418 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -14889,19 +15436,20 @@ extern char boolnames;
int main(void)
{
void *foo = &(boolnames);
+ fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
${cf_cv_main_return:-return}(foo == 0);
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:14896: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15444: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14899: \$? = $ac_status" >&5
+ echo "$as_me:15447: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:14901: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15449: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14904: \$? = $ac_status" >&5
+ echo "$as_me:15452: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14912,7 +15460,7 @@ cf_result=no
fi
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
- echo "$as_me:14915: result: $cf_result" >&5
+ echo "$as_me:15463: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
@@ -14925,11 +15473,11 @@ EOF
fi
fi
-echo "$as_me:14928: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15476: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 14932 "configure"
+#line 15480 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -14957,16 +15505,16 @@ void *foo = &(boolfnames)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14960: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15508: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14963: \$? = $ac_status" >&5
+ echo "$as_me:15511: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14966: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15514: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14969: \$? = $ac_status" >&5
+ echo "$as_me:15517: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14975,7 +15523,7 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14978: result: $cf_result" >&5
+echo "$as_me:15526: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
@@ -14987,14 +15535,14 @@ cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz
EOF
else
- echo "$as_me:14990: checking for data boolfnames in library" >&5
+ echo "$as_me:15538: checking for data boolfnames in library" >&5
echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
# BSD linkers insist on making weak linkage, but resolve at runtime.
if test "$cross_compiling" = yes; then
# cross-compiling
cat >conftest.$ac_ext <<_ACEOF
-#line 14997 "configure"
+#line 15545 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -15018,6 +15566,7 @@ main ()
do {
void *foo = &(boolfnames);
+ fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
${cf_cv_main_return:-return}(foo == 0);
} while (0)
@@ -15026,16 +15575,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15029: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15578: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:15032: \$? = $ac_status" >&5
+ echo "$as_me:15581: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:15035: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15584: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15038: \$? = $ac_status" >&5
+ echo "$as_me:15587: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -15047,7 +15596,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
-#line 15050 "configure"
+#line 15599 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -15068,19 +15617,20 @@ extern char boolfnames;
int main(void)
{
void *foo = &(boolfnames);
+ fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
${cf_cv_main_return:-return}(foo == 0);
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:15075: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15625: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:15078: \$? = $ac_status" >&5
+ echo "$as_me:15628: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:15080: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15630: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15083: \$? = $ac_status" >&5
+ echo "$as_me:15633: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -15091,7 +15641,7 @@ cf_result=no
fi
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
- echo "$as_me:15094: result: $cf_result" >&5
+ echo "$as_me:15644: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
@@ -15104,6 +15654,1287 @@ EOF
fi
fi
+if ( test "$GCC" = yes || test "$GXX" = yes )
+then
+echo "$as_me:15659: checking if you want to turn on gcc warnings" >&5
+echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
+
+# Check whether --enable-warnings or --disable-warnings was given.
+if test "${enable_warnings+set}" = set; then
+ enableval="$enable_warnings"
+ test "$enableval" != yes && enableval=no
+ if test "$enableval" != "no" ; then
+ with_warnings=yes
+ else
+ with_warnings=no
+ fi
+else
+ enableval=no
+ with_warnings=no
+
+fi;
+echo "$as_me:15676: result: $with_warnings" >&5
+echo "${ECHO_T}$with_warnings" >&6
+if test "$with_warnings" = "yes"
+then
+
+if test "$GCC" = yes
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test "$GCC" = yes
+then
+ { echo "$as_me:15699: checking for $CC __attribute__ directives..." >&5
+echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
+cat > conftest.$ac_ext <<EOF
+#line 15702 "${as_me:-configure}"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var) /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
+EOF
+ cf_printf_attribute=no
+ cf_scanf_attribute=no
+ for cf_attribute in scanf printf unused noreturn
+ do
+
+cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+ cf_directive="__attribute__(($cf_attribute))"
+ echo "checking for $CC $cf_directive" 1>&5
+
+ case $cf_attribute in #(vi
+ printf) #(vi
+ cf_printf_attribute=yes
+ cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+ ;;
+ scanf) #(vi
+ cf_scanf_attribute=yes
+ cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+ ;;
+ *) #(vi
+ cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE $cf_directive
+EOF
+ ;;
+ esac
+
+ if { (eval echo "$as_me:15751: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:15754: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ test -n "$verbose" && echo "$as_me:15756: result: ... $cf_attribute" >&5
+echo "${ECHO_T}... $cf_attribute" >&6
+ cat conftest.h >>confdefs.h
+ case $cf_attribute in #(vi
+ noreturn) #(vi
+
+cat >>confdefs.h <<EOF
+#define GCC_NORETURN $cf_directive
+EOF
+
+ ;;
+ printf) #(vi
+ cf_value='/* nothing */'
+ if test "$cf_printf_attribute" != no ; then
+ cf_value='__attribute__((format(printf,fmt,var)))'
+
+cat >>confdefs.h <<\EOF
+#define GCC_PRINTF 1
+EOF
+
+ fi
+
+cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) $cf_value
+EOF
+
+ ;;
+ scanf) #(vi
+ cf_value='/* nothing */'
+ if test "$cf_scanf_attribute" != no ; then
+ cf_value='__attribute__((format(scanf,fmt,var)))'
+
+cat >>confdefs.h <<\EOF
+#define GCC_SCANF 1
+EOF
+
+ fi
+
+cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) $cf_value
+EOF
+
+ ;;
+ unused) #(vi
+
+cat >>confdefs.h <<EOF
+#define GCC_UNUSED $cf_directive
+EOF
+
+ ;;
+ esac
+ fi
+ done
+else
+ fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
+
+INTEL_COMPILER=no
+
+if test "$GCC" = yes ; then
+ case $host_os in
+ linux*|gnu*)
+ echo "$as_me:15820: checking if this is really Intel C compiler" >&5
+echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
+ cf_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -no-gcc"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 15825 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:15842: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:15845: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:15848: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:15851: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ INTEL_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147"
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$cf_save_CFLAGS"
+ echo "$as_me:15862: result: $INTEL_COMPILER" >&5
+echo "${ECHO_T}$INTEL_COMPILER" >&6
+ ;;
+ esac
+fi
+
+CLANG_COMPILER=no
+
+if test "$GCC" = yes ; then
+ echo "$as_me:15871: checking if this is really Clang C compiler" >&5
+echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
+ cf_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Qunused-arguments"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 15876 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+#ifdef __clang__
+#else
+make an error
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:15893: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:15896: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:15899: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:15902: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ CLANG_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$cf_save_CFLAGS"
+ echo "$as_me:15913: result: $CLANG_COMPILER" >&5
+echo "${ECHO_T}$CLANG_COMPILER" >&6
+fi
+
+cat > conftest.$ac_ext <<EOF
+#line 15918 "${as_me:-configure}"
+int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
+EOF
+
+if test "$INTEL_COMPILER" = yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
+# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
+# remark #193: zero used for undefined preprocessing identifier
+# remark #593: variable "curs_sb_left_arrow" was set but never used
+# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
+# remark #869: parameter "tw" was never referenced
+# remark #981: operands are evaluated in unspecified order
+# warning #279: controlling expression is constant
+
+ { echo "$as_me:15935: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+ cf_save_CFLAGS="$CFLAGS"
+ EXTRA_CFLAGS="-Wall"
+ for cf_opt in \
+ wd1419 \
+ wd1683 \
+ wd1684 \
+ wd193 \
+ wd593 \
+ wd279 \
+ wd810 \
+ wd869 \
+ wd981
+ do
+ CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+ if { (eval echo "$as_me:15951: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:15954: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ test -n "$verbose" && echo "$as_me:15956: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+ fi
+ done
+ CFLAGS="$cf_save_CFLAGS"
+
+elif test "$GCC" = yes
+then
+ { echo "$as_me:15965: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+ cf_save_CFLAGS="$CFLAGS"
+ EXTRA_CFLAGS=
+ cf_warn_CONST=""
+ test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
+ cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
+ test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
+ for cf_opt in W Wall \
+ Wbad-function-cast \
+ Wcast-align \
+ Wcast-qual \
+ Wdeclaration-after-statement \
+ Wextra \
+ Winline \
+ Wmissing-declarations \
+ Wmissing-prototypes \
+ Wnested-externs \
+ Wpointer-arith \
+ Wshadow \
+ Wstrict-prototypes \
+ Wundef $cf_gcc_warnings $cf_warn_CONST
+ do
+ CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+ if { (eval echo "$as_me:15989: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:15992: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ test -n "$verbose" && echo "$as_me:15994: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+ case $cf_opt in #(vi
+ Wcast-qual) #(vi
+ CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
+ ;;
+ Winline) #(vi
+ case $GCC_VERSION in
+ [34].*)
+ test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
+
+echo "${as_me:-configure}:16005: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+
+ continue;;
+ esac
+ ;;
+ Wpointer-arith) #(vi
+ case $GCC_VERSION in
+ [12].*)
+ test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
+
+echo "${as_me:-configure}:16015: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+
+ continue;;
+ esac
+ ;;
+ esac
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+ fi
+ done
+ CFLAGS="$cf_save_CFLAGS"
+fi
+rm -rf conftest*
+
+fi
+fi
+
+echo "$as_me:16031: checking if you want to use dmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
+
+# Check whether --with-dmalloc or --without-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then
+ withval="$with_dmalloc"
+
+cat >>confdefs.h <<EOF
+#define USE_DMALLOC 1
+EOF
+
+ : ${with_cflags:=-g}
+ : ${with_no_leaks:=yes}
+ with_dmalloc=yes
+else
+ with_dmalloc=
+fi;
+echo "$as_me:16048: result: ${with_dmalloc:-no}" >&5
+echo "${ECHO_T}${with_dmalloc:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+ case .$CFLAGS in #(vi
+ .*-g*) #(vi
+ ;;
+ *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ case $cf_add_cflags in #(vi
+ -D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+ ;;
+ esac
+ ;;
+esac
+
+if test "$with_dmalloc" = yes ; then
+ echo "$as_me:16142: checking for dmalloc.h" >&5
+echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dmalloc_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 16148 "configure"
+#include "confdefs.h"
+#include <dmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:16152: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:16158: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_cv_header_dmalloc_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_header_dmalloc_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:16177: result: $ac_cv_header_dmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
+if test $ac_cv_header_dmalloc_h = yes; then
+
+echo "$as_me:16181: checking for dmalloc_debug in -ldmalloc" >&5
+echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
+if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldmalloc $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 16189 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dmalloc_debug ();
+int
+main ()
+{
+dmalloc_debug ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16208: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:16211: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:16214: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16217: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dmalloc_dmalloc_debug=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dmalloc_dmalloc_debug=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:16228: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
+if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
+ cat >>confdefs.h <<EOF
+#define HAVE_LIBDMALLOC 1
+EOF
+
+ LIBS="-ldmalloc $LIBS"
+
+fi
+
+fi
+
+fi
+
+echo "$as_me:16243: checking if you want to use dbmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
+
+# Check whether --with-dbmalloc or --without-dbmalloc was given.
+if test "${with_dbmalloc+set}" = set; then
+ withval="$with_dbmalloc"
+
+cat >>confdefs.h <<EOF
+#define USE_DBMALLOC 1
+EOF
+
+ : ${with_cflags:=-g}
+ : ${with_no_leaks:=yes}
+ with_dbmalloc=yes
+else
+ with_dbmalloc=
+fi;
+echo "$as_me:16260: result: ${with_dbmalloc:-no}" >&5
+echo "${ECHO_T}${with_dbmalloc:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+ case .$CFLAGS in #(vi
+ .*-g*) #(vi
+ ;;
+ *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ case $cf_add_cflags in #(vi
+ -D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+ ;;
+ esac
+ ;;
+esac
+
+if test "$with_dbmalloc" = yes ; then
+ echo "$as_me:16354: checking for dbmalloc.h" >&5
+echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dbmalloc_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 16360 "configure"
+#include "confdefs.h"
+#include <dbmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:16364: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:16370: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_cv_header_dbmalloc_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_header_dbmalloc_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:16389: result: $ac_cv_header_dbmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
+if test $ac_cv_header_dbmalloc_h = yes; then
+
+echo "$as_me:16393: checking for debug_malloc in -ldbmalloc" >&5
+echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
+if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldbmalloc $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 16401 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char debug_malloc ();
+int
+main ()
+{
+debug_malloc ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16420: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:16423: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:16426: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16429: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dbmalloc_debug_malloc=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dbmalloc_debug_malloc=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:16440: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
+if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
+ cat >>confdefs.h <<EOF
+#define HAVE_LIBDBMALLOC 1
+EOF
+
+ LIBS="-ldbmalloc $LIBS"
+
+fi
+
+fi
+
+fi
+
+echo "$as_me:16455: checking if you want to use valgrind for testing" >&5
+echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
+
+# Check whether --with-valgrind or --without-valgrind was given.
+if test "${with_valgrind+set}" = set; then
+ withval="$with_valgrind"
+
+cat >>confdefs.h <<EOF
+#define USE_VALGRIND 1
+EOF
+
+ : ${with_cflags:=-g}
+ : ${with_no_leaks:=yes}
+ with_valgrind=yes
+else
+ with_valgrind=
+fi;
+echo "$as_me:16472: result: ${with_valgrind:-no}" >&5
+echo "${ECHO_T}${with_valgrind:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+ case .$CFLAGS in #(vi
+ .*-g*) #(vi
+ ;;
+ *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ case $cf_add_cflags in #(vi
+ -D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+ ;;
+ esac
+ ;;
+esac
+
+echo "$as_me:16565: checking if you want to perform memory-leak testing" >&5
+echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
+
+# Check whether --enable-leaks or --disable-leaks was given.
+if test "${enable_leaks+set}" = set; then
+ enableval="$enable_leaks"
+ if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
+else
+ : ${with_no_leaks:=no}
+fi;
+echo "$as_me:16575: result: $with_no_leaks" >&5
+echo "${ECHO_T}$with_no_leaks" >&6
+
+if test "$with_no_leaks" = yes ; then
+
+cat >>confdefs.h <<\EOF
+#define NO_LEAKS 1
+EOF
+
+cat >>confdefs.h <<\EOF
+#define YY_NO_LEAKS 1
+EOF
+
+fi
+
+LD_RPATH_OPT=
+echo "$as_me:16591: checking for an rpath option" >&5
+echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
+case $cf_cv_system_name in #(vi
+irix*) #(vi
+ if test "$GCC" = yes; then
+ LD_RPATH_OPT="-Wl,-rpath,"
+ else
+ LD_RPATH_OPT="-rpath "
+ fi
+ ;;
+linux*|gnu*|k*bsd*-gnu) #(vi
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+openbsd[2-9].*|mirbsd*) #(vi
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+dragonfly*|freebsd*) #(vi
+ LD_RPATH_OPT="-rpath "
+ ;;
+netbsd*) #(vi
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+osf*|mls+*) #(vi
+ LD_RPATH_OPT="-rpath "
+ ;;
+solaris2*) #(vi
+ LD_RPATH_OPT="-R"
+ ;;
+*)
+ ;;
+esac
+echo "$as_me:16622: result: $LD_RPATH_OPT" >&5
+echo "${ECHO_T}$LD_RPATH_OPT" >&6
+
+case "x$LD_RPATH_OPT" in #(vi
+x-R*)
+ echo "$as_me:16627: checking if we need a space after rpath option" >&5
+echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
+ cf_save_LIBS="$LIBS"
+
+cf_add_libs="${LD_RPATH_OPT}$libdir"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+ for cf_add_2lib in $cf_add_libs
+ do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"
+ then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 16648 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16660: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:16663: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:16666: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16669: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_rpath_space=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_rpath_space=yes
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ LIBS="$cf_save_LIBS"
+ echo "$as_me:16679: result: $cf_rpath_space" >&5
+echo "${ECHO_T}$cf_rpath_space" >&6
+ test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+ ;;
+esac
+
+echo "$as_me:16685: checking if rpath-hack should be disabled" >&5
+echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
+
+# Check whether --enable-rpath-hack or --disable-rpath-hack was given.
+if test "${enable_rpath_hack+set}" = set; then
+ enableval="$enable_rpath_hack"
+ test "$enableval" != no && enableval=yes
+ if test "$enableval" != "yes" ; then
+ cf_disable_rpath_hack=yes
+ else
+ cf_disable_rpath_hack=no
+ fi
+else
+ enableval=yes
+ cf_disable_rpath_hack=no
+
+fi;
+echo "$as_me:16702: result: $cf_disable_rpath_hack" >&5
+echo "${ECHO_T}$cf_disable_rpath_hack" >&6
+if test "$cf_disable_rpath_hack" = no ; then
+
+echo "$as_me:16706: checking for updated LDFLAGS" >&5
+echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
+if test -n "$LD_RPATH_OPT" ; then
+ echo "$as_me:16709: result: maybe" >&5
+echo "${ECHO_T}maybe" >&6
+
+ for ac_prog in ldd
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:16716: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$cf_ldd_prog"; then
+ ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_cf_ldd_prog="$ac_prog"
+echo "$as_me:16731: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
+if test -n "$cf_ldd_prog"; then
+ echo "$as_me:16739: result: $cf_ldd_prog" >&5
+echo "${ECHO_T}$cf_ldd_prog" >&6
+else
+ echo "$as_me:16742: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$cf_ldd_prog" && break
+done
+test -n "$cf_ldd_prog" || cf_ldd_prog="no"
+
+ cf_rpath_list="/usr/lib /lib"
+ if test "$cf_ldd_prog" != no
+ then
+ cf_rpath_oops=
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 16756 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello");
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16768: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:16771: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:16774: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16777: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
+ cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+ # If we passed the link-test, but get a "not found" on a given library,
+ # this could be due to inept reconfiguration of gcc to make it only
+ # partly honor /usr/local/lib (or whatever). Sometimes this behavior
+ # is intentional, e.g., installing gcc in /usr/bin and suppressing the
+ # /usr/local libraries.
+ if test -n "$cf_rpath_oops"
+ then
+ for cf_rpath_src in $cf_rpath_oops
+ do
+ for cf_rpath_dir in \
+ /usr/local \
+ /usr/pkg \
+ /opt/sfw
+ do
+ if test -f $cf_rpath_dir/lib/$cf_rpath_src
+ then
+ test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
+
+echo "${as_me:-configure}:16805: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
+
+ LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
+ break
+ fi
+ done
+ done
+ fi
+ fi
+
+ test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:16817: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+
+test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:16821: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
+
+cf_rpath_dst=
+for cf_rpath_src in $LDFLAGS
+do
+ case $cf_rpath_src in #(vi
+ -L*) #(vi
+
+ # check if this refers to a directory which we will ignore
+ cf_rpath_skip=no
+ if test -n "$cf_rpath_list"
+ then
+ for cf_rpath_item in $cf_rpath_list
+ do
+ if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
+ then
+ cf_rpath_skip=yes
+ break
+ fi
+ done
+ fi
+
+ if test "$cf_rpath_skip" = no
+ then
+ # transform the option
+ if test "$LD_RPATH_OPT" = "-R " ; then
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
+ else
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
+ fi
+
+ # if we have not already added this, add it now
+ cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
+ if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
+ then
+ test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
+
+echo "${as_me:-configure}:16858: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+
+ EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+ fi
+ fi
+ ;;
+ esac
+ cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
+done
+LDFLAGS=$cf_rpath_dst
+
+test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:16871: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
+
+test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6
+
+echo "${as_me:-configure}:16875: testing ...checking LIBS $LIBS ..." 1>&5
+
+cf_rpath_dst=
+for cf_rpath_src in $LIBS
+do
+ case $cf_rpath_src in #(vi
+ -L*) #(vi
+
+ # check if this refers to a directory which we will ignore
+ cf_rpath_skip=no
+ if test -n "$cf_rpath_list"
+ then
+ for cf_rpath_item in $cf_rpath_list
+ do
+ if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
+ then
+ cf_rpath_skip=yes
+ break
+ fi
+ done
+ fi
+
+ if test "$cf_rpath_skip" = no
+ then
+ # transform the option
+ if test "$LD_RPATH_OPT" = "-R " ; then
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
+ else
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
+ fi
+
+ # if we have not already added this, add it now
+ cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
+ if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
+ then
+ test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
+
+echo "${as_me:-configure}:16912: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+
+ EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+ fi
+ fi
+ ;;
+ esac
+ cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
+done
+LIBS=$cf_rpath_dst
+
+test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6
+
+echo "${as_me:-configure}:16925: testing ...checked LIBS $LIBS ..." 1>&5
+
+ test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:16929: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+
+else
+ echo "$as_me:16932: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+
TEST_ARGS="$LIBS"
LIBS=
@@ -15188,7 +17019,7 @@ DEFS=-DHAVE_CONFIG_H
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:15191: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:17022: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
@@ -15320,7 +17151,7 @@ EOF
cat >>$CONFIG_STATUS <<EOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.52.20101002,
+configured by $0, generated by GNU Autoconf 2.52.20141204,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
@@ -15364,7 +17195,7 @@ cat >>$CONFIG_STATUS <<\EOF
echo "$ac_cs_version"; exit 0 ;;
--he | --h)
# Conflict between --help and --header
- { { echo "$as_me:15367: error: ambiguous option: $1
+ { { echo "$as_me:17198: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
@@ -15383,7 +17214,7 @@ Try \`$0 --help' for more information." >&2;}
ac_need_defaults=false;;
# This is an error.
- -*) { { echo "$as_me:15386: error: unrecognized option: $1
+ -*) { { echo "$as_me:17217: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
@@ -15402,7 +17233,7 @@ cat >&5 << _ACEOF
## Running config.status. ##
## ----------------------- ##
-This file was extended by $as_me 2.52.20101002, executed with
+This file was extended by $as_me 2.52.20141204, executed with
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
@@ -15419,7 +17250,9 @@ cat >>$CONFIG_STATUS <<EOF
#
AWK="$AWK"
+ECHO_CC="$ECHO_CC"
ECHO_LD="$ECHO_LD"
+SHOW_CC="$SHOW_LD"
EOF
@@ -15431,7 +17264,7 @@ do
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
"ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
- *) { { echo "$as_me:15434: error: invalid argument: $ac_config_target" >&5
+ *) { { echo "$as_me:17267: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
@@ -15490,6 +17323,7 @@ s,@program_transform_name@,$program_transform_name,;t t
s,@bindir@,$bindir,;t t
s,@sbindir@,$sbindir,;t t
s,@libexecdir@,$libexecdir,;t t
+s,@datarootdir@,$datarootdir,;t t
s,@datadir@,$datadir,;t t
s,@sysconfdir@,$sysconfdir,;t t
s,@sharedstatedir@,$sharedstatedir,;t t
@@ -15529,6 +17363,7 @@ s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@ac_ct_CC@,$ac_ct_CC,;t t
s,@EXEEXT@,$EXEEXT,;t t
s,@OBJEXT@,$OBJEXT,;t t
+s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
s,@CPP@,$CPP,;t t
s,@AWK@,$AWK,;t t
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
@@ -15541,6 +17376,7 @@ s,@ETAGS@,$ETAGS,;t t
s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
s,@MATH_LIB@,$MATH_LIB,;t t
+s,@top_builddir@,$top_builddir,;t t
s,@CC_G_OPT@,$CC_G_OPT,;t t
s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
@@ -15561,25 +17397,30 @@ s,@PTHREAD@,$PTHREAD,;t t
s,@TEST_ARGS@,$TEST_ARGS,;t t
s,@TEST_DEPS@,$TEST_DEPS,;t t
s,@TEST_LIBS@,$TEST_LIBS,;t t
-s,@TINFO_ARGS@,$TINFO_ARGS,;t t
+s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
+s,@TINFO_LIBS@,$TINFO_LIBS,;t t
s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
-s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
+s,@includesubdir@,$includesubdir,;t t
+s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
s,@ECHO_LT@,$ECHO_LT,;t t
s,@ECHO_LD@,$ECHO_LD,;t t
s,@RULE_CC@,$RULE_CC,;t t
s,@SHOW_CC@,$SHOW_CC,;t t
s,@ECHO_CC@,$ECHO_CC,;t t
-s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
+s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
-s,@PKG_CONFIG@,$PKG_CONFIG,;t t
-s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
+s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
s,@X_CFLAGS@,$X_CFLAGS,;t t
s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
s,@X_LIBS@,$X_LIBS,;t t
s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
-s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
+s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
+s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
+s,@cf_ldd_prog@,$cf_ldd_prog,;t t
+s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
CEOF
EOF
@@ -15694,7 +17535,7 @@ done; }
esac
if test x"$ac_file" != x-; then
- { echo "$as_me:15697: creating $ac_file" >&5
+ { echo "$as_me:17538: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
@@ -15712,7 +17553,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:15715: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:17556: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@@ -15725,13 +17566,45 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:15728: error: cannot find input file: $f" >&5
+ { { echo "$as_me:17569: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
esac
done` || { (exit 1); exit 1; }
EOF
+cat >>$CONFIG_STATUS <<\EOF
+ ac_warn_datarootdir=no
+ if test x"$ac_file" != x-; then
+ for ac_item in $ac_file_inputs
+ do
+ ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
+ if test -n "$ac_seen"; then
+ ac_used=`grep '@datarootdir@' $ac_item`
+ if test -z "$ac_used"; then
+ { echo "$as_me:17585: WARNING: datarootdir was used implicitly but not set:
+$ac_seen" >&5
+echo "$as_me: WARNING: datarootdir was used implicitly but not set:
+$ac_seen" >&2;}
+ ac_warn_datarootdir=yes
+ fi
+ fi
+ ac_seen=`grep '${datarootdir}' $ac_item`
+ if test -n "$ac_seen"; then
+ { echo "$as_me:17594: WARNING: datarootdir was used explicitly but not set:
+$ac_seen" >&5
+echo "$as_me: WARNING: datarootdir was used explicitly but not set:
+$ac_seen" >&2;}
+ ac_warn_datarootdir=yes
+ fi
+ done
+ fi
+
+if test "x$ac_warn_datarootdir" = xyes; then
+ ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
+fi
+
+EOF
cat >>$CONFIG_STATUS <<EOF
sed "$ac_vpsub
$extrasub
@@ -15746,11 +17619,35 @@ s,@INSTALL@,$ac_INSTALL,;t t
" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
rm -f $tmp/stdin
if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
+ cp $tmp/out $ac_file
+
+ for ac_name in prefix exec_prefix datarootdir
+ do
+ ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
+ if test -n "$ac_seen"; then
+ ac_init=`egrep '[ ]*'$ac_name'[ ]*=' $ac_file`
+ if test -z "$ac_init"; then
+ ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
+ { echo "$as_me:17631: WARNING: Variable $ac_name is used but was not set:
+$ac_seen" >&5
+echo "$as_me: WARNING: Variable $ac_name is used but was not set:
+$ac_seen" >&2;}
+ fi
+ fi
+ done
+ egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
+ egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
+ if test -s $tmp/out; then
+ ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
+ { echo "$as_me:17642: WARNING: Some variables may not be substituted:
+$ac_seen" >&5
+echo "$as_me: WARNING: Some variables may not be substituted:
+$ac_seen" >&2;}
+ fi
else
cat $tmp/out
- rm -f $tmp/out
fi
+ rm -f $tmp/out
done
EOF
@@ -15791,7 +17688,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
* ) ac_file_in=$ac_file.in ;;
esac
- test x"$ac_file" != x- && { echo "$as_me:15794: creating $ac_file" >&5
+ test x"$ac_file" != x- && { echo "$as_me:17691: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
# First look for the input files in the build tree, otherwise in the
@@ -15802,7 +17699,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:15805: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:17702: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@@ -15815,7 +17712,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:15818: error: cannot find input file: $f" >&5
+ { { echo "$as_me:17715: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
@@ -15873,7 +17770,7 @@ cat >>$CONFIG_STATUS <<\EOF
rm -f $tmp/in
if test x"$ac_file" != x-; then
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
- { echo "$as_me:15876: $ac_file is unchanged" >&5
+ { echo "$as_me:17773: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
@@ -15949,7 +17846,8 @@ do
\$(MODEL)/$N.o : \$(srcdir)/$N.c \\
\$(srcdir)/test.priv.h \\
ncurses_cfg.h
- @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
+ $SHOW_CC
+ $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
TEST_EOF
done
diff --git a/test/configure.in b/test/configure.in
index 5ffd3e8..d99456a 100644
--- a/test/configure.in
+++ b/test/configure.in
@@ -1,5 +1,5 @@
dnl***************************************************************************
-dnl Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+dnl Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1996, etc.
dnl
-dnl $Id: configure.in,v 1.90 2011/03/22 09:15:08 tom Exp $
+dnl $Id: configure.in,v 1.117 2014/09/20 21:03:23 tom Exp $
dnl This is a simple configuration-script for the ncurses test programs that
dnl allows the test-directory to be separately configured against a reference
dnl system (i.e., sysvr4 curses)
@@ -38,7 +38,7 @@ dnl It's only for testing purposes.
dnl
dnl See http://invisible-island.net/autoconf/ for additional information.
dnl ---------------------------------------------------------------------------
-AC_PREREQ(2.13.20020210)
+AC_PREREQ(2.52.20030208)
AC_INIT(ncurses.c)
AC_CONFIG_HEADER(ncurses_cfg.h:ncurses_tst.hin)
@@ -49,17 +49,18 @@ CF_CHECK_CACHE
AC_ARG_PROGRAM
AC_PROG_MAKE_SET
-AC_PROG_CC
+CF_PROG_CC
AC_PROG_CPP
AC_PROG_AWK
CF_PROG_INSTALL
CF_PROG_LINT
CF_MAKE_TAGS
-CF_MATH_LIB(MATH_LIB,sin(x))
+CF_MATH_LIB(MATH_LIB,pow(sin(x),x))
AC_SUBST(MATH_LIB)
dnl Things that we don't need (or must override) if we're not building ncurses
+CF_TOP_BUILDDIR
CC_G_OPT="-g" AC_SUBST(CC_G_OPT)
CC_SHARED_OPTS=unknown AC_SUBST(CC_SHARED_OPTS)
CPPFLAGS="$CPPFLAGS" AC_SUBST(CPPFLAGS)
@@ -81,9 +82,11 @@ PTHREAD="-lm" AC_SUBST(PTHREAD)
TEST_ARGS="" AC_SUBST(TEST_ARGS)
TEST_DEPS="" AC_SUBST(TEST_DEPS)
TEST_LIBS="" AC_SUBST(TEST_LIBS)
-TINFO_ARGS='$(LIBS_CURSES)' AC_SUBST(TINFO_ARGS)
+TINFO_LDFLAGS='' AC_SUBST(TINFO_LDFLAGS)
+TINFO_LIBS='$(LIBS_CURSES)' AC_SUBST(TINFO_LIBS)
cf_cv_abi_version="" AC_SUBST(cf_cv_abi_version)
cf_cv_rel_version="" AC_SUBST(cf_cv_rel_version)
+includesubdir="" AC_SUBST(includesubdir)
cf_cv_screen=curses
cf_cv_libtype=
@@ -91,55 +94,38 @@ cf_cv_libtype=
AC_EXEEXT
AC_OBJEXT
-CF_ANSI_CC_REQD
CF_GCC_ATTRIBUTES
CF_XOPEN_SOURCE
-AC_C_CONST
CF_SIG_ATOMIC_T
+dnl ---------------------------------------------------------------------------
+CF_HELP_MESSAGE(General Options:)
+CF_PKG_CONFIG
CF_DISABLE_ECHO
-CF_ENABLE_WARNINGS
-
-CF_DISABLE_LEAKS
-CF_WITH_CURSES_DIR
-
-dnl SunOS 4.x
-AC_ARG_WITH(5lib,
- [ --with-5lib use SunOS sysv-libraries],
- [LIBS="-L/usr/5lib $LIBS"
- CPPFLAGS="$CPPFLAGS -I/usr/5include"])
dnl ---------------------------------------------------------------------------
-dnl NcursesW, installed in conventional location
-AC_ARG_WITH(ncursesw,
- [ --with-ncursesw use wide ncurses-libraries (installed)],
- [cf_cv_screen=ncursesw],[
+CF_HELP_MESSAGE(Curses Version-dependent Options:)
+CF_NCURSES_WRAP_PREFIX
-dnl Ncurses, installed in conventional location
-AC_ARG_WITH(ncurses,
- [ --with-ncurses use ncurses-libraries (installed)],
- [cf_cv_screen=ncurses],[
+AC_MSG_CHECKING(if you want to check for wide-character functions)
+CF_ARG_DISABLE(widec,
+ [ --disable-widec disable checks for wide-character functions],
+ cf_enable_widec=no,
+ cf_enable_widec=yes,
+ yes)
+AC_MSG_RESULT($cf_enable_widec)
-AC_ARG_WITH(pdcurses,
- [ --with-pdcurses compile/link with pdcurses X11 library],
- [cf_cv_screen=pdcurses])])])
+dnl ---------------------------------------------------------------------------
+CF_HELP_MESSAGE(Curses Version-dependent Options:)
+CF_WITH_NCURSES_ETC
case $cf_cv_screen in
-curses)
- CF_CURSES_CONFIG
+curses|curses_*)
CF_NETBSD_FORM_H
CF_NETBSD_MENU_H
;;
-ncurses)
- CF_NCURSES_CONFIG
- ;;
ncursesw)
cf_cv_libtype=w
- CF_UTF8_LIB
- CF_NCURSES_CONFIG(ncursesw)
- ;;
-pdcurses) #(vi
- CF_PDCURSES_X11
;;
esac
@@ -153,9 +139,12 @@ pdcurses) #(vi
;;
*)
# look for curses-related libraries
- AC_CHECK_LIB(panel$cf_cv_libtype,new_panel)
- AC_CHECK_LIB(menu$cf_cv_libtype,menu_driver)
- AC_CHECK_LIB(form$cf_cv_libtype,form_driver)
+ : ${cf_panel_lib:=panel}
+ : ${cf_menu_lib:=menu}
+ : ${cf_form_lib:=form}
+ AC_CHECK_LIB($cf_panel_lib$cf_cv_libtype,new_panel)
+ AC_CHECK_LIB($cf_menu_lib$cf_cv_libtype,menu_driver)
+ AC_CHECK_LIB($cf_form_lib$cf_cv_libtype,form_driver)
# look for curses-related headers
AC_CHECK_HEADERS( \
@@ -169,8 +158,6 @@ pdcurses) #(vi
;;
esac
-AC_TYPE_SIGNAL
-
AC_STDC_HEADERS
AC_HEADER_TIME
AC_CHECK_HEADERS( \
@@ -185,20 +172,32 @@ termios.h \
unistd.h \
)
+CF_GETOPT_HEADER
+
AC_CHECK_FUNCS( \
+getopt \
gettimeofday \
+)
+
+if test "x$ac_cv_func_getopt" = xno; then
+ AC_MSG_ERROR(getopt is required for building programs)
+fi
+
+if test "$cf_enable_widec" = yes; then
+AC_CHECK_FUNCS( \
mblen \
mbrlen \
mbrtowc \
mbsrtowcs \
mbstowcs \
mbtowc \
-strdup \
wcsrtombs \
wcstombs \
)
+fi
CF_CURSES_FUNCS( \
+assume_default_colors \
chgat \
color_set \
filter \
@@ -225,61 +224,108 @@ tigetnum \
tigetstr \
typeahead \
use_default_colors \
-vw_printw \
+use_env \
+use_extended_names \
+use_screen \
+use_window \
+vid_puts \
+vidputs \
vsscanf \
+vw_printw \
wchgat \
winsstr \
wresize \
wsyncdown \
)
+CF_TPUTS_PROTO
CF_NCURSES_EXT_FUNCS
-AC_CACHE_CHECK(for wide-character functions,cf_cv_widechar_funcs,[
-AC_TRY_LINK([
+if test "$cf_enable_widec" = yes
+then
+ # workaround for systems with ncurses before 20111029, due to change of
+ # feature test macro from _XPG5 to _XOPEN_SOURCE
+ if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
+ then
+ cf_define_xpg5=no
+ AC_MSG_CHECKING(if _XPG5 should be defined to enable wide-characters)
+
+ AC_TRY_COMPILE([
+#include <${cf_cv_ncurses_header:-curses.h}>],
+ [int x = _XPG5],,
+ [cf_save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -D_XPG5"
+ AC_TRY_COMPILE([
#include <${cf_cv_ncurses_header:-curses.h}>],
-[
- static wchar_t src_wchar[2];
- static cchar_t dst_cchar;
- setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
- ],
- [cf_cv_widechar_funcs=yes],
- [cf_cv_widechar_funcs=no])
-])
-if test "$cf_cv_widechar_funcs" != no ; then
- AC_DEFINE(USE_WIDEC_SUPPORT,1)
+ [int x = _XPG5],
+ [cf_define_xpg5=yes])
+ CPPFLAGS="$cf_save_cppflags"])
+ AC_MSG_RESULT($cf_define_xpg5)
+
+ if test "$cf_define_xpg5" = yes
+ then
+ CPPFLAGS="$CPPFLAGS -D_XPG5"
+ fi
+ fi
+
+ AC_CACHE_CHECK(for wide-character functions,cf_cv_widechar_funcs,[
+ AC_TRY_LINK([
+#include <${cf_cv_ncurses_header:-curses.h}>],
+ [
+ static wchar_t src_wchar[2];
+ static cchar_t dst_cchar;
+ setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
+ ],
+ [cf_cv_widechar_funcs=yes],
+ [cf_cv_widechar_funcs=no])
+ ])
+ if test "$cf_cv_widechar_funcs" != no ; then
+ AC_DEFINE(USE_WIDEC_SUPPORT,1,[Define to 1 to enable wide-character support in (n)curses])
+ else
+ AC_DEFINE(USE_WIDEC_SUPPORT,0)
+ fi
else
AC_DEFINE(USE_WIDEC_SUPPORT,0)
fi
-AC_FUNC_VFORK
CF_SYS_TIME_SELECT
CF_FUNC_CURSES_VERSION
+
CF_CURSES_ACS_MAP
-CF_CURSES_WACS_MAP
-CF_CURSES_WACS_SYMBOLS
+if test "$cf_enable_widec" = yes; then
+ CF_CURSES_WACS_MAP
+ CF_CURSES_WACS_SYMBOLS
+fi
CF_CURSES_CHECK_TYPE(attr_t,long)
-CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T, NCURSES_OK_MBSTATE_T)
-CF_WCHAR_TYPE(wchar_t, NCURSES_WCHAR_T, NCURSES_OK_WCHAR_T)
-CF_WCHAR_TYPE(wint_t, NCURSES_WINT_T, NCURSES_OK_WINT_T)
+if test "$cf_enable_widec" = yes; then
+ CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T, NCURSES_OK_MBSTATE_T)
+ CF_WCHAR_TYPE(wchar_t, NCURSES_WCHAR_T, NCURSES_OK_WCHAR_T)
+ CF_WCHAR_TYPE(wint_t, NCURSES_WINT_T, NCURSES_OK_WINT_T)
-if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
- CF_CURSES_CHECK_TYPE(mbstate_t,long)
-fi
+ if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
+ CF_CURSES_CHECK_TYPE(mbstate_t,long)
+ fi
-if test "$NCURSES_OK_WCHAR_T" = 0 ; then
- CF_CURSES_CHECK_TYPE(wchar_t,long)
-fi
+ if test "$NCURSES_OK_WCHAR_T" = 0 ; then
+ CF_CURSES_CHECK_TYPE(wchar_t,long)
+ fi
-if test "$NCURSES_OK_WINT_T" = 0 ; then
- CF_CURSES_CHECK_TYPE(wint_t,long)
+ if test "$NCURSES_OK_WINT_T" = 0 ; then
+ CF_CURSES_CHECK_TYPE(wint_t,long)
+ fi
fi
CF_CURSES_CHECK_DATA(boolnames)
CF_CURSES_CHECK_DATA(boolfnames)
+dnl ---------------------------------------------------------------------------
+CF_HELP_MESSAGE(Testing/development Options:)
+CF_ENABLE_WARNINGS
+CF_DISABLE_LEAKS
+CF_DISABLE_RPATH_HACK
+
TEST_ARGS="$LIBS"
LIBS=
@@ -302,7 +348,8 @@ do
\$(MODEL)/$N.o : \$(srcdir)/$N.c \\
\$(srcdir)/test.priv.h \\
ncurses_cfg.h
- @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
+ $SHOW_CC
+ $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
TEST_EOF
done
@@ -317,5 +364,7 @@ TEST_EOF
fi
],[
AWK="$AWK"
+ECHO_CC="$ECHO_CC"
ECHO_LD="$ECHO_LD"
+SHOW_CC="$SHOW_LD"
],cat)
diff --git a/test/demo_defkey.c b/test/demo_defkey.c
index ac6dc2d..045c2c7 100644
--- a/test/demo_defkey.c
+++ b/test/demo_defkey.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2002-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 2002-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_defkey.c,v 1.20 2010/11/14 00:59:35 tom Exp $
+ * $Id: demo_defkey.c,v 1.22 2013/09/28 22:02:17 tom Exp $
*
* Demonstrate the define_key() function.
* Thomas Dickey - 2002/11/23
@@ -106,7 +106,7 @@ visible(const char *string)
for (pass = 0; pass < 2; ++pass) {
for (n = 0; string[n] != '\0'; ++n) {
char temp[80];
- strcpy(temp, visichar(string[n]));
+ strncpy(temp, visichar(string[n]), sizeof(temp) - 2);
if (pass)
strcat(result, temp);
else
@@ -116,7 +116,7 @@ visible(const char *string)
result = typeCalloc(char, need);
}
} else {
- result = typeCalloc(char, 1);
+ result = typeCalloc(char, (size_t) 1);
}
return result;
}
@@ -186,9 +186,9 @@ duplicate(WINDOW *win, NCURSES_CONST char *name, int code)
const char *prefix = 0;
char temp[BUFSIZ];
- if (!strncmp(value, "\033[", 2)) {
+ if (!strncmp(value, "\033[", (size_t) 2)) {
prefix = "\033O";
- } else if (!strncmp(value, "\033O", 2)) {
+ } else if (!strncmp(value, "\033O", (size_t) 2)) {
prefix = "\033[";
}
if (prefix != 0) {
diff --git a/test/demo_forms.c b/test/demo_forms.c
index afa4ed3..97125e3 100644
--- a/test/demo_forms.c
+++ b/test/demo_forms.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2003-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_forms.c,v 1.38 2011/01/15 18:15:11 tom Exp $
+ * $Id: demo_forms.c,v 1.50 2014/10/10 00:38:00 tom Exp $
*
* Demonstrate a variety of functions from the form library.
* Thomas Dickey - 2003/4/26
@@ -70,14 +70,116 @@ set_max_field -
#include <edit_field.h>
+typedef struct {
+ char *name;
+ char *value;
+} MY_DATA;
+
+static MY_DATA *my_data;
+
static int d_option = 0;
static int j_value = 0;
static int m_value = 0;
static int o_value = 0;
static char *t_value = 0;
+static void
+failed(const char *s)
+{
+ perror(s);
+ ExitProgram(EXIT_FAILURE);
+}
+
+static void
+chomp(char *value)
+{
+ size_t have = strlen(value);
+ while (have != 0 && (value[have - 1] == '\n' || value[have - 1] == '\r')) {
+ value[--have] = '\0';
+ }
+}
+
+static int
+trimmed(const char *value)
+{
+ int result = (int) strlen(value);
+ while (result > 0 && isspace(UChar(value[result - 1]))) {
+ --result;
+ }
+ return result;
+}
+
+static char *
+get_data(const char *name)
+{
+ char *result = t_value;
+ if (my_data != 0) {
+ int n;
+ for (n = 0; my_data[n].name != 0; ++n) {
+ if (!strcmp(name, my_data[n].name)) {
+ result = my_data[n].value;
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+/*
+ * Read (possibly) multi-line data with name+value pairs.
+ */
+static void
+read_data(const char *filename)
+{
+ FILE *fp = fopen(filename, "r");
+
+ if (fp != 0) {
+ char buffer[BUFSIZ];
+ char *colon;
+ int more = 0;
+ int item = 0;
+
+ my_data = typeCalloc(MY_DATA, (size_t) 100); /* FIXME */
+ while (fgets(buffer, sizeof(buffer), fp) != 0) {
+ chomp(buffer);
+ if (more) {
+ if (strcmp(buffer, ".")) {
+ char *prior = my_data[more - 1].value;
+ size_t need = strlen(buffer) + 2 + strlen(prior);
+ char *value = typeRealloc(char, need, prior);
+ if (value == 0)
+ failed("realloc");
+ strcat(value, "\n");
+ strcat(value, buffer);
+ my_data[more - 1].value = value;
+ } else {
+ more = 0;
+ }
+ } else if (*buffer == '#') {
+ continue;
+ } else if ((colon = strchr(buffer, ':')) != 0) {
+ char *name;
+ char *value;
+ *colon++ = '\0';
+ name = strdup(buffer);
+ value = strdup(colon);
+ if (name == 0 || value == 0)
+ failed("strdup");
+ my_data[item].name = name;
+ my_data[item].value = value;
+ more = ++item;
+ } else {
+ failed("expected a colon");
+ }
+ }
+ fclose(fp);
+ } else {
+ failed(filename);
+ }
+}
+
static FIELD *
-make_label(int frow, int fcol, NCURSES_CONST char *label)
+make_label(const char *label, int frow, int fcol)
{
FIELD *f = new_field(1, (int) strlen(label), frow, fcol, 0, 0);
@@ -92,13 +194,11 @@ make_label(int frow, int fcol, NCURSES_CONST char *label)
* Define each field with an extra one, for reflecting "actual" text.
*/
static FIELD *
-make_field(int frow, int fcol, int rows, int cols)
+make_field(const char *label, int frow, int fcol, int rows, int cols)
{
FIELD *f = new_field(rows, cols, frow, fcol, o_value, 1);
if (f) {
- FieldAttrs *ptr;
-
set_field_back(f, A_UNDERLINE);
/*
* If -j and -d options are combined, -j loses. It is documented in
@@ -108,8 +208,8 @@ make_field(int frow, int fcol, int rows, int cols)
set_field_just(f, j_value);
if (d_option) {
if (has_colors()) {
- set_field_fore(f, COLOR_PAIR(2));
- set_field_back(f, A_UNDERLINE | COLOR_PAIR(3));
+ set_field_fore(f, (chtype) COLOR_PAIR(2));
+ set_field_back(f, (A_UNDERLINE | (chtype) COLOR_PAIR(3)));
} else {
set_field_fore(f, A_BOLD);
}
@@ -121,17 +221,7 @@ make_field(int frow, int fcol, int rows, int cols)
set_max_field(f, m_value);
}
- /*
- * The userptr is used in edit_field.c's inactive_field().
- */
- ptr = (FieldAttrs *) field_userptr(f);
- if (ptr == 0) {
- ptr = typeCalloc(FieldAttrs, 1);
- ptr->background = field_back(f);
- }
- set_field_userptr(f, (void *) ptr);
- if (t_value)
- set_field_buffer(f, 0, t_value);
+ init_edit_field(f, get_data(label));
}
return (f);
}
@@ -153,10 +243,10 @@ display_form(FORM * f)
set_form_sub(f, derwin(w, rows, cols, 1, 2));
box(w, 0, 0);
keypad(w, TRUE);
- }
- if (post_form(f) != E_OK)
- wrefresh(w);
+ if (post_form(f) != E_OK)
+ wrefresh(w);
+ }
}
static void
@@ -257,7 +347,7 @@ show_current_field(WINDOW *win, FORM * form)
int currow, curcol;
if (has_colors()) {
- wbkgd(win, COLOR_PAIR(1));
+ wbkgd(win, (chtype) COLOR_PAIR(1));
}
werase(win);
form_getyx(form, currow, curcol);
@@ -309,25 +399,28 @@ show_current_field(WINDOW *win, FORM * form)
}
waddch(win, ' ');
- (void) wattrset(win, field_fore(field));
+ (void) wattrset(win, AttrArg(field_fore(field), 0));
waddstr(win, "fore");
- wattroff(win, field_fore(field));
+ wattroff(win, (int) field_fore(field));
waddch(win, '/');
- (void) wattrset(win, field_back(field));
+ (void) wattrset(win, AttrArg(field_back(field), 0));
waddstr(win, "back");
- wattroff(win, field_back(field));
+ wattroff(win, (int) field_back(field));
- wprintw(win, ", pad '%c'",
- field_pad(field));
+ wprintw(win, ", pad '%c'", field_pad(field));
waddstr(win, "\n");
for (nbuf = 0; nbuf <= 2; ++nbuf) {
if ((buffer = field_buffer(field, nbuf)) != 0) {
wprintw(win, "buffer %d:", nbuf);
(void) wattrset(win, A_REVERSE);
- waddstr(win, buffer);
+ if (nbuf) {
+ waddnstr(win, buffer, trimmed(buffer));
+ } else {
+ waddstr(win, buffer);
+ }
wattroff(win, A_REVERSE);
waddstr(win, "\n");
}
@@ -341,11 +434,12 @@ demo_forms(void)
{
WINDOW *w;
FORM *form;
- FIELD *f[100]; /* FIXME memset to zero */
+ FIELD *f[100]; /* will memset to zero */
int finished = 0, c;
unsigned n = 0;
int pg;
WINDOW *also;
+ const char *fname;
#ifdef NCURSES_MOUSE_VERSION
mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
@@ -363,66 +457,76 @@ demo_forms(void)
for (pg = 0; pg < 4; ++pg) {
char label[80];
sprintf(label, "Sample Form Page %d", pg + 1);
- f[n++] = make_label(0, 15, label);
+ f[n++] = make_label(label, 0, 15);
set_new_page(f[n - 1], TRUE);
switch (pg) {
default:
- f[n++] = make_label(2, 0, "Last Name");
- f[n++] = make_field(3, 0, 1, 18);
+ fname = "Last Name";
+ f[n++] = make_label(fname, 2, 0);
+ f[n++] = make_field(fname, 3, 0, 1, 18);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
- f[n++] = make_label(2, 20, "First Name");
- f[n++] = make_field(3, 20, 1, 12);
+ fname = "First Name";
+ f[n++] = make_label(fname, 2, 20);
+ f[n++] = make_field(fname, 3, 20, 1, 12);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
- f[n++] = make_label(2, 34, "Middle Name");
- f[n++] = make_field(3, 34, 1, 12);
+ fname = "Middle Name";
+ f[n++] = make_label(fname, 2, 34);
+ f[n++] = make_field(fname, 3, 34, 1, 12);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
break;
case 1:
- f[n++] = make_label(2, 0, "Last Name");
- f[n++] = make_field(3, 0, 1, 18);
+ fname = "Last Name";
+ f[n++] = make_label(fname, 2, 0);
+ f[n++] = make_field(fname, 3, 0, 1, 18);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
- f[n++] = make_label(2, 20, "First Name");
- f[n++] = make_field(3, 20, 1, 12);
+ fname = "First Name";
+ f[n++] = make_label(fname, 2, 20);
+ f[n++] = make_field(fname, 3, 20, 1, 12);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
- f[n++] = make_label(2, 34, "MI");
- f[n++] = make_field(3, 34, 1, 1);
+ fname = "MI";
+ f[n++] = make_label(fname, 2, 34);
+ f[n++] = make_field(fname, 3, 34, 1, 1);
set_field_pad(f[n - 1], '?');
set_field_type(f[n - 1], TYPE_ALPHA, 1);
break;
case 2:
- f[n++] = make_label(2, 0, "Host Name");
- f[n++] = make_field(3, 0, 1, 18);
+ fname = "Host Name";
+ f[n++] = make_label(fname, 2, 0);
+ f[n++] = make_field(fname, 3, 0, 1, 24);
set_field_type(f[n - 1], TYPE_ALNUM, 1);
#ifdef NCURSES_VERSION
- f[n++] = make_label(2, 20, "IP Address");
- f[n++] = make_field(3, 20, 1, 12);
+ fname = "IP Address";
+ f[n++] = make_label(fname, 2, 26);
+ f[n++] = make_field(fname, 3, 26, 1, 16);
set_field_type(f[n - 1], TYPE_IPV4, 1);
#endif
break;
case 3:
- f[n++] = make_label(2, 0, "Four digits");
- f[n++] = make_field(3, 0, 1, 18);
+ fname = "Four digits";
+ f[n++] = make_label(fname, 2, 0);
+ f[n++] = make_field(fname, 3, 0, 1, 18);
set_field_type(f[n - 1], TYPE_INTEGER, 4, 0, 0);
- f[n++] = make_label(2, 20, "Numeric");
- f[n++] = make_field(3, 20, 1, 12);
+ fname = "Numeric";
+ f[n++] = make_label(fname, 2, 20);
+ f[n++] = make_field(fname, 3, 20, 1, 12);
set_field_type(f[n - 1], TYPE_NUMERIC, 3, -10000.0, 100000000.0);
break;
}
- f[n++] = make_label(5, 0, "Comments");
- f[n++] = make_field(6, 0, 4, 46);
- set_field_buffer(f[n - 1], 0, "HELLO\nWORLD!");
- set_field_buffer(f[n - 1], 1, "Hello\nWorld!");
+ fname = "Comments";
+ f[n++] = make_label(fname, 5, 0);
+ f[n++] = make_field(fname, 6, 0, 4, 46);
+ init_edit_field(f[n - 1], get_data(fname));
}
f[n] = (FIELD *) 0;
@@ -471,7 +575,7 @@ usage(void)
{
static const char *tbl[] =
{
- "Usage: demo_forms [options]"
+ "Usage: demo_forms [options] [data file]"
,""
," -d make fields dynamic"
," -j value justify (1=left, 2=center, 3=right)"
@@ -517,6 +621,9 @@ main(int argc, char *argv[])
}
}
+ while (optind < argc) {
+ read_data(argv[optind++]);
+ }
initscr();
cbreak();
@@ -531,7 +638,7 @@ main(int argc, char *argv[])
init_pair(1, COLOR_WHITE, COLOR_BLUE);
init_pair(2, COLOR_GREEN, COLOR_BLACK);
init_pair(3, COLOR_CYAN, COLOR_BLACK);
- bkgd(COLOR_PAIR(1));
+ bkgd((chtype) COLOR_PAIR(1));
refresh();
}
@@ -540,6 +647,7 @@ main(int argc, char *argv[])
endwin();
ExitProgram(EXIT_SUCCESS);
}
+
#else
int
main(void)
diff --git a/test/demo_forms.txt b/test/demo_forms.txt
new file mode 100644
index 0000000..0763fc0
--- /dev/null
+++ b/test/demo_forms.txt
@@ -0,0 +1,20 @@
+# $Id: demo_forms.txt,v 1.3 2013/06/08 14:10:15 tom Exp $
+First Name:John
+.
+Middle Name:Don
+.
+MI:D
+.
+Last Name:Smith
+.
+Comments:Hello
+World!
+.
+Host Name:localhost@localdomain
+.
+IP Address:192.168.1.100
+.
+Four digits:1234
+.
+Numeric:32768
+.
diff --git a/test/demo_menus.c b/test/demo_menus.c
index 4f75807..ccd48b0 100644
--- a/test/demo_menus.c
+++ b/test/demo_menus.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2005-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 2005-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_menus.c,v 1.32 2011/01/15 20:02:47 tom Exp $
+ * $Id: demo_menus.c,v 1.54 2014/09/05 08:34:06 tom Exp $
*
* Demonstrate a variety of functions from the menu library.
* Thomas Dickey - 2005/4/9
@@ -38,7 +38,6 @@ item_opts -
item_opts_off -
item_opts_on -
item_term -
-item_userptr -
item_visible -
menu_back -
menu_fore -
@@ -49,22 +48,16 @@ menu_opts -
menu_pad -
menu_request_by_name -
menu_request_name -
-menu_sub -
menu_term -
menu_userptr -
set_current_item -
-set_item_init -
set_item_opts -
-set_item_term -
-set_item_userptr -
set_menu_grey -
-set_menu_init -
set_menu_items -
set_menu_opts -
set_menu_pad -
set_menu_pattern -
set_menu_spacing -
-set_menu_term -
set_menu_userptr -
set_top_row -
top_row -
@@ -103,23 +96,23 @@ typedef enum {
#define MENU_Y 1
+typedef struct {
+ NCURSES_CONST char *name;
+ void (*func) (int);
+ unsigned mask;
+} MENU_DATA;
+
+static void call_files(int);
+
static MENU *mpBanner;
static MENU *mpFile;
static MENU *mpSelect;
+static WINDOW *status;
+
static bool loaded_file = FALSE;
-#if !HAVE_STRDUP
-#define strdup my_strdup
-static char *
-strdup(char *s)
-{
- char *p = typeMalloc(char, strlen(s) + 1);
- if (p)
- strcpy(p, s);
- return (p);
-}
-#endif /* not HAVE_STRDUP */
+static char empty[1];
/* Common function to allow ^T to toggle trace-mode in the middle of a test
* so that trace-files can be made smaller.
@@ -207,6 +200,48 @@ menu_offset(MenuNo number)
return result;
}
+static void
+my_menu_init(MENU * menu)
+{
+ Trace(("called MenuHook my_menu_init"));
+ mvwprintw(status, 2, 0, "menu_init %p", (void *) menu);
+ wclrtoeol(status);
+ wrefresh(status);
+}
+
+static void
+my_menu_term(MENU * menu)
+{
+ Trace(("called MenuHook my_menu_term"));
+ mvwprintw(status, 2, 0, "menu_term %p", (void *) menu);
+ wclrtoeol(status);
+ wrefresh(status);
+}
+
+static void
+my_item_init(MENU * menu)
+{
+ ITEM *item = current_item(menu);
+ const char *name = item_name(item);
+
+ Trace(("called MenuHook my_item_init (%s)", name));
+ mvwprintw(status, 2, 0, "item_init %s", name);
+ wclrtoeol(status);
+ wrefresh(status);
+}
+
+static void
+my_item_term(MENU * menu)
+{
+ ITEM *item = current_item(menu);
+ const char *name = item_name(item);
+
+ Trace(("called MenuHook my_item_term (%s)", name));
+ mvwprintw(status, 2, 0, "item_term %s", name);
+ wclrtoeol(status);
+ wrefresh(status);
+}
+
static MENU *
menu_create(ITEM ** items, int count, int ncols, MenuNo number)
{
@@ -225,8 +260,8 @@ menu_create(ITEM ** items, int count, int ncols, MenuNo number)
result = new_menu(items);
if (has_colors()) {
- set_menu_fore(result, COLOR_PAIR(1));
- set_menu_back(result, COLOR_PAIR(2));
+ set_menu_fore(result, (chtype) COLOR_PAIR(1));
+ set_menu_back(result, (chtype) COLOR_PAIR(2));
}
set_menu_format(result, maxrow, maxcol);
@@ -252,6 +287,10 @@ menu_create(ITEM ** items, int count, int ncols, MenuNo number)
post_menu(result);
+ set_menu_init(result, my_menu_init);
+ set_menu_term(result, my_menu_term);
+ set_item_init(result, my_item_init);
+ set_item_term(result, my_item_term);
return result;
}
@@ -278,15 +317,18 @@ menu_destroy(MENU * m)
if ((count > 0) && (m == mpSelect)) {
if (blob && loaded_file) {
Trace(("freeing blob %p", blob));
- free((char *) blob);
+ free((void *) blob);
}
free(items);
+ items = 0;
}
#ifdef TRACE
if ((count > 0) && (m == mpTrace)) {
ITEM **ip = items;
- while (*ip)
- free(*ip++);
+ if (ip != 0) {
+ while (*ip)
+ free(*ip++);
+ }
}
#endif
}
@@ -305,21 +347,24 @@ menu_display(MENU * m)
static void
build_file_menu(MenuNo number)
{
- static CONST_MENUS char *labels[] =
+ static MENU_DATA table[] =
{
- "Exit",
- (char *) 0
+ {"Exit", call_files, 0},
+ {(char *) 0, 0, 0}
};
- static ITEM *items[SIZEOF(labels)];
+ static ITEM *items[SIZEOF(table)];
ITEM **ip = items;
- CONST_MENUS char **ap;
+ int n;
- for (ap = labels; *ap; ap++)
- *ip++ = new_item(*ap, "");
+ for (n = 0; table[n].name != 0; ++n) {
+ *ip = new_item(table[n].name, empty);
+ set_item_userptr(*ip, (void *) &table[n]);
+ ++ip;
+ }
*ip = (ITEM *) 0;
- mpFile = menu_create(items, SIZEOF(labels) - 1, 1, number);
+ mpFile = menu_create(items, SIZEOF(table) - 1, 1, number);
}
static int
@@ -331,31 +376,40 @@ perform_file_menu(int cmd)
/*****************************************************************************/
static void
+call_select(int code)
+{
+ (void) code;
+ Trace(("Selected item %d", code));
+}
+
+static void
build_select_menu(MenuNo number, char *filename)
{
- static CONST_MENUS char *labels[] =
+#define MY_DATA(name) { name, call_select, 0 }
+ static MENU_DATA table[] =
{
- "Lions",
- "Tigers",
- "Bears",
- "(Oh my!)",
- "Newts",
- "Platypi",
- "Lemurs",
- "(Oh really?!)",
- "Leopards",
- "Panthers",
- "Pumas",
- "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs",
- "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs, Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs",
- (char *) 0
+ MY_DATA("Lions"),
+ MY_DATA("Tigers"),
+ MY_DATA("Bears"),
+ MY_DATA("(Oh my!)"),
+ MY_DATA("Newts"),
+ MY_DATA("Platypi"),
+ MY_DATA("Lemurs"),
+ MY_DATA("(Oh really?!)"),
+ MY_DATA("Leopards"),
+ MY_DATA("Panthers"),
+ MY_DATA("Pumas"),
+ MY_DATA("Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs"),
+ MY_DATA("Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs, Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs"),
+ {(char *) 0, 0, 0}
};
static ITEM **items;
ITEM **ip;
- CONST_MENUS char **ap = 0;
- CONST_MENUS char **myList = 0;
- unsigned count = 0;
+ MENU_DATA *ap = 0;
+ MENU_DATA *myList = 0;
+ int i;
+ size_t count = 0;
if (filename != 0) {
struct stat sb;
@@ -365,7 +419,7 @@ build_select_menu(MenuNo number, char *filename)
size_t size = (size_t) sb.st_size;
unsigned j, k;
char *blob = typeMalloc(char, size + 1);
- CONST_MENUS char **list = typeCalloc(CONST_MENUS char *, size + 1);
+ MENU_DATA *list = typeCalloc(MENU_DATA, size + 1);
items = typeCalloc(ITEM *, size + 1);
Trace(("build_select_menu blob=%p, items=%p",
@@ -378,19 +432,19 @@ build_select_menu(MenuNo number, char *filename)
bool mark = TRUE;
for (j = k = 0; j < size; ++j) {
if (mark) {
- list[k++] = blob + j;
+ list[k++].name = blob + j;
mark = FALSE;
}
if (blob[j] == '\n') {
blob[j] = '\0';
- if (k > 0 && *list[k - 1] == '\0')
+ if (k > 0 && *list[k - 1].name == '\0')
--k;
mark = TRUE;
} else if (blob[j] == '\t') {
blob[j] = ' '; /* menu items are printable */
}
}
- list[k] = 0;
+ list[k].name = 0;
count = k;
ap = myList = list;
}
@@ -398,17 +452,24 @@ build_select_menu(MenuNo number, char *filename)
}
loaded_file = TRUE;
}
+ if (ap == 0)
+ free(items);
}
}
if (ap == 0) {
- count = SIZEOF(labels) - 1;
+ count = SIZEOF(table) - 1;
items = typeCalloc(ITEM *, count + 1);
- ap = labels;
+ ap = table;
}
ip = items;
- while (*ap != 0)
- *ip++ = new_item(*ap++, "");
+ for (i = 0; ap[i].name != 0; ++i) {
+ ap[i].func = call_select;
+ ap[i].mask = (unsigned) i;
+ *ip = new_item(ap[i].name, empty);
+ set_item_userptr(*ip, (void *) &table[i]);
+ ++ip;
+ }
*ip = 0;
mpSelect = menu_create(items, (int) count, 1, number);
@@ -425,30 +486,36 @@ perform_select_menu(int cmd)
/*****************************************************************************/
#ifdef TRACE
-#define T_TBL(name) { #name, name }
-static struct {
- const char *name;
- unsigned mask;
-} t_tbl[] = {
+
+static void
+call_trace(int code)
+{
+ (void) code;
+ Trace(("Updating trace mask %d", code));
+}
+
+#define T_TBL(name) { #name, call_trace, name }
+static MENU_DATA t_tbl[] =
+{
T_TBL(TRACE_DISABLE),
- T_TBL(TRACE_TIMES),
- T_TBL(TRACE_TPUTS),
- T_TBL(TRACE_UPDATE),
- T_TBL(TRACE_MOVE),
- T_TBL(TRACE_CHARPUT),
- T_TBL(TRACE_ORDINARY),
- T_TBL(TRACE_CALLS),
- T_TBL(TRACE_VIRTPUT),
- T_TBL(TRACE_IEVENT),
- T_TBL(TRACE_BITS),
- T_TBL(TRACE_ICALLS),
- T_TBL(TRACE_CCALLS),
- T_TBL(TRACE_DATABASE),
- T_TBL(TRACE_ATTRS),
- T_TBL(TRACE_MAXIMUM),
+ T_TBL(TRACE_TIMES),
+ T_TBL(TRACE_TPUTS),
+ T_TBL(TRACE_UPDATE),
+ T_TBL(TRACE_MOVE),
+ T_TBL(TRACE_CHARPUT),
+ T_TBL(TRACE_ORDINARY),
+ T_TBL(TRACE_CALLS),
+ T_TBL(TRACE_VIRTPUT),
+ T_TBL(TRACE_IEVENT),
+ T_TBL(TRACE_BITS),
+ T_TBL(TRACE_ICALLS),
+ T_TBL(TRACE_CCALLS),
+ T_TBL(TRACE_DATABASE),
+ T_TBL(TRACE_ATTRS),
+ T_TBL(TRACE_MAXIMUM),
{
- (char *) 0, 0
+ (char *) 0, 0, 0
}
};
@@ -460,8 +527,11 @@ build_trace_menu(MenuNo number)
ITEM **ip = items;
int n;
- for (n = 0; t_tbl[n].name != 0; n++)
- *ip++ = new_item(t_tbl[n].name, "");
+ for (n = 0; t_tbl[n].name != 0; n++) {
+ *ip = new_item(t_tbl[n].name, empty);
+ set_item_userptr(*ip, (void *) &t_tbl[n]);
+ ++ip;
+ }
*ip = (ITEM *) 0;
mpTrace = menu_create(items, SIZEOF(t_tbl) - 1, 2, number);
@@ -527,7 +597,8 @@ perform_trace_menu(int cmd)
int result;
for (ip = menu_items(mpTrace); *ip; ip++) {
- unsigned mask = t_tbl[item_index(*ip)].mask;
+ MENU_DATA *td = (MENU_DATA *) item_userptr(*ip);
+ unsigned mask = td->mask;
if (mask == 0)
set_item_value(*ip, _nc_tracing == 0);
else if ((mask & _nc_tracing) == mask)
@@ -540,15 +611,17 @@ perform_trace_menu(int cmd)
if (update_trace_menu(mpTrace) || cmd == REQ_TOGGLE_ITEM) {
newtrace = 0;
for (ip = menu_items(mpTrace); *ip; ip++) {
- if (item_value(*ip))
- newtrace |= t_tbl[item_index(*ip)].mask;
+ if (item_value(*ip)) {
+ MENU_DATA *td = (MENU_DATA *) item_userptr(*ip);
+ newtrace |= td->mask;
+ }
}
trace(newtrace);
Trace(("trace level interactively set to %s", tracetrace(_nc_tracing)));
- MvPrintw(LINES - 2, 0,
- "Trace level is %s\n", tracetrace(_nc_tracing));
- refresh();
+ MvWPrintw(status, 1, 0,
+ "Trace level is %s\n", tracetrace(_nc_tracing));
+ wrefresh(status);
}
}
return result;
@@ -588,27 +661,37 @@ current_menu(void)
}
static void
+call_menus(int code)
+{
+ (void) code;
+ Trace(("Activated menu %d\n", code));
+}
+
+static void
build_menus(char *filename)
{
- static CONST_MENUS char *labels[] =
+ static MENU_DATA table[] =
{
- "File",
- "Select",
+ {"File", call_menus, 0},
+ {"Select", call_menus, 1},
#ifdef TRACE
- "Trace",
+ {"Trace", call_menus, 2},
#endif
- (char *) 0
+ {(char *) 0, 0, 0}
};
- static ITEM *items[SIZEOF(labels)];
+ static ITEM *items[SIZEOF(table)];
ITEM **ip = items;
- CONST_MENUS char **ap;
+ int n;
- for (ap = labels; *ap; ap++)
- *ip++ = new_item(*ap, "");
+ for (n = 0; table[n].name != 0; ++n) {
+ *ip = new_item(table[n].name, empty);
+ set_item_userptr(*ip, (void *) &table[n]);
+ ++ip;
+ }
*ip = (ITEM *) 0;
- mpBanner = menu_create(items, SIZEOF(labels) - 1, SIZEOF(labels) - 1, eBanner);
+ mpBanner = menu_create(items, SIZEOF(table) - 1, SIZEOF(table) - 1, eBanner);
set_menu_mark(mpBanner, ">");
build_file_menu(eFile);
@@ -671,14 +754,14 @@ move_menus(MENU * current, int by_y, int by_x)
static void
show_status(int ch, MENU * menu)
{
- move(LINES - 1, 0);
- printw("key %s, menu %d, mark %s, match %s",
- keyname(ch),
- menu_number(),
- menu_mark(menu),
- menu_pattern(menu));
- clrtoeol();
- refresh();
+ wmove(status, 0, 0);
+ wprintw(status, "key %s, menu %d, mark %s, match %s",
+ keyname(ch),
+ menu_number(),
+ menu_mark(menu),
+ menu_pattern(menu));
+ wclrtoeol(status);
+ wrefresh(status);
}
static void
@@ -777,9 +860,9 @@ perform_menus(void)
wrefresh(menu_win(last_menu));
if (code == E_UNKNOWN_COMMAND
|| code == E_NOT_POSTED) {
- if (menu_number() == eFile)
- break;
- beep();
+ ITEM *item = current_item(last_menu);
+ MENU_DATA *td = (MENU_DATA *) item_userptr(item);
+ td->func((int) td->mask);
}
if (code == E_REQUEST_DENIED)
beep();
@@ -827,11 +910,23 @@ rip_header(WINDOW *win, int cols)
#endif /* HAVE_RIPOFFLINE */
static void
+call_files(int code)
+{
+ switch (code) {
+ case 0:
+ destroy_menus();
+ endwin();
+ printf("DONE!\n");
+ ExitProgram(EXIT_SUCCESS);
+ }
+}
+
+static void
usage(void)
{
static const char *const tbl[] =
{
- "Usage: demo_menus [options]"
+ "Usage: demo_menus [options] [menu-file]"
,""
,"Options:"
#if HAVE_RIPOFFLINE
@@ -867,7 +962,7 @@ main(int argc, char *argv[])
#endif /* HAVE_RIPOFFLINE */
#ifdef TRACE
case 't':
- trace(strtoul(optarg, 0, 0));
+ trace((unsigned) strtoul(optarg, 0, 0));
break;
#endif
default:
@@ -885,6 +980,7 @@ main(int argc, char *argv[])
init_pair(1, COLOR_RED, COLOR_BLACK);
init_pair(2, COLOR_BLUE, COLOR_WHITE);
}
+ status = newwin(3, COLS, LINES - 3, 0);
build_menus(argc > 1 ? argv[1] : 0);
perform_menus();
destroy_menus();
diff --git a/test/demo_panels.c b/test/demo_panels.c
index ce6beb7..041b5bb 100644
--- a/test/demo_panels.c
+++ b/test/demo_panels.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2007-2008,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2010,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_panels.c,v 1.37 2010/05/01 22:19:02 tom Exp $
+ * $Id: demo_panels.c,v 1.38 2014/08/02 17:24:07 tom Exp $
*
* Demonstrate a variety of functions from the panel library.
*/
@@ -406,7 +406,7 @@ make_fullwidth_digit(cchar_t *target, int digit)
{
wchar_t source[2];
- source[0] = digit + 0xff10;
+ source[0] = (wchar_t) (digit + 0xff10);
source[1] = 0;
setcchar(target, source, A_NORMAL, 0, 0);
}
diff --git a/test/demo_termcap.c b/test/demo_termcap.c
index a3733c6..2a29266 100644
--- a/test/demo_termcap.c
+++ b/test/demo_termcap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2005-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 2005-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,12 +29,29 @@
/*
* Author: Thomas E. Dickey
*
- * $Id: demo_termcap.c,v 1.14 2011/01/15 21:41:27 tom Exp $
+ * $Id: demo_termcap.c,v 1.46 2014/10/10 00:35:43 tom Exp $
*
* A simple demo of the termcap interface.
*/
#define USE_TINFO
#include <test.priv.h>
+#include <sys/stat.h>
+
+#if NCURSES_XNAMES
+#if HAVE_TERM_ENTRY_H
+#include <term_entry.h>
+#else
+#undef NCURSES_XNAMES
+#define NCURSES_XNAMES 0
+#endif
+#endif
+
+static void
+failed(const char *msg)
+{
+ fprintf(stderr, "%s\n", msg);
+ ExitProgram(EXIT_FAILURE);
+}
#if HAVE_TGETENT
@@ -47,13 +64,103 @@
#define FCOLS 8
#define FNAME(type) "%s %-*s = ", #type, FCOLS
-#if USE_CODE_LISTS
static bool b_opt = FALSE;
static bool n_opt = FALSE;
static bool s_opt = FALSE;
-#endif
+static bool q_opt = FALSE;
+static bool x_opt = FALSE;
+static bool y_opt = FALSE;
+
+static char *d_opt;
+static char *e_opt;
+static char **db_list;
+static int db_item;
+
+static char *my_blob;
+static char **my_boolcodes;
+static char **my_numcodes;
+static char **my_numvalues;
+static char **my_strcodes;
+static char **my_strvalues;
+
+static long total_values;
+static long total_b_values;
+static long total_n_values;
+static long total_s_values;
+
+#define isCapName(c) (isgraph(c) && strchr("^=:\\", c) == 0)
+#define EachCapName(n) n = 33; n < 127; ++n
+
+static char *
+make_dbitem(char *p, char *q)
+{
+ char *result = malloc(strlen(e_opt) + 2 + (size_t) (p - q));
+ sprintf(result, "%s=%.*s", e_opt, (int) (p - q), q);
+ return result;
+}
+
+static void
+make_dblist(void)
+{
+ if (d_opt && e_opt) {
+ int pass;
+
+ for (pass = 0; pass < 2; ++pass) {
+ char *p, *q;
+ size_t count = 0;
+
+ for (p = q = d_opt; *p != '\0'; ++p) {
+ if (*p == ':') {
+ if (p != q + 1) {
+ if (pass) {
+ db_list[count] = make_dbitem(p, q);
+ }
+ count++;
+ }
+ q = p + 1;
+ }
+ }
+ if (p != q + 1) {
+ if (pass) {
+ db_list[count] = make_dbitem(p, q);
+ }
+ count++;
+ }
+ if (!pass) {
+ db_list = typeCalloc(char *, count + 1);
+ }
+ }
+ }
+}
-#define isCapName(c) (isgraph(c) && strchr("^#=:\\", c) == 0)
+static char *
+next_dbitem(void)
+{
+ char *result = 0;
+
+ if (db_list) {
+ if ((result = db_list[db_item]) == 0) {
+ db_item = 0;
+ result = db_list[0];
+ } else {
+ db_item++;
+ }
+ }
+ printf("** %s\n", result);
+ return result;
+}
+
+static void
+free_dblist(void)
+{
+ if (db_list) {
+ int n;
+ for (n = 0; db_list[n]; ++n)
+ free(db_list[n]);
+ free(db_list);
+ db_list = 0;
+ }
+}
static void
dumpit(NCURSES_CONST char *cap)
@@ -70,66 +177,80 @@ dumpit(NCURSES_CONST char *cap)
int num;
if ((str = tgetstr(cap, &ap)) != 0) {
- /*
- * Note that the strings returned are mostly terminfo format, since
- * ncurses does not convert except for a handful of special cases.
- */
- printf(FNAME(str), cap);
- while (*str != 0) {
- int ch = UChar(*str++);
- switch (ch) {
- case '\177':
- fputs("^?", stdout);
- break;
- case '\033':
- fputs("\\E", stdout);
- break;
- case '\b':
- fputs("\\b", stdout);
- break;
- case '\f':
- fputs("\\f", stdout);
- break;
- case '\n':
- fputs("\\n", stdout);
- break;
- case '\r':
- fputs("\\r", stdout);
- break;
- case ' ':
- fputs("\\s", stdout);
- break;
- case '\t':
- fputs("\\t", stdout);
- break;
- case '^':
- fputs("\\^", stdout);
- break;
- case ':':
- fputs("\\072", stdout);
- break;
- case '\\':
- fputs("\\\\", stdout);
- break;
- default:
- if (isgraph(ch))
- fputc(ch, stdout);
- else if (ch < 32)
- printf("^%c", ch + '@');
- else
- printf("\\%03o", ch);
- break;
+ total_values++;
+ total_s_values++;
+ if (!q_opt) {
+ /*
+ * Note that the strings returned are mostly terminfo format, since
+ * ncurses does not convert except for a handful of special cases.
+ */
+ printf(FNAME(str), cap);
+ while (*str != 0) {
+ int ch = UChar(*str++);
+ switch (ch) {
+ case '\177':
+ fputs("^?", stdout);
+ break;
+ case '\033':
+ fputs("\\E", stdout);
+ break;
+ case '\b':
+ fputs("\\b", stdout);
+ break;
+ case '\f':
+ fputs("\\f", stdout);
+ break;
+ case '\n':
+ fputs("\\n", stdout);
+ break;
+ case '\r':
+ fputs("\\r", stdout);
+ break;
+ case ' ':
+ fputs("\\s", stdout);
+ break;
+ case '\t':
+ fputs("\\t", stdout);
+ break;
+ case '^':
+ fputs("\\^", stdout);
+ break;
+ case ':':
+ fputs("\\072", stdout);
+ break;
+ case '\\':
+ fputs("\\\\", stdout);
+ break;
+ default:
+ if (isgraph(ch))
+ fputc(ch, stdout);
+ else if (ch < 32)
+ printf("^%c", ch + '@');
+ else
+ printf("\\%03o", ch);
+ break;
+ }
}
+ printf("\n");
}
- printf("\n");
} else if ((num = tgetnum(cap)) >= 0) {
- printf(FNAME(num), cap);
- printf(" %d\n", num);
+ total_values++;
+ total_n_values++;
+ if (!q_opt) {
+ printf(FNAME(num), cap);
+ printf(" %d\n", num);
+ }
} else if (tgetflag(cap) > 0) {
- printf(FNAME(flg), cap);
- printf("%s\n", "true");
+ total_values++;
+ total_b_values++;
+ if (!q_opt) {
+ printf(FNAME(flg), cap);
+ printf("%s\n", "true");
+ }
}
- fflush(stdout);
+
+ if (!q_opt)
+ fflush(stdout);
}
static void
@@ -137,16 +258,20 @@ brute_force(const char *name)
{
char buffer[1024];
- printf("Terminal type %s\n", name);
+ if (db_list) {
+ putenv(next_dbitem());
+ }
+ if (!q_opt)
+ printf("Terminal type \"%s\"\n", name);
if (tgetent(buffer, name) >= 0) {
char cap[3];
int c1, c2;
cap[2] = 0;
- for (c1 = 0; c1 < 256; ++c1) {
+ for (EachCapName(c1)) {
cap[0] = (char) c1;
if (isCapName(c1)) {
- for (c2 = 0; c2 < 256; ++c2) {
+ for (EachCapName(c2)) {
cap[1] = (char) c2;
if (isCapName(c2)) {
dumpit(cap);
@@ -157,54 +282,422 @@ brute_force(const char *name)
}
}
-#if USE_CODE_LISTS
+#if NCURSES_XNAMES
static void
-demo_terminfo(NCURSES_CONST char *name)
+dump_xname(NCURSES_CONST char *cap)
+{
+ if (strlen(cap) == 2)
+ dumpit(cap);
+}
+#endif
+
+static void
+demo_termcap(NCURSES_CONST char *name)
{
unsigned n;
NCURSES_CONST char *cap;
+ char buffer[1024];
- printf("Terminal type \"%s\"\n", name);
-#if HAVE_SETUPTERM
- setupterm(name, 1, (int *) 0);
-#else
- setterm(name);
+ if (db_list) {
+ putenv(next_dbitem());
+ }
+ if (!q_opt)
+ printf("Terminal type \"%s\"\n", name);
+ if (tgetent(buffer, name) >= 0) {
+
+ if (b_opt) {
+ for (n = 0;; ++n) {
+ cap = my_boolcodes[n];
+ if (cap == 0)
+ break;
+ dumpit(cap);
+ }
+ }
+
+ if (n_opt) {
+ for (n = 0;; ++n) {
+ cap = my_numcodes[n];
+ if (cap == 0)
+ break;
+ dumpit(cap);
+ }
+ }
+
+ if (s_opt) {
+ for (n = 0;; ++n) {
+ cap = my_strcodes[n];
+ if (cap == 0)
+ break;
+ dumpit(cap);
+ }
+ }
+#ifdef NCURSES_VERSION
+ if (x_opt && (my_blob == 0) && y_opt) {
+#if NCURSES_XNAMES
+ TERMTYPE *term = &(cur_term->type);
+ if (term != 0
+ && ((NUM_BOOLEANS(term) != BOOLCOUNT)
+ || (NUM_NUMBERS(term) != NUMCOUNT)
+ || (NUM_STRINGS(term) != STRCOUNT))) {
+ for (n = BOOLCOUNT; n < NUM_BOOLEANS(term); ++n) {
+ dump_xname(ExtBoolname(term, (int) n, boolnames));
+ }
+ for (n = NUMCOUNT; n < NUM_NUMBERS(term); ++n) {
+ dump_xname(ExtNumname(term, (int) n, numnames));
+ }
+ for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) {
+ dump_xname(ExtStrname(term, (int) n, strnames));
+ }
+ }
+#endif
+ }
#endif
+ }
+}
+
+typedef enum {
+ pDefault = 0
+ ,pComment
+ ,pDescription
+ ,pEscaped
+ ,pNewline
+ ,pName
+ ,pNumber
+ ,pString
+} STATE;
+
+static void
+parse_description(const char *input_name)
+{
+ static char empty[1];
+
+ FILE *fp;
+ struct stat sb;
+ size_t count_bools = 0;
+ size_t count_nums = 0;
+ size_t count_strs = 0;
+ size_t len;
+ size_t j, k;
+ STATE state;
+
+ if (stat(input_name, &sb) != 0
+ || (sb.st_mode & S_IFMT) != S_IFREG) {
+ failed("input is not a file");
+ }
+
+ if (sb.st_size == 0) {
+ failed("input is empty");
+ }
- if (b_opt) {
- for (n = 0;; ++n) {
- cap = boolcodes[n];
- if (cap == 0)
+ /*
+ * None of the arrays could be larger than the input-file, and since it
+ * is small, just allocate the maximum for simplicity.
+ */
+ if ((my_blob = malloc((size_t) sb.st_size + 1)) == 0 ||
+ (my_boolcodes = typeCalloc(char *, sb.st_size)) == 0 ||
+ (my_numcodes = typeCalloc(char *, sb.st_size)) == 0 ||
+ (my_numvalues = typeCalloc(char *, sb.st_size)) == 0 ||
+ (my_strcodes = typeCalloc(char *, sb.st_size)) == 0 ||
+ (my_strvalues = typeCalloc(char *, sb.st_size)) == 0) {
+ failed("cannot allocate memory for input-file");
+ }
+
+ if ((fp = fopen(input_name, "r")) == 0)
+ failed("cannot open input-file");
+ len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
+ my_blob[sb.st_size] = '\0';
+ fclose(fp);
+
+ /*
+ * First, get rid of comments and escaped newlines, as well as repeated
+ * colons to construct a canonical entry.
+ *
+ * FIXME: actually this should make an additional pass just to strip
+ * comment-lines and escaped newlines. But it is workable for infocmp
+ * output.
+ */
+ state = pNewline;
+ for (j = k = 0; j < len; ++j) {
+ int ch = my_blob[j];
+ if (ch == '\t') {
+ ch = ' ';
+ }
+ switch (state) {
+ case pNewline:
+ if (ch == ' ') {
+ continue;
+ }
+ if (ch == '#') {
+ state = pComment;
+ continue;
+ }
+ state = pDefault;
+ /* FALLTHRU */
+ case pDefault:
+ switch (ch) {
+ case '|':
+ state = pDescription;
+ continue;
+ case '\\':
+ state = pEscaped;
+ continue;
+ case '\n':
+ state = pNewline;
+ continue;
+ case ' ':
+ case ':':
+ break;
+ default:
+ state = pName;
+ break;
+ }
+ my_blob[k++] = (char) ch;
+ break;
+ case pComment:
+ if (ch == '\n')
+ state = pNewline;
+ break;
+ case pDescription:
+ switch (ch) {
+ case ':':
+ state = pDefault;
+ break;
+ case '\n':
+ state = pNewline;
+ break;
+ }
+ break;
+ case pEscaped:
+ if (ch != '\n') {
+ my_blob[k++] = (char) ch;
+ state = pDefault;
+ } else {
+ state = pNewline;
+ }
+ break;
+ case pName:
+ switch (ch) {
+ case '\n':
+ state = pNewline;
+ continue;
+ case ' ':
+ case ':':
+ state = pDefault;
+ break;
+ case '#':
+ state = pNumber;
+ break;
+ case '|':
+ state = pDescription;
+ continue;
+ }
+ my_blob[k++] = (char) ch;
+ break;
+ case pNumber:
+ switch (ch) {
+ case '\n':
+ state = pNewline;
+ continue;
+ case ':':
+ state = pDefault;
+ break;
+ case ' ':
+ state = pDefault;
+ continue;
+ }
+ my_blob[k++] = (char) ch;
+ break;
+ case pString:
+ switch (ch) {
+ case '\\':
+ if (my_blob[j + 1] == '\0') {
+ state = pDefault;
+ continue;
+ }
break;
- dumpit(cap);
+ case '\n':
+ state = pNewline;
+ continue;
+ case ':':
+ state = pDefault;
+ break;
+ }
+ my_blob[k++] = (char) ch;
+ break;
+ default:
+ /* not used */
+ break;
}
}
+ my_blob[k] = '\0';
- if (n_opt) {
- for (n = 0;; ++n) {
- cap = numcodes[n];
- if (cap == 0)
+ /*
+ * Then, parse what's left, making indexes of the names and values.
+ */
+ state = pDefault;
+ for (j = 0; my_blob[j] != '\0'; ++j) {
+ switch (state) {
+ case pDefault:
+ switch (my_blob[j]) {
+ case '\\':
+ state = pEscaped;
+ break;
+ case ':':
+ my_blob[j] = '\0';
+ if (my_blob[j + 1] != '\0' && my_blob[j + 1] != ':')
+ state = pName;
+ break;
+ case ' ':
+ break;
+ default:
break;
- dumpit(cap);
+ }
+ case pEscaped:
+ break;
+ case pName:
+ state = pDefault;
+ /*
+ * Commented-out capabilities might be accessible (they are in
+ * ncurses).
+ */
+ if (my_blob[j] == '.' && my_blob[j + 1] == '.') {
+ j += 2;
+ }
+ if (my_blob[j + 1] != '\0') {
+ switch (my_blob[j + 2]) {
+ case '#':
+ my_numvalues[count_nums] = &my_blob[j + 3];
+ my_numcodes[count_nums++] = &my_blob[j];
+ my_blob[j + 2] = '\0';
+ state = pNumber;
+ j += 2;
+ break;
+ case '=':
+ my_strvalues[count_strs] = &my_blob[j + 3];
+ my_strcodes[count_strs++] = &my_blob[j];
+ my_blob[j + 2] = '\0';
+ state = pString;
+ j += 2;
+ break;
+ default:
+ if (my_blob[j + 2] == '@') {
+ /*
+ * We cannot get the type for a cancelled item
+ * directly, but can infer it assuming the input
+ * came from infocmp, which puts the data in a
+ * known order.
+ */
+ if (count_strs) {
+ my_strvalues[count_strs] = empty;
+ my_strcodes[count_strs++] = &my_blob[j];
+ } else if (count_nums) {
+ my_numvalues[count_nums] = empty;
+ my_numcodes[count_nums++] = &my_blob[j];
+ } else {
+ my_boolcodes[count_bools++] = &my_blob[j];
+ }
+ } else {
+ my_boolcodes[count_bools++] = &my_blob[j];
+ }
+ j++;
+ break;
+ }
+ }
+ break;
+ case pNumber:
+ if (!isdigit(UChar(my_blob[j]))) {
+ --j;
+ state = pDefault;
+ }
+ break;
+ case pString:
+ switch (my_blob[j]) {
+ case '\\':
+ if (my_blob[j + 1] == '\0') {
+ state = pDefault;
+ continue;
+ } else {
+ ++j;
+ }
+ break;
+ case '\n':
+ state = pNewline;
+ continue;
+ case ':':
+ --j;
+ state = pDefault;
+ break;
+ }
+ break;
+ case pNewline:
+ case pComment:
+ case pDescription:
+ default:
+ break;
}
}
+ my_boolcodes[count_bools] = 0;
+ my_numcodes[count_nums] = 0;
+ my_numvalues[count_nums] = 0;
+ my_strcodes[count_strs] = 0;
+ my_strvalues[count_strs] = 0;
- if (s_opt) {
- for (n = 0;; ++n) {
- cap = strcodes[n];
- if (cap == 0)
- break;
- dumpit(cap);
+#if 0
+ printf("bools:%d\n", (int) count_bools);
+ for (j = 0; my_boolcodes[j]; ++j)
+ printf("%5d:%s\n", (int) j, my_boolcodes[j]);
+
+ printf("numbers:%d\n", (int) count_nums);
+ for (j = 0; my_numcodes[j]; ++j)
+ printf("%5d:%s(%s)\n", (int) j, my_numcodes[j], my_numvalues[j]);
+
+ printf("strings:%d\n", (int) count_strs);
+ for (j = 0; my_strcodes[j]; ++j)
+ printf("%5d:%s(%s)\n", (int) j, my_strcodes[j], my_strvalues[j]);
+#endif
+}
+
+#if USE_CODE_LISTS
+static char **
+copy_code_list(NCURSES_CONST char *const *list)
+{
+ int pass;
+ size_t count;
+ size_t length = 1;
+ char **result = 0;
+ char *blob = 0;
+ char *unused = 0;
+
+ for (pass = 0; pass < 2; ++pass) {
+ for (count = 0; list[count] != 0; ++count) {
+ size_t chunk = strlen(list[count]) + 1;
+ if (pass == 0) {
+ length += chunk;
+ } else {
+ result[count] = unused;
+ strcpy(unused, list[count]);
+ unused += chunk;
+ }
+ }
+ if (pass == 0) {
+ blob = malloc(length);
+ result = typeCalloc(char *, count + 1);
+ unused = blob;
+ if (blob == 0 || result == 0)
+ failed("copy_code_list failed");
}
}
+
+ return result;
}
+#endif
static void
usage(void)
{
static const char *msg[] =
{
- "Usage: demo_terminfo [options] [terminal]",
+ "Usage: demo_termcap [options] [terminal]",
"",
"If no options are given, print all (boolean, numeric, string)",
"capabilities for the given terminal, using short names.",
@@ -212,9 +705,16 @@ usage(void)
"Options:",
" -a try all names, print capabilities found",
" -b print boolean-capabilities",
+ " -d LIST colon-separated list of databases to use",
+ " -e NAME environment variable to set with -d option",
+ " -i NAME terminal description to use as names for \"-a\" option, etc.",
" -n print numeric-capabilities",
+ " -q quiet (prints only counts)",
" -r COUNT repeat for given count",
" -s print string-capabilities",
+#ifdef NCURSES_VERSION
+ " -x print extended capabilities",
+#endif
};
unsigned n;
for (n = 0; n < SIZEOF(msg); ++n) {
@@ -222,7 +722,6 @@ usage(void)
}
ExitProgram(EXIT_FAILURE);
}
-#endif
int
main(int argc, char *argv[])
@@ -230,12 +729,12 @@ main(int argc, char *argv[])
int n;
char *name;
bool a_opt = FALSE;
+ char *input_name = 0;
-#if USE_CODE_LISTS
int repeat;
int r_opt = 1;
- while ((n = getopt(argc, argv, "abnr:s")) != -1) {
+ while ((n = getopt(argc, argv, "abd:e:i:nqr:sxy")) != -1) {
switch (n) {
case 'a':
a_opt = TRUE;
@@ -243,9 +742,21 @@ main(int argc, char *argv[])
case 'b':
b_opt = TRUE;
break;
+ case 'd':
+ d_opt = optarg;
+ break;
+ case 'e':
+ e_opt = optarg;
+ break;
+ case 'i':
+ input_name = optarg;
+ break;
case 'n':
n_opt = TRUE;
break;
+ case 'q':
+ q_opt = TRUE;
+ break;
case 'r':
if ((r_opt = atoi(optarg)) <= 0)
usage();
@@ -253,49 +764,79 @@ main(int argc, char *argv[])
case 's':
s_opt = TRUE;
break;
+#if NCURSES_XNAMES
+ case 'x':
+ x_opt = TRUE;
+ break;
+ case 'y':
+ y_opt = TRUE;
+ x_opt = TRUE;
+ break;
+#endif
default:
usage();
break;
}
}
+#if HAVE_USE_EXTENDED_NAMES
+ use_extended_names(x_opt);
+#endif
+
if (!(b_opt || n_opt || s_opt)) {
b_opt = TRUE;
n_opt = TRUE;
s_opt = TRUE;
}
-#else
- a_opt = TRUE;
-#endif
+
+ make_dblist();
if (a_opt) {
- if (optind < argc) {
- for (n = optind; n < argc; ++n) {
- brute_force(argv[n]);
+ for (repeat = 0; repeat < r_opt; ++repeat) {
+ if (optind < argc) {
+ for (n = optind; n < argc; ++n) {
+ brute_force(argv[n]);
+ }
+ } else if ((name = getenv("TERM")) != 0) {
+ brute_force(name);
+ } else {
+ static char dumb[] = "dumb";
+ brute_force(dumb);
}
- } else if ((name = getenv("TERM")) != 0) {
- brute_force(name);
- } else {
- static char dumb[] = "dumb";
- brute_force(dumb);
}
- }
+ } else {
+ if (input_name != 0) {
+ parse_description(input_name);
+ }
#if USE_CODE_LISTS
- else {
+ else {
+ my_boolcodes = copy_code_list(boolcodes);
+ my_numcodes = copy_code_list(numcodes);
+ my_strcodes = copy_code_list(strcodes);
+ }
+#else
+ else {
+ failed("no capability-lists available (use -i option)");
+ }
+#endif /* USE_CODE_LISTS */
for (repeat = 0; repeat < r_opt; ++repeat) {
if (optind < argc) {
for (n = optind; n < argc; ++n) {
- demo_terminfo(argv[n]);
+ demo_termcap(argv[n]);
}
} else if ((name = getenv("TERM")) != 0) {
- demo_terminfo(name);
+ demo_termcap(name);
} else {
static char dumb[] = "dumb";
- demo_terminfo(dumb);
+ demo_termcap(dumb);
}
}
}
-#endif
+
+ printf("%ld values (%ld booleans, %ld numbers, %ld strings)\n",
+ total_values, total_b_values, total_n_values, total_s_values);
+
+ free_dblist();
ExitProgram(EXIT_SUCCESS);
}
@@ -305,7 +846,6 @@ int
main(int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
- printf("This program requires termcap\n");
- exit(EXIT_FAILURE);
+ failed("This program requires termcap");
}
#endif
diff --git a/test/demo_terminfo.c b/test/demo_terminfo.c
index 2ee5b4c..3b44a0b 100644
--- a/test/demo_terminfo.c
+++ b/test/demo_terminfo.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2009-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,123 +29,305 @@
/*
* Author: Thomas E. Dickey
*
- * $Id: demo_terminfo.c,v 1.9 2010/11/28 00:15:27 tom Exp $
+ * $Id: demo_terminfo.c,v 1.38 2014/10/10 00:35:28 tom Exp $
*
* A simple demo of the terminfo interface.
*/
#define USE_TINFO
#include <test.priv.h>
+#include <sys/stat.h>
-#ifdef NCURSES_VERSION
-#if !(defined(HAVE_TERM_ENTRY_H) && HAVE_TERM_ENTRY_H)
-#undef NCURSES_XNAMES
-#define NCURSES_XNAMES 0
-#endif
#if NCURSES_XNAMES
+#if HAVE_TERM_ENTRY_H
#include <term_entry.h>
+#else
+#undef NCURSES_XNAMES
+#define NCURSES_XNAMES 0
#endif
#endif
+static void
+failed(const char *msg)
+{
+ fprintf(stderr, "%s\n", msg);
+ ExitProgram(EXIT_FAILURE);
+}
+
#if HAVE_TIGETSTR
+
#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)
+#define USE_CODE_LISTS 1
+#else
+#define USE_CODE_LISTS 0
+#endif
+static bool a_opt = FALSE;
static bool b_opt = FALSE;
static bool f_opt = FALSE;
static bool n_opt = FALSE;
+static bool q_opt = FALSE;
static bool s_opt = FALSE;
static bool x_opt = FALSE;
+static bool y_opt = FALSE;
+
+static char *d_opt;
+static char *e_opt;
+static char **db_list;
+static int db_item;
+
+static char *my_blob;
+static char **my_boolcodes;
+static char **my_numcodes;
+static char **my_numvalues;
+static char **my_strcodes;
+static char **my_strvalues;
+
+static long total_values;
+static long total_b_values;
+static long total_n_values;
+static long total_s_values;
#define FCOLS 8
#define FNAME(type) "%s %-*s = ", #type, FCOLS
+static char *
+make_dbitem(char *p, char *q)
+{
+ char *result = malloc(strlen(e_opt) + 2 + (size_t) (p - q));
+ sprintf(result, "%s=%.*s", e_opt, (int) (p - q), q);
+ return result;
+}
+
+static void
+make_dblist(void)
+{
+ if (d_opt && e_opt) {
+ int pass;
+
+ for (pass = 0; pass < 2; ++pass) {
+ char *p, *q;
+ size_t count = 0;
+
+ for (p = q = d_opt; *p != '\0'; ++p) {
+ if (*p == ':') {
+ if (p != q + 1) {
+ if (pass) {
+ db_list[count] = make_dbitem(p, q);
+ }
+ count++;
+ }
+ q = p + 1;
+ }
+ }
+ if (p != q + 1) {
+ if (pass) {
+ db_list[count] = make_dbitem(p, q);
+ }
+ count++;
+ }
+ if (!pass) {
+ db_list = typeCalloc(char *, count + 1);
+ }
+ }
+ }
+}
+
+static char *
+next_dbitem(void)
+{
+ char *result = 0;
+
+ if (db_list) {
+ if ((result = db_list[db_item]) == 0) {
+ db_item = 0;
+ result = db_list[0];
+ } else {
+ db_item++;
+ }
+ }
+ printf("** %s\n", result);
+ return result;
+}
+
+#ifdef NO_LEAKS
+static void
+free_dblist(void)
+{
+ if (db_list) {
+ int n;
+ for (n = 0; db_list[n]; ++n)
+ free(db_list[n]);
+ free(db_list);
+ db_list = 0;
+ }
+}
+#endif
+
static void
dumpit(NCURSES_CONST char *cap)
{
- /*
- * One of the limitations of the termcap interface is that the library
- * cannot determine the size of the buffer passed via tgetstr(), nor the
- * amount of space remaining. This demo simply reuses the whole buffer
- * for each call; a normal termcap application would try to use the buffer
- * to hold all of the strings extracted from the terminal entry.
- */
const char *str;
int num;
if ((str = tigetstr(cap)) != 0 && (str != (char *) -1)) {
- /*
- * Note that the strings returned are mostly terminfo format, since
- * ncurses does not convert except for a handful of special cases.
- */
- printf(FNAME(str), cap);
- while (*str != 0) {
- int ch = UChar(*str++);
- switch (ch) {
- case '\177':
- fputs("^?", stdout);
- break;
- case '\033':
- fputs("\\E", stdout);
- break;
- case '\b':
- fputs("\\b", stdout);
- break;
- case '\f':
- fputs("\\f", stdout);
- break;
- case '\n':
- fputs("\\n", stdout);
- break;
- case '\r':
- fputs("\\r", stdout);
- break;
- case ' ':
- fputs("\\s", stdout);
- break;
- case '\t':
- fputs("\\t", stdout);
- break;
- case '^':
- fputs("\\^", stdout);
- break;
- case ':':
- fputs("\\072", stdout);
- break;
- case '\\':
- fputs("\\\\", stdout);
- break;
- default:
- if (isgraph(ch))
- fputc(ch, stdout);
- else if (ch < 32)
- printf("^%c", ch + '@');
- else
- printf("\\%03o", ch);
- break;
+ total_values++;
+ total_s_values++;
+ if (!q_opt) {
+ printf(FNAME(str), cap);
+ while (*str != 0) {
+ int ch = UChar(*str++);
+ switch (ch) {
+ case '\177':
+ fputs("^?", stdout);
+ break;
+ case '\033':
+ fputs("\\E", stdout);
+ break;
+ case '\b':
+ fputs("\\b", stdout);
+ break;
+ case '\f':
+ fputs("\\f", stdout);
+ break;
+ case '\n':
+ fputs("\\n", stdout);
+ break;
+ case '\r':
+ fputs("\\r", stdout);
+ break;
+ case ' ':
+ fputs("\\s", stdout);
+ break;
+ case '\t':
+ fputs("\\t", stdout);
+ break;
+ case '^':
+ fputs("\\^", stdout);
+ break;
+ case ':':
+ fputs("\\072", stdout);
+ break;
+ case '\\':
+ fputs("\\\\", stdout);
+ break;
+ default:
+ if (isgraph(ch))
+ fputc(ch, stdout);
+ else if (ch < 32)
+ printf("^%c", ch + '@');
+ else
+ printf("\\%03o", ch);
+ break;
+ }
}
+ printf("\n");
}
- printf("\n");
} else if ((num = tigetnum(cap)) >= 0) {
- printf(FNAME(num), cap);
- printf(" %d\n", num);
+ total_values++;
+ total_n_values++;
+ if (!q_opt) {
+ printf(FNAME(num), cap);
+ printf(" %d\n", num);
+ }
} else if ((num = tigetflag(cap)) >= 0) {
- printf(FNAME(flg), cap);
- printf("%s\n", num ? "true" : "false");
+ total_values++;
+ total_b_values++;
+ if (!q_opt) {
+ printf(FNAME(flg), cap);
+ printf("%s\n", num ? "true" : "false");
+ }
+ }
+
+ if (!q_opt)
+ fflush(stdout);
+}
+
+#define isCapName(c) (isalnum(UChar(c)) || ((c) == '_'))
+#define LegalItem(c,n) (n)
+
+static void
+brute_force(const char *name)
+{
+#define MAX_FORCE 5 /* omit "colors", since CPU-time is a problem */
+ static const char legal[] = "\
+0123456789\
+ABCDEFGHIJKLMNOPQRSTUVWXYZ\
+abcdefghijklmnopqrstuvwxyz_";
+ int length;
+ int j, k;
+ bool carry;
+ bool changed;
+ char cap[MAX_FORCE + 1];
+ int item[MAX_FORCE + 1];
+
+ if (db_list) {
+ putenv(next_dbitem());
+ }
+ if (!q_opt)
+ printf("Terminal type \"%s\"\n", name);
+ setupterm((NCURSES_CONST char *) name, 1, (int *) 0);
+
+ for (length = 1; length <= MAX_FORCE; ++length) {
+ /* set all digits to zeros */
+ for (j = 0; j < length; ++j) {
+ item[j] = LegalItem(j, 0);
+ }
+
+ do {
+ changed = FALSE;
+ /* copy digits to cap-name */
+ for (j = 0; j < length; ++j) {
+ cap[j] = legal[item[j]];
+ }
+ cap[length] = '\0';
+ dumpit(cap);
+
+ k = length - 1;
+ do {
+ carry = FALSE;
+ for (; k >= 0; --k) {
+ item[k] += 1;
+ if (legal[item[k]]) {
+ changed = TRUE;
+ break;
+ }
+ if (k > 0 &&
+ legal[item[k - 1] + 1]) {
+ for (j = k; j < length; ++j) {
+ item[j] = LegalItem(j, 0);
+ }
+ carry = TRUE;
+ changed = TRUE;
+ }
+ }
+ } while (carry);
+ } while (changed);
}
- fflush(stdout);
+ del_curterm(cur_term);
}
+#if USE_CODE_LISTS
+#define fullname(type,n) f_opt ? type##fnames[n] : my_##type##codes[n]
+#else
+#define fullname(type,n) my_##type##codes[n]
+#endif
+
static void
demo_terminfo(char *name)
{
unsigned n;
NCURSES_CONST char *cap;
- printf("Terminal type \"%s\"\n", name);
+ if (db_list) {
+ putenv(next_dbitem());
+ }
+ if (!q_opt)
+ printf("Terminal type \"%s\"\n", name);
setupterm(name, 1, (int *) 0);
if (b_opt) {
for (n = 0;; ++n) {
- cap = f_opt ? boolfnames[n] : boolnames[n];
+ cap = fullname(bool, n);
if (cap == 0)
break;
dumpit(cap);
@@ -154,7 +336,7 @@ demo_terminfo(char *name)
if (n_opt) {
for (n = 0;; ++n) {
- cap = f_opt ? numfnames[n] : numnames[n];
+ cap = fullname(num, n);
if (cap == 0)
break;
dumpit(cap);
@@ -163,16 +345,16 @@ demo_terminfo(char *name)
if (s_opt) {
for (n = 0;; ++n) {
- cap = f_opt ? strfnames[n] : strnames[n];
+ cap = fullname(str, n);
if (cap == 0)
break;
dumpit(cap);
}
}
#ifdef NCURSES_VERSION
- if (x_opt) {
+ if (x_opt && (my_blob == 0)) {
int mod;
- if (f_opt) {
+ if (y_opt) {
#if NCURSES_XNAMES
TERMTYPE *term = &(cur_term->type);
if (term != 0
@@ -191,7 +373,7 @@ demo_terminfo(char *name)
}
#endif
} else {
- char temp[10];
+ char temp[80];
static const char *xterm_keys[] =
{
"kDC", "kDN", "kEND", "kHOM", "kIC",
@@ -199,18 +381,368 @@ demo_terminfo(char *name)
};
for (n = 0; n < SIZEOF(xterm_keys); ++n) {
for (mod = 0; mod < 8; ++mod) {
- if (mod == 0)
- strcpy(temp, xterm_keys[n]);
- else
- sprintf(temp, "%s%d", xterm_keys[n], mod);
+ if (mod == 0) {
+ /* these happen to be standard - avoid duplicates */
+ if (!strcmp(xterm_keys[n], "kDC") ||
+ !strcmp(xterm_keys[n], "kEND") ||
+ !strcmp(xterm_keys[n], "kHOM") ||
+ !strcmp(xterm_keys[n], "kLFT") ||
+ !strcmp(xterm_keys[n], "kRIT")) {
+ continue;
+ }
+ sprintf(temp, "%.*s", 8, xterm_keys[n]);
+ } else {
+ sprintf(temp, "%.*s%d", 8, xterm_keys[n], mod);
+ }
dumpit(temp);
}
}
}
}
#endif
+ del_curterm(cur_term);
+}
+
+typedef enum {
+ pDefault = 0
+ ,pComment
+ ,pDescription
+ ,pEscaped
+ ,pNewline
+ ,pName
+ ,pNumber
+ ,pString
+} STATE;
+
+static void
+parse_description(const char *input_name)
+{
+ static char empty[1];
+
+ FILE *fp;
+ struct stat sb;
+ size_t count_bools = 0;
+ size_t count_nums = 0;
+ size_t count_strs = 0;
+ size_t len;
+ size_t j, k, jl;
+ STATE state;
+
+ if (stat(input_name, &sb) != 0
+ || (sb.st_mode & S_IFMT) != S_IFREG) {
+ failed("input is not a file");
+ }
+
+ if (sb.st_size == 0) {
+ failed("input is empty");
+ }
+ /*
+ * None of the arrays could be larger than the input-file, and since it
+ * is small, just allocate the maximum for simplicity.
+ */
+ if ((my_blob = malloc((size_t) sb.st_size + 1)) == 0 ||
+ (my_boolcodes = typeCalloc(char *, sb.st_size)) == 0 ||
+ (my_numcodes = typeCalloc(char *, sb.st_size)) == 0 ||
+ (my_numvalues = typeCalloc(char *, sb.st_size)) == 0 ||
+ (my_strcodes = typeCalloc(char *, sb.st_size)) == 0 ||
+ (my_strvalues = typeCalloc(char *, sb.st_size)) == 0) {
+ failed("cannot allocate memory for input-file");
+ }
+
+ if ((fp = fopen(input_name, "r")) == 0)
+ failed("cannot open input-file");
+ len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
+ my_blob[sb.st_size] = '\0';
+ fclose(fp);
+
+ /*
+ * First, get rid of comments and escaped newlines, as well as repeated
+ * colons to construct a canonical entry.
+ */
+ state = pNewline;
+ for (j = k = 0; j < len; ++j) {
+ int ch = my_blob[j];
+ if (ch == '\t') {
+ ch = ' ';
+ }
+ switch (state) {
+ case pNewline:
+ if (ch == ' ') {
+ continue;
+ }
+ if (ch == '#') {
+ state = pComment;
+ continue;
+ }
+ state = pDefault;
+ /* FALLTHRU */
+ case pDefault:
+ switch (ch) {
+ case '|':
+ state = pDescription;
+ continue;
+ case '\\':
+ state = pEscaped;
+ continue;
+ case '\n':
+ state = pNewline;
+ continue;
+ case ' ':
+ break;
+ case ',':
+ my_blob[k++] = (char) ch;
+ break;
+ default:
+ if (isalpha(UChar(ch)))
+ state = pName;
+ else
+ fprintf(stderr, "OOPS @%d:%.20s\n", __LINE__, my_blob + j);
+ my_blob[k++] = (char) ch;
+ break;
+ }
+ break;
+ case pComment:
+ if (ch == '\n')
+ state = pNewline;
+ break;
+ case pDescription:
+ switch (ch) {
+ case ',':
+ state = pDefault;
+ break;
+ case '\n':
+ state = pNewline;
+ break;
+ }
+ break;
+ case pEscaped:
+ if (ch != '\n') {
+ my_blob[k++] = (char) ch;
+ state = pDefault;
+ } else {
+ state = pNewline;
+ }
+ break;
+ case pName:
+ switch (ch) {
+ case '\n':
+ state = pNewline;
+ continue;
+ case ' ':
+ case ',':
+ state = pDefault;
+ break;
+ case '#':
+ state = pNumber;
+ break;
+ case '=':
+ state = pString;
+ break;
+ case '|':
+ state = pDescription;
+ continue;
+ }
+ my_blob[k++] = (char) ch;
+ break;
+ case pNumber:
+ switch (ch) {
+ case '\n':
+ state = pNewline;
+ continue;
+ case ',':
+ state = pDefault;
+ break;
+ case ' ':
+ state = pDefault;
+ continue;
+ }
+ my_blob[k++] = (char) ch;
+ break;
+ case pString:
+ switch (ch) {
+ case '\n':
+ state = pNewline;
+ break;
+ case ',':
+ state = pDefault;
+ my_blob[k++] = (char) ch;
+ break;
+ default:
+ my_blob[k++] = (char) ch;
+ break;
+ }
+ break;
+ default:
+ /* not used */
+ break;
+ }
+ }
+ my_blob[k] = '\0';
+
+ /*
+ * Then, parse what's left, making indexes of the names and values.
+ */
+ state = pDefault;
+ for (j = 0; my_blob[j] != '\0'; ++j) {
+ switch (state) {
+ case pDefault:
+ switch (my_blob[j]) {
+ case '\\':
+ state = pEscaped;
+ break;
+ case ',':
+ my_blob[j] = '\0';
+ if (my_blob[j + 1] != '\0' && my_blob[j + 1] != ',')
+ state = pName;
+ break;
+ case ' ':
+ break;
+ default:
+ break;
+ }
+ case pEscaped:
+ break;
+ case pName:
+ state = pDefault;
+ if (isalpha(UChar(my_blob[j]))) {
+ for (jl = 1; isalnum(UChar(my_blob[j + jl])); ++jl) {
+ ;
+ }
+ } else {
+ jl = 0;
+ }
+ if (jl != 0) {
+ switch (my_blob[j + jl]) {
+ case '#':
+ my_numvalues[count_nums] = &my_blob[j + jl + 1];
+ my_numcodes[count_nums++] = &my_blob[j];
+ my_blob[j + jl] = '\0';
+ state = pNumber;
+ j += jl;
+ break;
+ case '=':
+ my_strvalues[count_strs] = &my_blob[j + jl + 1];
+ my_strcodes[count_strs++] = &my_blob[j];
+ my_blob[j + jl] = '\0';
+ state = pString;
+ j += jl;
+ break;
+ default:
+ if (my_blob[j + jl] == '@') {
+ /*
+ * We cannot get the type for a cancelled item
+ * directly, but can infer it assuming the input
+ * came from infocmp, which puts the data in a
+ * known order.
+ */
+ if (count_strs) {
+ my_strvalues[count_strs] = empty;
+ my_strcodes[count_strs++] = &my_blob[j];
+ } else if (count_nums) {
+ my_numvalues[count_nums] = empty;
+ my_numcodes[count_nums++] = &my_blob[j];
+ } else {
+ my_boolcodes[count_bools++] = &my_blob[j];
+ }
+ my_blob[j + jl] = '\0';
+ j += jl + 1;
+ } else {
+ my_boolcodes[count_bools++] = &my_blob[j];
+ my_blob[j + jl] = '\0';
+ j += jl;
+ }
+ state = (isCapName(my_blob[j + 1])
+ ? pName
+ : pDefault);
+ break;
+ }
+ }
+ break;
+ case pNumber:
+ if (!isdigit(UChar(my_blob[j]))) {
+ --j;
+ state = pDefault;
+ }
+ break;
+ case pString:
+ switch (my_blob[j]) {
+ case '\\':
+ if (my_blob[j + 1] != '\0') {
+ ++j;
+ } else {
+ --j;
+ state = pDefault;
+ }
+ break;
+ case ',':
+ --j;
+ state = pDefault;
+ break;
+ }
+ break;
+ case pNewline:
+ case pComment:
+ case pDescription:
+ default:
+ break;
+ }
+ }
+ my_boolcodes[count_bools] = 0;
+ my_numcodes[count_nums] = 0;
+ my_numvalues[count_nums] = 0;
+ my_strcodes[count_strs] = 0;
+ my_strvalues[count_strs] = 0;
+
+#if 0
+ printf("# bools:%d\n", (int) count_bools);
+ for (j = 0; my_boolcodes[j]; ++j)
+ printf("\t%s,\n", my_boolcodes[j]);
+
+ printf("# numbers:%d\n", (int) count_nums);
+ for (j = 0; my_numcodes[j]; ++j)
+ printf("\t%s#%s,\n", my_numcodes[j], my_numvalues[j]);
+
+ printf("# strings:%d\n", (int) count_strs);
+ for (j = 0; my_strcodes[j]; ++j)
+ printf("\t%s=%s,\n", my_strcodes[j], my_strvalues[j]);
+#endif
+}
+
+#if USE_CODE_LISTS
+static char **
+copy_code_list(NCURSES_CONST char *const *list)
+{
+ int pass;
+ size_t count;
+ size_t length = 1;
+ char **result = 0;
+ char *blob = 0;
+ char *unused = 0;
+
+ for (pass = 0; pass < 2; ++pass) {
+ for (count = 0; list[count] != 0; ++count) {
+ size_t chunk = strlen(list[count]) + 1;
+ if (pass == 0) {
+ length += chunk;
+ } else {
+ result[count] = unused;
+ strcpy(unused, list[count]);
+ unused += chunk;
+ }
+ }
+ if (pass == 0) {
+ blob = malloc(length);
+ result = typeCalloc(char *, count + 1);
+ unused = blob;
+ if (blob == 0 || result == 0)
+ failed("copy_code_list failed");
+ }
+ }
+
+ return result;
}
+#endif
static void
usage(void)
@@ -223,13 +755,19 @@ usage(void)
"capabilities for the given terminal, using short names.",
"",
"Options:",
+ " -a try all names, print capabilities found",
" -b print boolean-capabilities",
+ " -d LIST colon-separated list of databases to use",
+ " -e NAME environment variable to set with -d option",
" -f print full names",
+ " -i NAME terminal description to use as names for \"-a\" option",
" -n print numeric-capabilities",
+ " -q quiet (prints only counts)",
" -r COUNT repeat for given count",
" -s print string-capabilities",
#ifdef NCURSES_VERSION
" -x print extended capabilities",
+ " -y direct-lookup names of extended capabilities",
#endif
};
unsigned n;
@@ -246,18 +784,34 @@ main(int argc, char *argv[])
int repeat;
char *name;
int r_opt = 1;
+ char *input_name = 0;
- while ((n = getopt(argc, argv, "bfnr:sx")) != -1) {
+ while ((n = getopt(argc, argv, "abd:e:fi:nqr:sxy")) != -1) {
switch (n) {
+ case 'a':
+ a_opt = TRUE;
+ break;
case 'b':
b_opt = TRUE;
break;
+ case 'd':
+ d_opt = optarg;
+ break;
+ case 'e':
+ e_opt = optarg;
+ break;
case 'f':
f_opt = TRUE;
break;
+ case 'i':
+ input_name = optarg;
+ break;
case 'n':
n_opt = TRUE;
break;
+ case 'q':
+ q_opt = TRUE;
+ break;
case 'r':
if ((r_opt = atoi(optarg)) <= 0)
usage();
@@ -268,7 +822,10 @@ main(int argc, char *argv[])
#ifdef NCURSES_VERSION
case 'x':
x_opt = TRUE;
- use_extended_names(TRUE);
+ break;
+ case 'y':
+ y_opt = TRUE;
+ x_opt = TRUE;
break;
#endif
default:
@@ -277,36 +834,78 @@ main(int argc, char *argv[])
}
}
- if (!(b_opt || n_opt || s_opt || x_opt)) {
+#if HAVE_USE_EXTENDED_NAMES
+ use_extended_names(x_opt);
+#endif
+
+ if (!(b_opt || n_opt || s_opt)) {
b_opt = TRUE;
n_opt = TRUE;
s_opt = TRUE;
}
- for (repeat = 0; repeat < r_opt; ++repeat) {
- if (optind < argc) {
- for (n = optind; n < argc; ++n) {
- demo_terminfo(argv[n]);
+ make_dblist();
+
+ if (a_opt) {
+ for (repeat = 0; repeat < r_opt; ++repeat) {
+ if (optind < argc) {
+ for (n = optind; n < argc; ++n) {
+ brute_force(argv[n]);
+ }
+ } else if ((name = getenv("TERM")) != 0) {
+ brute_force(name);
+ } else {
+ static char dumb[] = "dumb";
+ brute_force(dumb);
+ }
+ }
+ } else {
+ if (input_name != 0) {
+ parse_description(input_name);
+ }
+#if USE_CODE_LISTS
+ else {
+ my_boolcodes = copy_code_list(boolnames);
+ my_numcodes = copy_code_list(numnames);
+ my_strcodes = copy_code_list(strnames);
+ }
+#else
+ else {
+ failed("no capability-lists available (use -i option)");
+ }
+#endif /* USE_CODE_LISTS */
+ for (repeat = 0; repeat < r_opt; ++repeat) {
+ if (optind < argc) {
+ for (n = optind; n < argc; ++n) {
+ demo_terminfo(argv[n]);
+ }
+ } else if ((name = getenv("TERM")) != 0) {
+ demo_terminfo(name);
+ } else {
+ static char dumb[] = "dumb";
+ demo_terminfo(dumb);
}
- } else if ((name = getenv("TERM")) != 0) {
- demo_terminfo(name);
- } else {
- static char dumb[] = "dumb";
- demo_terminfo(dumb);
}
}
+ printf("%ld values (%ld booleans, %ld numbers, %ld strings)\n",
+ total_values, total_b_values, total_n_values, total_s_values);
+
+#ifdef NO_LEAKS
+ free_dblist();
+ if (my_blob != 0) {
+ free(my_blob);
+ free(my_boolcodes);
+ free(my_numcodes);
+ free(my_numvalues);
+ free(my_strcodes);
+ free(my_strvalues);
+ }
+#endif
+
ExitProgram(EXIT_SUCCESS);
}
-#else
-int
-main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
-{
- printf("This program requires the terminfo arrays\n");
- ExitProgram(EXIT_FAILURE);
-}
-#endif
#else /* !HAVE_TIGETSTR */
int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
diff --git a/test/ditto.c b/test/ditto.c
index 636a6ee..921f216 100644
--- a/test/ditto.c
+++ b/test/ditto.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,7 +29,7 @@
/*
* Author: Thomas E. Dickey (1998-on)
*
- * $Id: ditto.c,v 1.40 2010/11/14 01:06:47 tom Exp $
+ * $Id: ditto.c,v 1.42 2012/11/24 20:16:18 tom Exp $
*
* The program illustrates how to set up multiple screens from a single
* program.
@@ -80,6 +80,7 @@ typedef struct {
int which1; /* this screen's index in DITTO[] array */
int length; /* length of windows[] and peeks[] */
char **titles; /* per-window titles */
+ WINDOW **parents; /* display boxes around each screen's data */
WINDOW **windows; /* display data from each screen */
PEEK *peeks; /* indices for each screen's fifo */
FIFO fifo; /* fifo for this screen */
@@ -98,6 +99,9 @@ typedef struct {
DITTO *ditto; /* data for all screens */
} DDATA;
+static void failed(const char *) GCC_NORETURN;
+static void usage(void) GCC_NORETURN;
+
static void
failed(const char *s)
{
@@ -201,6 +205,7 @@ init_screen(
scrollok(stdscr, TRUE);
box(stdscr, 0, 0);
+ target->parents = typeCalloc(WINDOW *, (size_t) target->length);
target->windows = typeCalloc(WINDOW *, (size_t) target->length);
target->peeks = typeCalloc(PEEK, (size_t) target->length);
@@ -220,6 +225,7 @@ init_screen(
nodelay(inner, TRUE);
#endif
+ target->parents[k] = outer;
target->windows[k] = inner;
}
doupdate();
diff --git a/test/dots.c b/test/dots.c
index 2533c7e..474d880 100644
--- a/test/dots.c
+++ b/test/dots.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1999-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1999-2011,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,7 +29,7 @@
/*
* Author: Thomas E. Dickey <dickey@clark.net> 1999
*
- * $Id: dots.c,v 1.22 2010/11/14 01:00:02 tom Exp $
+ * $Id: dots.c,v 1.25 2013/09/28 22:12:09 tom Exp $
*
* A simple demo of the terminfo interface.
*/
@@ -46,23 +46,23 @@ static bool interrupted = FALSE;
static long total_chars = 0;
static time_t started;
-static int
-outc(TPUTS_ARG c)
+static
+TPUTS_PROTO(outc, c)
{
int rc = c;
if (interrupted) {
char tmp = (char) c;
- if (write(STDOUT_FILENO, &tmp, 1) == -1)
+ if (write(STDOUT_FILENO, &tmp, (size_t) 1) == -1)
rc = EOF;
} else {
rc = putc(c, stdout);
}
- return rc;
+ TPUTS_RETURN(rc);
}
static bool
-outs(char *s)
+outs(const char *s)
{
if (valid(s)) {
tputs(s, 1, outc);
@@ -105,6 +105,7 @@ main(int argc GCC_UNUSED,
int x, y, z, p;
double r;
double c;
+ int my_colors;
CATCHALL(onsig);
@@ -112,11 +113,12 @@ main(int argc GCC_UNUSED,
setupterm((char *) 0, 1, (int *) 0);
outs(clear_screen);
outs(cursor_invisible);
- if (max_colors > 1) {
+ my_colors = max_colors;
+ if (my_colors > 1) {
if (!valid(set_a_foreground)
|| !valid(set_a_background)
|| (!valid(orig_colors) && !valid(orig_pair)))
- max_colors = -1;
+ my_colors = -1;
}
r = (double) (lines - 4);
@@ -129,8 +131,8 @@ main(int argc GCC_UNUSED,
p = (ranf() > 0.9) ? '*' : ' ';
tputs(tparm3(cursor_address, y, x), 1, outc);
- if (max_colors > 0) {
- z = (int) (ranf() * max_colors);
+ if (my_colors > 0) {
+ z = (int) (ranf() * my_colors);
if (ranf() > 0.01) {
tputs(tparm2(set_a_foreground, z), 1, outc);
} else {
diff --git a/test/dots_curses.c b/test/dots_curses.c
new file mode 100644
index 0000000..c344280
--- /dev/null
+++ b/test/dots_curses.c
@@ -0,0 +1,151 @@
+/****************************************************************************
+ * Copyright (c) 2014 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/*
+ * Author: Thomas E. Dickey
+ *
+ * $Id: dots_curses.c,v 1.3 2014/08/09 22:28:42 tom Exp $
+ *
+ * A simple demo of the curses interface used for comparison with termcap.
+ */
+#include <test.priv.h>
+
+#if !defined(__MINGW32__)
+#include <sys/time.h>
+#endif
+
+#include <time.h>
+
+#define valid(s) ((s != 0) && s != (char *)-1)
+
+static bool interrupted = FALSE;
+static long total_chars = 0;
+static time_t started;
+
+static void
+cleanup(void)
+{
+ endwin();
+
+ printf("\n\n%ld total chars, rate %.2f/sec\n",
+ total_chars,
+ ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
+}
+
+static void
+onsig(int n GCC_UNUSED)
+{
+ interrupted = TRUE;
+}
+
+static double
+ranf(void)
+{
+ long r = (rand() & 077777);
+ return ((double) r / 32768.);
+}
+
+static int
+mypair(int fg, int bg)
+{
+ int pair = (fg * COLORS) + bg;
+ return (pair >= COLOR_PAIRS) ? -1 : pair;
+}
+
+static void
+set_colors(int fg, int bg)
+{
+ int pair = mypair(fg, bg);
+ if (pair > 0) {
+ attron(COLOR_PAIR(mypair(fg, bg)));
+ }
+}
+
+int
+main(int argc GCC_UNUSED,
+ char *argv[]GCC_UNUSED)
+{
+ int x, y, z, p;
+ int fg, bg;
+ double r;
+ double c;
+
+ CATCHALL(onsig);
+
+ srand((unsigned) time(0));
+
+ initscr();
+ if (has_colors()) {
+ start_color();
+ for (fg = 0; fg < COLORS; fg++) {
+ for (bg = 0; bg < COLORS; bg++) {
+ int pair = mypair(fg, bg);
+ if (pair > 0)
+ init_pair((short) pair, (short) fg, (short) bg);
+ }
+ }
+ }
+
+ r = (double) (LINES - 4);
+ c = (double) (COLS - 4);
+ started = time((time_t *) 0);
+
+ fg = COLOR_WHITE;
+ bg = COLOR_BLACK;
+ while (!interrupted) {
+ x = (int) (c * ranf()) + 2;
+ y = (int) (r * ranf()) + 2;
+ p = (ranf() > 0.9) ? '*' : ' ';
+
+ move(y, x);
+ if (has_colors()) {
+ z = (int) (ranf() * COLORS);
+ if (ranf() > 0.01) {
+ set_colors(fg = z, bg);
+ attron(COLOR_PAIR(mypair(fg, bg)));
+ } else {
+ set_colors(fg, bg = z);
+ napms(1);
+ }
+ } else {
+ if (ranf() <= 0.01) {
+ if (ranf() > 0.6) {
+ attron(A_REVERSE);
+ } else {
+ attroff(A_REVERSE);
+ }
+ napms(1);
+ }
+ }
+ addch((chtype) p);
+ refresh();
+ ++total_chars;
+ }
+ cleanup();
+ ExitProgram(EXIT_SUCCESS);
+}
diff --git a/test/dots_mvcur.c b/test/dots_mvcur.c
index 558683d..90b9c4e 100644
--- a/test/dots_mvcur.c
+++ b/test/dots_mvcur.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2009,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,7 +29,7 @@
/*
* Author: Thomas E. Dickey - 2007
*
- * $Id: dots_mvcur.c,v 1.6 2010/11/14 01:00:44 tom Exp $
+ * $Id: dots_mvcur.c,v 1.10 2013/09/28 22:44:18 tom Exp $
*
* A simple demo of the terminfo interface, and mvcur.
*/
@@ -46,24 +46,24 @@ static bool interrupted = FALSE;
static long total_chars = 0;
static time_t started;
-static int
-outc(TPUTS_ARG c)
+static
+TPUTS_PROTO(outc, c)
{
int rc = c;
if (interrupted) {
char tmp = (char) c;
- if (write(STDOUT_FILENO, &tmp, 1) == -1)
+ if (write(STDOUT_FILENO, &tmp, (size_t) 1) == -1)
rc = EOF;
} else {
if (putc(c, stdout) == EOF)
rc = EOF;
}
- return rc;
+ TPUTS_RETURN(rc);
}
static bool
-outs(char *s)
+outs(const char *s)
{
if (valid(s)) {
tputs(s, 1, outc);
@@ -108,6 +108,7 @@ main(int argc GCC_UNUSED,
double r;
double c;
SCREEN *sp;
+ int my_colors;
CATCHALL(onsig);
@@ -116,11 +117,12 @@ main(int argc GCC_UNUSED,
outs(clear_screen);
outs(cursor_home);
outs(cursor_invisible);
- if (max_colors > 1) {
+ my_colors = max_colors;
+ if (my_colors > 1) {
if (!valid(set_a_foreground)
|| !valid(set_a_background)
|| (!valid(orig_colors) && !valid(orig_pair)))
- max_colors = -1;
+ my_colors = -1;
}
r = (double) (lines - 4);
@@ -137,8 +139,8 @@ main(int argc GCC_UNUSED,
y0 = y;
}
- if (max_colors > 0) {
- z = (int) (ranf() * max_colors);
+ if (my_colors > 0) {
+ z = (int) (ranf() * my_colors);
if (ranf() > 0.01) {
tputs(tparm2(set_a_foreground, z), 1, outc);
} else {
@@ -155,6 +157,7 @@ main(int argc GCC_UNUSED,
}
}
outc(p);
+ ++x0;
fflush(stdout);
++total_chars;
}
diff --git a/test/dots_termcap.c b/test/dots_termcap.c
new file mode 100644
index 0000000..9918e36
--- /dev/null
+++ b/test/dots_termcap.c
@@ -0,0 +1,254 @@
+/****************************************************************************
+ * Copyright (c) 2013 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/*
+ * Author: Thomas E. Dickey
+ *
+ * $Id: dots_termcap.c,v 1.8 2014/09/25 09:00:56 tom Exp $
+ *
+ * A simple demo of the termcap interface.
+ */
+#define USE_TINFO
+#include <test.priv.h>
+
+#if !defined(__MINGW32__)
+#include <sys/time.h>
+#endif
+
+#if HAVE_TGETENT
+
+#include <time.h>
+
+#define valid(s) ((s != 0) && s != (char *)-1)
+
+static bool interrupted = FALSE;
+static long total_chars = 0;
+static time_t started;
+
+static char *t_AB;
+static char *t_AF;
+static char *t_cl;
+static char *t_cm;
+static char *t_me;
+static char *t_mr;
+static char *t_oc;
+static char *t_op;
+static char *t_ve;
+static char *t_vi;
+
+static struct {
+ const char *name;
+ char **value;
+} my_caps[] = {
+
+ {
+ "AB", &t_AB
+ },
+ {
+ "AF", &t_AF
+ },
+ {
+ "cl", &t_cl
+ },
+ {
+ "cm", &t_cm
+ },
+ {
+ "me", &t_me
+ },
+ {
+ "mr", &t_mr
+ },
+ {
+ "oc", &t_oc
+ },
+ {
+ "op", &t_op
+ },
+ {
+ "ve", &t_ve
+ },
+ {
+ "vi", &t_vi
+ },
+};
+
+static
+TPUTS_PROTO(outc, c)
+{
+ int rc = c;
+
+ if (interrupted) {
+ char tmp = (char) c;
+ if (write(STDOUT_FILENO, &tmp, (size_t) 1) == -1)
+ rc = EOF;
+ } else {
+ rc = putc(c, stdout);
+ }
+ TPUTS_RETURN(rc);
+}
+
+static bool
+outs(char *s)
+{
+ if (valid(s)) {
+ tputs(s, 1, outc);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void
+cleanup(void)
+{
+ outs(t_me);
+ if (!outs(t_oc))
+ outs(t_op);
+ outs(t_cl);
+ outs(t_ve);
+
+ printf("\n\n%ld total chars, rate %.2f/sec\n",
+ total_chars,
+ ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
+}
+
+static void
+onsig(int n GCC_UNUSED)
+{
+ interrupted = TRUE;
+}
+
+static double
+ranf(void)
+{
+ long r = (rand() & 077777);
+ return ((double) r / 32768.);
+}
+
+static void
+my_napms(int ms)
+{
+#if defined(__MINGW32__) || !HAVE_GETTIMEOFDAY
+ Sleep((DWORD) ms);
+#else
+ struct timeval data;
+ data.tv_sec = 0;
+ data.tv_usec = ms * 1000;
+ select(0, NULL, NULL, NULL, &data);
+#endif
+}
+
+int
+main(int argc GCC_UNUSED,
+ char *argv[]GCC_UNUSED)
+{
+ int x, y, z, p;
+ int num_colors;
+ int num_lines;
+ int num_columns;
+ double r;
+ double c;
+ char buffer[1024];
+ char area[1024];
+ char *name;
+
+ CATCHALL(onsig);
+
+ srand((unsigned) time(0));
+
+ if ((name = getenv("TERM")) == 0) {
+ fprintf(stderr, "TERM is not set\n");
+ ExitProgram(EXIT_FAILURE);
+ } else if (tgetent(buffer, name) < 0) {
+ fprintf(stderr, "terminal description not found\n");
+ ExitProgram(EXIT_FAILURE);
+ } else {
+ size_t t;
+ char *ap = area;
+ for (t = 0; t < SIZEOF(my_caps); ++t) {
+ *(my_caps[t].value) = tgetstr((NCURSES_CONST char *)
+ my_caps[t].name, &ap);
+ }
+ }
+
+ num_colors = tgetnum("Co");
+ num_lines = tgetnum("li");
+ num_columns = tgetnum("co");
+
+ outs(t_cl);
+ outs(t_vi);
+ if (num_colors > 1) {
+ if (!valid(t_AF)
+ || !valid(t_AB)
+ || (!valid(t_oc) && !valid(t_op)))
+ num_colors = -1;
+ }
+
+ r = (double) (num_lines - 4);
+ c = (double) (num_columns - 4);
+ started = time((time_t *) 0);
+
+ while (!interrupted) {
+ x = (int) (c * ranf()) + 2;
+ y = (int) (r * ranf()) + 2;
+ p = (ranf() > 0.9) ? '*' : ' ';
+
+ tputs(tgoto(t_cm, x, y), 1, outc);
+ if (num_colors > 0) {
+ z = (int) (ranf() * num_colors);
+ if (ranf() > 0.01) {
+ tputs(tgoto(t_AF, 0, z), 1, outc);
+ } else {
+ tputs(tgoto(t_AB, 0, z), 1, outc);
+ my_napms(1);
+ }
+ } else if (valid(t_me)
+ && valid(t_mr)) {
+ if (ranf() <= 0.01) {
+ outs((ranf() > 0.6)
+ ? t_mr
+ : t_me);
+ my_napms(1);
+ }
+ }
+ outc(p);
+ fflush(stdout);
+ ++total_chars;
+ }
+ cleanup();
+ ExitProgram(EXIT_SUCCESS);
+}
+#else
+int
+main(int argc GCC_UNUSED,
+ char *argv[]GCC_UNUSED)
+{
+ fprintf(stderr, "This program requires termcap\n");
+ exit(EXIT_FAILURE);
+}
+#endif
diff --git a/test/echochar.c b/test/echochar.c
index 829d1f2..c9ac29a 100644
--- a/test/echochar.c
+++ b/test/echochar.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2006-2008,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: echochar.c,v 1.8 2010/11/14 01:00:44 tom Exp $
+ * $Id: echochar.c,v 1.10 2014/08/09 22:35:51 tom Exp $
*
* Demonstrate the echochar function (compare to dots.c).
* Thomas Dickey - 2006/11/4
diff --git a/test/edit_field.c b/test/edit_field.c
index 8a664e8..8c58cd6 100644
--- a/test/edit_field.c
+++ b/test/edit_field.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2003-2008,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,11 +26,11 @@
* authorization. *
****************************************************************************/
/*
- * $Id: edit_field.c,v 1.17 2011/01/15 18:15:11 tom Exp $
+ * $Id: edit_field.c,v 1.24 2014/09/05 08:39:52 tom Exp $
*
* A wrapper for form_driver() which keeps track of the user's editing changes
- * for each field, and makes the result available as a null-terminated string
- * in field_buffer(field,1).
+ * for each field, and makes the resulting length available as a
+ * null-terminated string in field_buffer(field,1).
*
* Thomas Dickey - 2003/4/26.
*/
@@ -297,8 +297,54 @@ offset_in_field(FORM * form)
static void
inactive_field(FIELD * f)
{
- FieldAttrs *ptr = (FieldAttrs *) field_userptr(f);
- set_field_back(f, ptr->background);
+ set_field_back(f, field_attrs(f)->background);
+}
+
+FieldAttrs *
+field_attrs(FIELD * f)
+{
+ return (FieldAttrs *) field_userptr(f);
+}
+
+static int
+buffer_length(FIELD * f)
+{
+ return field_attrs(f)->row_lengths[0];
+}
+
+static void
+set_buffer_length(FIELD * f, int length)
+{
+ field_attrs(f)->row_lengths[0] = length;
+}
+
+/*
+ * The userptr is used in edit_field.c's inactive_field(), as well as for
+ * keeping track of the actual lengths of lines in a multiline field.
+ */
+void
+init_edit_field(FIELD * f, char *value)
+{
+ char empty[1];
+ FieldAttrs *ptr = field_attrs(f);
+ if (ptr == 0) {
+ int rows, cols, frow, fcol, nrow, nbuf;
+
+ ptr = typeCalloc(FieldAttrs, (size_t) 1);
+ ptr->background = field_back(f);
+ if (field_info(f, &rows, &cols, &frow, &fcol, &nrow, &nbuf) == E_OK) {
+ ptr->row_count = nrow;
+ ptr->row_lengths = typeCalloc(int, (size_t) nrow + 1);
+ }
+ }
+ if (value == 0) {
+ value = empty;
+ *value = '\0';
+ }
+ set_field_userptr(f, (void *) ptr);
+ set_field_buffer(f, 0, value); /* will be formatted */
+ set_field_buffer(f, 1, value); /* will be unformatted */
+ set_buffer_length(f, (int) strlen(value));
}
int
@@ -308,9 +354,7 @@ edit_field(FORM * form, int *result)
int status;
FIELD *before;
unsigned n;
- char lengths[80];
int length;
- char *buffer;
int before_row;
int before_col;
int before_off = offset_in_field(form);
@@ -337,9 +381,7 @@ edit_field(FORM * form, int *result)
if (status == E_OK) {
bool modified = TRUE;
- length = 0;
- if ((buffer = field_buffer(before, 1)) != 0)
- length = atoi(buffer);
+ length = buffer_length(before);
if (length < before_off)
length = before_off;
switch (*result) {
@@ -347,7 +389,7 @@ edit_field(FORM * form, int *result)
length = before_off;
break;
case REQ_CLR_EOL:
- if (before_row + 1 == before->rows)
+ if ((int) (before_row + 1) == (int) (before->rows))
length = before_off;
break;
case REQ_CLR_FIELD:
@@ -445,8 +487,7 @@ edit_field(FORM * form, int *result)
< MIN_FORM_COMMAND)
++length;
- sprintf(lengths, "%d", length);
- set_field_buffer(before, 1, lengths);
+ set_buffer_length(before, length);
}
if (current_field(form) != before)
diff --git a/test/edit_field.h b/test/edit_field.h
index eacade3..3c5b80e 100644
--- a/test/edit_field.h
+++ b/test/edit_field.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2003-2006,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2008,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: edit_field.h,v 1.6 2008/12/20 19:23:18 tom Exp $
+ * $Id: edit_field.h,v 1.9 2013/06/08 15:46:01 tom Exp $
*
* Interface of edit_field.c
*/
@@ -45,8 +45,12 @@
typedef struct {
chtype background;
+ int row_count;
+ int *row_lengths;
} FieldAttrs;
+extern FieldAttrs *field_attrs(FIELD * field);
+extern void init_edit_field(FIELD * field, char *value);
extern void help_edit_field(void);
extern int edit_field(FORM * form, int *result);
diff --git a/test/filter.c b/test/filter.c
index 489136e..ab2d856 100644
--- a/test/filter.c
+++ b/test/filter.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,7 +29,7 @@
/*
* Author: Thomas E. Dickey <dickey@clark.net> 1998
*
- * $Id: filter.c,v 1.13 2010/11/13 20:55:54 tom Exp $
+ * $Id: filter.c,v 1.16 2014/08/09 22:35:51 tom Exp $
*/
#include <test.priv.h>
@@ -48,7 +48,7 @@
*/
static int
-new_command(char *buffer, int length, attr_t underline)
+new_command(char *buffer, int length, int underline)
{
int code;
@@ -99,7 +99,7 @@ main(int argc, char *argv[])
{
int ch;
char buffer[80];
- attr_t underline;
+ int underline;
bool i_option = FALSE;
setlocale(LC_ALL, "");
@@ -143,7 +143,7 @@ main(int argc, char *argv[])
reset_shell_mode();
printf("\n");
fflush(stdout);
- system(buffer);
+ IGNORE_RC(system(buffer));
reset_prog_mode();
touchwin(stdscr);
erase();
diff --git a/test/firework.c b/test/firework.c
index 2c409d8..6d35d50 100644
--- a/test/firework.c
+++ b/test/firework.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: firework.c,v 1.27 2010/11/13 20:58:25 tom Exp $
+ * $Id: firework.c,v 1.30 2014/08/02 17:24:07 tom Exp $
*/
#include <test.priv.h>
@@ -41,7 +41,7 @@ cleanup(void)
endwin();
}
-static RETSIGTYPE
+static void
onsig(int n GCC_UNUSED)
{
cleanup();
@@ -94,14 +94,14 @@ explode(int row, int col)
showit();
init_pair(1, get_colour(&bold), my_bg);
- (void) attrset(COLOR_PAIR(1) | bold);
+ (void) attrset(AttrArg(COLOR_PAIR(1), bold));
MvPrintw(row - 1, col - 1, " - ");
MvPrintw(row + 0, col - 1, "-+-");
MvPrintw(row + 1, col - 1, " - ");
showit();
init_pair(1, get_colour(&bold), my_bg);
- (void) attrset(COLOR_PAIR(1) | bold);
+ (void) attrset(AttrArg(COLOR_PAIR(1), bold));
MvPrintw(row - 2, col - 2, " --- ");
MvPrintw(row - 1, col - 2, "-+++-");
MvPrintw(row + 0, col - 2, "-+#+-");
@@ -110,7 +110,7 @@ explode(int row, int col)
showit();
init_pair(1, get_colour(&bold), my_bg);
- (void) attrset(COLOR_PAIR(1) | bold);
+ (void) attrset(AttrArg(COLOR_PAIR(1), bold));
MvPrintw(row - 2, col - 2, " +++ ");
MvPrintw(row - 1, col - 2, "++#++");
MvPrintw(row + 0, col - 2, "+# #+");
@@ -119,7 +119,7 @@ explode(int row, int col)
showit();
init_pair(1, get_colour(&bold), my_bg);
- (void) attrset(COLOR_PAIR(1) | bold);
+ (void) attrset(AttrArg(COLOR_PAIR(1), bold));
MvPrintw(row - 2, col - 2, " # ");
MvPrintw(row - 1, col - 2, "## ##");
MvPrintw(row + 0, col - 2, "# #");
@@ -128,7 +128,7 @@ explode(int row, int col)
showit();
init_pair(1, get_colour(&bold), my_bg);
- (void) attrset(COLOR_PAIR(1) | bold);
+ (void) attrset(AttrArg(COLOR_PAIR(1), bold));
MvPrintw(row - 2, col - 2, " # # ");
MvPrintw(row - 1, col - 2, "# #");
MvPrintw(row + 0, col - 2, " ");
@@ -173,7 +173,7 @@ main(
direction = (start > end) ? -1 : 1;
diff = abs(start - end);
} while (diff < 2 || diff >= LINES - 2);
- (void) attrset(A_NORMAL);
+ (void) attrset(AttrArg(0, A_NORMAL));
for (row = 0; row < diff; row++) {
MvPrintw(LINES - row, start + (row * direction),
(direction < 0) ? "\\" : "/");
diff --git a/test/form_driver_w.c b/test/form_driver_w.c
new file mode 100644
index 0000000..3e928af
--- /dev/null
+++ b/test/form_driver_w.c
@@ -0,0 +1,150 @@
+/****************************************************************************
+ * Copyright (c) 2013,2014 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Gaute Hope, 2013 *
+ ****************************************************************************/
+
+/*
+ * $Id: form_driver_w.c,v 1.13 2014/08/02 17:24:55 tom Exp $
+ *
+ * Test form_driver_w (int, int, wchar_t), a wide char aware
+ * replacement of form_driver.
+ */
+
+#include <locale.h>
+
+#include <test.priv.h>
+
+#if USE_WIDEC_SUPPORT && USE_LIBFORM && (defined(NCURSES_VERSION_PATCH) && NCURSES_VERSION_PATCH >= 20131207)
+
+#include <form.h>
+
+int
+main(void)
+{
+ FIELD *field[3];
+ FORM *my_form;
+ bool done = FALSE;
+
+ setlocale(LC_ALL, "");
+
+ /* Initialize curses */
+ initscr();
+ cbreak();
+ noecho();
+ keypad(stdscr, TRUE);
+
+ /* Initialize the fields */
+ field[0] = new_field(1, 10, 4, 18, 0, 0);
+ field[1] = new_field(1, 10, 6, 18, 0, 0);
+ field[2] = NULL;
+
+ /* Set field options */
+ set_field_back(field[0], A_UNDERLINE); /* Print a line for the option */
+ field_opts_off(field[0], O_AUTOSKIP); /* Don't go to next field when this */
+ /* Field is filled up */
+ set_field_back(field[1], A_UNDERLINE);
+ field_opts_off(field[1], O_AUTOSKIP);
+
+ /* Create the form and post it */
+ my_form = new_form(field);
+ post_form(my_form);
+ refresh();
+
+ mvprintw(4, 10, "Value 1:");
+ mvprintw(6, 10, "Value 2:");
+ refresh();
+
+ /* Loop through to get user requests */
+ while (!done) {
+ wint_t ch;
+ int ret = get_wch(&ch);
+
+ mvprintw(8, 10, "Got %d (%#x), type: %s", (int) ch, (int) ch,
+ (ret == KEY_CODE_YES)
+ ? "KEY_CODE_YES"
+ : ((ret == OK)
+ ? "OK"
+ : ((ret == ERR)
+ ? "ERR"
+ : "?")));
+ clrtoeol();
+
+ switch (ret) {
+ case KEY_CODE_YES:
+ switch (ch) {
+ case KEY_DOWN:
+ /* Go to next field */
+ form_driver_w(my_form, KEY_CODE_YES, REQ_NEXT_FIELD);
+ /* Go to the end of the present buffer */
+ /* Leaves nicely at the last character */
+ form_driver_w(my_form, KEY_CODE_YES, REQ_END_LINE);
+ break;
+ case KEY_UP:
+ /* Go to previous field */
+ form_driver_w(my_form, KEY_CODE_YES, REQ_PREV_FIELD);
+ form_driver_w(my_form, KEY_CODE_YES, REQ_END_LINE);
+ break;
+ default:
+ break;
+ }
+ break;
+ case OK:
+ switch (ch) {
+ case CTRL('D'):
+ case QUIT:
+ case ESCAPE:
+ done = TRUE;
+ break;
+ default:
+ form_driver_w(my_form, OK, (wchar_t) ch);
+ break;
+ }
+ break;
+ }
+ }
+
+ /* Un post form and free the memory */
+ unpost_form(my_form);
+ free_form(my_form);
+ free_field(field[0]);
+ free_field(field[1]);
+
+ endwin();
+ ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(void)
+{
+ printf("This program requires the wide-ncurses and forms library\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif /* USE_WIDEC_SUPPORT */
diff --git a/test/gdc.c b/test/gdc.c
index f3018cd..04ea1b6 100644
--- a/test/gdc.c
+++ b/test/gdc.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -27,13 +27,13 @@
****************************************************************************/
/*
* Grand digital clock for curses compatible terminals
- * Usage: gdc [-s] [n] -- run for n seconds (default infinity)
+ * Usage: gdc [-s] [-t hh:mm:ss] [n] -- run for n seconds (default infinity)
* Flags: -s: scroll
*
* modified 10-18-89 for curses (jrl)
* 10-18-89 added signal handling
*
- * $Id: gdc.c,v 1.34 2010/11/13 21:01:23 tom Exp $
+ * $Id: gdc.c,v 1.42 2014/08/09 22:28:42 tom Exp $
*/
#include <test.priv.h>
@@ -60,7 +60,7 @@ static int sigtermed = 0;
static bool redirected = FALSE;
static bool hascolor = FALSE;
-static RETSIGTYPE
+static void
sighndl(int signo)
{
signal(signo, sighndl);
@@ -72,13 +72,24 @@ sighndl(int signo)
}
static void
+check_term(void)
+{
+ if (sigtermed) {
+ (void) standend();
+ endwin();
+ fprintf(stderr, "gdc terminated by signal %d\n", sigtermed);
+ ExitProgram(EXIT_FAILURE);
+ }
+}
+
+static void
drawbox(bool scrolling)
{
chtype bottom[XLENGTH + 1];
int n;
if (hascolor)
- (void) attrset(COLOR_PAIR(PAIR_FRAMES));
+ (void) attrset(AttrArg(COLOR_PAIR(PAIR_FRAMES), 0));
MvAddCh(YBASE - 1, XBASE - 1, ACS_ULCORNER);
hline(ACS_HLINE, XLENGTH);
@@ -102,7 +113,7 @@ drawbox(bool scrolling)
vline(ACS_VLINE, YDEPTH);
if (hascolor)
- (void) attrset(COLOR_PAIR(PAIR_OTHERS));
+ (void) attrset(AttrArg(COLOR_PAIR(PAIR_OTHERS), 0));
}
static void
@@ -147,6 +158,7 @@ usage(void)
,"Options:"
," -n redirect input to /dev/null"
," -s scroll each number into place, rather than flipping"
+ ," -t hh:mm:ss specify starting time (default is ``now'')"
,""
,"If you specify a count, gdc runs for that number of seconds"
};
@@ -156,6 +168,43 @@ usage(void)
ExitProgram(EXIT_FAILURE);
}
+static time_t
+parse_time(const char *value)
+{
+ int hh, mm, ss;
+ int check;
+ time_t result;
+ char c;
+ struct tm *tm;
+
+ if (sscanf(value, "%d:%d:%d%c", &hh, &mm, &ss, &c) != 3) {
+ if (sscanf(value, "%02d%02d%02d%c", &hh, &mm, &ss, &c) != 3) {
+ usage();
+ }
+ }
+
+ if ((hh < 0) || (hh >= 24) ||
+ (mm < 0) || (mm >= 60) ||
+ (ss < 0) || (ss >= 60)) {
+ usage();
+ }
+
+ /* adjust so that the localtime in the main loop will give usable time */
+ result = (hh * 3600) + ((mm * 60) + ss);
+ for (check = 0; check < 24; ++check) {
+ tm = localtime(&result);
+ if (tm->tm_hour == hh)
+ break;
+ result += 3600;
+ }
+
+ if (tm->tm_hour != hh) {
+ fprintf(stderr, "Cannot find local time for %s!\n", value);
+ usage();
+ }
+ return result;
+}
+
int
main(int argc, char *argv[])
{
@@ -166,21 +215,26 @@ main(int argc, char *argv[])
int count = 0;
FILE *ofp = stdout;
FILE *ifp = stdin;
- bool scrol = FALSE;
+ bool smooth = FALSE;
+ bool stages = FALSE;
+ time_t starts = 0;
setlocale(LC_ALL, "");
CATCHALL(sighndl);
- while ((k = getopt(argc, argv, "sn")) != -1) {
+ while ((k = getopt(argc, argv, "nst:")) != -1) {
switch (k) {
- case 's':
- scrol = TRUE;
- break;
case 'n':
ifp = fopen("/dev/null", "r");
redirected = TRUE;
break;
+ case 's':
+ smooth = TRUE;
+ break;
+ case 't':
+ starts = parse_time(optarg);
+ break;
default:
usage();
}
@@ -220,7 +274,7 @@ main(int argc, char *argv[])
init_pair(PAIR_DIGITS, COLOR_BLACK, COLOR_RED);
init_pair(PAIR_OTHERS, COLOR_RED, bg);
init_pair(PAIR_FRAMES, COLOR_WHITE, bg);
- (void) attrset(COLOR_PAIR(PAIR_OTHERS));
+ (void) attrset(AttrArg(COLOR_PAIR(PAIR_OTHERS), 0));
}
restart:
@@ -231,9 +285,13 @@ main(int argc, char *argv[])
drawbox(FALSE);
do {
- char buf[30];
+ char buf[40];
- time(&now);
+ if (starts != 0) {
+ now = ++starts;
+ } else {
+ time(&now);
+ }
tm = localtime(&now);
mask = 0;
@@ -247,12 +305,13 @@ main(int argc, char *argv[])
set(10, 17);
for (k = 0; k < 6; k++) {
- if (scrol) {
+ if (smooth) {
for (i = 0; i < 5; i++)
newer[i] = (newer[i] & ~mask) | (newer[i + 1] & mask);
newer[5] = (newer[5] & ~mask) | (next[k] & mask);
- } else
+ } else {
newer[k] = (newer[k] & ~mask) | (next[k] & mask);
+ }
next[k] = 0;
for (s = 1; s >= 0; s--) {
standt(s);
@@ -273,7 +332,7 @@ main(int argc, char *argv[])
}
}
if (!s) {
- if (scrol)
+ if (smooth)
drawbox(TRUE);
refresh();
/*
@@ -286,14 +345,41 @@ main(int argc, char *argv[])
* a lot of time when asking what time it is, at the top of
* this loop -T.Dickey
*/
- if (scrol)
+ if (smooth)
napms(85);
+ if (stages) {
+ stages = FALSE;
+ switch (wgetch(stdscr)) {
+ case 'q':
+ count = 1;
+ break;
+ case 'S':
+ stages = TRUE;
+ /* FALLTHRU */
+ case 's':
+ nodelay(stdscr, FALSE);
+ break;
+ case ' ':
+ nodelay(stdscr, TRUE);
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+#endif
+ case '?':
+ goto restart;
+ case ERR:
+ check_term();
+ /* FALLTHRU */
+ default:
+ continue;
+ }
+ }
}
}
}
/* this depends on the detailed format of ctime(3) */
- (void) strcpy(buf, ctime(&now));
+ (void) strncpy(buf, ctime(&now), (size_t) 30);
(void) strcpy(buf + 10, buf + 19);
MvAddStr(16, 30, buf);
@@ -302,11 +388,11 @@ main(int argc, char *argv[])
refresh();
/*
- * If we're not scrolling, wait 1000 msec (1 sec). Use napms() rather
- * than sleep() because the latter does odd things on some systems,
- * e.g., suspending output as well.
+ * If we're not smooth-scrolling, wait 1000 msec (1 sec). Use napms()
+ * rather than sleep() because the latter does odd things on some
+ * systems, e.g., suspending output as well.
*/
- if (scrol)
+ if (smooth)
napms(500);
else
napms(1000);
@@ -318,10 +404,14 @@ main(int argc, char *argv[])
* will return an error if interrupted. This works only if we can
* read from the input, of course.
*/
+ stages = FALSE;
switch (wgetch(stdscr)) {
case 'q':
count = 1;
break;
+ case 'S':
+ stages = TRUE;
+ /* FALLTHRU */
case 's':
nodelay(stdscr, FALSE);
break;
@@ -334,12 +424,7 @@ main(int argc, char *argv[])
case '?':
goto restart;
case ERR:
- if (sigtermed) {
- (void) standend();
- endwin();
- fprintf(stderr, "gdc terminated by signal %d\n", sigtermed);
- ExitProgram(EXIT_FAILURE);
- }
+ check_term();
/* FALLTHRU */
default:
continue;
diff --git a/test/hanoi.c b/test/hanoi.c
index 3366e93..7447ae2 100644
--- a/test/hanoi.c
+++ b/test/hanoi.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -41,10 +41,11 @@
*
* Date: 05.Nov.90
*
- * $Id: hanoi.c,v 1.31 2010/11/14 01:01:07 tom Exp $
+ * $Id: hanoi.c,v 1.36 2014/08/02 17:24:07 tom Exp $
*/
#include <test.priv.h>
+#include <math.h>
#define NPEGS 3 /* This is not configurable !! */
#define MINTILES 3
@@ -57,7 +58,7 @@
#define MIDPEG 39
#define RIGHTPEG 59
-#define LENTOIND(x) (((x)-1)/2)
+#define LENTOIND(x) (((int)(x)-1)/2)
#define OTHER(a,b) (3-((a)+(b)))
struct Peg {
@@ -84,10 +85,11 @@ static short TileColour[] =
COLOR_MAGENTA, /* Length 17 */
COLOR_RED, /* Length 19 */
};
+static int NTiles = 0;
static int NMoves = 0;
static bool AutoFlag = FALSE;
-static void InitTiles(int NTiles);
+static void InitTiles(void);
static void DisplayTiles(void);
static void MakeMove(int From, int To);
static void AutoMove(int From, int To, int Num);
@@ -99,7 +101,7 @@ static int InvalidMove(int From, int To);
int
main(int argc, char **argv)
{
- int NTiles, FromCol, ToCol;
+ int FromCol, ToCol;
setlocale(LC_ALL, "");
@@ -130,9 +132,6 @@ main(int argc, char **argv)
Usage();
ExitProgram(EXIT_FAILURE);
}
-#ifdef TRACE
- trace(TRACE_MAXIMUM);
-#endif
initscr();
if (has_colors()) {
int i;
@@ -155,7 +154,7 @@ main(int argc, char **argv)
curs_set(0);
leaveok(stdscr, TRUE); /* Attempt to remove cursor */
}
- InitTiles(NTiles);
+ InitTiles();
DisplayTiles();
if (AutoFlag) {
do {
@@ -211,7 +210,7 @@ InvalidMove(int From, int To)
}
static void
-InitTiles(int NTiles)
+InitTiles(void)
{
int Size, SlotNo;
@@ -232,7 +231,7 @@ DisplayTiles(void)
erase();
MvAddStr(1, 24, "T O W E R S O F H A N O I");
MvAddStr(3, 34, "SJR 1990");
- MvPrintw(19, 5, "Moves : %d", NMoves);
+ MvPrintw(19, 5, "Moves : %d of %.0f", NMoves, pow(2.0, (float) NTiles) - 1);
(void) attrset(A_REVERSE);
MvAddStr(BASELINE, 8,
" ");
@@ -255,7 +254,7 @@ DisplayTiles(void)
memset(TileBuf, ' ', len);
TileBuf[len] = '\0';
if (has_colors())
- (void) attrset(COLOR_PAIR(LENTOIND(len)));
+ (void) attrset(AttrArg(COLOR_PAIR(LENTOIND(len)), 0));
else
(void) attrset(A_REVERSE);
MvAddStr(BASELINE - (SlotNo + 1),
@@ -310,12 +309,12 @@ AutoMove(int From, int To, int Num)
if (Num == 1) {
MakeMove(From, To);
napms(500);
- return;
+ } else {
+ AutoMove(From, OTHER(From, To), Num - 1);
+ MakeMove(From, To);
+ napms(500);
+ AutoMove(OTHER(From, To), To, Num - 1);
}
- AutoMove(From, OTHER(From, To), Num - 1);
- MakeMove(From, To);
- napms(500);
- AutoMove(OTHER(From, To), To, Num - 1);
}
static int
diff --git a/test/hashtest.c b/test/hashtest.c
index 919a109..8499221 100644
--- a/test/hashtest.c
+++ b/test/hashtest.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,7 +30,7 @@
*
* Generate timing statistics for vertical-motion optimization.
*
- * $Id: hashtest.c,v 1.31 2010/11/13 23:43:15 tom Exp $
+ * $Id: hashtest.c,v 1.32 2013/04/27 19:50:17 tom Exp $
*/
#include <test.priv.h>
@@ -54,7 +54,7 @@ cleanup(void)
endwin();
}
-static RETSIGTYPE
+static void
finish(int sig GCC_UNUSED)
{
cleanup();
diff --git a/test/inchs.c b/test/inchs.c
index f07a2bd..be3aab8 100644
--- a/test/inchs.c
+++ b/test/inchs.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2007,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: inchs.c,v 1.11 2010/11/13 23:41:23 tom Exp $
+ * $Id: inchs.c,v 1.12 2012/11/18 01:58:15 tom Exp $
*
* Author: Thomas E Dickey
*/
@@ -50,6 +50,16 @@
#define BASE_Y 7
#define MAX_COLS 1024
+static void
+failed(const char *s)
+{
+ int save = errno;
+ endwin();
+ errno = save;
+ perror(s);
+ ExitProgram(EXIT_FAILURE);
+}
+
static bool
Quit(int ch)
{
@@ -87,6 +97,8 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
txtwin = stdscr;
base_y = BASE_Y;
}
+ if (txtwin == 0)
+ failed("cannot create txtwin");
keypad(txtwin, TRUE); /* enable keyboard mapping */
(void) cbreak(); /* take input chars one at a time, no wait for \n */
diff --git a/test/ins_wide.c b/test/ins_wide.c
index 87deb1a..8e7c123 100644
--- a/test/ins_wide.c
+++ b/test/ins_wide.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2002-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: ins_wide.c,v 1.15 2010/12/12 00:20:14 tom Exp $
+ * $Id: ins_wide.c,v 1.21 2014/08/02 17:24:55 tom Exp $
*
* Demonstrate the wins_wstr() and wins_wch functions.
* Thomas Dickey - 2002/11/23
@@ -132,7 +132,7 @@ ColOf(wchar_t *buffer, int length, int margin)
result += 2;
break;
default:
- result += wcwidth(ch);
+ result += wcwidth((wchar_t) ch);
if (ch < 32)
++result;
break;
@@ -228,8 +228,9 @@ test_inserts(int level)
WINDOW *work = 0;
WINDOW *show = 0;
int margin = (2 * MY_TABSIZE) - 1;
- Options option = ((m_opt ? oMove : oDefault)
- | ((w_opt || (level > 0)) ? oWindow : oDefault));
+ Options option = (Options) ((int) (m_opt ? oMove : oDefault)
+ | (int) ((w_opt || (level > 0))
+ ? oWindow : oDefault));
if (first) {
static char cmd[80];
@@ -241,6 +242,15 @@ test_inserts(int level)
(void) cbreak(); /* take input chars one at a time, no wait for \n */
(void) noecho(); /* don't echo input */
keypad(stdscr, TRUE);
+
+ /*
+ * Show the characters inserted in color, to distinguish from those
+ * that are shifted.
+ */
+ if (has_colors()) {
+ start_color();
+ init_pair(1, COLOR_WHITE, COLOR_BLUE);
+ }
}
limit = LINES - 5;
@@ -274,14 +284,8 @@ test_inserts(int level)
doupdate();
- /*
- * Show the characters inserted in color, to distinguish from those that
- * are shifted.
- */
if (has_colors()) {
- start_color();
- init_pair(1, COLOR_WHITE, COLOR_BLUE);
- wbkgdset(work, COLOR_PAIR(1) | ' ');
+ wbkgdset(work, (chtype) (COLOR_PAIR(1) | ' '));
}
while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
@@ -290,11 +294,13 @@ test_inserts(int level)
case key_RECUR:
test_inserts(level + 1);
- touchwin(look);
+ if (look)
+ touchwin(look);
touchwin(work);
touchwin(show);
- wnoutrefresh(look);
+ if (look)
+ wnoutrefresh(look);
wnoutrefresh(work);
wnoutrefresh(show);
@@ -384,7 +390,7 @@ test_inserts(int level)
}
break;
default:
- buffer[length++] = ch;
+ buffer[length++] = (wchar_t) ch;
buffer[length] = '\0';
/* put the string in, one character at a time */
@@ -438,10 +444,10 @@ test_inserts(int level)
}
}
if (level > 0) {
- delwin(show);
delwin(work);
delwin(look);
}
+ delwin(show);
}
static void
diff --git a/test/insdelln.c b/test/insdelln.c
index d5034a4..34fb388 100644
--- a/test/insdelln.c
+++ b/test/insdelln.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2008-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2008-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: insdelln.c,v 1.5 2010/11/13 23:39:38 tom Exp $
+ * $Id: insdelln.c,v 1.9 2014/08/02 23:09:32 tom Exp $
*
* test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln
*/
@@ -175,6 +175,8 @@ do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
delwin(win1);
touchwin(win);
} else {
+ if (win1)
+ delwin(win1);
beep();
}
}
@@ -300,7 +302,7 @@ test_winsdelln(WINDOW *win)
init_status(win, &st);
do {
- (void) wattrset(win, st.attr | (attr_t) COLOR_PAIR(st.pair));
+ (void) wattrset(win, AttrArg(COLOR_PAIR(st.pair), st.attr));
switch (st.ch) {
case 'i':
for (n = 0; n < st.count; ++n)
@@ -341,7 +343,7 @@ test_insdelln(void)
init_status(stdscr, &st);
do {
- (void) attrset(st.attr | (attr_t) COLOR_PAIR(st.pair));
+ (void) attrset(AttrArg(COLOR_PAIR(st.pair), st.attr));
switch (st.ch) {
case 'i':
for (n = 0; n < st.count; ++n)
diff --git a/test/inserts.c b/test/inserts.c
index a12fa40..ae38fa2 100644
--- a/test/inserts.c
+++ b/test/inserts.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2002-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: inserts.c,v 1.23 2010/12/12 00:19:55 tom Exp $
+ * $Id: inserts.c,v 1.27 2012/12/16 00:35:27 tom Exp $
*
* Demonstrate the winsstr() and winsch functions.
* Thomas Dickey - 2002/10/19
@@ -167,6 +167,15 @@ test_inserts(int level)
(void) cbreak(); /* take input chars one at a time, no wait for \n */
(void) noecho(); /* don't echo input */
keypad(stdscr, TRUE);
+
+ /*
+ * Show the characters inserted in color, to distinguish from those
+ * that are shifted.
+ */
+ if (has_colors()) {
+ start_color();
+ init_pair(1, COLOR_WHITE, COLOR_BLUE);
+ }
}
limit = LINES - 5;
@@ -200,14 +209,8 @@ test_inserts(int level)
doupdate();
- /*
- * Show the characters inserted in color, to distinguish from those that
- * are shifted.
- */
if (has_colors()) {
- start_color();
- init_pair(1, COLOR_WHITE, COLOR_BLUE);
- wbkgdset(work, COLOR_PAIR(1) | ' ');
+ wbkgdset(work, (chtype) (COLOR_PAIR(1) | ' '));
}
while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
@@ -216,11 +219,13 @@ test_inserts(int level)
case key_RECUR:
test_inserts(level + 1);
- touchwin(look);
+ if (look)
+ touchwin(look);
touchwin(work);
touchwin(show);
- wnoutrefresh(look);
+ if (look)
+ wnoutrefresh(look);
wnoutrefresh(work);
wnoutrefresh(show);
@@ -368,10 +373,10 @@ test_inserts(int level)
}
}
if (level > 0) {
- delwin(show);
delwin(work);
delwin(look);
}
+ delwin(show);
}
static void
diff --git a/test/key_names.c b/test/key_names.c
index ba45656..579f02f 100644
--- a/test/key_names.c
+++ b/test/key_names.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2008,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: key_names.c,v 1.4 2008/10/11 20:22:37 tom Exp $
+ * $Id: key_names.c,v 1.5 2014/08/02 17:24:55 tom Exp $
*/
#include <test.priv.h>
@@ -77,7 +77,7 @@ main(int argc, char *argv[])
endwin();
}
for (n = -1; n < KEY_MAX + 512; n++) {
- const char *result = key_name(n);
+ const char *result = key_name((wchar_t) n);
if (result != 0)
printf("%d(%5o):%s\n", n, n, result);
}
diff --git a/test/knight.c b/test/knight.c
index d9f81fa..ae9d223 100644
--- a/test/knight.c
+++ b/test/knight.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -33,7 +33,7 @@
* Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995. Mouse support
* added September 20th 1995.
*
- * $Id: knight.c,v 1.31 2010/11/13 20:44:21 tom Exp $
+ * $Id: knight.c,v 1.36 2013/02/16 19:53:08 tom Exp $
*/
#include <test.priv.h>
@@ -123,13 +123,16 @@ init_program(void)
(void) init_pair(PLUS_COLOR, (short) COLOR_RED, (short) bg);
(void) init_pair(MINUS_COLOR, (short) COLOR_GREEN, (short) bg);
- trail |= COLOR_PAIR(TRAIL_COLOR);
- plus |= COLOR_PAIR(PLUS_COLOR);
- minus |= COLOR_PAIR(MINUS_COLOR);
+ trail |= (chtype) COLOR_PAIR(TRAIL_COLOR);
+ plus |= (chtype) COLOR_PAIR(PLUS_COLOR);
+ minus |= (chtype) COLOR_PAIR(MINUS_COLOR);
}
#ifdef NCURSES_MOUSE_VERSION
(void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL);
#endif /* NCURSES_MOUSE_VERSION */
+#if defined(PDCURSES)
+ mouse_set(BUTTON1_RELEASED);
+#endif
oldch = minus;
}
@@ -300,15 +303,16 @@ mark_possibles(int prow, int pcol, chtype mark)
}
}
-static void
+static bool
find_next_move(int *y, int *x)
{
unsigned j, k;
int found = -1;
int first = -1;
- int next = 0;
+ int next = -1;
int oldy, oldx;
int newy, newx;
+ bool result = FALSE;
if (movecount > 1) {
oldy = history[movecount - 1].y;
@@ -335,9 +339,27 @@ find_next_move(int *y, int *x)
*y = oldy + offsets[next].y;
*x = oldx + offsets[next].x;
}
- } else {
- beep();
+ result = TRUE;
}
+ return result;
+}
+
+static void
+count_next_moves(int y, int x)
+{
+ int count = 0;
+ unsigned j;
+
+ wprintw(msgwin, "\nMove %d", movecount);
+ for (j = 0; j < SIZEOF(offsets); j++) {
+ int newy = y + offsets[j].y;
+ int newx = x + offsets[j].x;
+ if (chksqr(newy, newx)) {
+ ++count;
+ }
+ }
+ wprintw(msgwin, ", gives %d choices", count);
+ wclrtoeol(msgwin);
}
static void
@@ -558,8 +580,9 @@ play(void)
nx = col + 1;
break;
-#ifdef NCURSES_MOUSE_VERSION
+#ifdef KEY_MOUSE
case KEY_MOUSE:
+#ifdef NCURSES_MOUSE_VERSION
{
MEVENT myevent;
@@ -576,6 +599,24 @@ play(void)
}
}
#endif /* NCURSES_MOUSE_VERSION */
+#ifdef PDCURSES
+ {
+ int test_y, test_x;
+ request_mouse_pos();
+ test_y = MOUSE_Y_POS + 0;
+ test_x = MOUSE_X_POS + 1;
+ if (test_y >= CY(0) && test_y <= CY(BDEPTH)
+ && test_x >= CX(0) && test_x <= CX(BWIDTH)) {
+ ny = CYINV(test_y);
+ nx = CXINV(test_x);
+ wmove(helpwin, 0, 0);
+ wrefresh(helpwin);
+ ungetch('\n');
+ }
+ break;
+ }
+#endif /* PDCURSES */
+#endif /* KEY_MOUSE */
case KEY_B2:
case '\n':
@@ -614,8 +655,8 @@ play(void)
ny = history[movecount].y;
nx = history[movecount].x;
if (nx < 0 || ny < 0) {
- ny = lastrow;
- nx = lastcol;
+ ny = (lastrow >= 0) ? lastrow : 0;
+ nx = (lastcol >= 0) ? lastcol : 0;
}
movecount = 0;
board[ny][nx] = FALSE;
@@ -652,7 +693,10 @@ play(void)
case 'a':
nx = col;
ny = rw;
- find_next_move(&ny, &nx);
+ if (find_next_move(&ny, &nx))
+ count_next_moves(ny, nx);
+ else
+ beep();
break;
case 'F':
diff --git a/test/linedata.h b/test/linedata.h
index 2510ee7..751bc6b 100644
--- a/test/linedata.h
+++ b/test/linedata.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2009-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -85,10 +85,8 @@ read_linedata(WINDOW *work)
beep();
continue;
}
- } else if (code != ERR) {
- result = (int) ch;
- break;
} else {
+ result = (int) ch;
break;
}
}
diff --git a/test/make-tar.sh b/test/make-tar.sh
index 0ebccbb..a71e1e1 100755
--- a/test/make-tar.sh
+++ b/test/make-tar.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-# $Id: make-tar.sh,v 1.10 2011/03/26 20:46:51 tom Exp $
+# $Id: make-tar.sh,v 1.12 2013/10/26 23:11:43 tom Exp $
##############################################################################
-# Copyright (c) 2010,2011 Free Software Foundation, Inc. #
+# Copyright (c) 2010-2011,2013 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@@ -66,11 +66,11 @@ edit_specfile() {
make_changelog() {
test -f $1 && chmod u+w $1
cat >$1 <<EOF
-`echo $PKG_NAME|tr '[A-Z]' '[a-z]'` ($NCURSES_PATCH) unstable; urgency=low
+`echo $PKG_NAME|tr '[A-Z]' '[a-z]'` ($NCURSES_MAJOR.$NCURSES_MINOR-$NCURSES_PATCH) unstable; urgency=low
* snapshot of ncurses subpackage for $PKG_NAME.
- -- `head -1 $HOME/.signature` `date -R`
+ -- `head -n 1 $HOME/.signature` `date -R`
EOF
}
@@ -108,7 +108,10 @@ for spec in $BUILD/$ROOTNAME/package/*.spec
do
edit_specfile $spec
done
-make_changelog $BUILD/$ROOTNAME/package/debian/changelog
+for spec in $BUILD/$ROOTNAME/package/debian*
+do
+ make_changelog $spec/changelog
+done
cp -p $SOURCE/NEWS $BUILD/$ROOTNAME
diff --git a/test/modules b/test/modules
index 67c019e..b1ee5a0 100644
--- a/test/modules
+++ b/test/modules
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.43 2010/01/23 17:51:38 tom Exp $
+# $Id: modules,v 1.51 2014/06/21 15:28:46 tom Exp $
##############################################################################
-# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@@ -49,13 +49,16 @@ demo_termcap progs $(srcdir) $(HEADER_DEPS)
demo_terminfo progs $(srcdir) $(HEADER_DEPS)
ditto progs $(srcdir) $(HEADER_DEPS)
dots progs $(srcdir) $(HEADER_DEPS)
+dots_curses progs $(srcdir) $(HEADER_DEPS)
dots_mvcur progs $(srcdir) $(HEADER_DEPS)
+dots_termcap progs $(srcdir) $(HEADER_DEPS)
echochar progs $(srcdir) $(HEADER_DEPS)
edit_field progs $(srcdir) $(HEADER_DEPS) $(srcdir)/edit_field.h
filter progs $(srcdir) $(HEADER_DEPS)
firework progs $(srcdir) $(HEADER_DEPS)
firstlast progs $(srcdir) $(HEADER_DEPS)
foldkeys progs $(srcdir) $(HEADER_DEPS)
+form_driver_w progs $(srcdir) $(HEADER_DEPS)
gdc progs $(srcdir) $(HEADER_DEPS)
hanoi progs $(srcdir) $(HEADER_DEPS)
hashtest progs $(srcdir) $(HEADER_DEPS)
@@ -86,10 +89,12 @@ test_getstr progs $(srcdir) $(HEADER_DEPS)
test_instr progs $(srcdir) $(HEADER_DEPS)
test_inwstr progs $(srcdir) $(HEADER_DEPS)
test_opaque progs $(srcdir) $(HEADER_DEPS)
+test_vid_puts progs $(srcdir) $(HEADER_DEPS)
+test_vidputs progs $(srcdir) $(HEADER_DEPS)
testaddch progs $(srcdir) $(HEADER_DEPS)
testcurs progs $(srcdir) $(HEADER_DEPS)
testscanw progs $(srcdir) $(HEADER_DEPS)
-view progs $(srcdir) $(HEADER_DEPS)
+view progs $(srcdir) $(HEADER_DEPS) $(srcdir)/widechars.h
worm progs $(srcdir) $(HEADER_DEPS)
xmas progs $(srcdir) $(HEADER_DEPS)
diff --git a/test/movewindow.c b/test/movewindow.c
index e55a694..9effda4 100644
--- a/test/movewindow.c
+++ b/test/movewindow.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2006-2008,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,18 +26,22 @@
* authorization. *
****************************************************************************/
/*
- * $Id: movewindow.c,v 1.24 2010/11/13 23:34:55 tom Exp $
+ * $Id: movewindow.c,v 1.39 2013/05/04 19:41:02 tom Exp $
*
* Demonstrate move functions for windows and derived windows from the curses
* library.
*
- * Thomas Dickey - 2006/2/11
+ * Author: Thomas E. Dickey
*/
/*
derwin
mvderwin
subwin
mvwin
+
+TODO:
+ add command to reset subwindow's origin to coincide with parent.
+ add command to delete subwindow (check if it has subwindows though)
*/
#include <test.priv.h>
@@ -76,6 +80,14 @@ static unsigned num_windows;
static FRAME *all_windows;
static void
+failed(const char *s)
+{
+ perror(s);
+ endwin();
+ ExitProgram(EXIT_FAILURE);
+}
+
+static void
message(int lineno, CONST_FMT char *fmt, va_list argp)
{
int y, x;
@@ -122,7 +134,12 @@ tail_line(CONST_FMT char *fmt,...)
* Arrow keys move cursor, return location at current on non-arrow key.
*/
static PAIR *
-selectcell(WINDOW *parent, int uli, int ulj, int lri, int lrj)
+selectcell(WINDOW *parent,
+ WINDOW *child,
+ int uli, int ulj,
+ int lri, int lrj,
+ bool relative,
+ bool * more)
{
static PAIR res; /* result cell */
int si = lri - uli + 1; /* depth of the select area */
@@ -131,25 +148,46 @@ selectcell(WINDOW *parent, int uli, int ulj, int lri, int lrj)
res.y = uli;
res.x = ulj;
+
+ if (child != 0) {
+ if (relative) {
+ getparyx(child, i, j);
+ } else {
+ getbegyx(child, i, j);
+ i -= uli + getbegy(parent);
+ j -= ulj + getbegx(parent);
+ }
+ }
+
+ if (more)
+ *more = FALSE;
+
for (;;) {
- tail_line("Upper left [%2d,%2d] Lower right [%2d,%2d] -> %d,%d",
+ bool moved = FALSE;
+
+ tail_line("Upper left [%2d,%2d] Lower right [%2d,%2d] -> %d,%d -> %d,%d",
uli, ulj,
lri, lrj,
+ i, j,
uli + i, ulj + j);
wmove(parent, uli + i, ulj + j);
switch (wgetch(parent)) {
case KEY_UP:
i += si - 1;
+ moved = TRUE;
break;
case KEY_DOWN:
i++;
+ moved = TRUE;
break;
case KEY_LEFT:
j += sj - 1;
+ moved = TRUE;
break;
case KEY_RIGHT:
j++;
+ moved = TRUE;
break;
case QUIT:
case ESCAPE:
@@ -161,8 +199,13 @@ selectcell(WINDOW *parent, int uli, int ulj, int lri, int lrj)
getmouse(&event);
if (event.y > uli && event.x > ulj) {
- i = event.y - uli;
- j = event.x - ulj;
+ if (parent != stdscr) {
+ i = event.y - getbegy(parent) - uli;
+ j = event.x - getbegx(parent) - ulj;
+ } else {
+ i = event.y - uli;
+ j = event.x - ulj;
+ }
} else {
beep();
break;
@@ -175,8 +218,26 @@ selectcell(WINDOW *parent, int uli, int ulj, int lri, int lrj)
res.x = ulj + j;
return (&res);
}
- i %= si;
- j %= sj;
+
+ if (si <= 0)
+ i = 0;
+ else
+ i %= si;
+
+ if (sj <= 0)
+ j = 0;
+ else
+ j %= sj;
+
+ /*
+ * If the caller can handle continuous movement, return the result.
+ */
+ if (moved && more) {
+ *more = TRUE;
+ res.y = uli + i;
+ res.x = ulj + j;
+ return (&res);
+ }
}
}
@@ -194,12 +255,20 @@ getwindow(WINDOW *parent, PAIR * ul, PAIR * lr)
bool result = FALSE;
head_line("Use arrows to move cursor, anything else to mark corner 1");
- if ((tmp = selectcell(parent, min_line, min_col, max_line, max_col)) != 0) {
+ if ((tmp = selectcell(parent, 0,
+ min_line, min_col,
+ max_line, max_col,
+ FALSE,
+ (bool *) 0)) != 0) {
*ul = *tmp;
MvWAddCh(parent, ul->y, ul->x, '*');
head_line("Use arrows to move cursor, anything else to mark corner 2");
- if ((tmp = selectcell(parent, ul->y, ul->x, max_line, max_col)) != 0) {
+ if ((tmp = selectcell(parent, 0,
+ ul->y, ul->x,
+ max_line, max_col,
+ FALSE,
+ (bool *) 0)) != 0) {
*lr = *tmp;
MvWAddCh(parent, lr->y, lr->x, '*');
wmove(parent, lr->y, lr->x);
@@ -252,6 +321,8 @@ add_window(WINDOW *parent, WINDOW *child)
keypad(child, TRUE);
if (need > have) {
all_windows = typeRealloc(FRAME, need, all_windows);
+ if (!all_windows)
+ failed("add_window");
}
all_windows[num_windows].parent = parent;
all_windows[num_windows].child = child;
@@ -341,10 +412,7 @@ recur_move_window(WINDOW *parent, int dy, int dx)
for (n = 0; n < num_windows; ++n) {
if (all_windows[n].parent == parent) {
- int y0, x0;
-
- getbegyx(all_windows[n].child, y0, x0);
- mvwin(all_windows[n].child, y0 + dy, x0 + dx);
+ mvwin(all_windows[n].child, dy, dx);
recur_move_window(all_windows[n].child, dy, dx);
}
}
@@ -366,20 +434,24 @@ move_window(WINDOW *win, bool recur)
int min_line = top ? LINE_MIN : 0;
int max_line = top ? LINE_MAX : getmaxy(parent);
PAIR *tmp;
+ bool more;
head_line("Select new position for %swindow", top ? "" : "sub");
- if ((tmp = selectcell(parent,
- min_line, min_col,
- max_line, max_col)) != 0) {
+ while ((tmp = selectcell(parent,
+ win,
+ min_line, min_col,
+ max_line, max_col,
+ FALSE,
+ &more)) != 0) {
int y0, x0;
getbegyx(parent, y0, x0);
/*
- * Note: Moving a subwindow has the effect of moving a viewport
- * around the screen. The parent window retains the contents of
- * the subwindow in the original location, but the viewport will
- * show the contents (again) at the new location. So it will look
- * odd when testing.
+ * Moving a subwindow has the effect of moving a viewport around
+ * the screen. The parent window retains the contents of the
+ * subwindow in the original location, but the viewport will show
+ * the contents (again) at the new location. So it will look odd
+ * when testing.
*/
if (mvwin(win, y0 + tmp->y, x0 + tmp->x) != ERR) {
if (recur) {
@@ -388,45 +460,69 @@ move_window(WINDOW *win, bool recur)
refresh_all(win);
doupdate();
result = TRUE;
+ } else {
+ result = FALSE;
}
+ if (!more)
+ break;
}
}
+ head_line("done");
return result;
}
+static void
+show_derwin(WINDOW *win)
+{
+ int pary, parx, maxy, maxx;
+
+ getmaxyx(win, maxy, maxx);
+ getparyx(win, pary, parx);
+
+ head_line("Select new position for derived window at %d,%d (%d,%d)",
+ pary, parx, maxy, maxx);
+}
+
/*
* test mvderwin().
*/
static bool
-move_subwin(WINDOW *win)
+move_derwin(WINDOW *win)
{
WINDOW *parent = parent_of(win);
bool result = FALSE;
if (parent != 0) {
bool top = (parent == stdscr);
- if (!top) {
- int min_col = top ? COL_MIN : 0;
- int max_col = top ? COL_MAX : getmaxx(parent);
- int min_line = top ? LINE_MIN : 0;
- int max_line = top ? LINE_MAX : getmaxy(parent);
- PAIR *tmp;
-
- head_line("Select new position for subwindow");
-
- if ((tmp = selectcell(parent,
- min_line, min_col,
- max_line, max_col)) != 0) {
- int y0, x0;
- getbegyx(parent, y0, x0);
- if (mvderwin(win, y0 + tmp->y, x0 + tmp->x) != ERR) {
- refresh_all(win);
- doupdate();
- result = TRUE;
- }
+ int min_col = top ? COL_MIN : 0;
+ int max_col = top ? COL_MAX : getmaxx(parent);
+ int min_line = top ? LINE_MIN : 0;
+ int max_line = top ? LINE_MAX : getmaxy(parent);
+ PAIR *tmp;
+ bool more;
+
+ show_derwin(win);
+ while ((tmp = selectcell(parent,
+ win,
+ min_line, min_col,
+ max_line, max_col,
+ TRUE,
+ &more)) != 0) {
+ if (mvderwin(win, tmp->y, tmp->x) != ERR) {
+ refresh_all(win);
+ doupdate();
+ repaint_one(win);
+ doupdate();
+ result = TRUE;
+ show_derwin(win);
+ } else {
+ flash();
}
+ if (!more)
+ break;
}
}
+ head_line("done");
return result;
}
@@ -449,6 +545,28 @@ fill_window(WINDOW *win, chtype ch)
wrefresh(win);
}
+static void
+fill_with_pattern(WINDOW *win)
+{
+ int y, x;
+ int y0, x0;
+ int y1, x1;
+ int ch = 'a';
+
+ getyx(win, y0, x0);
+ getmaxyx(win, y1, x1);
+ for (y = 0; y < y1; ++y) {
+ for (x = 0; x < x1; ++x) {
+ MvWAddCh(win, y, x, (chtype) ch);
+ if (++ch > 'z')
+ ch = 'a';
+ }
+ }
+ wsyncdown(win);
+ wmove(win, y0, x0);
+ wrefresh(win);
+}
+
#define lines_of(ul,lr) (lr.y - ul.y + 1)
#define cols_of(ul,lr) (lr.x - ul.x + 1)
#define pair_of(ul) ul.y, ul.x
@@ -523,12 +641,13 @@ show_help(WINDOW *current)
{ 'b', "Draw a box inside the current window" },
{ 'c', "Create a new window" },
{ 'd', "Create a new derived window" },
+ { 'D', "Move derived window (moves viewport)" },
{ 'f', "Fill the current window with the next character" },
+ { 'F', "Fill the current window with a pattern" },
{ 'm', "Move the current window" },
{ 'M', "Move the current window (and its children)" },
{ 'q', "Quit" },
{ 's', "Create a new subwindow" },
- { 't', "Move the current subwindow (moves content)" },
{ CTRL('L'), "Repaint all windows, doing current one last" },
{ CTRL('N'), "Cursor to next window" },
{ CTRL('P'), "Cursor to previous window" },
@@ -571,6 +690,10 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
#endif /* NCURSES_MOUSE_VERSION */
while (!done && (ch = wgetch(current_win)) != ERR) {
+ int y, x;
+
+ getyx(current_win, y, x);
+
switch (ch) {
case '?':
show_help(current_win);
@@ -584,9 +707,18 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
case 'd':
current_win = create_my_derwin(current_win);
break;
+ case 'D':
+ if (!move_derwin(current_win)) {
+ tail_line("error");
+ continue;
+ }
+ break;
case 'f':
fill_window(current_win, (chtype) wgetch(current_win));
break;
+ case 'F':
+ fill_with_pattern(current_win);
+ break;
case 'm':
case 'M':
if (!move_window(current_win, (ch == 'M'))) {
@@ -600,12 +732,6 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
case 's':
current_win = create_my_subwin(current_win);
break;
- case 't':
- if (!move_subwin(current_win)) {
- tail_line("error");
- continue;
- }
- break;
case CTRL('L'):
refresh_all(current_win);
break;
@@ -621,6 +747,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
/* want to allow deleting a window also */
#endif
default:
+ wmove(current_win, y, x);
tail_line("unrecognized key (use '?' for help)");
beep();
continue;
diff --git a/test/ncurses.c b/test/ncurses.c
index 5a422cf..e6aa8fa 100644
--- a/test/ncurses.c
+++ b/test/ncurses.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -40,7 +40,7 @@ AUTHOR
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.365 2011/01/22 19:48:33 tom Exp $
+$Id: ncurses.c,v 1.417 2014/10/10 09:09:41 tom Exp $
***************************************************************************/
@@ -157,15 +157,23 @@ static bool use_colors; /* true if we use colors */
static int max_pairs; /* ...and the number of color pairs */
typedef struct {
- short red;
- short green;
- short blue;
+ NCURSES_COLOR_T red;
+ NCURSES_COLOR_T green;
+ NCURSES_COLOR_T blue;
} RGB_DATA;
static RGB_DATA *all_colors;
static void main_menu(bool);
+static void
+failed(const char *s)
+{
+ perror(s);
+ endwin();
+ ExitProgram(EXIT_FAILURE);
+}
+
/* The behavior of mvhline, mvvline for negative/zero length is unspecified,
* though we can rely on negative x/y values to stop the macro.
*/
@@ -295,9 +303,9 @@ wGetstring(WINDOW *win, char *buffer, int limit)
#if USE_WIDEC_SUPPORT
static wchar_t
-fullwidth_of(int ch)
+fullwidth_digit(int ch)
{
- return (ch + 0xff10 - '0');
+ return (wchar_t) (ch + 0xff10 - '0');
}
static void
@@ -305,7 +313,7 @@ make_fullwidth_text(wchar_t *target, const char *source)
{
int ch;
while ((ch = *source++) != 0) {
- *target++ = fullwidth_of(ch);
+ *target++ = fullwidth_digit(ch);
}
*target = 0;
}
@@ -315,7 +323,7 @@ make_narrow_text(wchar_t *target, const char *source)
{
int ch;
while ((ch = *source++) != 0) {
- *target++ = ch;
+ *target++ = (wchar_t) ch;
}
*target = 0;
}
@@ -326,7 +334,7 @@ make_fullwidth_digit(cchar_t *target, int digit)
{
wchar_t source[2];
- source[0] = fullwidth_of(digit + '0');
+ source[0] = fullwidth_digit(digit + '0');
source[1] = 0;
setcchar(target, source, A_NORMAL, 0, 0);
}
@@ -490,7 +498,7 @@ ShellOut(bool message)
#ifdef __MINGW32__
system("cmd.exe");
#else
- system("sh");
+ IGNORE_RC(system("sh"));
#endif
if (message)
addstr("returned from shellout.\n");
@@ -723,6 +731,8 @@ remember_boxes(unsigned level, WINDOW *txt_win, WINDOW *box_win)
len_winstack = need;
winstack = typeRealloc(WINSTACK, len_winstack, winstack);
}
+ if (!winstack)
+ failed("remember_boxes");
winstack[level].text = txt_win;
winstack[level].frame = box_win;
}
@@ -777,12 +787,21 @@ resize_boxes(unsigned level, WINDOW *win)
}
doupdate();
}
-#endif /* resize_boxes */
+#endif /* resize_boxes */
#else
#define forget_boxes() /* nothing */
#define remember_boxes(level,text,frame) /* nothing */
#endif
+/*
+ * Return-code is OK/ERR or a keyname.
+ */
+static const char *
+ok_keyname(int code)
+{
+ return ((code == OK) ? "OK" : ((code == ERR) ? "ERR" : keyname(code)));
+}
+
static void
wgetch_test(unsigned level, WINDOW *win, int delay)
{
@@ -824,9 +843,11 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
} else if (c == 'g') {
waddstr(win, "getstr test: ");
echo();
- wgetnstr(win, buf, sizeof(buf) - 1);
+ c = wgetnstr(win, buf, sizeof(buf) - 1);
noecho();
- wprintw(win, "I saw %d characters:\n\t`%s'.", (int) strlen(buf), buf);
+ wprintw(win, "I saw %d characters:\n\t`%s' (%s).",
+ (int) strlen(buf), buf,
+ ok_keyname(c));
wclrtoeol(win);
wgetch_wrap(win, first_y);
} else if (c == 'k') {
@@ -922,7 +943,7 @@ begin_getch_test(void)
refresh();
#ifdef NCURSES_MOUSE_VERSION
- mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
+ mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, (mmask_t *) 0);
#endif
(void) printw("Delay in 10ths of a second (<CR> for blocking input)? ");
@@ -1023,6 +1044,8 @@ wcstos(const wchar_t *src)
free(result);
result = 0;
}
+ } else {
+ failed("wcstos");
}
}
return result;
@@ -1072,7 +1095,7 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
} else if (c == 'g') {
waddstr(win, "getstr test: ");
echo();
- code = wgetn_wstr(win, wint_buf, sizeof(wint_buf) - 1);
+ code = wgetn_wstr(win, wint_buf, BUFSIZ - 1);
noecho();
if (code == ERR) {
wprintw(win, "wgetn_wstr returns an error.");
@@ -1229,8 +1252,13 @@ my_termattrs(void)
#define termattrs() my_termattrs()
#endif
-#define MAX_ATTRSTRING 31
-#define LEN_ATTRSTRING 26
+#define ATTRSTRING_1ST 32 /* ' ' */
+#define ATTRSTRING_END 126 /* '~' */
+
+#define COL_ATTRSTRING 25
+#define MARGIN_4_ATTRS (COL_ATTRSTRING + 8)
+#define LEN_ATTRSTRING (COLS - MARGIN_4_ATTRS)
+#define MAX_ATTRSTRING (ATTRSTRING_END + 1 - ATTRSTRING_1ST)
static char attr_test_string[MAX_ATTRSTRING + 1];
@@ -1264,6 +1292,10 @@ attr_legend(WINDOW *helpwin)
" a/A toggle ACS (alternate character set) mapping");
MvWPrintw(helpwin, row, col,
" v/V toggle video attribute to combine with each line");
+#if USE_WIDEC_SUPPORT
+ MvWPrintw(helpwin, row, col,
+ " w/W toggle normal/wide (double-width) test-characters");
+#endif
}
static void
@@ -1278,29 +1310,29 @@ show_color_attr(int fg, int bg, int tx)
}
static bool
-cycle_color_attr(int ch, short *fg, short *bg, short *tx)
+cycle_color_attr(int ch, NCURSES_COLOR_T *fg, NCURSES_COLOR_T *bg, NCURSES_COLOR_T *tx)
{
bool error = FALSE;
if (use_colors) {
switch (ch) {
case 'f':
- *fg = (short) (*fg + 1);
+ *fg = (NCURSES_COLOR_T) (*fg + 1);
break;
case 'F':
- *fg = (short) (*fg - 1);
+ *fg = (NCURSES_COLOR_T) (*fg - 1);
break;
case 'b':
- *bg = (short) (*bg + 1);
+ *bg = (NCURSES_COLOR_T) (*bg + 1);
break;
case 'B':
- *bg = (short) (*bg - 1);
+ *bg = (NCURSES_COLOR_T) (*bg - 1);
break;
case 't':
- *tx = (short) (*tx + 1);
+ *tx = (NCURSES_COLOR_T) (*tx + 1);
break;
case 'T':
- *tx = (short) (*tx - 1);
+ *tx = (NCURSES_COLOR_T) (*tx - 1);
break;
default:
beep();
@@ -1308,17 +1340,17 @@ cycle_color_attr(int ch, short *fg, short *bg, short *tx)
break;
}
if (*fg >= COLORS)
- *fg = (short) min_colors;
+ *fg = (NCURSES_COLOR_T) min_colors;
if (*fg < min_colors)
- *fg = (short) (COLORS - 1);
+ *fg = (NCURSES_COLOR_T) (COLORS - 1);
if (*bg >= COLORS)
- *bg = (short) min_colors;
+ *bg = (NCURSES_COLOR_T) min_colors;
if (*bg < min_colors)
- *bg = (short) (COLORS - 1);
+ *bg = (NCURSES_COLOR_T) (COLORS - 1);
if (*tx >= COLORS)
*tx = -1;
if (*tx < -1)
- *tx = (short) (COLORS - 1);
+ *tx = (NCURSES_COLOR_T) (COLORS - 1);
} else {
beep();
error = TRUE;
@@ -1329,12 +1361,14 @@ cycle_color_attr(int ch, short *fg, short *bg, short *tx)
static void
adjust_attr_string(int adjust)
{
- int first = ((int) UChar(attr_test_string[0])) + adjust;
- int last = first + LEN_ATTRSTRING;
+ char save = attr_test_string[0];
+ int first = ((int) UChar(save)) + adjust;
+ int j, k;
- if (first >= ' ' && last <= '~') { /* 32..126 */
- int j, k;
- for (j = 0, k = first; j < MAX_ATTRSTRING && k <= last; ++j, ++k) {
+ if (first >= ATTRSTRING_1ST) {
+ for (j = 0, k = first; j < MAX_ATTRSTRING; ++j, ++k) {
+ if (k > ATTRSTRING_END)
+ break;
attr_test_string[j] = (char) k;
if (((k + 1 - first) % 5) == 0) {
if (++j >= MAX_ATTRSTRING)
@@ -1342,23 +1376,40 @@ adjust_attr_string(int adjust)
attr_test_string[j] = ' ';
}
}
- while (j < MAX_ATTRSTRING)
- attr_test_string[j++] = ' ';
- attr_test_string[j] = '\0';
- } else {
- beep();
+ if ((LEN_ATTRSTRING - j) > 5) {
+ attr_test_string[0] = save;
+ adjust_attr_string(adjust - 1);
+ } else {
+ while (j < MAX_ATTRSTRING)
+ attr_test_string[j++] = ' ';
+ attr_test_string[j] = '\0';
+ }
}
}
+/*
+ * Prefer the right-end of the string for starting, since that maps to the
+ * VT100 line-drawing.
+ */
+static int
+default_attr_string(void)
+{
+ int result = (ATTRSTRING_END - LEN_ATTRSTRING);
+ result += (LEN_ATTRSTRING / 5);
+ if (result < ATTRSTRING_1ST)
+ result = ATTRSTRING_1ST;
+ return result;
+}
+
static void
init_attr_string(void)
{
- attr_test_string[0] = 'a';
+ attr_test_string[0] = (char) default_attr_string();
adjust_attr_string(0);
}
static int
-show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
+show_attr(WINDOW *win, int row, int skip, bool arrow, chtype attr, const char *name)
{
int ncv = get_ncv();
chtype test = attr & (chtype) (~A_ALTCHARSET);
@@ -1366,7 +1417,7 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
if (arrow)
MvPrintw(row, 5, "-->");
MvPrintw(row, 8, "%s mode:", name);
- MvPrintw(row, 24, "|");
+ MvPrintw(row, COL_ATTRSTRING - 1, "|");
if (skip)
printw("%*s", skip, " ");
/*
@@ -1374,27 +1425,29 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
* character at a time (to pass its rendition directly), and use the
* string operation for the other attributes.
*/
+ wmove(win, 0, 0);
+ werase(win);
if (attr & A_ALTCHARSET) {
const char *s;
chtype ch;
for (s = attr_test_string; *s != '\0'; ++s) {
ch = UChar(*s);
- addch(ch | attr);
+ (void) waddch(win, ch | attr);
}
} else {
- (void) attrset(attr);
- addstr(attr_test_string);
- attroff(attr);
+ (void) wattrset(win, AttrArg(attr, 0));
+ (void) waddstr(win, attr_test_string);
+ (void) wattroff(win, (int) attr);
}
if (skip)
printw("%*s", skip, " ");
- printw("|");
+ MvPrintw(row, COL_ATTRSTRING + LEN_ATTRSTRING, "|");
if (test != A_NORMAL) {
if (!(termattrs() & test)) {
printw(" (N/A)");
} else {
- if (ncv > 0 && (getbkgd(stdscr) & A_COLOR)) {
+ if (ncv > 0 && stdscr && (getbkgd(stdscr) & A_COLOR)) {
static const chtype table[] =
{
A_STANDOUT,
@@ -1406,6 +1459,9 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
#ifdef A_INVIS
A_INVIS,
#endif
+#ifdef A_ITALIC
+ A_ITALIC,
+#endif
A_PROTECT,
A_ALTCHARSET
};
@@ -1427,11 +1483,13 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
}
return row + 2;
}
+
+typedef struct {
+ attr_t attr;
+ NCURSES_CONST char *name;
+} ATTR_TBL;
/* *INDENT-OFF* */
-static const struct {
- chtype attr;
- NCURSES_CONST char * name;
-} attrs_to_test[] = {
+static const ATTR_TBL attrs_to_test[] = {
{ A_STANDOUT, "STANDOUT" },
{ A_REVERSE, "REVERSE" },
{ A_BOLD, "BOLD" },
@@ -1442,12 +1500,36 @@ static const struct {
#ifdef A_INVIS
{ A_INVIS, "INVISIBLE" },
#endif
+#ifdef A_ITALIC
+ { A_ITALIC, "ITALIC" },
+#endif
{ A_NORMAL, "NORMAL" },
};
/* *INDENT-ON* */
+static unsigned
+init_attr_list(ATTR_TBL * target, attr_t attrs)
+{
+ unsigned result = 0;
+ size_t n;
+
+ for (n = 0; n < SIZEOF(attrs_to_test); ++n) {
+ attr_t test = attrs_to_test[n].attr;
+ if (test == A_NORMAL || (test & attrs) != 0) {
+ target[result++] = attrs_to_test[n];
+ }
+ }
+ return result;
+}
+
static bool
-attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc)
+attr_getc(int *skip,
+ NCURSES_COLOR_T *fg,
+ NCURSES_COLOR_T *bg,
+ NCURSES_COLOR_T *tx,
+ int *ac,
+ unsigned *kc,
+ unsigned limit)
{
bool result = TRUE;
bool error = FALSE;
@@ -1480,13 +1562,13 @@ attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc)
break;
case 'v':
if (*kc == 0)
- *kc = SIZEOF(attrs_to_test) - 1;
+ *kc = limit - 1;
else
*kc -= 1;
break;
case 'V':
*kc += 1;
- if (*kc >= SIZEOF(attrs_to_test))
+ if (*kc >= limit)
*kc = 0;
break;
case '<':
@@ -1513,110 +1595,171 @@ attr_test(void)
{
int n;
int skip = get_xmc();
- short fg = COLOR_BLACK; /* color pair 0 is special */
- short bg = COLOR_BLACK;
- short tx = -1;
+ NCURSES_COLOR_T fg = COLOR_BLACK; /* color pair 0 is special */
+ NCURSES_COLOR_T bg = COLOR_BLACK;
+ NCURSES_COLOR_T tx = -1;
int ac = 0;
unsigned j, k;
+ WINDOW *my_wins[SIZEOF(attrs_to_test)];
+ ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+ unsigned my_size = init_attr_list(my_list, termattrs());
+
+ if (my_size > 1) {
+ for (j = 0; j < my_size; ++j) {
+ my_wins[j] = subwin(stdscr,
+ 1, LEN_ATTRSTRING,
+ 2 + (int) (2 * j), COL_ATTRSTRING);
+ scrollok(my_wins[j], FALSE);
+ }
- if (skip < 0)
- skip = 0;
+ if (skip < 0)
+ skip = 0;
- n = skip; /* make it easy */
- k = SIZEOF(attrs_to_test) - 1;
- init_attr_string();
+ n = skip; /* make it easy */
+ k = my_size - 1;
+ init_attr_string();
- do {
- int row = 2;
- chtype normal = A_NORMAL | BLANK;
- chtype extras = (chtype) ac;
+ do {
+ int row = 2;
+ chtype normal = A_NORMAL | BLANK;
+ chtype extras = (chtype) ac;
- if (use_colors) {
- short pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK);
- if (pair != 0) {
- pair = 1;
- if (init_pair(pair, fg, bg) == ERR) {
- beep();
- } else {
- normal |= (chtype) COLOR_PAIR(pair);
+ if (use_colors) {
+ NCURSES_PAIRS_T pair = 0;
+ if ((fg != COLOR_BLACK) || (bg != COLOR_BLACK)) {
+ pair = 1;
+ if (init_pair(pair, fg, bg) == ERR) {
+ beep();
+ } else {
+ normal |= (chtype) COLOR_PAIR(pair);
+ }
}
- }
- if (tx >= 0) {
- pair = 2;
- if (init_pair(pair, tx, bg) == ERR) {
- beep();
- } else {
- extras |= (chtype) COLOR_PAIR(pair);
+ if (tx >= 0) {
+ pair = 2;
+ if (init_pair(pair, tx, bg) == ERR) {
+ beep();
+ } else {
+ extras |= (chtype) COLOR_PAIR(pair);
+ normal &= ~A_COLOR;
+ }
}
}
- }
- bkgd(normal);
- bkgdset(normal);
- erase();
-
- box(stdscr, 0, 0);
- MvAddStr(0, 20, "Character attribute test display");
+ bkgd(normal);
+ bkgdset(normal);
+ erase();
- for (j = 0; j < SIZEOF(attrs_to_test); ++j) {
- bool arrow = (j == k);
- row = show_attr(row, n, arrow,
- extras |
- attrs_to_test[j].attr |
- attrs_to_test[k].attr,
- attrs_to_test[j].name);
- }
+ box(stdscr, 0, 0);
+ MvAddStr(0, 20, "Character attribute test display");
+
+ for (j = 0; j < my_size; ++j) {
+ bool arrow = (j == k);
+ row = show_attr(my_wins[j], row, n, arrow,
+ normal |
+ extras |
+ my_list[j].attr |
+ my_list[k].attr,
+ my_list[j].name);
+ }
- MvPrintw(row, 8,
- "This terminal does %shave the magic-cookie glitch",
- get_xmc() > -1 ? "" : "not ");
- MvPrintw(row + 1, 8, "Enter '?' for help.");
- show_color_attr(fg, bg, tx);
- printw(" ACS (%d)", ac != 0);
+ MvPrintw(row, 8,
+ "This terminal does %shave the magic-cookie glitch",
+ get_xmc() > -1 ? "" : "not ");
+ MvPrintw(row + 1, 8, "Enter '?' for help.");
+ show_color_attr(fg, bg, tx);
+ printw(" ACS (%d)", ac != 0);
- refresh();
- } while (attr_getc(&n, &fg, &bg, &tx, &ac, &k));
+ refresh();
+ } while (attr_getc(&n, &fg, &bg, &tx, &ac, &k, my_size));
- bkgdset(A_NORMAL | BLANK);
- erase();
- endwin();
+ bkgdset(A_NORMAL | BLANK);
+ erase();
+ endwin();
+ } else {
+ Cannot("does not support video attributes.");
+ }
}
#if USE_WIDEC_SUPPORT
+static bool use_fullwidth;
static wchar_t wide_attr_test_string[MAX_ATTRSTRING + 1];
+#define FULL_LO 0xff00
+#define FULL_HI 0xff5e
+#define HALF_LO 0x20
+
+#define isFullWidth(ch) ((int)(ch) >= FULL_LO && (int)(ch) <= FULL_HI)
+#define ToNormalWidth(ch) (wchar_t) (((int)(ch) - FULL_LO) + HALF_LO)
+#define ToFullWidth(ch) (wchar_t) (((int)(ch) - HALF_LO) + FULL_LO)
+
+/*
+ * Returns an ASCII code in [32..126]
+ */
+static wchar_t
+normal_wchar(int ch)
+{
+ wchar_t result = (wchar_t) ch;
+ if (isFullWidth(ch))
+ result = ToNormalWidth(ch);
+ return result;
+}
+
+/*
+ * Returns either an ASCII code in in [32..126] or full-width in
+ * [0xff00..0xff5e], according to use_fullwidth setting.
+ */
+static wchar_t
+target_wchar(int ch)
+{
+ wchar_t result = (wchar_t) ch;
+ if (use_fullwidth) {
+ if (!isFullWidth(ch))
+ result = ToFullWidth(ch);
+ } else {
+ if (isFullWidth(ch))
+ result = ToNormalWidth(ch);
+ }
+ return result;
+}
+
static void
wide_adjust_attr_string(int adjust)
{
- int first = ((int) UChar(wide_attr_test_string[0])) + adjust;
- int last = first + LEN_ATTRSTRING;
+ wchar_t save = wide_attr_test_string[0];
+ int first = ((int) normal_wchar(save)) + adjust;
+ int j, k;
- if (first >= ' ' && last <= '~') { /* 32..126 */
- int j, k;
- for (j = 0, k = first; j < MAX_ATTRSTRING && k <= last; ++j, ++k) {
- wide_attr_test_string[j] = k;
+ if (first >= ATTRSTRING_1ST) {
+ for (j = 0, k = first; j < MAX_ATTRSTRING; ++j, ++k) {
+ if (k > ATTRSTRING_END)
+ break;
+ wide_attr_test_string[j] = target_wchar(k);
if (((k + 1 - first) % 5) == 0) {
if (++j >= MAX_ATTRSTRING)
break;
wide_attr_test_string[j] = ' ';
}
}
- while (j < MAX_ATTRSTRING)
- wide_attr_test_string[j++] = ' ';
- wide_attr_test_string[j] = '\0';
- } else {
- beep();
+ if ((LEN_ATTRSTRING - j) > 5) {
+ wide_attr_test_string[0] = save;
+ wide_adjust_attr_string(adjust - 1);
+ } else {
+ while (j < MAX_ATTRSTRING)
+ wide_attr_test_string[j++] = ' ';
+ wide_attr_test_string[j] = '\0';
+ }
}
}
static void
wide_init_attr_string(void)
{
- wide_attr_test_string[0] = 'a';
+ use_fullwidth = FALSE;
+ wide_attr_test_string[0] = (wchar_t) default_attr_string();
wide_adjust_attr_string(0);
}
static void
-set_wide_background(short pair)
+set_wide_background(NCURSES_PAIRS_T pair)
{
cchar_t normal;
wchar_t blank[2];
@@ -1634,9 +1777,10 @@ get_wide_background(void)
attr_t result = A_NORMAL;
attr_t attr;
cchar_t ch;
- short pair;
+ NCURSES_PAIRS_T pair;
wchar_t wch[10];
+ memset(&ch, 0, sizeof(ch));
if (getbkgrnd(&ch) != ERR) {
if (getcchar(&ch, wch, &attr, &pair, 0) != ERR) {
result = attr;
@@ -1646,7 +1790,13 @@ get_wide_background(void)
}
static int
-wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const char *name)
+wide_show_attr(WINDOW *win,
+ int row,
+ int skip,
+ bool arrow,
+ chtype attr,
+ NCURSES_PAIRS_T pair,
+ const char *name)
{
int ncv = get_ncv();
chtype test = attr & ~WA_ALTCHARSET;
@@ -1654,7 +1804,7 @@ wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const cha
if (arrow)
MvPrintw(row, 5, "-->");
MvPrintw(row, 8, "%s mode:", name);
- MvPrintw(row, 24, "|");
+ MvPrintw(row, COL_ATTRSTRING - 1, "|");
if (skip)
printw("%*s", skip, " ");
@@ -1663,6 +1813,8 @@ wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const cha
* character at a time (to pass its rendition directly), and use the
* string operation for the other attributes.
*/
+ wmove(win, 0, 0);
+ werase(win);
if (attr & WA_ALTCHARSET) {
const wchar_t *s;
cchar_t ch;
@@ -1672,20 +1824,20 @@ wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const cha
fill[0] = *s;
fill[1] = L'\0';
setcchar(&ch, fill, attr, pair, 0);
- add_wch(&ch);
+ (void) wadd_wch(win, &ch);
}
} else {
- attr_t old_attr;
- short old_pair;
+ attr_t old_attr = 0;
+ NCURSES_PAIRS_T old_pair = 0;
- (void) attr_get(&old_attr, &old_pair, 0);
- (void) attr_set(attr, pair, 0);
- addwstr(wide_attr_test_string);
- (void) attr_set(old_attr, old_pair, 0);
+ (void) (wattr_get) (win, &old_attr, &old_pair, 0);
+ (void) wattr_set(win, attr, pair, 0);
+ (void) waddwstr(win, wide_attr_test_string);
+ (void) wattr_set(win, old_attr, old_pair, 0);
}
if (skip)
printw("%*s", skip, " ");
- printw("|");
+ MvPrintw(row, COL_ATTRSTRING + LEN_ATTRSTRING, "|");
if (test != A_NORMAL) {
if (!(term_attrs() & test)) {
printw(" (N/A)");
@@ -1723,7 +1875,10 @@ wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const cha
}
static bool
-wide_attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc)
+wide_attr_getc(int *skip,
+ NCURSES_COLOR_T *fg, NCURSES_COLOR_T *bg,
+ NCURSES_COLOR_T *tx, int *ac,
+ unsigned *kc, unsigned limit)
{
bool result = TRUE;
bool error = FALSE;
@@ -1756,15 +1911,23 @@ wide_attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc
break;
case 'v':
if (*kc == 0)
- *kc = SIZEOF(attrs_to_test) - 1;
+ *kc = limit - 1;
else
*kc -= 1;
break;
case 'V':
*kc += 1;
- if (*kc >= SIZEOF(attrs_to_test))
+ if (*kc >= limit)
*kc = 0;
break;
+ case 'w':
+ use_fullwidth = FALSE;
+ wide_adjust_attr_string(0);
+ break;
+ case 'W':
+ use_fullwidth = TRUE;
+ wide_adjust_attr_string(0);
+ break;
case '<':
wide_adjust_attr_string(-1);
break;
@@ -1789,68 +1952,82 @@ wide_attr_test(void)
{
int n;
int skip = get_xmc();
- short fg = COLOR_BLACK; /* color pair 0 is special */
- short bg = COLOR_BLACK;
- short tx = -1;
+ NCURSES_COLOR_T fg = COLOR_BLACK; /* color pair 0 is special */
+ NCURSES_COLOR_T bg = COLOR_BLACK;
+ NCURSES_COLOR_T tx = -1;
int ac = 0;
unsigned j, k;
+ ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+ WINDOW *my_wins[SIZEOF(attrs_to_test)];
+ unsigned my_size = init_attr_list(my_list, term_attrs());
+
+ if (my_size > 1) {
+ for (j = 0; j < my_size; ++j) {
+ my_wins[j] = subwin(stdscr,
+ 1, LEN_ATTRSTRING,
+ 2 + (int) (2 * j), COL_ATTRSTRING);
+ scrollok(my_wins[j], FALSE);
+ }
- if (skip < 0)
- skip = 0;
+ if (skip < 0)
+ skip = 0;
- n = skip; /* make it easy */
- k = SIZEOF(attrs_to_test) - 1;
- wide_init_attr_string();
+ n = skip; /* make it easy */
+ k = my_size - 1;
+ wide_init_attr_string();
- do {
- int row = 2;
- short pair = 0;
- short extras = 0;
+ do {
+ int row = 2;
+ NCURSES_PAIRS_T pair = 0;
+ NCURSES_PAIRS_T extras = 0;
- if (use_colors) {
- pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK);
- if (pair != 0) {
- pair = 1;
- if (init_pair(pair, fg, bg) == ERR) {
- beep();
+ if (use_colors) {
+ pair = (NCURSES_PAIRS_T) (fg != COLOR_BLACK || bg != COLOR_BLACK);
+ if (pair != 0) {
+ pair = 1;
+ if (init_pair(pair, fg, bg) == ERR) {
+ beep();
+ }
}
- }
- extras = pair;
- if (tx >= 0) {
- extras = 2;
- if (init_pair(extras, tx, bg) == ERR) {
- beep();
+ extras = pair;
+ if (tx >= 0) {
+ extras = 2;
+ if (init_pair(extras, tx, bg) == ERR) {
+ beep();
+ }
}
}
- }
- set_wide_background(pair);
- erase();
+ set_wide_background(pair);
+ erase();
- box_set(stdscr, 0, 0);
- MvAddStr(0, 20, "Character attribute test display");
+ box_set(stdscr, 0, 0);
+ MvAddStr(0, 20, "Character attribute test display");
- for (j = 0; j < SIZEOF(attrs_to_test); ++j) {
- row = wide_show_attr(row, n, j == k,
- ((attr_t) ac |
- attrs_to_test[j].attr |
- attrs_to_test[k].attr),
- extras,
- attrs_to_test[j].name);
- }
+ for (j = 0; j < my_size; ++j) {
+ row = wide_show_attr(my_wins[j], row, n, (j == k),
+ ((attr_t) ac |
+ my_list[j].attr |
+ my_list[k].attr),
+ extras,
+ my_list[j].name);
+ }
- MvPrintw(row, 8,
- "This terminal does %shave the magic-cookie glitch",
- get_xmc() > -1 ? "" : "not ");
- MvPrintw(row + 1, 8, "Enter '?' for help.");
- show_color_attr(fg, bg, tx);
- printw(" ACS (%d)", ac != 0);
+ MvPrintw(row, 8,
+ "This terminal does %shave the magic-cookie glitch",
+ get_xmc() > -1 ? "" : "not ");
+ MvPrintw(row + 1, 8, "Enter '?' for help.");
+ show_color_attr(fg, bg, tx);
+ printw(" ACS (%d)", ac != 0);
- refresh();
- } while (wide_attr_getc(&n, &fg, &bg, &tx, &ac, &k));
+ refresh();
+ } while (wide_attr_getc(&n, &fg, &bg, &tx, &ac, &k, my_size));
- set_wide_background(0);
- erase();
- endwin();
+ set_wide_background(0);
+ erase();
+ endwin();
+ } else {
+ Cannot("does not support extended video attributes.");
+ }
}
#endif
@@ -1895,7 +2072,7 @@ show_color_name(int y, int x, int color, bool wide)
} else if (color < 0) {
strcpy(temp, "default");
} else {
- strcpy(temp, the_color_names[color]);
+ sprintf(temp, "%.*s", 16, the_color_names[color]);
}
printw("%-*.*s", width, width, temp);
}
@@ -1925,6 +2102,10 @@ color_legend(WINDOW *helpwin, bool wide)
" a/A toggle altcharset off/on");
MvWPrintw(helpwin, row++, col,
" b/B toggle bold off/on");
+ if (has_colors()) {
+ MvWPrintw(helpwin, row++, col,
+ " c/C cycle used-colors through 8,16,...,COLORS");
+ }
MvWPrintw(helpwin, row++, col,
" n/N toggle text/number on/off");
MvWPrintw(helpwin, row++, col,
@@ -1945,16 +2126,46 @@ color_legend(WINDOW *helpwin, bool wide)
#define set_color_test(name, value) if (name != value) { name = value; base_row = 0; }
+static int
+color_cycle(int current, int step)
+{
+ int result = current;
+ if (step < 0) {
+ if (current <= 8) {
+ result = COLORS;
+ } else {
+ result = 8;
+ if ((result * 2) > COLORS) {
+ result = COLORS;
+ } else {
+ while ((result * 2) < current) {
+ result *= 2;
+ }
+ }
+ }
+ } else {
+ if (current >= COLORS) {
+ result = 8;
+ } else {
+ result *= 2;
+ }
+ if (result > COLORS)
+ result = COLORS;
+ }
+ return result;
+}
+
/* generate a color test pattern */
static void
color_test(void)
{
- short i;
+ NCURSES_PAIRS_T i;
int top = 0, width;
int base_row = 0;
int grid_top = top + 3;
int page_size = (LINES - grid_top);
- int pairs_max = PAIR_NUMBER(A_COLOR) + 1;
+ int pairs_max;
+ int colors_max = COLORS;
int row_limit;
int per_row;
char numbered[80];
@@ -1967,23 +2178,24 @@ color_test(void)
bool opt_wide = FALSE;
WINDOW *helpwin;
- if (COLORS * COLORS == COLOR_PAIRS) {
- int limit = (COLORS - min_colors) * (COLORS - min_colors);
- if (pairs_max > limit)
- pairs_max = limit;
- } else {
- if (pairs_max > COLOR_PAIRS)
- pairs_max = COLOR_PAIRS;
- }
-
while (!done) {
int shown = 0;
+ pairs_max = PAIR_NUMBER(A_COLOR) + 1;
+ if (colors_max * colors_max <= COLOR_PAIRS) {
+ int limit = (colors_max - min_colors) * (colors_max - min_colors);
+ if (pairs_max > limit)
+ pairs_max = limit;
+ } else {
+ if (pairs_max > COLOR_PAIRS)
+ pairs_max = COLOR_PAIRS;
+ }
+
/* this assumes an 80-column line */
if (opt_wide) {
width = 4;
hello = "Test";
- per_row = (COLORS > 8) ? 16 : 8;
+ per_row = (colors_max > 8) ? 16 : 8;
} else {
width = 8;
hello = "Hello";
@@ -1994,9 +2206,12 @@ color_test(void)
row_limit = (pairs_max + per_row - 1) / per_row;
move(0, 0);
- (void) printw("There are %d color pairs and %d colors%s\n",
- pairs_max, COLORS,
- min_colors ? " besides 'default'" : "");
+ (void) printw("There are %d color pairs and %d colors",
+ pairs_max, COLORS);
+ if (colors_max != COLORS)
+ (void) printw(" (using %d colors)", colors_max);
+ if (min_colors)
+ (void) addstr(" besides 'default'");
clrtobot();
MvPrintw(top + 1, 0,
@@ -2010,28 +2225,28 @@ color_test(void)
show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
/* show a grid of colors, with color names/ numbers on the left */
- for (i = (short) (base_row * per_row); i < pairs_max; i++) {
+ for (i = (NCURSES_PAIRS_T) (base_row * per_row); i < pairs_max; i++) {
int row = grid_top + (i / per_row) - base_row;
int col = (i % per_row + 1) * width;
- short pair = i;
+ NCURSES_PAIRS_T pair = i;
-#define InxToFG(i) (short) ((i % (COLORS - min_colors)) + min_colors)
-#define InxToBG(i) (short) ((i / (COLORS - min_colors)) + min_colors)
+#define InxToFG(i) (NCURSES_COLOR_T) ((i % (colors_max - min_colors)) + min_colors)
+#define InxToBG(i) (NCURSES_COLOR_T) ((i / (colors_max - min_colors)) + min_colors)
if (row >= 0 && move(row, col) != ERR) {
- short fg = InxToFG(i);
- short bg = InxToBG(i);
+ NCURSES_COLOR_T fg = InxToFG(i);
+ NCURSES_COLOR_T bg = InxToBG(i);
init_pair(pair, fg, bg);
- attron((attr_t) COLOR_PAIR(pair));
+ attron(COLOR_PAIR(pair));
if (opt_acsc)
- attron((attr_t) A_ALTCHARSET);
+ attron(A_ALTCHARSET);
if (opt_bold)
- attron((attr_t) A_BOLD);
+ attron(A_BOLD);
if (opt_revs)
- attron((attr_t) A_REVERSE);
+ attron(A_REVERSE);
if (opt_nums) {
- sprintf(numbered, "{%02X}", i);
+ sprintf(numbered, "{%02X}", (int) i);
hello = numbered;
}
printw("%-*.*s", width, width, hello);
@@ -2059,6 +2274,12 @@ color_test(void)
case 'B':
opt_bold = TRUE;
break;
+ case 'c':
+ colors_max = color_cycle(colors_max, -1);
+ break;
+ case 'C':
+ colors_max = color_cycle(colors_max, 1);
+ break;
case 'n':
opt_nums = FALSE;
break;
@@ -2148,6 +2369,7 @@ wide_color_test(void)
int grid_top = top + 3;
int page_size = (LINES - grid_top);
int pairs_max = (unsigned short) (-1);
+ int colors_max = COLORS;
int row_limit;
int per_row;
char numbered[80];
@@ -2159,26 +2381,27 @@ wide_color_test(void)
bool opt_wide = FALSE;
bool opt_nums = FALSE;
bool opt_xchr = FALSE;
- wchar_t buffer[10];
+ wchar_t buffer[80];
WINDOW *helpwin;
- if (COLORS * COLORS == COLOR_PAIRS) {
- int limit = (COLORS - min_colors) * (COLORS - min_colors);
- if (pairs_max > limit)
- pairs_max = limit;
- } else {
- if (pairs_max > COLOR_PAIRS)
- pairs_max = COLOR_PAIRS;
- }
-
while (!done) {
int shown = 0;
+ pairs_max = (unsigned short) (-1);
+ if (colors_max * colors_max <= COLOR_PAIRS) {
+ int limit = (colors_max - min_colors) * (colors_max - min_colors);
+ if (pairs_max > limit)
+ pairs_max = limit;
+ } else {
+ if (pairs_max > COLOR_PAIRS)
+ pairs_max = COLOR_PAIRS;
+ }
+
/* this assumes an 80-column line */
if (opt_wide) {
width = 4;
hello = "Test";
- per_row = (COLORS > 8) ? 16 : 8;
+ per_row = (colors_max > 8) ? 16 : 8;
} else {
width = 8;
hello = "Hello";
@@ -2197,9 +2420,12 @@ wide_color_test(void)
row_limit = (pairs_max + per_row - 1) / per_row;
move(0, 0);
- (void) printw("There are %d color pairs and %d colors%s\n",
- pairs_max, COLORS,
- min_colors ? " besides 'default'" : "");
+ (void) printw("There are %d color pairs and %d colors",
+ pairs_max, COLORS);
+ if (colors_max != COLORS)
+ (void) printw(" (using %d colors)", colors_max);
+ if (min_colors)
+ (void) addstr(" besides 'default'");
clrtobot();
MvPrintw(top + 1, 0,
@@ -2216,17 +2442,17 @@ wide_color_test(void)
for (i = (base_row * per_row); i < pairs_max; i++) {
int row = grid_top + (i / per_row) - base_row;
int col = (i % per_row + 1) * width;
- short pair = (short) i;
+ NCURSES_PAIRS_T pair = (NCURSES_PAIRS_T) i;
if (row >= 0 && move(row, col) != ERR) {
init_pair(pair, InxToFG(i), InxToBG(i));
- color_set(pair, NULL);
+ (void) color_set(pair, NULL);
if (opt_acsc)
- attr_on((attr_t) A_ALTCHARSET, NULL);
+ attr_on(A_ALTCHARSET, NULL);
if (opt_bold)
- attr_on((attr_t) A_BOLD, NULL);
+ attr_on(A_BOLD, NULL);
if (opt_revs)
- attr_on((attr_t) A_REVERSE, NULL);
+ attr_on(A_REVERSE, NULL);
if (opt_nums) {
sprintf(numbered, "{%02X}", i);
@@ -2261,6 +2487,12 @@ wide_color_test(void)
case 'B':
opt_bold = TRUE;
break;
+ case 'c':
+ colors_max = color_cycle(colors_max, -1);
+ break;
+ case 'C':
+ colors_max = color_cycle(colors_max, 1);
+ break;
case 'n':
opt_nums = FALSE;
break;
@@ -2347,21 +2579,21 @@ wide_color_test(void)
#endif /* USE_WIDEC_SUPPORT */
static void
-change_color(short current, int field, int value, int usebase)
+change_color(NCURSES_PAIRS_T current, int field, int value, int usebase)
{
- short red, green, blue;
+ NCURSES_COLOR_T red, green, blue;
color_content(current, &red, &green, &blue);
switch (field) {
case 0:
- red = (short) (usebase ? (red + value) : value);
+ red = (NCURSES_COLOR_T) (usebase ? (red + value) : value);
break;
case 1:
- green = (short) (usebase ? (green + value) : value);
+ green = (NCURSES_COLOR_T) (usebase ? (green + value) : value);
break;
case 2:
- blue = (short) (usebase ? (blue + value) : value);
+ blue = (NCURSES_COLOR_T) (usebase ? (blue + value) : value);
break;
}
@@ -2372,7 +2604,7 @@ change_color(short current, int field, int value, int usebase)
static void
init_all_colors(void)
{
- short c;
+ NCURSES_PAIRS_T c;
for (c = 0; c < COLORS; ++c)
init_color(c,
@@ -2398,18 +2630,20 @@ color_edit(void)
refresh();
for (i = 0; i < max_colors; i++)
- init_pair((short) i, (short) COLOR_WHITE, (short) i);
+ init_pair((NCURSES_PAIRS_T) i,
+ (NCURSES_COLOR_T) COLOR_WHITE,
+ (NCURSES_COLOR_T) i);
MvPrintw(LINES - 2, 0, "Number: %d", value);
do {
- short red, green, blue;
+ NCURSES_COLOR_T red, green, blue;
attron(A_BOLD);
MvAddStr(0, 20, "Color RGB Value Editing");
attroff(A_BOLD);
- for (i = (short) top_color;
+ for (i = (NCURSES_COLOR_T) top_color;
(i - top_color < page_size)
&& (i < max_colors); i++) {
char numeric[80];
@@ -2419,34 +2653,34 @@ color_edit(void)
(i == current ? '>' : ' '),
(i < (int) SIZEOF(the_color_names)
? the_color_names[i] : numeric));
- (void) attrset((attr_t) COLOR_PAIR(i));
+ (void) attrset(AttrArg(COLOR_PAIR(i), 0));
addstr(" ");
(void) attrset(A_NORMAL);
- color_content((short) i, &red, &green, &blue);
+ color_content((NCURSES_PAIRS_T) i, &red, &green, &blue);
addstr(" R = ");
if (current == i && field == 0)
attron(A_STANDOUT);
- printw("%04d", red);
+ printw("%04d", (int) red);
if (current == i && field == 0)
(void) attrset(A_NORMAL);
addstr(", G = ");
if (current == i && field == 1)
attron(A_STANDOUT);
- printw("%04d", green);
+ printw("%04d", (int) green);
if (current == i && field == 1)
(void) attrset(A_NORMAL);
addstr(", B = ");
if (current == i && field == 2)
attron(A_STANDOUT);
- printw("%04d", blue);
+ printw("%04d", (int) blue);
if (current == i && field == 2)
(void) attrset(A_NORMAL);
(void) attrset(A_NORMAL);
printw(" ( %3d %3d %3d )",
- scaled_rgb(red),
- scaled_rgb(green),
- scaled_rgb(blue));
+ (int) scaled_rgb(red),
+ (int) scaled_rgb(green),
+ (int) scaled_rgb(blue));
}
MvAddStr(LINES - 3, 0,
@@ -2510,15 +2744,15 @@ color_edit(void)
break;
case '+':
- change_color((short) current, field, value, 1);
+ change_color((NCURSES_PAIRS_T) current, field, value, 1);
break;
case '-':
- change_color((short) current, field, -value, 1);
+ change_color((NCURSES_PAIRS_T) current, field, -value, 1);
break;
case '=':
- change_color((short) current, field, value, 0);
+ change_color((NCURSES_PAIRS_T) current, field, value, 0);
break;
case '?':
@@ -2545,7 +2779,9 @@ color_edit(void)
endwin();
main_menu(FALSE);
for (i = 0; i < max_colors; i++)
- init_pair((short) i, (short) COLOR_WHITE, (short) i);
+ init_pair((NCURSES_PAIRS_T) i,
+ (NCURSES_COLOR_T) COLOR_WHITE,
+ (NCURSES_COLOR_T) i);
refresh();
break;
@@ -2586,32 +2822,19 @@ color_edit(void)
* Alternate character-set stuff
*
****************************************************************************/
-/* *INDENT-OFF* */
-static struct {
- chtype attr;
- const char *name;
-} attrs_to_cycle[] = {
- { A_NORMAL, "normal" },
- { A_BOLD, "bold" },
- { A_BLINK, "blink" },
- { A_REVERSE, "reverse" },
- { A_UNDERLINE, "underline" },
-};
-/* *INDENT-ON* */
-
static bool
-cycle_attr(int ch, unsigned *at_code, chtype *attr)
+cycle_attr(int ch, unsigned *at_code, chtype *attr, ATTR_TBL * list, unsigned limit)
{
bool result = TRUE;
switch (ch) {
case 'v':
- if ((*at_code += 1) >= SIZEOF(attrs_to_cycle))
+ if ((*at_code += 1) >= limit)
*at_code = 0;
break;
case 'V':
if (*at_code == 0)
- *at_code = SIZEOF(attrs_to_cycle) - 1;
+ *at_code = limit - 1;
else
*at_code -= 1;
break;
@@ -2620,12 +2843,12 @@ cycle_attr(int ch, unsigned *at_code, chtype *attr)
break;
}
if (result)
- *attr = attrs_to_cycle[*at_code].attr;
+ *attr = list[*at_code].attr;
return result;
}
static bool
-cycle_colors(int ch, int *fg, int *bg, short *pair)
+cycle_colors(int ch, int *fg, int *bg, NCURSES_PAIRS_T *pair)
{
bool result = FALSE;
@@ -2653,10 +2876,12 @@ cycle_colors(int ch, int *fg, int *bg, short *pair)
break;
}
if (result) {
- *pair = (short) (*fg != COLOR_BLACK || *bg != COLOR_BLACK);
+ *pair = (NCURSES_PAIRS_T) (*fg != COLOR_BLACK || *bg != COLOR_BLACK);
if (*pair != 0) {
*pair = 1;
- if (init_pair(*pair, (short) *fg, (short) *bg) == ERR) {
+ if (init_pair(*pair,
+ (NCURSES_COLOR_T) *fg,
+ (NCURSES_COLOR_T) *bg) == ERR) {
result = FALSE;
}
}
@@ -2715,7 +2940,7 @@ slk_help(void)
static void
call_slk_color(int fg, int bg)
{
- init_pair(1, (short) bg, (short) fg);
+ init_pair(1, (NCURSES_COLOR_T) bg, (NCURSES_COLOR_T) fg);
slk_color(1);
MvPrintw(SLK_WORK, 0, "Colors %d/%d\n", fg, bg);
clrtoeol();
@@ -2737,8 +2962,10 @@ slk_test(void)
#if HAVE_SLK_COLOR
int fg = COLOR_BLACK;
int bg = COLOR_WHITE;
- short pair = 0;
+ NCURSES_PAIRS_T pair = 0;
#endif
+ ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+ unsigned my_size = init_attr_list(my_list, termattrs());
c = CTRL('l');
#if HAVE_SLK_COLOR
@@ -2800,7 +3027,7 @@ slk_test(void)
MvAddStr(SLK_WORK, 0, "Please enter the label value: ");
strcpy(buf, "");
if ((s = slk_label(c - '0')) != 0) {
- strncpy(buf, s, 8);
+ strncpy(buf, s, (size_t) 8);
}
wGetstring(stdscr, buf, 8);
slk_set((c - '0'), buf, fmt);
@@ -2819,7 +3046,7 @@ slk_test(void)
#endif
default:
- if (cycle_attr(c, &at_code, &attr)) {
+ if (cycle_attr(c, &at_code, &attr, my_list, my_size)) {
slk_attrset(attr);
slk_touch();
slk_noutrefresh();
@@ -2859,7 +3086,9 @@ wide_slk_test(void)
unsigned at_code = 0;
int fg = COLOR_BLACK;
int bg = COLOR_WHITE;
- short pair = 0;
+ NCURSES_PAIRS_T pair = 0;
+ ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+ unsigned my_size = init_attr_list(my_list, term_attrs());
c = CTRL('l');
if (use_colors) {
@@ -2955,13 +3184,13 @@ wide_slk_test(void)
case 'F':
if (use_colors) {
- fg = (short) ((fg + 1) % COLORS);
+ fg = (NCURSES_COLOR_T) ((fg + 1) % COLORS);
call_slk_color(fg, bg);
}
break;
case 'B':
if (use_colors) {
- bg = (short) ((bg + 1) % COLORS);
+ bg = (NCURSES_COLOR_T) ((bg + 1) % COLORS);
call_slk_color(fg, bg);
}
break;
@@ -2971,8 +3200,8 @@ wide_slk_test(void)
break;
#endif
default:
- if (cycle_attr(c, &at_code, &attr)) {
- slk_attr_set(attr, (fg || bg), NULL);
+ if (cycle_attr(c, &at_code, &attr, my_list, my_size)) {
+ slk_attr_set(attr, (NCURSES_COLOR_T) (fg || bg), NULL);
slk_touch();
slk_noutrefresh();
break;
@@ -3000,15 +3229,46 @@ wide_slk_test(void)
#endif
#endif /* SLK_INIT */
-/* ISO 6429: codes 0x80 to 0x9f may be control characters that cause the
+static void
+show_256_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
+{
+ unsigned first = 0;
+ unsigned last = 255;
+ unsigned code;
+ int count;
+
+ erase();
+ attron(A_BOLD);
+ MvPrintw(0, 20, "Display of Character Codes %#0x to %#0x",
+ first, last);
+ attroff(A_BOLD);
+ refresh();
+
+ for (code = first; code <= last; ++code) {
+ int row = (int) (2 + (code / 16));
+ int col = (int) (5 * (code % 16));
+ IGNORE_RC(mvaddch(row, col, colored_chtype(code, attr, pair)));
+ for (count = 1; count < repeat; ++count) {
+ addch(colored_chtype(code, attr, pair));
+ }
+ }
+
+}
+
+/*
+ * Show a slice of 32 characters, allowing those to be repeated up to the
+ * screen's width.
+ *
+ * ISO 6429: codes 0x80 to 0x9f may be control characters that cause the
* terminal to perform functions. The remaining codes can be graphic.
*/
static void
-show_upper_chars(unsigned first, int repeat, attr_t attr, short pair)
+show_upper_chars(int base, int pagesize, int repeat, attr_t attr, NCURSES_PAIRS_T pair)
{
- bool C1 = (first == 128);
unsigned code;
- unsigned last = first + 31;
+ unsigned first = (unsigned) base;
+ unsigned last = first + (unsigned) pagesize - 2;
+ bool C1 = (first == 128);
int reply;
erase();
@@ -3020,8 +3280,8 @@ show_upper_chars(unsigned first, int repeat, attr_t attr, short pair)
for (code = first; code <= last; code++) {
int count = repeat;
- int row = 2 + ((int) (code - first) % 16);
- int col = ((int) (code - first) / 16) * COLS / 2;
+ int row = 2 + ((int) (code - first) % (pagesize / 2));
+ int col = ((int) (code - first) / (pagesize / 2)) * COLS / 2;
char tmp[80];
sprintf(tmp, "%3u (0x%x)", code, code);
MvPrintw(row, col, "%*s: ", COLS / 4, tmp);
@@ -3045,7 +3305,7 @@ show_upper_chars(unsigned first, int repeat, attr_t attr, short pair)
#define PC_COLS 4
static void
-show_pc_chars(int repeat, attr_t attr, short pair)
+show_pc_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
{
unsigned code;
@@ -3086,7 +3346,7 @@ show_pc_chars(int repeat, attr_t attr, short pair)
}
static void
-show_box_chars(int repeat, attr_t attr, short pair)
+show_box_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
{
(void) repeat;
@@ -3133,7 +3393,7 @@ show_1_acs(int n, int repeat, const char *name, chtype code)
}
static void
-show_acs_chars(int repeat, attr_t attr, short pair)
+show_acs_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
/* display the ACS character set */
{
int n;
@@ -3195,6 +3455,7 @@ static void
acs_display(void)
{
int c = 'a';
+ int pagesize = 32;
char *term = getenv("TERM");
const char *pch_kludge = ((term != 0 && strstr(term, "linux"))
? "p=PC, "
@@ -3205,8 +3466,10 @@ acs_display(void)
int fg = COLOR_BLACK;
int bg = COLOR_BLACK;
unsigned at_code = 0;
- short pair = 0;
- void (*last_show_acs) (int, attr_t, short) = 0;
+ NCURSES_PAIRS_T pair = 0;
+ void (*last_show_acs) (int, attr_t, NCURSES_PAIRS_T) = 0;
+ ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+ unsigned my_size = init_attr_list(my_list, termattrs());
do {
switch (c) {
@@ -3222,6 +3485,13 @@ acs_display(void)
else
beep();
break;
+ case 'w':
+ if (pagesize == 32) {
+ pagesize = 256;
+ } else {
+ pagesize = 32;
+ }
+ break;
case 'x':
ToggleAcs(last_show_acs, show_box_chars);
break;
@@ -3257,7 +3527,7 @@ acs_display(void)
--repeat;
break;
default:
- if (cycle_attr(c, &at_code, &attr)
+ if (cycle_attr(c, &at_code, &attr, my_list, my_size)
|| cycle_colors(c, &fg, &bg, &pair)) {
break;
} else {
@@ -3265,25 +3535,28 @@ acs_display(void)
}
break;
}
- if (last_show_acs != 0)
+ if (pagesize != 32) {
+ show_256_chars(repeat, attr, pair);
+ } else if (last_show_acs != 0) {
last_show_acs(repeat, attr, pair);
- else
- show_upper_chars((unsigned) (digit * 32 + 128), repeat, attr, pair);
+ } else {
+ show_upper_chars(digit * pagesize + 128, pagesize, repeat, attr, pair);
+ }
MvPrintw(LINES - 3, 0,
"Note: ANSI terminals may not display C1 characters.");
MvPrintw(LINES - 2, 0,
- "Select: a=ACS, x=box, %s0=C1, 1-3,+/- non-ASCII, </> repeat, ESC=quit",
+ "Select: a=ACS, w=all x=box, %s0=C1, 1-3,+/- non-ASCII, </> repeat, ESC=quit",
pch_kludge);
if (use_colors) {
MvPrintw(LINES - 1, 0,
"v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.",
- attrs_to_cycle[at_code].name,
+ my_list[at_code].name,
fg, bg);
} else {
MvPrintw(LINES - 1, 0,
"v/V cycles through video attributes (%s).",
- attrs_to_cycle[at_code].name);
+ my_list[at_code].name);
}
refresh();
} while (!isQuit(c = Getchar()));
@@ -3295,7 +3568,7 @@ acs_display(void)
#if USE_WIDEC_SUPPORT
static cchar_t *
-merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, short pair)
+merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, NCURSES_PAIRS_T pair)
{
int count;
@@ -3312,8 +3585,55 @@ merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, short pair)
return dst;
}
+/*
+ * Header/legend take up no more than 8 lines, leaving 16 lines on a 24-line
+ * display. If there are no repeats, we could normally display 16 lines of 64
+ * characters (1024 total). However, taking repeats and double-width cells
+ * into account, use 256 characters for the page.
+ */
static void
-show_upper_widechars(int first, int repeat, int space, attr_t attr, short pair)
+show_paged_widechars(int base,
+ int pagesize,
+ int repeat,
+ int space,
+ attr_t attr,
+ NCURSES_PAIRS_T pair)
+{
+ int first = base * pagesize;
+ int last = first + pagesize - 1;
+ int per_line = 16;
+ cchar_t temp;
+ wchar_t code;
+ wchar_t codes[10];
+
+ erase();
+ attron(A_BOLD);
+ MvPrintw(0, 20, "Display of Character Codes %#x to %#x", first, last);
+ attroff(A_BOLD);
+
+ for (code = (wchar_t) first; (int) code <= last; code++) {
+ int row = (2 + ((int) code - first) / per_line);
+ int col = 5 * ((int) code % per_line);
+ int count;
+
+ memset(&codes, 0, sizeof(codes));
+ codes[0] = code;
+ setcchar(&temp, codes, attr, pair, 0);
+ move(row, col);
+ if (wcwidth(code) == 0 && code != 0) {
+ addch((chtype) space |
+ (A_REVERSE ^ attr) |
+ (attr_t) COLOR_PAIR(pair));
+ }
+ add_wch(&temp);
+ for (count = 1; count < repeat; ++count) {
+ add_wch(&temp);
+ }
+ }
+}
+
+static void
+show_upper_widechars(int first, int repeat, int space, attr_t attr, NCURSES_PAIRS_T pair)
{
cchar_t temp;
wchar_t code;
@@ -3324,7 +3644,7 @@ show_upper_widechars(int first, int repeat, int space, attr_t attr, short pair)
MvPrintw(0, 20, "Display of Character Codes %d to %d", first, last);
attroff(A_BOLD);
- for (code = first; (int) code <= last; code++) {
+ for (code = (wchar_t) first; (int) code <= last; code++) {
int row = 2 + ((code - first) % 16);
int col = ((code - first) / 16) * COLS / 2;
wchar_t codes[10];
@@ -3332,11 +3652,13 @@ show_upper_widechars(int first, int repeat, int space, attr_t attr, short pair)
int count = repeat;
int y, x;
- memset(&codes, 0, sizeof(codes));
- codes[0] = code;
sprintf(tmp, "%3ld (0x%lx)", (long) code, (long) code);
MvPrintw(row, col, "%*s: ", COLS / 4, tmp);
+
+ memset(&codes, 0, sizeof(codes));
+ codes[0] = code;
setcchar(&temp, codes, attr, pair, 0);
+
do {
/*
* Give non-spacing characters something to combine with. If we
@@ -3350,16 +3672,17 @@ show_upper_widechars(int first, int repeat, int space, attr_t attr, short pair)
(attr_t) COLOR_PAIR(pair));
}
/*
- * This could use add_wch(), but is done for comparison with the
- * normal 'f' test (and to make a test-case for echo_wchar()).
- * The screen will flicker because the erase() at the top of the
- * function is met by the builtin refresh() in echo_wchar().
+ * This uses echo_wchar(), for comparison with the normal 'f'
+ * test (and to make a test-case for echo_wchar()). The screen
+ * may flicker because the erase() at the top of the function
+ * is met by the builtin refresh() in echo_wchar().
*/
echo_wchar(&temp);
/*
* The repeat-count may make text wrap - avoid that.
*/
getyx(stdscr, y, x);
+ (void) y;
if (x >= col + (COLS / 2) - 2)
break;
} while (--count > 0);
@@ -3383,7 +3706,7 @@ show_1_wacs(int n, int repeat, const char *name, const cchar_t *code)
#define MERGE_ATTR(wch) merge_wide_attr(&temp, wch, attr, pair)
static void
-show_wacs_chars(int repeat, attr_t attr, short pair)
+show_wacs_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
/* display the wide-ACS character set */
{
cchar_t temp;
@@ -3443,7 +3766,7 @@ show_wacs_chars(int repeat, attr_t attr, short pair)
#ifdef WACS_D_PLUS
static void
-show_wacs_chars_double(int repeat, attr_t attr, short pair)
+show_wacs_chars_double(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
/* display the wide-ACS character set */
{
cchar_t temp;
@@ -3504,7 +3827,7 @@ show_wacs_chars_double(int repeat, attr_t attr, short pair)
#ifdef WACS_T_PLUS
static void
-show_wacs_chars_thick(int repeat, attr_t attr, short pair)
+show_wacs_chars_thick(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
/* display the wide-ACS character set */
{
cchar_t temp;
@@ -3568,7 +3891,7 @@ show_wacs_chars_thick(int repeat, attr_t attr, short pair)
#define MERGE_ATTR(n,wch) merge_wide_attr(&temp[n], wch, attr, pair)
static void
-show_wbox_chars(int repeat, attr_t attr, short pair)
+show_wbox_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
{
cchar_t temp[8];
@@ -3603,7 +3926,7 @@ show_wbox_chars(int repeat, attr_t attr, short pair)
#undef MERGE_ATTR
static int
-show_2_wacs(int n, const char *name, const char *code, attr_t attr, short pair)
+show_2_wacs(int n, const char *name, const char *code, attr_t attr, NCURSES_PAIRS_T pair)
{
const int height = 16;
int row = 2 + (n % height);
@@ -3612,7 +3935,7 @@ show_2_wacs(int n, const char *name, const char *code, attr_t attr, short pair)
MvPrintw(row, col, "%*s : ", COLS / 4, name);
(void) attr_set(attr, pair, 0);
- addstr(strcpy(temp, code));
+ addstr(strncpy(temp, code, 20));
(void) attr_set(A_NORMAL, 0, 0);
return n + 1;
}
@@ -3620,7 +3943,7 @@ show_2_wacs(int n, const char *name, const char *code, attr_t attr, short pair)
#define SHOW_UTF8(n, name, code) show_2_wacs(n, name, code, attr, pair)
static void
-show_utf8_chars(int repeat, attr_t attr, short pair)
+show_utf8_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
{
int n;
@@ -3680,12 +4003,15 @@ wide_acs_display(void)
int digit = 0;
int repeat = 1;
int space = ' ';
+ int pagesize = 32;
chtype attr = A_NORMAL;
int fg = COLOR_BLACK;
int bg = COLOR_BLACK;
unsigned at_code = 0;
- short pair = 0;
- void (*last_show_wacs) (int, attr_t, short) = 0;
+ NCURSES_PAIRS_T pair = 0;
+ void (*last_show_wacs) (int, attr_t, NCURSES_PAIRS_T) = 0;
+ ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+ unsigned my_size = init_attr_list(my_list, term_attrs());
do {
switch (c) {
@@ -3705,6 +4031,13 @@ wide_acs_display(void)
ToggleAcs(last_show_wacs, show_wacs_chars_thick);
break;
#endif
+ case 'w':
+ if (pagesize == 32) {
+ pagesize = 256;
+ } else {
+ pagesize = 32;
+ }
+ break;
case 'x':
ToggleAcs(last_show_wacs, show_wbox_chars);
break;
@@ -3728,7 +4061,7 @@ wide_acs_display(void)
} else if (c == '_') {
space = (space == ' ') ? '_' : ' ';
last_show_wacs = 0;
- } else if (cycle_attr(c, &at_code, &attr)
+ } else if (cycle_attr(c, &at_code, &attr, my_list, my_size)
|| cycle_colors(c, &fg, &bg, &pair)) {
if (last_show_wacs != 0)
break;
@@ -3738,22 +4071,27 @@ wide_acs_display(void)
}
break;
}
- if (last_show_wacs != 0)
+ if (pagesize != 32) {
+ show_paged_widechars(digit, pagesize, repeat, space, attr, pair);
+ } else if (last_show_wacs != 0) {
last_show_wacs(repeat, attr, pair);
- else
+ } else {
show_upper_widechars(digit * 32 + 128, repeat, space, attr, pair);
+ }
- MvPrintw(LINES - 3, 0,
- "Select: a/d/t WACS, x box, u UTF-8, 0-9,+/- non-ASCII, </> repeat, ESC=quit");
+ MvPrintw(LINES - 4, 0,
+ "Select: a/d/t WACS, w=all x=box, u UTF-8, ^L repaint");
+ MvPrintw(LINES - 3, 2,
+ "0-9,+/- non-ASCII, </> repeat, _ space, ESC=quit");
if (use_colors) {
- MvPrintw(LINES - 2, 0,
+ MvPrintw(LINES - 2, 2,
"v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.",
- attrs_to_cycle[at_code].name,
+ my_list[at_code].name,
fg, bg);
} else {
- MvPrintw(LINES - 2, 0,
+ MvPrintw(LINES - 2, 2,
"v/V cycles through video attributes (%s).",
- attrs_to_cycle[at_code].name);
+ my_list[at_code].name);
}
refresh();
} while (!isQuit(c = Getchar()));
@@ -3779,7 +4117,7 @@ test_sgr_attributes(void)
/* Use non-default colors if possible to exercise bce a little */
if (use_colors) {
init_pair(1, COLOR_WHITE, COLOR_BLUE);
- normal |= COLOR_PAIR(1);
+ normal |= (chtype) COLOR_PAIR(1);
}
bkgdset(normal);
erase();
@@ -4115,7 +4453,8 @@ getwindow(void)
outerbox(ul, lr, TRUE);
refresh();
- wrefresh(rwindow);
+ if (rwindow != 0)
+ wrefresh(rwindow);
move(0, 0);
clrtoeol();
@@ -4185,10 +4524,12 @@ acs_and_scroll(void)
transient((FRAME *) 0, (char *) 0);
switch (c) {
case CTRL('C'):
- if ((neww = typeCalloc(FRAME, 1)) == 0) {
+ if ((neww = typeCalloc(FRAME, (size_t) 1)) == 0) {
+ failed("acs_and_scroll");
goto breakout;
}
if ((neww->wind = getwindow()) == (WINDOW *) 0) {
+ failed("acs_and_scroll");
free(neww);
goto breakout;
}
@@ -4265,16 +4606,20 @@ acs_and_scroll(void)
if ((fp = fopen(DUMPFILE, "r")) == (FILE *) 0) {
transient(current, "Can't open screen dump file");
} else {
- if ((neww = typeCalloc(FRAME, 1)) != 0) {
+ if ((neww = typeCalloc(FRAME, (size_t) 1)) != 0) {
neww->next = current ? current->next : 0;
neww->last = current;
- neww->last->next = neww;
- neww->next->last = neww;
+ if (neww->last != 0)
+ neww->last->next = neww;
+ if (neww->next != 0)
+ neww->next->last = neww;
neww->wind = getwin(fp);
wrefresh(neww->wind);
+ } else {
+ failed("acs_and_scroll");
}
(void) fclose(fp);
}
@@ -4463,7 +4808,7 @@ saywhat(NCURSES_CONST char *text)
mkpanel(rows,cols,tly,tlx) - alloc a win and panel and associate them
--------------------------------------------------------------------------*/
static PANEL *
-mkpanel(short color, int rows, int cols, int tly, int tlx)
+mkpanel(NCURSES_COLOR_T color, int rows, int cols, int tly, int tlx)
{
WINDOW *win;
PANEL *pan = 0;
@@ -4472,8 +4817,10 @@ mkpanel(short color, int rows, int cols, int tly, int tlx)
if ((pan = new_panel(win)) == 0) {
delwin(win);
} else if (use_colors) {
- short fg = (short) ((color == COLOR_BLUE) ? COLOR_WHITE : COLOR_BLACK);
- short bg = color;
+ NCURSES_COLOR_T fg = (NCURSES_COLOR_T) ((color == COLOR_BLUE)
+ ? COLOR_WHITE
+ : COLOR_BLACK);
+ NCURSES_COLOR_T bg = color;
init_pair(color, fg, bg);
wbkgdset(win, (attr_t) (COLOR_PAIR(color) | ' '));
@@ -4509,13 +4856,13 @@ pflush(void)
fill_panel(win)
--------------------------------------------------------------------------*/
static void
-init_panel(void)
+init_panel(WINDOW *win)
{
register int y, x;
for (y = 0; y < LINES - 1; y++) {
for (x = 0; x < COLS; x++)
- wprintw(stdscr, "%d", (y + x) % 10);
+ wprintw(win, "%d", (y + x) % 10);
}
}
@@ -4541,7 +4888,7 @@ fill_panel(PANEL * pan)
#if USE_WIDEC_SUPPORT
static void
-init_wide_panel(void)
+init_wide_panel(WINDOW *win)
{
int digit;
cchar_t temp[10];
@@ -4553,7 +4900,7 @@ init_wide_panel(void)
int y, x;
getyx(stdscr, y, x);
digit = (y + x / 2) % 10;
- } while (add_wch(&temp[digit]) != ERR);
+ } while (wadd_wch(win, &temp[digit]) != ERR);
}
static void
@@ -4607,7 +4954,7 @@ canned_panel(PANEL * px[MAX_PANELS + 1], NCURSES_CONST char *cmd)
}
static void
-demo_panels(void (*InitPanel) (void), void (*FillPanel) (PANEL *))
+demo_panels(void (*InitPanel) (WINDOW *), void (*FillPanel) (PANEL *))
{
int count;
int itmp;
@@ -4616,7 +4963,7 @@ demo_panels(void (*InitPanel) (void), void (*FillPanel) (PANEL *))
scrollok(stdscr, FALSE); /* we don't want stdscr to scroll! */
refresh();
- InitPanel();
+ InitPanel(stdscr);
for (count = 0; count < 5; count++) {
px[1] = mkpanel(COLOR_RED,
LINES / 2 - 2,
@@ -5226,7 +5573,7 @@ flushinp_test(WINDOW *win)
#ifdef A_COLOR
if (use_colors) {
init_pair(2, COLOR_CYAN, COLOR_BLUE);
- wbkgd(subWin, COLOR_PAIR(2) | ' ');
+ wbkgd(subWin, (chtype) (COLOR_PAIR(2) | ' '));
}
#endif
(void) wattrset(subWin, A_BOLD);
@@ -5449,6 +5796,8 @@ tracetrace(unsigned tlevel)
for (n = 0; t_tbl[n].name != 0; n++)
need += strlen(t_tbl[n].name) + 2;
buf = typeMalloc(char, need);
+ if (!buf)
+ failed("tracetrace");
}
sprintf(buf, "0x%02x = {", tlevel);
if (tlevel == 0) {
@@ -5622,10 +5971,9 @@ display_form(FORM * f)
set_form_sub(f, derwin(w, rows, cols, 1, 2));
box(w, 0, 0);
keypad(w, TRUE);
+ if (post_form(f) != E_OK)
+ wrefresh(w);
}
-
- if (post_form(f) != E_OK)
- wrefresh(w);
}
static void
@@ -5649,55 +5997,60 @@ edit_secure(FIELD * me, int c)
if (field_info(me, &rows, &cols, &frow, &fcol, &nrow, &nbuf) == E_OK
&& nbuf > 0) {
char *source = field_buffer(me, 1);
- char temp[80];
- long len;
-
- strcpy(temp, source ? source : "");
- len = (long) (char *) field_userptr(me);
- if (c <= KEY_MAX) {
- if (isgraph(c) && (len + 1) < (int) sizeof(temp)) {
- temp[len++] = (char) c;
- temp[len] = 0;
- set_field_buffer(me, 1, temp);
- c = '*';
- } else {
- c = 0;
- }
- } else {
- switch (c) {
- case REQ_BEG_FIELD:
- case REQ_CLR_EOF:
- case REQ_CLR_EOL:
- case REQ_DEL_LINE:
- case REQ_DEL_WORD:
- case REQ_DOWN_CHAR:
- case REQ_END_FIELD:
- case REQ_INS_CHAR:
- case REQ_INS_LINE:
- case REQ_LEFT_CHAR:
- case REQ_NEW_LINE:
- case REQ_NEXT_WORD:
- case REQ_PREV_WORD:
- case REQ_RIGHT_CHAR:
- case REQ_UP_CHAR:
- c = 0; /* we don't want to do inline editing */
- break;
- case REQ_CLR_FIELD:
- if (len) {
- temp[0] = 0;
+ size_t have = (source ? strlen(source) : 0) + 1;
+ size_t need = 80 + have;
+ char *temp = malloc(need);
+ size_t len;
+
+ if (temp != 0) {
+ strncpy(temp, source ? source : "", have + 1);
+ len = (size_t) (char *) field_userptr(me);
+ if (c <= KEY_MAX) {
+ if (isgraph(c) && (len + 1) < sizeof(temp)) {
+ temp[len++] = (char) c;
+ temp[len] = 0;
set_field_buffer(me, 1, temp);
+ c = '*';
+ } else {
+ c = 0;
}
- break;
- case REQ_DEL_CHAR:
- case REQ_DEL_PREV:
- if (len) {
- temp[--len] = 0;
- set_field_buffer(me, 1, temp);
+ } else {
+ switch (c) {
+ case REQ_BEG_FIELD:
+ case REQ_CLR_EOF:
+ case REQ_CLR_EOL:
+ case REQ_DEL_LINE:
+ case REQ_DEL_WORD:
+ case REQ_DOWN_CHAR:
+ case REQ_END_FIELD:
+ case REQ_INS_CHAR:
+ case REQ_INS_LINE:
+ case REQ_LEFT_CHAR:
+ case REQ_NEW_LINE:
+ case REQ_NEXT_WORD:
+ case REQ_PREV_WORD:
+ case REQ_RIGHT_CHAR:
+ case REQ_UP_CHAR:
+ c = 0; /* we don't want to do inline editing */
+ break;
+ case REQ_CLR_FIELD:
+ if (len) {
+ temp[0] = 0;
+ set_field_buffer(me, 1, temp);
+ }
+ break;
+ case REQ_DEL_CHAR:
+ case REQ_DEL_PREV:
+ if (len) {
+ temp[--len] = 0;
+ set_field_buffer(me, 1, temp);
+ }
+ break;
}
- break;
}
+ set_field_userptr(me, (void *) len);
+ free(temp);
}
- set_field_userptr(me, (void *) len);
}
return c;
}
@@ -6045,7 +6398,7 @@ overlap_helpitem(int state, int item, char *message)
static void
overlap_test_1_attr(WINDOW *win, int flavor, int col)
{
- short cpair = (short) (1 + (flavor * 2) + col);
+ NCURSES_PAIRS_T cpair = (NCURSES_PAIRS_T) (1 + (flavor * 2) + col);
switch (flavor) {
case 0:
@@ -6056,11 +6409,11 @@ overlap_test_1_attr(WINDOW *win, int flavor, int col)
break;
case 2:
init_pair(cpair, COLOR_BLUE, COLOR_WHITE);
- (void) wattrset(win, (attr_t) COLOR_PAIR(cpair) | A_NORMAL);
+ (void) wattrset(win, AttrArg(COLOR_PAIR(cpair), A_NORMAL));
break;
case 3:
init_pair(cpair, COLOR_WHITE, COLOR_BLUE);
- (void) wattrset(win, (attr_t) COLOR_PAIR(cpair) | A_BOLD);
+ (void) wattrset(win, AttrArg(COLOR_PAIR(cpair), A_BOLD));
break;
}
}
@@ -6068,7 +6421,7 @@ overlap_test_1_attr(WINDOW *win, int flavor, int col)
static void
overlap_test_2_attr(WINDOW *win, int flavor, int col)
{
- short cpair = (short) (9 + (flavor * 2) + col);
+ NCURSES_PAIRS_T cpair = (NCURSES_PAIRS_T) (9 + (flavor * 2) + col);
switch (flavor) {
case 0:
@@ -6483,6 +6836,9 @@ usage(void)
," -a f,b set default-colors (assumed white-on-black)"
," -d use default-colors if terminal supports them"
#endif
+#if HAVE_USE_ENV
+ ," -E call use_env(FALSE) to ignore $LINES and $COLUMNS"
+#endif
#if USE_SOFTKEYS
," -e fmt specify format for soft-keys test (e)"
#endif
@@ -6495,6 +6851,9 @@ usage(void)
#if USE_LIBPANEL
," -s msec specify nominal time for panel-demo (default: 1, to hold)"
#endif
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20120714) && !defined(__MINGW32__)
+ ," -T call use_tioctl(TRUE) to allow SIGWINCH to override environment"
+#endif
#ifdef TRACE
," -t mask specify default trace-level (may toggle with ^T)"
#endif
@@ -6517,7 +6876,7 @@ set_terminal_modes(void)
}
#ifdef SIGUSR1
-static RETSIGTYPE
+static void
announce_sig(int sig)
{
(void) fprintf(stderr, "Handled signal %d\r\n", sig);
@@ -6613,7 +6972,7 @@ main_menu(bool top)
command = 0;
for (;;) {
char ch = '\0';
- if (read(fileno(stdin), &ch, 1) <= 0) {
+ if (read(fileno(stdin), &ch, (size_t) 1) <= 0) {
if (command == 0)
command = 'q';
break;
@@ -6681,17 +7040,29 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- while ((c = getopt(argc, argv, "a:de:fhmp:s:t:")) != -1) {
+ while ((c = getopt(argc, argv, "a:dEe:fhmp:s:Tt:")) != -1) {
switch (c) {
#ifdef NCURSES_VERSION
case 'a':
assumed_colors = TRUE;
- sscanf(optarg, "%d,%d", &default_fg, &default_bg);
+ switch (sscanf(optarg, "%d,%d", &default_fg, &default_bg)) {
+ case 0:
+ default_fg = COLOR_WHITE;
+ /* FALLTHRU */
+ case 1:
+ default_bg = COLOR_BLACK;
+ break;
+ }
break;
case 'd':
default_colors = TRUE;
break;
#endif
+#if HAVE_USE_ENV
+ case 'E':
+ use_env(FALSE);
+ break;
+#endif
case 'e':
my_e_param = atoi(optarg);
#ifdef NCURSES_VERSION
@@ -6721,6 +7092,11 @@ main(int argc, char *argv[])
nap_msec = (int) atol(optarg);
break;
#endif
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20120714) && !defined(__MINGW32__)
+ case 'T':
+ use_tioctl(TRUE);
+ break;
+#endif
#ifdef TRACE
case 't':
save_trace = (unsigned) strtol(optarg, 0, 0);
@@ -6761,7 +7137,7 @@ main(int argc, char *argv[])
bkgdset(BLANK);
/* tests, in general, will want these modes */
- use_colors = monochrome ? FALSE : has_colors();
+ use_colors = (bool) (monochrome ? FALSE : has_colors());
if (use_colors) {
start_color();
@@ -6772,7 +7148,7 @@ main(int argc, char *argv[])
use_default_colors();
min_colors = -1;
}
-#if NCURSES_VERSION_PATCH >= 20000708
+#if HAVE_ASSUME_DEFAULT_COLORS
if (assumed_colors)
assume_default_colors(default_fg, default_bg);
#endif
@@ -6783,8 +7159,10 @@ main(int argc, char *argv[])
max_pairs = COLOR_PAIRS; /* was > 256 ? 256 : COLOR_PAIRS */
if (can_change_color()) {
- short cp;
+ NCURSES_PAIRS_T cp;
all_colors = typeMalloc(RGB_DATA, (unsigned) max_colors);
+ if (!all_colors)
+ failed("all_colors");
for (cp = 0; cp < max_colors; ++cp) {
color_content(cp,
&all_colors[cp].red,
@@ -6809,9 +7187,10 @@ main(int argc, char *argv[])
&& okRGB(red)
&& okRGB(green)
&& okRGB(blue)) {
- all_colors[c].red = (short) ((red * 1000) / scale);
- all_colors[c].green = (short) ((green * 1000) / scale);
- all_colors[c].blue = (short) ((blue * 1000) / scale);
+#define Scaled(n) (NCURSES_COLOR_T) (((n) * 1000) / scale)
+ all_colors[c].red = Scaled(red);
+ all_colors[c].green = Scaled(green);
+ all_colors[c].blue = Scaled(blue);
}
}
fclose(fp);
diff --git a/test/newdemo.c b/test/newdemo.c
index 75626a9..f9b6f82 100644
--- a/test/newdemo.c
+++ b/test/newdemo.c
@@ -2,7 +2,7 @@
* newdemo.c - A demo program using PDCurses. The program illustrate
* the use of colours for text output.
*
- * $Id: newdemo.c,v 1.35 2010/12/12 00:19:15 tom Exp $
+ * $Id: newdemo.c,v 1.41 2014/08/02 23:10:56 tom Exp $
*/
#include <test.priv.h>
@@ -47,7 +47,7 @@ static const char *messages[] =
/*
* Trap interrupt
*/
-static RETSIGTYPE
+static void
trap(int sig GCC_UNUSED)
{
endwin();
@@ -84,7 +84,7 @@ set_colors(WINDOW *win, int pair, int foreground, int background)
if (pair > COLOR_PAIRS)
pair = COLOR_PAIRS;
init_pair((short) pair, (short) foreground, (short) background);
- (void) wattrset(win, (attr_t) COLOR_PAIR(pair));
+ (void) wattrset(win, AttrArg(COLOR_PAIR(pair), 0));
}
}
@@ -96,7 +96,7 @@ use_colors(WINDOW *win, int pair, chtype attrs)
pair = COLOR_PAIRS;
attrs |= (chtype) COLOR_PAIR(pair);
}
- (void) wattrset(win, attrs);
+ (void) wattrset(win, AttrArg(attrs, 0));
return attrs;
}
@@ -113,12 +113,19 @@ SubWinTest(WINDOW *win)
getbegyx(win, by, bx);
sw = w / 3;
sh = h / 3;
- if ((swin1 = subwin(win, sh, sw, by + 3, bx + 5)) == NULL)
+
+ if ((swin1 = subwin(win, sh, sw, by + 3, bx + 5)) == NULL) {
return 1;
- if ((swin2 = subwin(win, sh, sw, by + 4, bx + 8)) == NULL)
+ }
+ if ((swin2 = subwin(win, sh, sw, by + 4, bx + 8)) == NULL) {
+ delwin(swin1);
return 1;
- if ((swin3 = subwin(win, sh, sw, by + 5, bx + 11)) == NULL)
+ }
+ if ((swin3 = subwin(win, sh, sw, by + 5, bx + 11)) == NULL) {
+ delwin(swin1);
+ delwin(swin2);
return 1;
+ }
set_colors(swin1, 8, COLOR_RED, COLOR_BLUE);
werase(swin1);
@@ -215,7 +222,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
WINDOW *win;
int w, x, y, i, j, k;
- char buffer[200];
+ char buffer[SIZEOF(messages) * 80];
const char *message;
int width, height;
chtype save[80];
diff --git a/test/package/debian/source/format b/test/package/debian/source/format
index 89ae9db..163aaf8 100644
--- a/test/package/debian/source/format
+++ b/test/package/debian/source/format
@@ -1 +1 @@
-3.0 (native)
+3.0 (quilt)
diff --git a/test/package/mingw-ncurses-examples.spec b/test/package/mingw-ncurses-examples.spec
new file mode 100644
index 0000000..fdc2a69
--- /dev/null
+++ b/test/package/mingw-ncurses-examples.spec
@@ -0,0 +1,109 @@
+Summary: ncurses-examples - example/test programs from ncurses
+%?mingw_package_header
+
+%define AppProgram ncurses-examples
+%define AppVersion MAJOR.MINOR
+%define AppRelease YYYYMMDD
+# $Id: mingw-ncurses-examples.spec,v 1.3 2013/10/26 23:30:21 tom Exp $
+Name: mingw32-ncurses6-examples
+Version: %{AppVersion}
+Release: %{AppRelease}
+License: X11
+Group: Development/Libraries
+Source: ncurses-examples-%{release}.tgz
+# URL: http://invisible-island.net/ncurses/
+
+BuildRequires: mingw32-ncurses6
+
+BuildRequires: mingw32-filesystem >= 95
+BuildRequires: mingw32-gcc
+BuildRequires: mingw32-binutils
+
+BuildRequires: mingw64-ncurses6
+
+BuildRequires: mingw64-filesystem >= 95
+BuildRequires: mingw64-gcc
+BuildRequires: mingw64-binutils
+
+%define CC_NORMAL -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
+%define CC_STRICT %{CC_NORMAL} -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
+
+%description -n mingw32-ncurses6-examples
+Cross-compiling support for ncurses to mingw32.
+
+The ncurses library routines are a terminal-independent method of
+updating character screens with reasonable optimization.
+
+This package is used for testing ABI 6 with cross-compiles to MinGW.
+
+%package -n mingw64-ncurses6-examples
+Summary: Curses library for MinGW64
+
+%description -n mingw64-ncurses6-examples
+Cross-compiling support for ncurses to mingw64.
+
+The ncurses library routines are a terminal-independent method of
+updating character screens with reasonable optimization.
+
+This package is used for testing ABI 6 with cross-compiles to MinGW.
+
+%prep
+
+# override location of bindir, e.g., to avoid conflict with pdcurses
+%global mingw32_bindir %{mingw32_exec_prefix}/bin/%{AppProgram}
+%global mingw64_bindir %{mingw64_exec_prefix}/bin/%{AppProgram}
+
+%define CFG_OPTS \\\
+ --disable-echo \\\
+ --enable-warnings \\\
+ --verbose
+
+%define debug_package %{nil}
+%setup -q -n ncurses-examples-%{release}
+
+%build
+mkdir BUILD-W32
+pushd BUILD-W32
+CFLAGS="%{CC_NORMAL}" \
+CC=%{mingw32_cc} \
+%mingw32_configure %{CFG_OPTS}
+cp config.status /tmp/ming32-config.status
+make
+popd
+
+mkdir BUILD-W64
+pushd BUILD-W64
+CFLAGS="%{CC_NORMAL}" \
+CC=%{mingw64_cc} \
+%mingw64_configure %{CFG_OPTS}
+cp config.status /tmp/ming64-config.status
+make
+popd
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+pushd BUILD-W32
+%{mingw32_make} install DESTDIR=$RPM_BUILD_ROOT
+popd
+
+pushd BUILD-W64
+%{mingw64_make} install DESTDIR=$RPM_BUILD_ROOT
+popd
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+
+%files -n mingw32-ncurses6-examples
+%{mingw32_bindir}/*
+
+%files -n mingw64-ncurses6-examples
+%{mingw64_bindir}/*
+
+%changelog
+
+* Sat Oct 19 2013 Thomas E. Dickey
+- initial version
diff --git a/test/package/ncurses-examples.spec b/test/package/ncurses-examples.spec
index ad79e5a..8a01678 100644
--- a/test/package/ncurses-examples.spec
+++ b/test/package/ncurses-examples.spec
@@ -2,7 +2,7 @@ Summary: ncurses-examples - example/test programs from ncurses
%define AppProgram ncurses-examples
%define AppVersion MAJOR.MINOR
%define AppRelease YYYYMMDD
-# $Id: ncurses-examples.spec,v 1.2 2011/03/25 17:46:44 tom Exp $
+# $Id: ncurses-examples.spec,v 1.3 2013/10/05 23:44:19 tom Exp $
Name: %{AppProgram}
Version: %{AppVersion}
Release: %{AppRelease}
@@ -51,5 +51,5 @@ strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram}/*
%changelog
# each patch should add its ChangeLog entries here
-* Fri Mar 25 2010 Thomas Dickey
+* Thu Mar 25 2010 Thomas Dickey
- initial version
diff --git a/test/programs b/test/programs
index bfcc134..1110ce5 100644
--- a/test/programs
+++ b/test/programs
@@ -1,6 +1,6 @@
-# $Id: programs,v 1.19 2009/09/12 19:44:01 tom Exp $
+# $Id: programs,v 1.25 2014/06/21 15:28:49 tom Exp $
##############################################################################
-# Copyright (c) 2006-2008,2009 Free Software Foundation, Inc. #
+# Copyright (c) 2006-2013,2014 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@@ -47,12 +47,15 @@ demo_termcap $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_termcap
demo_terminfo $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_terminfo
ditto $(LDFLAGS_THREADS) $(LOCAL_LIBS) ditto
dots $(LDFLAGS_TINFO) $(LOCAL_LIBS) dots
+dots_curses $(LDFLAGS_CURSES) $(LOCAL_LIBS) dots_curses
dots_mvcur $(LDFLAGS_CURSES) $(LOCAL_LIBS) dots_mvcur
+dots_termcap $(LDFLAGS_TINFO) $(LOCAL_LIBS) dots_termcap
echochar $(LDFLAGS_CURSES) $(LOCAL_LIBS) echochar
filter $(LDFLAGS_CURSES) $(LOCAL_LIBS) filter
firework $(LDFLAGS_CURSES) $(LOCAL_LIBS) firework
firstlast $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) firstlast
foldkeys $(LDFLAGS_CURSES) $(LOCAL_LIBS) foldkeys
+form_driver_w $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) form_driver_w
gdc $(LDFLAGS_CURSES) $(LOCAL_LIBS) gdc
hanoi $(LDFLAGS_CURSES) $(LOCAL_LIBS) hanoi
hashtest $(LDFLAGS_CURSES) $(LOCAL_LIBS) hashtest
@@ -83,6 +86,8 @@ test_getstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_getstr
test_instr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_instr
test_inwstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_inwstr
test_opaque $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_opaque
+test_vid_puts $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_vid_puts
+test_vidputs $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_vidputs
testaddch $(LDFLAGS_CURSES) $(LOCAL_LIBS) testaddch
testcurs $(LDFLAGS_CURSES) $(LOCAL_LIBS) testcurs
testscanw $(LDFLAGS_CURSES) $(LOCAL_LIBS) testscanw
diff --git a/test/railroad.c b/test/railroad.c
index 973ec46..33dc46f 100644
--- a/test/railroad.c
+++ b/test/railroad.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2000-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 2000-2011,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,7 +29,7 @@
/*
* Author: Thomas E. Dickey - 2000
*
- * $Id: railroad.c,v 1.19 2009/10/24 21:37:56 tom Exp $
+ * $Id: railroad.c,v 1.21 2013/09/28 22:02:17 tom Exp $
*
* A simple demo of the termcap interface.
*/
@@ -55,20 +55,20 @@ static char *backup;
static bool interrupted = FALSE;
-static int
-outc(TPUTS_ARG c)
+static
+TPUTS_PROTO(outc, c)
{
int rc = OK;
if (interrupted) {
char tmp = (char) c;
- if (write(STDOUT_FILENO, &tmp, 1) == -1)
+ if (write(STDOUT_FILENO, &tmp, (size_t) 1) == -1)
rc = ERR;
} else {
if (putc(c, stdout) == EOF)
rc = ERR;
}
- return rc;
+ TPUTS_RETURN(rc);
}
static void
diff --git a/test/rain.c b/test/rain.c
index 5f0cbfa..0f123ba 100644
--- a/test/rain.c
+++ b/test/rain.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: rain.c,v 1.38 2010/11/13 20:11:46 tom Exp $
+ * $Id: rain.c,v 1.41 2014/08/02 17:24:07 tom Exp $
*/
#include <test.priv.h>
@@ -102,10 +102,7 @@ next_j(int j)
--j;
if (has_colors()) {
int z = (int) (3 * ranf());
- chtype color = (chtype) COLOR_PAIR(z);
- if (z)
- color |= A_BOLD;
- (void) attrset(color);
+ (void) attrset(AttrArg(COLOR_PAIR(z), (z ? A_BOLD : A_NORMAL)));
}
return j;
}
@@ -222,7 +219,7 @@ draw_drop(void *arg)
* Find myself in the list of threads so we can count the number of loops.
*/
for (mystats = 0; mystats < MAX_THREADS; ++mystats) {
-#ifdef __MINGW32__
+#if defined(__MINGW32__) && !defined(__WINPTHREADS_VERSION)
if (drop_threads[mystats].myself.p == pthread_self().p)
#else
if (drop_threads[mystats].myself == pthread_self())
@@ -256,7 +253,7 @@ draw_drop(void *arg)
/*
* The description of pthread_create() is misleading, since it implies that
* threads will exit cleanly after their function returns.
- *
+ *
* Since they do not (and the number of threads is limited by system
* resources), make a limited number of threads, and signal any that are
* waiting when we want a thread past that limit.
diff --git a/test/redraw.c b/test/redraw.c
index f62c098..9cb0de9 100644
--- a/test/redraw.c
+++ b/test/redraw.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2006-2007,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: redraw.c,v 1.5 2010/05/01 22:04:08 tom Exp $
+ * $Id: redraw.c,v 1.8 2012/12/08 20:46:02 tom Exp $
*
* Demonstrate the redrawwin() and wredrawln() functions.
* Thomas Dickey - 2006/11/4
@@ -113,7 +113,7 @@ test_redraw(WINDOW *win)
* using mvcur(). It is ifdef'd for NCURSES, since X/Open does
* not define the case where the old location is unknown.
*/
- system("date");
+ IGNORE_RC(system("date"));
mvcur(-1, -1, y, x);
break;
#endif
diff --git a/test/tclock.c b/test/tclock.c
index fb44725..96e1d19 100644
--- a/test/tclock.c
+++ b/test/tclock.c
@@ -1,4 +1,4 @@
-/* $Id: tclock.c,v 1.30 2011/03/22 09:16:00 tom Exp $ */
+/* $Id: tclock.c,v 1.34 2014/08/02 16:37:03 tom Exp $ */
#include <test.priv.h>
@@ -53,14 +53,14 @@
/* Plot a point */
static void
-plot(int x, int y, char col)
+plot(int x, int y, int col)
{
MvAddCh(y, x, (chtype) col);
}
/* Draw a diagonal(arbitrary) line using Bresenham's alogrithm. */
static void
-dline(int pair, int from_x, int from_y, int x2, int y2, char ch)
+dline(int pair, int from_x, int from_y, int x2, int y2, int ch)
{
int dx, dy;
int ax, ay;
@@ -69,7 +69,7 @@ dline(int pair, int from_x, int from_y, int x2, int y2, char ch)
int d;
if (has_colors())
- (void) attrset((attr_t) COLOR_PAIR(pair));
+ (void) attrset(AttrArg(COLOR_PAIR(pair), 0));
dx = x2 - from_x;
dy = y2 - from_y;
@@ -135,8 +135,8 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
short my_bg = COLOR_BLACK;
#if HAVE_GETTIMEOFDAY
struct timeval current;
- double fraction = 0.0;
#endif
+ double fraction = 0.0;
setlocale(LC_ALL, "");
@@ -216,12 +216,12 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
attroff(A_REVERSE);
if (has_colors())
- (void) attrset(COLOR_PAIR(1));
+ (void) attrset(AttrArg(COLOR_PAIR(1), 0));
dline(1, cx, cy, cx + sdx, cy - sdy, 'O');
if (has_colors())
- (void) attrset(COLOR_PAIR(0));
+ (void) attrset(AttrArg(COLOR_PAIR(0), 0));
text = ctime(&tim);
MvPrintw(2, 0, "%.*s", (int) (strlen(text) - 1), text);
diff --git a/test/test.priv.h b/test/test.priv.h
index 51d52a8..eedf201 100644
--- a/test/test.priv.h
+++ b/test/test.priv.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,7 +29,7 @@
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
-/* $Id: test.priv.h,v 1.103 2011/03/22 09:15:45 tom Exp $ */
+/* $Id: test.priv.h,v 1.131 2014/10/25 01:20:34 tom Exp $ */
#ifndef __TEST_PRIV_H
#define __TEST_PRIV_H 1
@@ -58,6 +58,10 @@
/*
* Fallback definitions to accommodate broken compilers.
*/
+#ifndef HAVE_ASSUME_DEFAULT_COLORS
+#define HAVE_ASSUME_DEFAULT_COLORS 0
+#endif
+
#ifndef HAVE_CURSES_VERSION
#define HAVE_CURSES_VERSION 0
#endif
@@ -158,6 +162,10 @@
#define HAVE_RIPOFFLINE 0
#endif
+#ifndef HAVE_SCR_DUMP
+#define HAVE_SCR_DUMP 0
+#endif
+
#ifndef HAVE_SETUPTERM
#define HAVE_SETUPTERM 0
#endif
@@ -170,14 +178,30 @@
#define HAVE_SLK_INIT 0
#endif
+#ifndef HAVE_SYS_IOCTL_H
+#define HAVE_SYS_IOCTL_H 0
+#endif
+
+#ifndef HAVE_SYS_SELECT_H
+#define HAVE_SYS_SELECT_H 0
+#endif
+
#ifndef HAVE_TERMATTRS
#define HAVE_TERMATTRS 0
#endif
+#ifndef HAVE_TERMIOS_H
+#define HAVE_TERMIOS_H 0
+#endif
+
#ifndef HAVE_TERMNAME
#define HAVE_TERMNAME 0
#endif
+#ifndef HAVE_TERM_ENTRY_H
+#define HAVE_TERM_ENTRY_H 0
+#endif
+
#ifndef HAVE_TGETENT
#define HAVE_TGETENT 0
#endif
@@ -202,6 +226,30 @@
#define HAVE_USE_DEFAULT_COLORS 0
#endif
+#ifndef HAVE_USE_ENV
+#define HAVE_USE_ENV 0
+#endif
+
+#ifndef HAVE_USE_EXTENDED_NAMES
+#define HAVE_USE_EXTENDED_NAMES 0
+#endif
+
+#ifndef HAVE_USE_SCREEN
+#define HAVE_USE_SCREEN 0
+#endif
+
+#ifndef HAVE_USE_WINDOW
+#define HAVE_USE_WINDOW 0
+#endif
+
+#ifndef HAVE_VIDPUTS
+#define HAVE_VIDPUTS 0
+#endif
+
+#ifndef HAVE_VID_PUTS
+#define HAVE_VID_PUTS 0
+#endif
+
#ifndef HAVE_WRESIZE
#define HAVE_WRESIZE 0
#endif
@@ -222,6 +270,13 @@
#define NO_LEAKS 0
#endif
+/*
+ * Workaround for HPUX
+ */
+#if defined(__hpux) && !defined(NCURSES_VERSION)
+#define _ACS_COMPAT_CODE /* needed for acs_map vs __acs_map */
+#endif
+
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
@@ -269,21 +324,18 @@
/*
* Not all curses.h implementations include unctrl.h,
- * Solaris 10 xpg4 for example.
*/
-#if defined(NCURSES_VERSION) || defined(_XOPEN_CURSES)
-#if defined(HAVE_NCURSESW_NCURSES_H)
+#if defined(HAVE_NCURSESW_UNCTRL_H)
#include <ncursesw/unctrl.h>
-#elif defined(HAVE_NCURSES_NCURSES_H)
+#elif defined(HAVE_NCURSES_UNCTRL_H)
#include <ncurses/unctrl.h>
-#else
+#elif defined(HAVE_UNCTRL_H)
#include <unctrl.h>
#endif
-#endif
#if HAVE_GETOPT_H
#include <getopt.h>
-#else
+#elif !defined(HAVE_GETOPT_HEADER)
/* 'getopt()' may be prototyped in <stdlib.h>, but declaring its variables
* doesn't hurt.
*/
@@ -323,17 +375,20 @@ extern int optind;
#endif
#if !USE_SOFTKEYS
-#define slk_init() /* nothing */
-#define slk_restore() /* nothing */
-#define slk_clear() /* nothing */
+#define slk_init() /* nothing */
+#define slk_restore() /* nothing */
+#define slk_clear() /* nothing */
#endif
#ifndef HAVE_WSYNCDOWN
-#define wsyncdown(win) /* nothing */
+#define wsyncdown(win) /* nothing */
#endif
#ifndef USE_WIDEC_SUPPORT
-#if (defined(_XOPEN_SOURCE_EXTENDED) || defined(_XPG5)) && defined(WACS_ULCORNER)
+#if (defined(_XOPEN_SOURCE_EXTENDED) \
+ || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500)) \
+ || (defined(NCURSES_WIDECHAR) && (NCURSES_WIDECHAR - 0 < 1))) \
+ && defined(WACS_ULCORNER)
#define USE_WIDEC_SUPPORT 1
#else
#define USE_WIDEC_SUPPORT 0
@@ -385,6 +440,14 @@ extern int optind;
#define NCURSES_CH_T cchar_t
#endif
+#ifndef NCURSES_COLOR_T
+#define NCURSES_COLOR_T short
+#endif
+
+#ifndef NCURSES_PAIRS_T
+#define NCURSES_PAIRS_T short
+#endif
+
#ifndef NCURSES_OPAQUE
#define NCURSES_OPAQUE 0
#endif
@@ -507,7 +570,7 @@ extern char *strnames[], *strcodes[], *strfnames[];
if ((count = getcchar(s, NULL, NULL, NULL, NULL)) > 0) { \
wchar_t test_wch[CCHARW_MAX + 2]; \
attr_t test_attrs; \
- short test_pair; \
+ NCURSES_PAIRS_T test_pair; \
\
if (getcchar( s, test_wch, &test_attrs, &test_pair, NULL) == OK \
&& test_wch[0] != L'\0') { \
@@ -576,6 +639,17 @@ extern char *strnames[], *strcodes[], *strfnames[];
#define TIGETSTR(ti,tc) tgetstr(tc,&area_pointer)
#endif
+/*
+ * So far (2013 - more than ten years), only ncurses implements
+ * use_extended_names().
+ */
+#if defined(NCURSES_XNAMES)
+#elif defined(NCURSES_VERSION) && defined(HAVE_TERM_ENTRY_H) && HAVE_TERM_ENTRY_H
+#define NCURSES_XNAMES 1
+#else
+#define NCURSES_XNAMES 0
+#endif
+
/* ncurses implements tparm() with varargs, X/Open with a fixed-parameter list
* (which is incompatible with legacy usage, doesn't solve any problems).
*/
@@ -593,9 +667,9 @@ extern char *strnames[], *strcodes[], *strfnames[];
#define ExitProgram(code) _nc_free_tinfo(code)
#endif
#else
-#define typeMalloc(type,n) (type *) malloc((n) * sizeof(type))
-#define typeCalloc(type,elts) (type *) calloc((elts), sizeof(type))
-#define typeRealloc(type,n,p) (type *) realloc(p, (n) * sizeof(type))
+#define typeMalloc(type,n) (type *) malloc((size_t)(n) * sizeof(type))
+#define typeCalloc(type,elts) (type *) calloc((size_t)(elts), sizeof(type))
+#define typeRealloc(type,n,p) (type *) realloc(p, (size_t)(n) * sizeof(type))
#endif
#ifndef ExitProgram
@@ -609,8 +683,32 @@ extern char *strnames[], *strcodes[], *strfnames[];
#define EXIT_FAILURE 1
#endif
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(USE_WIN32CON_DRIVER)
+
+#if defined(PDCURSES)
+#ifdef WINVER
+# if WINVER < 0x0501
+# error WINVER must at least be 0x0501
+# endif
+#else
+# define WINVER 0x0501
+#endif
+#include <windows.h>
+#include <sys/time.h> /* for struct timeval */
+#undef sleep
+#define sleep(n) Sleep((n) * 1000)
+#define SIGHUP 1
+#define SIGKILL 9
+#define getlogin() "username"
+
+#elif defined(HAVE_NCURSESW_NCURSES_H)
+#include <ncursesw/nc_mingw.h>
+#elif defined(HAVE_NCURSES_NCURSES_H)
+#include <ncurses/nc_mingw.h>
+#else
#include <nc_mingw.h>
+#endif
+
/* conflicts in test/firstlast.c */
#undef large
#undef small
@@ -653,25 +751,32 @@ extern char *strnames[], *strcodes[], *strfnames[];
* The same would be needed for HPUX 10.20
*/
#ifndef TPUTS_ARG
+#define TPUTS_ARG int
+#endif
+
#if defined(sun) && !defined(_XOPEN_CURSES) && !defined(NCURSES_VERSION_PATCH)
+#undef TPUTS_ARG
#define TPUTS_ARG char
extern char *tgoto(char *, int, int); /* available, but not prototyped */
-#else
-#define TPUTS_ARG int
#endif
+
+#ifndef TPUTS_PROTO
+#define TPUTS_PROTO(func,value) int func(TPUTS_ARG value)
+#endif
+
+#ifndef TPUTS_RETURN
+#define TPUTS_RETURN(value) return value
#endif
/*
* Workarounds for Solaris's X/Open curses
*/
-#if defined(sun) && defined(_XOPEN_CURSES) && !defined(NCURSES_VERSION_PATCH)
#if !defined(KEY_MIN) && defined(__KEY_MIN)
#define KEY_MIN __KEY_MIN
#endif
#if !defined(KEY_MAX) && defined(__KEY_MIN)
#define KEY_MAX __KEY_MAX
#endif
-#endif
/*
* Workaround to build with Sun's default SVr4 curses.
@@ -702,23 +807,10 @@ extern char *tgoto(char *, int, int); /* available, but not prototyped */
#define CONST_MENUS /* nothing */
#endif
-#ifndef HAVE_USE_WINDOW
-#if !defined(NCURSES_VERSION_PATCH) || (NCURSES_VERSION_PATCH < 20070915) || !NCURSES_EXT_FUNCS
-#define HAVE_USE_WINDOW 0
-#else
-#define HAVE_USE_WINDOW 1
-#endif
-#endif
-
/*
* Simplify setting up demo of threading with these macros.
*/
-#if !HAVE_USE_WINDOW
-typedef int (*NCURSES_WINDOW_CB) (WINDOW *, void *);
-typedef int (*NCURSES_SCREEN_CB) (SCREEN *, void *);
-#endif
-
#if HAVE_USE_WINDOW
#define USING_WINDOW(w,func) use_window(w, (NCURSES_WINDOW_CB) func, w)
#define USING_WINDOW2(w,func,data) use_window(w, (NCURSES_WINDOW_CB) func, data)
@@ -745,6 +837,8 @@ typedef int (*NCURSES_SCREEN_CB) (SCREEN *, void *);
#define USE_TRACE 0
#endif
+#define Trace2(p) /* nothing */
+
#define MvAddCh (void) mvaddch
#define MvWAddCh (void) mvwaddch
#define MvAddStr (void) mvaddstr
@@ -758,6 +852,15 @@ typedef int (*NCURSES_SCREEN_CB) (SCREEN *, void *);
#define MvWVLine (void) mvwvline
/*
+ * The macro likely uses unsigned values, while X/Open prototype uses int.
+ */
+#if defined(wattrset) || defined(PDCURSES)
+#define AttrArg(p,a) (attr_t) ((attr_t)(p) | (attr_t)(a))
+#else
+#define AttrArg(p,a) (int) ((attr_t)(p) | (attr_t)(a))
+#endif
+
+/*
* Workaround for defective implementation of gcc attribute warn_unused_result
*/
#if defined(__GNUC__) && defined(_FORTIFY_SOURCE)
diff --git a/test/test_add_wchstr.c b/test/test_add_wchstr.c
index a48f2c4..c59a339 100644
--- a/test/test_add_wchstr.c
+++ b/test/test_add_wchstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2009,2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 2010-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_add_wchstr.c,v 1.15 2011/01/15 18:15:11 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.21 2014/08/02 17:24:55 tom Exp $
*
* Demonstrate the waddwchstr() and wadd_wch functions.
* Thomas Dickey - 2009/9/12
@@ -90,6 +90,8 @@ static size_t temp_length;
if (need > temp_length) { \
temp_length = need * 2; \
temp_buffer = typeRealloc(cchar_t, temp_length, temp_buffer); \
+ if (!temp_buffer) \
+ failed("TempBuffer"); \
} \
have[0] = 0; \
have[1] = 0; \
@@ -101,7 +103,7 @@ static size_t temp_length;
&& (temp = unctrl((chtype) have[0])) != 0 \
&& strlen(temp) > 1) { \
while (*temp != '\0') { \
- have[0] = *temp++; \
+ have[0] = (wchar_t) *temp++; \
setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \
} \
} else { \
@@ -208,7 +210,7 @@ ColOf(wchar_t *buffer, int length, int margin)
result += 2;
break;
default:
- result += wcwidth(ch);
+ result += wcwidth((wchar_t) ch);
if (ch < 32)
++result;
break;
@@ -317,6 +319,15 @@ test_add_wchstr(int level)
(void) cbreak(); /* take input chars one at a time, no wait for \n */
(void) noecho(); /* don't echo input */
keypad(stdscr, TRUE);
+
+ /*
+ * Show the characters added in color, to distinguish from those that
+ * are shifted.
+ */
+ if (has_colors()) {
+ start_color();
+ init_pair(1, COLOR_WHITE, COLOR_BLUE);
+ }
}
limit = LINES - 5;
@@ -350,14 +361,8 @@ test_add_wchstr(int level)
doupdate();
- /*
- * Show the characters added in color, to distinguish from those that
- * are shifted.
- */
if (has_colors()) {
- start_color();
- init_pair(1, COLOR_WHITE, COLOR_BLUE);
- wbkgdset(work, COLOR_PAIR(1) | ' ');
+ wbkgdset(work, (chtype) (COLOR_PAIR(1) | ' '));
}
while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
@@ -366,11 +371,13 @@ test_add_wchstr(int level)
case key_RECUR:
test_add_wchstr(level + 1);
- touchwin(look);
+ if (look)
+ touchwin(look);
touchwin(work);
touchwin(show);
- wnoutrefresh(look);
+ if (look)
+ wnoutrefresh(look);
wnoutrefresh(work);
wnoutrefresh(show);
@@ -461,7 +468,7 @@ test_add_wchstr(int level)
}
break;
default:
- buffer[length++] = ch;
+ buffer[length++] = (wchar_t) ch;
buffer[length] = '\0';
/* put the string in, one character at a time */
@@ -514,8 +521,8 @@ test_add_wchstr(int level)
break;
}
}
+ delwin(show);
if (level > 0) {
- delwin(show);
delwin(work);
delwin(look);
}
diff --git a/test/test_addchstr.c b/test/test_addchstr.c
index 815ccc5..2aae844 100644
--- a/test/test_addchstr.c
+++ b/test/test_addchstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2009-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_addchstr.c,v 1.13 2010/12/12 01:28:24 tom Exp $
+ * $Id: test_addchstr.c,v 1.18 2012/12/16 00:36:27 tom Exp $
*
* Demonstrate the waddchstr() and waddch functions.
* Thomas Dickey - 2009/9/12
@@ -101,6 +101,8 @@ ChStr(const char *source)
if (need > temp_length) {
temp_length = need * 2;
temp_buffer = typeRealloc(chtype, temp_length, temp_buffer);
+ if (!temp_buffer)
+ failed("TempBuffer");
}
do {
const char *s;
@@ -237,6 +239,15 @@ test_adds(int level)
(void) cbreak(); /* take input chars one at a time, no wait for \n */
(void) noecho(); /* don't echo input */
keypad(stdscr, TRUE);
+
+ /*
+ * Show the characters added in color, to distinguish from those that
+ * are shifted.
+ */
+ if (has_colors()) {
+ start_color();
+ init_pair(1, COLOR_WHITE, COLOR_BLUE);
+ }
}
limit = LINES - 5;
@@ -270,14 +281,8 @@ test_adds(int level)
doupdate();
- /*
- * Show the characters added in color, to distinguish from those that
- * are shifted.
- */
if (has_colors()) {
- start_color();
- init_pair(1, COLOR_WHITE, COLOR_BLUE);
- show_attr = COLOR_PAIR(1);
+ show_attr = (attr_t) COLOR_PAIR(1);
wbkgdset(work, show_attr | ' ');
} else {
show_attr = A_STANDOUT;
@@ -289,11 +294,13 @@ test_adds(int level)
case key_RECUR:
test_adds(level + 1);
- touchwin(look);
+ if (look)
+ touchwin(look);
touchwin(work);
touchwin(show);
- wnoutrefresh(look);
+ if (look)
+ wnoutrefresh(look);
wnoutrefresh(work);
wnoutrefresh(show);
@@ -445,10 +452,10 @@ test_adds(int level)
}
}
if (level > 0) {
- delwin(show);
delwin(work);
delwin(look);
}
+ delwin(show);
}
static void
diff --git a/test/test_addstr.c b/test/test_addstr.c
index 5cc184a..a14cded 100644
--- a/test/test_addstr.c
+++ b/test/test_addstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2009-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_addstr.c,v 1.6 2010/12/12 00:17:37 tom Exp $
+ * $Id: test_addstr.c,v 1.10 2012/12/16 00:14:10 tom Exp $
*
* Demonstrate the waddstr() and waddch functions.
* Thomas Dickey - 2009/9/12
@@ -161,6 +161,15 @@ test_adds(int level)
(void) cbreak(); /* take input chars one at a time, no wait for \n */
(void) noecho(); /* don't echo input */
keypad(stdscr, TRUE);
+
+ /*
+ * Show the characters added in color, to distinguish from those that
+ * are shifted.
+ */
+ if (has_colors()) {
+ start_color();
+ init_pair(1, COLOR_WHITE, COLOR_BLUE);
+ }
}
limit = LINES - 5;
@@ -194,14 +203,8 @@ test_adds(int level)
doupdate();
- /*
- * Show the characters added in color, to distinguish from those that
- * are shifted.
- */
if (has_colors()) {
- start_color();
- init_pair(1, COLOR_WHITE, COLOR_BLUE);
- wbkgdset(work, COLOR_PAIR(1) | ' ');
+ wbkgdset(work, (chtype) (COLOR_PAIR(1) | ' '));
}
while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
@@ -210,11 +213,13 @@ test_adds(int level)
case key_RECUR:
test_adds(level + 1);
- touchwin(look);
+ if (look)
+ touchwin(look);
touchwin(work);
touchwin(show);
- wnoutrefresh(look);
+ if (look)
+ wnoutrefresh(look);
wnoutrefresh(work);
wnoutrefresh(show);
@@ -361,8 +366,8 @@ test_adds(int level)
break;
}
}
+ delwin(show);
if (level > 0) {
- delwin(show);
delwin(work);
delwin(look);
}
diff --git a/test/test_addwstr.c b/test/test_addwstr.c
index 92334ae..ff5a350 100644
--- a/test/test_addwstr.c
+++ b/test/test_addwstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2009-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_addwstr.c,v 1.6 2010/12/12 00:18:00 tom Exp $
+ * $Id: test_addwstr.c,v 1.12 2014/08/02 17:24:55 tom Exp $
*
* Demonstrate the waddwstr() and wadd_wch functions.
* Thomas Dickey - 2009/9/12
@@ -137,7 +137,7 @@ ColOf(wchar_t *buffer, int length, int margin)
result += 2;
break;
default:
- result += wcwidth(ch);
+ result += wcwidth((wchar_t) ch);
if (ch < 32)
++result;
break;
@@ -233,8 +233,9 @@ test_inserts(int level)
WINDOW *work = 0;
WINDOW *show = 0;
int margin = (2 * MY_TABSIZE) - 1;
- Options option = ((m_opt ? oMove : oDefault)
- | ((w_opt || (level > 0)) ? oWindow : oDefault));
+ Options option = (Options) ((int) (m_opt ? oMove : oDefault)
+ | (int) ((w_opt || (level > 0))
+ ? oWindow : oDefault));
if (first) {
static char cmd[80];
@@ -246,6 +247,15 @@ test_inserts(int level)
(void) cbreak(); /* take input chars one at a time, no wait for \n */
(void) noecho(); /* don't echo input */
keypad(stdscr, TRUE);
+
+ /*
+ * Show the characters inserted in color, to distinguish from those that
+ * are shifted.
+ */
+ if (has_colors()) {
+ start_color();
+ init_pair(1, COLOR_WHITE, COLOR_BLUE);
+ }
}
limit = LINES - 5;
@@ -279,14 +289,8 @@ test_inserts(int level)
doupdate();
- /*
- * Show the characters inserted in color, to distinguish from those that
- * are shifted.
- */
if (has_colors()) {
- start_color();
- init_pair(1, COLOR_WHITE, COLOR_BLUE);
- wbkgdset(work, COLOR_PAIR(1) | ' ');
+ wbkgdset(work, (chtype) (COLOR_PAIR(1) | ' '));
}
while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
@@ -295,11 +299,13 @@ test_inserts(int level)
case key_RECUR:
test_inserts(level + 1);
- touchwin(look);
+ if (look)
+ touchwin(look);
touchwin(work);
touchwin(show);
- wnoutrefresh(look);
+ if (look)
+ wnoutrefresh(look);
wnoutrefresh(work);
wnoutrefresh(show);
@@ -392,7 +398,7 @@ test_inserts(int level)
ch = '\b';
/* FALLTHRU */
default:
- buffer[length++] = ch;
+ buffer[length++] = (wchar_t) ch;
buffer[length] = '\0';
/* put the string in, one character at a time */
@@ -445,8 +451,8 @@ test_inserts(int level)
break;
}
}
+ delwin(show);
if (level > 0) {
- delwin(show);
delwin(work);
delwin(look);
}
diff --git a/test/test_getstr.c b/test/test_getstr.c
index a086393..3f64c77 100644
--- a/test/test_getstr.c
+++ b/test/test_getstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2009,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_getstr.c,v 1.9 2009/08/29 19:02:25 tom Exp $
+ * $Id: test_getstr.c,v 1.10 2012/07/07 18:22:49 tom Exp $
*
* Author: Thomas E Dickey
*
@@ -58,6 +58,15 @@ typedef enum {
eMaxFlavor
} Flavors;
+/*
+ * Return-code is OK/ERR or a keyname.
+ */
+static const char *
+ok_keyname(int code)
+{
+ return ((code == OK) ? "OK" : ((code == ERR) ? "ERR" : keyname(code)));
+}
+
static bool
Quit(int ch)
{
@@ -310,7 +319,7 @@ test_getstr(int level, char **argv, WINDOW *strwin)
}
noecho();
(void) wattrset(txtwin, A_NORMAL);
- wprintw(strwin, "%d:%s", rc, buffer);
+ wprintw(strwin, "%s:%s", ok_keyname(rc), buffer);
wnoutrefresh(strwin);
break;
default:
diff --git a/test/test_vid_puts.c b/test/test_vid_puts.c
new file mode 100644
index 0000000..9896d1b
--- /dev/null
+++ b/test/test_vid_puts.c
@@ -0,0 +1,148 @@
+/****************************************************************************
+ * Copyright (c) 2013,2014 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/*
+ * $Id: test_vid_puts.c,v 1.6 2014/07/19 23:09:28 tom Exp $
+ *
+ * Demonstrate the vid_puts and vid_attr functions.
+ * Thomas Dickey - 2013/01/12
+ */
+
+#define USE_TINFO
+#include <test.priv.h>
+
+#if USE_WIDEC_SUPPORT && HAVE_SETUPTERM && HAVE_VID_PUTS
+
+#define valid(s) ((s != 0) && s != (char *)-1)
+
+static FILE *my_fp;
+static bool p_opt = FALSE;
+
+static
+TPUTS_PROTO(outc, c)
+{
+ int rc = c;
+
+ rc = putc(c, my_fp);
+ TPUTS_RETURN(rc);
+}
+
+static bool
+outs(const char *s)
+{
+ if (valid(s)) {
+ tputs(s, 1, outc);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void
+cleanup(void)
+{
+ outs(exit_attribute_mode);
+ if (!outs(orig_colors))
+ outs(orig_pair);
+ outs(cursor_normal);
+}
+
+static void
+change_attr(chtype attr)
+{
+ if (p_opt) {
+ vid_puts(attr, (short) 0, (void *) 0, outc);
+ } else {
+ vid_attr(attr, (short) 0, (void *) 0);
+ }
+}
+
+static void
+test_vid_puts(void)
+{
+ fprintf(my_fp, "Name: ");
+ change_attr(A_BOLD);
+ fputs("Bold", my_fp);
+ change_attr(A_REVERSE);
+ fputs(" Reverse", my_fp);
+ change_attr(A_NORMAL);
+ fputs("\n", my_fp);
+}
+
+static void
+usage(void)
+{
+ static const char *tbl[] =
+ {
+ "Usage: test_vid_puts [options]"
+ ,""
+ ,"Options:"
+ ," -e use stderr (default stdout)"
+ ," -p use vid_puts (default vid_attr)"
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(tbl); ++n)
+ fprintf(stderr, "%s\n", tbl[n]);
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ int ch;
+
+ my_fp = stdout;
+
+ while ((ch = getopt(argc, argv, "ep")) != -1) {
+ switch (ch) {
+ case 'e':
+ my_fp = stderr;
+ break;
+ case 'p':
+ p_opt = TRUE;
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
+ if (optind < argc)
+ usage();
+
+ setupterm((char *) 0, 1, (int *) 0);
+ test_vid_puts();
+ cleanup();
+ ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(void)
+{
+ printf("This program requires the wide-ncurses terminfo library\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/test_vidputs.c b/test/test_vidputs.c
new file mode 100644
index 0000000..7c7ade3
--- /dev/null
+++ b/test/test_vidputs.c
@@ -0,0 +1,148 @@
+/****************************************************************************
+ * Copyright (c) 2013,2014 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/*
+ * $Id: test_vidputs.c,v 1.5 2014/07/19 23:09:58 tom Exp $
+ *
+ * Demonstrate the vidputs and vidattr functions.
+ * Thomas Dickey - 2013/01/12
+ */
+
+#define USE_TINFO
+#include <test.priv.h>
+
+#if HAVE_SETUPTERM && HAVE_VIDPUTS
+
+#define valid(s) ((s != 0) && s != (char *)-1)
+
+static FILE *my_fp;
+static bool p_opt = FALSE;
+
+static
+TPUTS_PROTO(outc, c)
+{
+ int rc = c;
+
+ rc = putc(c, my_fp);
+ TPUTS_RETURN(rc);
+}
+
+static bool
+outs(const char *s)
+{
+ if (valid(s)) {
+ tputs(s, 1, outc);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void
+cleanup(void)
+{
+ outs(exit_attribute_mode);
+ if (!outs(orig_colors))
+ outs(orig_pair);
+ outs(cursor_normal);
+}
+
+static void
+change_attr(chtype attr)
+{
+ if (p_opt) {
+ vidputs(attr, outc);
+ } else {
+ vidattr(attr);
+ }
+}
+
+static void
+test_vidputs(void)
+{
+ fprintf(my_fp, "Name: ");
+ change_attr(A_BOLD);
+ fputs("Bold", my_fp);
+ change_attr(A_REVERSE);
+ fputs(" Reverse", my_fp);
+ change_attr(A_NORMAL);
+ fputs("\n", my_fp);
+}
+
+static void
+usage(void)
+{
+ static const char *tbl[] =
+ {
+ "Usage: test_vidputs [options]"
+ ,""
+ ,"Options:"
+ ," -e use stderr (default stdout)"
+ ," -p use vidputs (default vidattr)"
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(tbl); ++n)
+ fprintf(stderr, "%s\n", tbl[n]);
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ int ch;
+
+ my_fp = stdout;
+
+ while ((ch = getopt(argc, argv, "ep")) != -1) {
+ switch (ch) {
+ case 'e':
+ my_fp = stderr;
+ break;
+ case 'p':
+ p_opt = TRUE;
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
+ if (optind < argc)
+ usage();
+
+ setupterm((char *) 0, 1, (int *) 0);
+ test_vidputs();
+ cleanup();
+ ExitProgram(EXIT_SUCCESS);
+}
+#else
+int
+main(int argc GCC_UNUSED,
+ char *argv[]GCC_UNUSED)
+{
+ fprintf(stderr, "This program requires terminfo\n");
+ exit(EXIT_FAILURE);
+}
+#endif
diff --git a/test/testaddch.c b/test/testaddch.c
index 7a909e2..ccadab8 100644
--- a/test/testaddch.c
+++ b/test/testaddch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -29,7 +29,7 @@
* This is an example written by Alexander V. Lukyanov <lav@yars.free.net>,
* to demonstrate an inconsistency between ncurses and SVr4 curses.
*
- * $Id: testaddch.c,v 1.7 2009/08/29 19:02:25 tom Exp $
+ * $Id: testaddch.c,v 1.12 2014/08/02 23:11:20 tom Exp $
*/
#include <test.priv.h>
@@ -63,21 +63,21 @@ main(
for (i = 0; i < 8; i++) {
back = (i & 1) ? A_BOLD | 'B' : ' ';
set = (i & 2) ? A_REVERSE : 0;
- attr = (i & 4) ? COLOR_PAIR(4) : 0;
+ attr = (chtype) ((i & 4) ? COLOR_PAIR(4) : 0);
bkgdset(back);
- (void) attrset(set);
+ (void) attrset(AttrArg(set, 0));
attr_addstr("Test string with spaces -> <-\n", attr);
}
addch('\n');
for (i = 0; i < 8; i++) {
- back = (i & 1) ? A_BOLD | 'B' | COLOR_PAIR(1) : ' ';
- set = (i & 2) ? A_REVERSE | COLOR_PAIR(2) : 0;
- attr = (i & 4) ? COLOR_PAIR(4) : 0;
+ back = (i & 1) ? (A_BOLD | 'B' | (chtype) COLOR_PAIR(1)) : ' ';
+ set = (i & 2) ? (A_REVERSE | (chtype) COLOR_PAIR(2)) : 0;
+ attr = (chtype) ((i & 4) ? (chtype) COLOR_PAIR(4) : 0);
bkgdset(back);
- (void) attrset(set);
+ (void) attrset(AttrArg(set, 0));
attr_addstr("Test string with spaces -> <-\n", attr);
}
diff --git a/test/testcurs.c b/test/testcurs.c
index 5cc62f2..a1f0057 100644
--- a/test/testcurs.c
+++ b/test/testcurs.c
@@ -6,7 +6,7 @@
* wrs(5/28/93) -- modified to be consistent (perform identically) with either
* PDCurses or under Unix System V, R4
*
- * $Id: testcurs.c,v 1.43 2010/11/13 21:02:28 tom Exp $
+ * $Id: testcurs.c,v 1.49 2014/07/27 00:25:14 tom Exp $
*/
#include <test.priv.h>
@@ -45,18 +45,6 @@ static const COMMAND command[] =
};
#define MAX_OPTIONS (int) SIZEOF(command)
-#if !HAVE_STRDUP
-#define strdup my_strdup
-static char *
-strdup(char *s)
-{
- char *p = typeMalloc(char, strlen(s) + 1);
- if (p)
- strcpy(p, s);
- return (p);
-}
-#endif /* not HAVE_STRDUP */
-
static int width, height;
int
@@ -85,7 +73,7 @@ main(
#ifdef A_COLOR
if (has_colors()) {
init_pair(1, COLOR_WHITE, COLOR_BLUE);
- wbkgd(win, COLOR_PAIR(1));
+ wbkgd(win, (chtype) COLOR_PAIR(1));
} else
wbkgd(win, A_REVERSE);
#else
@@ -298,7 +286,7 @@ inputTest(WINDOW *win)
#ifdef A_COLOR
if (has_colors()) {
init_pair(2, COLOR_WHITE, COLOR_RED);
- wbkgd(subWin, COLOR_PAIR(2) | A_BOLD);
+ wbkgd(subWin, (chtype) COLOR_PAIR(2) | A_BOLD);
} else
wbkgd(subWin, A_BOLD);
#else
@@ -353,6 +341,9 @@ inputTest(WINDOW *win)
typeahead(-1);
#endif
+#ifdef NCURSES_MOUSE_VERSION
+ mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
+#endif
#if defined(PDCURSES)
mouse_set(ALL_MOUSE_EVENTS);
#endif
@@ -367,8 +358,38 @@ inputTest(WINDOW *win)
wprintw(win, "Key Pressed: %c", c);
else
wprintw(win, "Key Pressed: %s", unctrl(UChar(c)));
-#if defined(PDCURSES)
+#ifdef KEY_MOUSE
if (c == KEY_MOUSE) {
+#if defined(NCURSES_MOUSE_VERSION)
+#define ButtonChanged(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, 037))
+#define ButtonPressed(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED))
+#define ButtonDouble(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED))
+#define ButtonTriple(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED))
+#define ButtonRelease(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED))
+ MEVENT event;
+ int button = 0;
+
+ getmouse(&event);
+ if (ButtonChanged(1))
+ button = 1;
+ else if (ButtonChanged(2))
+ button = 2;
+ else if (ButtonChanged(3))
+ button = 3;
+ else
+ button = 0;
+ wmove(win, 4, 18);
+ wprintw(win, "Button %d: ", button);
+ if (ButtonPressed(button))
+ wprintw(win, "pressed: ");
+ else if (ButtonDouble(button))
+ wprintw(win, "double: ");
+ else if (ButtonTriple(button))
+ wprintw(win, "triple: ");
+ else
+ wprintw(win, "released: ");
+ wprintw(win, " Position: Y: %d X: %d", event.y, event.x);
+#elif defined(PDCURSES)
int button = 0;
request_mouse_pos();
if (BUTTON_CHANGED(1))
@@ -390,8 +411,9 @@ inputTest(WINDOW *win)
else
wprintw(win, "released: ");
wprintw(win, " Position: Y: %d X: %d", MOUSE_Y_POS, MOUSE_X_POS);
+#endif /* NCURSES_VERSION vs PDCURSES */
}
-#endif
+#endif /* KEY_MOUSE */
wrefresh(win);
if (c == ' ')
break;
@@ -491,7 +513,7 @@ outputTest(WINDOW *win)
#ifdef A_COLOR
if (has_colors()) {
init_pair(3, COLOR_BLUE, COLOR_WHITE);
- wbkgd(win1, COLOR_PAIR(3));
+ wbkgd(win1, (chtype) COLOR_PAIR(3));
} else
wbkgd(win1, A_NORMAL);
#else
@@ -693,9 +715,11 @@ padTest(WINDOW *dummy GCC_UNUSED)
raw();
wgetch(pad);
- spad = subpad(pad, 12, 25, 6, 52);
- MvWAddStr(spad, 2, 2, "This is a new subpad");
- box(spad, 0, 0);
+ if ((spad = subpad(pad, 12, 25, 6, 52)) != 0) {
+ MvWAddStr(spad, 2, 2, "This is a new subpad");
+ box(spad, 0, 0);
+ delwin(spad);
+ }
prefresh(pad, 0, 0, 0, 0, 15, 75);
keypad(pad, TRUE);
raw();
diff --git a/test/view.c b/test/view.c
index 6e5c241..4782d85 100644
--- a/test/view.c
+++ b/test/view.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -50,10 +50,11 @@
* scroll operation worked, and the refresh() code only had to do a
* partial repaint.
*
- * $Id: view.c,v 1.81 2010/11/14 01:06:02 tom Exp $
+ * $Id: view.c,v 1.94 2013/09/28 21:58:42 tom Exp $
*/
#include <test.priv.h>
+#include <widechars.h>
#include <time.h>
@@ -81,24 +82,10 @@
#include <sys/ptem.h>
#endif
-#if USE_WIDEC_SUPPORT
-#if HAVE_MBTOWC && HAVE_MBLEN
-#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0))
-#define count_mbytes(buffer,length,state) mblen(buffer,length)
-#define check_mbytes(wch,buffer,length,state) \
- (int) mbtowc(&wch, buffer, length)
-#define state_unused
-#elif HAVE_MBRTOWC && HAVE_MBRLEN
-#define reset_mbytes(state) init_mb(state)
-#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state)
-#define check_mbytes(wch,buffer,length,state) \
- (int) mbrtowc(&wch, buffer, length, &state)
-#else
-make an error
-#endif
-#endif /* USE_WIDEC_SUPPORT */
+#undef CTRL
+#define CTRL(x) ((x) & 0x1f)
-static RETSIGTYPE finish(int sig) GCC_NORETURN;
+static void finish(int sig) GCC_NORETURN;
static void show_all(const char *tag);
#if defined(SIGWINCH) && defined(TIOCGWINSZ) && HAVE_RESIZE_TERM
@@ -108,11 +95,11 @@ static void show_all(const char *tag);
#endif
#if CAN_RESIZE
-static RETSIGTYPE adjust(int sig);
+static void adjust(int sig);
static int interrupted;
+static bool waiting = FALSE;
#endif
-static bool waiting = FALSE;
static int shift = 0;
static bool try_color = FALSE;
@@ -121,6 +108,8 @@ static NCURSES_CH_T **vec_lines;
static NCURSES_CH_T **lptr;
static int num_lines;
+static void usage(void) GCC_NORETURN;
+
static void
usage(void)
{
@@ -135,6 +124,7 @@ usage(void)
#if defined(KEY_RESIZE)
," -r use old-style sigwinch handler rather than KEY_RESIZE"
#endif
+ ," -s start in single-step mode, waiting for input"
#ifdef TRACE
," -t trace screen updates"
," -T NUM specify trace mask"
@@ -180,7 +170,7 @@ ch_dup(char *src)
{
unsigned len = (unsigned) strlen(src);
NCURSES_CH_T *dst = typeMalloc(NCURSES_CH_T, len + 1);
- unsigned j, k;
+ size_t j, k;
#if USE_WIDEC_SUPPORT
wchar_t wstr[CCHARW_MAX + 1];
wchar_t wch;
@@ -243,6 +233,7 @@ main(int argc, char *argv[])
int value = 0;
bool done = FALSE;
bool got_number = FALSE;
+ bool single_step = FALSE;
#if CAN_RESIZE
bool nonposix_resize = FALSE;
#endif
@@ -258,7 +249,7 @@ main(int argc, char *argv[])
(void) signal(SIGINT, finish); /* arrange interrupts to terminate */
#endif
- while ((i = getopt(argc, argv, "cin:rtT:")) != -1) {
+ while ((i = getopt(argc, argv, "cin:rstT:")) != -1) {
switch (i) {
case 'c':
try_color = TRUE;
@@ -276,9 +267,18 @@ main(int argc, char *argv[])
nonposix_resize = TRUE;
break;
#endif
+ case 's':
+ single_step = TRUE;
+ break;
#ifdef TRACE
case 'T':
- trace((unsigned) atoi(optarg));
+ {
+ char *next = 0;
+ int tvalue = (int) strtol(optarg, &next, 0);
+ if (tvalue < 0 || (next != 0 && *next != 0))
+ usage();
+ trace((unsigned) tvalue);
+ }
break;
case 't':
trace(TRACE_CALLS);
@@ -306,7 +306,7 @@ main(int argc, char *argv[])
(void) signal(SIGWINCH, adjust); /* arrange interrupts to resize */
#endif
- /* slurp the file */
+ Trace(("slurp the file"));
for (lptr = &vec_lines[0]; (lptr - vec_lines) < MAXLINES; lptr++) {
char temp[BUFSIZ], *s, *d;
int col;
@@ -314,8 +314,26 @@ main(int argc, char *argv[])
if (fgets(buf, sizeof(buf), fp) == 0)
break;
- /* convert tabs so that shift will work properly */
+#if USE_WIDEC_SUPPORT
+ if (lptr == vec_lines) {
+ if (!memcmp("", buf, 3)) {
+ Trace(("trim BOM"));
+ s = buf + 3;
+ d = buf;
+ do {
+ } while ((*d++ = *s++) != '\0');
+ }
+ }
+#endif
+
+ /* convert tabs and nonprinting chars so that shift will work properly */
for (s = buf, d = temp, col = 0; (*d = *s) != '\0'; s++) {
+ if (*d == '\r') {
+ if (s[1] == '\n')
+ continue;
+ else
+ break;
+ }
if (*d == '\n') {
*d = '\0';
break;
@@ -347,14 +365,15 @@ main(int argc, char *argv[])
(void) nonl(); /* tell curses not to do NL->CR/NL on output */
(void) cbreak(); /* take input chars one at a time, no wait for \n */
(void) noecho(); /* don't echo input */
- nodelay(stdscr, TRUE);
+ if (!single_step)
+ nodelay(stdscr, TRUE);
idlok(stdscr, TRUE); /* allow use of insert/delete line */
if (try_color) {
if (has_colors()) {
start_color();
init_pair(my_pair, COLOR_WHITE, COLOR_BLUE);
- bkgd(COLOR_PAIR(my_pair));
+ bkgd((chtype) COLOR_PAIR(my_pair));
} else {
try_color = FALSE;
}
@@ -373,10 +392,12 @@ main(int argc, char *argv[])
adjust(0);
my_label = "interrupt";
}
-#endif
waiting = TRUE;
c = getch();
waiting = FALSE;
+#else
+ c = getch();
+#endif
if ((c < 127) && isdigit(c)) {
if (!got_number) {
MvPrintw(0, 0, "Count: ");
@@ -466,6 +487,9 @@ main(int argc, char *argv[])
nodelay(stdscr, TRUE);
my_delay = 0;
break;
+ case CTRL('L'):
+ redrawwin(stdscr);
+ break;
case ERR:
if (!my_delay)
napms(50);
@@ -483,7 +507,7 @@ main(int argc, char *argv[])
finish(0); /* we're done */
}
-static RETSIGTYPE
+static void
finish(int sig)
{
endwin();
@@ -510,7 +534,7 @@ finish(int sig)
* The 'wrefresh(curscr)' is needed to force the refresh to start from the top
* of the screen -- some xterms mangle the bitmap while resizing.
*/
-static RETSIGTYPE
+static void
adjust(int sig)
{
if (waiting || sig == 0) {
@@ -553,7 +577,7 @@ show_all(const char *tag)
printw("%.*s", COLS, temp);
clrtoeol();
this_time = time((time_t *) 0);
- strcpy(temp, ctime(&this_time));
+ strncpy(temp, ctime(&this_time), (size_t) 30);
if ((i = (int) strlen(temp)) != 0) {
temp[--i] = 0;
if (move(0, COLS - i - 2) != ERR)
diff --git a/test/widechars.h b/test/widechars.h
new file mode 100644
index 0000000..e7897ba
--- /dev/null
+++ b/test/widechars.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+ * Copyright (c) 2012 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+#ifndef __WIDECHARS_H
+#define __WIDECHARS_H 1
+
+#include <test.priv.h>
+
+#if USE_WIDEC_SUPPORT
+
+#if defined(__MINGW32__)
+/*
+ * MinGW has wide-character functions, but they do not work correctly.
+ */
+
+extern int _nc_mbtowc(wchar_t *pwc, const char *s, size_t n);
+extern int __MINGW_NOTHROW _nc_mbtowc(wchar_t *pwc, const char *s, size_t n);
+#define mbtowc(pwc,s,n) _nc_mbtowc(pwc,s,n)
+
+extern int __MINGW_NOTHROW _nc_mblen(const char *, size_t);
+#define mblen(s,n) _nc_mblen(s, n)
+
+#endif /* __MINGW32__ */
+
+#if HAVE_MBTOWC && HAVE_MBLEN
+#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0))
+#define count_mbytes(buffer,length,state) mblen(buffer,length)
+#define check_mbytes(wch,buffer,length,state) \
+ (int) mbtowc(&wch, buffer, length)
+#define state_unused
+#elif HAVE_MBRTOWC && HAVE_MBRLEN
+#define reset_mbytes(state) init_mb(state)
+#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state)
+#define check_mbytes(wch,buffer,length,state) \
+ (int) mbrtowc(&wch, buffer, length, &state)
+#else
+make an error
+#endif
+
+#else
+
+#endif /* USE_WIDEC_SUPPORT */
+
+extern void widechars_stub(void);
+
+#endif /* __WIDECHARS_H */
diff --git a/test/worm.c b/test/worm.c
index 98f099c..c3fc0da 100644
--- a/test/worm.c
+++ b/test/worm.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -61,7 +61,7 @@ Options:
traces will be dumped. The program stops and waits for one character of
input at the beginning and end of the interval.
- $Id: worm.c,v 1.60 2010/11/13 20:21:21 tom Exp $
+ $Id: worm.c,v 1.65 2013/06/22 20:01:41 tom Exp $
*/
#include <test.priv.h>
@@ -202,6 +202,14 @@ static const struct options {
/* *INDENT-ON* */
static void
+failed(const char *s)
+{
+ perror(s);
+ endwin();
+ ExitProgram(EXIT_FAILURE);
+}
+
+static void
cleanup(void)
{
USING_WINDOW(stdscr, wrefresh);
@@ -209,7 +217,7 @@ cleanup(void)
endwin();
}
-static RETSIGTYPE
+static void
onsig(int sig GCC_UNUSED)
{
cleanup();
@@ -354,8 +362,7 @@ draw_all_worms(void)
if (first) {
first = FALSE;
for (n = 0, w = &worm[0]; n < number; n++, w++) {
- int rc;
- rc = pthread_create(&(w->thread), NULL, start_worm, w);
+ (void) pthread_create(&(w->thread), NULL, start_worm, w);
}
}
#else
@@ -391,6 +398,8 @@ update_refs(WINDOW *win)
if (last_x != COLS - 1) {
for (y = 0; y <= last_y; y++) {
refs[y] = typeRealloc(int, (size_t) COLS, refs[y]);
+ if (!refs[y])
+ failed("update_refs");
for (x = last_x + 1; x < COLS; x++)
refs[y][x] = 0;
}
@@ -402,6 +411,8 @@ update_refs(WINDOW *win)
refs = typeRealloc(int *, (size_t) LINES, refs);
for (y = last_y + 1; y < LINES; y++) {
refs[y] = typeMalloc(int, (size_t) COLS);
+ if (!refs[y])
+ failed("update_refs");
for (x = 0; x < COLS; x++)
refs[y][x] = 0;
}
@@ -419,6 +430,7 @@ main(int argc, char *argv[])
struct worm *w;
int *ip;
bool done = FALSE;
+ int max_refs;
setlocale(LC_ALL, "");
@@ -489,7 +501,7 @@ main(int argc, char *argv[])
#define SET_COLOR(num, fg) \
init_pair(num+1, (short) fg, (short) bg); \
- flavor[num] |= COLOR_PAIR(num+1) | A_BOLD
+ flavor[num] |= (chtype) COLOR_PAIR(num+1) | A_BOLD
SET_COLOR(0, COLOR_GREEN);
SET_COLOR(1, COLOR_RED);
@@ -501,8 +513,9 @@ main(int argc, char *argv[])
}
#endif /* A_COLOR */
- refs = typeMalloc(int *, (size_t) LINES);
- for (y = 0; y < LINES; y++) {
+ max_refs = LINES;
+ refs = typeMalloc(int *, (size_t) max_refs);
+ for (y = 0; y < max_refs; y++) {
refs[y] = typeMalloc(int, (size_t) COLS);
for (x = 0; x < COLS; x++) {
refs[y][x] = 0;
@@ -596,7 +609,7 @@ main(int argc, char *argv[])
Trace(("Cleanup"));
cleanup();
#ifdef NO_LEAKS
- for (y = 0; y < LINES; y++) {
+ for (y = 0; y < max_refs; y++) {
free(refs[y]);
}
free(refs);
diff --git a/test/xmas.c b/test/xmas.c
index fc0cc4c..087fcd9 100644
--- a/test/xmas.c
+++ b/test/xmas.c
@@ -92,7 +92,7 @@
/******************************************************************************/
/*
- * $Id: xmas.c,v 1.27 2010/11/13 20:24:10 tom Exp $
+ * $Id: xmas.c,v 1.28 2013/04/27 19:46:53 tom Exp $
*/
#include <test.priv.h>
@@ -148,7 +148,7 @@ static int strng5(void);
static int reindeer(void);
static int blinkit(void);
-static RETSIGTYPE done(int sig) GCC_NORETURN;
+static void done(int sig) GCC_NORETURN;
static void
set_color(WINDOW *win, chtype color)
@@ -1143,7 +1143,7 @@ reindeer(void)
return (0);
}
-static RETSIGTYPE
+static void
done(int sig GCC_UNUSED)
{
CATCHALL(done);