From 6a8e0432e802cbc0becd44aa041d1c4ee37845c1 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Tue, 26 Jul 2011 19:57:13 +1000 Subject: [PATCH 01/12] Move AC_CONFIG_HEADERS macro to the top of the file The top of the file is where the macro should have been defined in the first place. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 34ca23b..f34d3b8 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,7 @@ AC_DEFINE([PACKAGE_AUTHOR], ["John Zaitseff"], [Package author]) AC_PREREQ([2.67]) AC_CONFIG_SRCDIR([src/trader.c]) AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign dist-bzip2]) AC_CONFIG_LIBOBJ_DIR([lib]) @@ -53,7 +54,6 @@ AS_IF([test "x$ax_cv_curses" != "xyes"], AC_MSG_ERROR([requires an X/Open-compatible Curses library.]), AC_SUBST([CURSES_LIB])) -AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ Makefile lib/Makefile From 8240043880830bf4785e43047c5a7a8db68d0c0e Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Tue, 26 Jul 2011 20:40:33 +1000 Subject: [PATCH 02/12] Move to appear before This is required on some systems, such as Darwin (MacOS X). --- src/system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system.h b/src/system.h index 36ff005..b239940 100644 --- a/src/system.h +++ b/src/system.h @@ -51,8 +51,8 @@ #include -#include #include +#include #include #include #include From b68da501fd6dfe8693b7f031ca8e52aee2cd7d2c Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Tue, 26 Jul 2011 21:13:12 +1000 Subject: [PATCH 03/12] Add an explicit check for a C99 compiler We use C99 features quite extensively in the source code. --- configure.ac | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index f34d3b8..ba3996d 100644 --- a/configure.ac +++ b/configure.ac @@ -37,12 +37,14 @@ AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign dist-bzip2]) AC_CONFIG_LIBOBJ_DIR([lib]) AC_PROG_CC -AC_PROG_CC_STDC +AC_PROG_CC_C99 + +AS_IF([test "x$ac_cv_prog_cc_c99" != "xyes"], + AC_MSG_ERROR([requires an ISO/IEC 9899:1999 (C99) compiler.])) + gl_EARLY AX_CFLAGS_WARN_ALL -AC_C_RESTRICT -AC_C_VOLATILE AX_C___ATTRIBUTE__ AC_TYPE_SIZE_T AC_TYPE_SSIZE_T From c0ce8c6770dfdb92bd143ad974d2366b0a0780d6 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Tue, 26 Jul 2011 21:18:12 +1000 Subject: [PATCH 04/12] Replace the check for a C99 compiler with one that works... I hope! --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ba3996d..a103f40 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,7 @@ AC_CONFIG_LIBOBJ_DIR([lib]) AC_PROG_CC AC_PROG_CC_C99 -AS_IF([test "x$ac_cv_prog_cc_c99" != "xyes"], +AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], AC_MSG_ERROR([requires an ISO/IEC 9899:1999 (C99) compiler.])) gl_EARLY From 653252442621ca9d0b18318270e0bb8c91330c32 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Tue, 26 Jul 2011 21:23:42 +1000 Subject: [PATCH 05/12] Ignore m4/largefile.m4 --- m4/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/m4/.gitignore b/m4/.gitignore index c08a797..1bf3aef 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -25,6 +25,7 @@ inttypes_h.m4 isnand.m4 isnanf.m4 isnanl.m4 +largefile.m4 ldexpl.m4 locale_h.m4 longlong.m4 From 48e8bbba93287c219e885c0841e0e43de72407cc Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Thu, 28 Jul 2011 21:19:33 +1000 Subject: [PATCH 06/12] Complete rewrite of the M4 macro that checks for Curses --- INSTALL | 4 + configure.ac | 11 +- m4/ax_with_curses.m4 | 509 ++++++++++++++++++++++++++++++++++++------- src/system.h | 8 +- 4 files changed, 451 insertions(+), 81 deletions(-) diff --git a/INSTALL b/INSTALL index b135501..7853dee 100644 --- a/INSTALL +++ b/INSTALL @@ -61,8 +61,12 @@ command line options: --disable-assert Turn off all debugging assert() statements --with-ncurses Force the use of NCurses over the system's Curses library + --with-ncursesw Force the use of the NCursesW library with wide- + character support --without-ncursesw Don't use the NCursesW library with wide-character support + --without-ncurses Don't use the NCurses library: use the system's + normal Curses library By default, configure uses "/usr/local" as the top-level (prefix) install directory. You can change this by specifying "--prefix=DIR" to use DIR diff --git a/configure.ac b/configure.ac index a103f40..4990ac8 100644 --- a/configure.ac +++ b/configure.ac @@ -39,8 +39,9 @@ AC_CONFIG_LIBOBJ_DIR([lib]) AC_PROG_CC AC_PROG_CC_C99 -AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], - AC_MSG_ERROR([requires an ISO/IEC 9899:1999 (C99) compiler.])) +AS_IF([test "x$ac_cv_prog_cc_c99" = xno], [ + AC_MSG_ERROR([requires an ISO/IEC 9899:1999 (C99) compiler]) +]) gl_EARLY @@ -52,9 +53,9 @@ AC_TYPE_SSIZE_T gl_INIT AX_WITH_CURSES -AS_IF([test "x$ax_cv_curses" != "xyes"], - AC_MSG_ERROR([requires an X/Open-compatible Curses library.]), - AC_SUBST([CURSES_LIB])) +AS_IF([test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes], [ + AC_MSG_ERROR([requires an X/Open-compatible Curses library with colour]) +]) AC_CONFIG_FILES([ Makefile diff --git a/m4/ax_with_curses.m4 b/m4/ax_with_curses.m4 index 76cde44..fdbc34f 100644 --- a/m4/ax_with_curses.m4 +++ b/m4/ax_with_curses.m4 @@ -8,29 +8,154 @@ # # DESCRIPTION # -# Detect SysV compatible curses, such as ncurses. +# This macro checks whether a SysV or X/Open-compatible Curses library +# is present, along with the associated header file. The NcursesW +# (wide-character) library is searched for first, followed by Ncurses, +# then the system-default plain Curses. The first library found is the +# one returned. # -# Defines HAVE_CURSES_H or HAVE_NCURSES_H if curses is found. CURSES_LIB -# is also set with the required library, but is not appended to LIBS -# automatically. If no working curses library is found CURSES_LIB will be -# left blank. If CURSES_LIB is set in the environment, the supplied value -# will be used. +# The following options are understood: --with-ncursesw, --with-ncurses, +# --without-ncursesw, --without-ncurses. The "--with" options force +# the macro to use that particular library, terminating with an error +# if not found. The "--without" options simply skip the check for that +# library. The effect on the search pattern is: # -# There are two options: --with-ncurses forces the use of ncurses, and -# --with-ncursesw forces the use of ncursesw (wide character ncurses). The -# corresponding options --without-ncurses and --without-ncursesw force -# those libraries not to be used. By default, ncursesw is preferred to -# ncurses, which is preferred to plain curses. +# (no options) - NcursesW, Ncurses, Curses +# --with-ncurses --with-ncursesw - NcursesW only [*] +# --without-ncurses --with-ncursesw - NcursesW only [*] +# --with-ncursesw - NcursesW only [*] +# --with-ncurses --without-ncursesw - Ncurses only [*] +# --with-ncurses - NcursesW, Ncurses [**] +# --without-ncurses --without-ncursesw - Curses only +# --without-ncursesw - Ncurses, Curses +# --without-ncurses - NcursesW, Curses # -# ax_cv_curses is set to "yes" if any curses is found (including -# ncurses!); ax_cv_ncurses is set to "yes" if any ncurses is found, and -# ax_cv_ncursesw is set to "yes" if ncursesw is found. +# [*] If the library is not found, abort the configure script. +# [**] If the second library (Ncurses) is not found, abort configure. +# +# The following preprocessor symbols may be defined by this macro if +# the appropriate conditions are met: +# +# HAVE_CURSES - if any SysV or X/Open Curses library found +# HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions +# HAVE_CURSES_COLOR - if library supports color (enhanced functions) +# HAVE_CURSES_OBSOLETE - if library supports certain obsolete features +# HAVE_NCURSESW - if NcursesW (wide char) library is to be used +# HAVE_NCURSES - if the Ncurses library is to be used +# +# HAVE_CURSES_H - if is present and should be used +# HAVE_NCURSESW_H - if should be used +# HAVE_NCURSES_H - if should be used +# HAVE_NCURSESW_CURSES_H - if should be used +# HAVE_NCURSES_CURSES_H - if should be used +# +# (These preprocessor symbols are discussed later in this document.) +# +# The following output variable is defined by this macro; it is +# precious and may be overridden on the ./configure command line: +# +# CURSES_LIB - library to add to xxx_LDADD +# +# The library listed in CURSES_LIB is NOT added to LIBS by default. +# You need to add CURSES_LIB to the appropriate xxx_LDADD line in your +# Makefile.am. For example: +# +# prog_LDADD = @CURSES_LIB@ +# +# If CURSES_LIB is set on the configure command line (such as by +# running "./configure CURSES_LIB=-lmycurses"), then the only header +# searched for is . The user may use the CPPFLAGS precious +# variable to override the standard #include search path. If the user +# needs to specify an alternative path for a library (such as for a +# non-standard NcurseW), the user should use the LDFLAGS variable. +# +# The following shell variables may be defined by this macro: +# +# ax_cv_curses - set to "yes" if any Curses library found +# ax_cv_curses_enhanced - set to "yes" if Enhanced functions present +# ax_cv_curses_color - set to "yes" if color functions present +# ax_cv_curses_obsolete - set to "yes" if obsolete features present +# +# ax_cv_ncursesw - set to "yes" if NcursesW library found +# ax_cv_ncurses - set to "yes" if Ncurses library found +# ax_cv_plaincurses - set to "yes" if plain Curses library found +# ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no" +# +# These variables can be used in your configure.ac to determine the +# level of support you need from the Curses library. For example, if +# you must have either Ncurses or NcursesW, you could include: +# +# AX_WITH_CURSES +# if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then +# AX_MSG_ERROR([requires either NcursesW or Ncurses library]) +# fi +# +# If any Curses library will do (but one must be present and must +# support color), you could use: +# +# AX_WITH_CURSES +# if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then +# AC_MSG_ERROR([requires an X/Open-compatible Curses library with color]) +# fi +# +# Certain preprocessor symbols and shell variables defined by this +# macro can be used to determine various features of the Curses +# library. In particular, HAVE_CURSES and ax_cv_curses are defined if +# the Curses library found conforms to the traditional SysV and/or +# X/Open Base Curses definition. Any working Curses library conforms +# to this level. +# +# HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the +# library supports the X/Open Enhanced Curses definition. In +# particular, the wide-character types attr_t, cchar_t and wint_t, the +# functions wattr_set() and wget_wch() and the macros WA_NORMAL and +# _XOPEN_CURSES are checked. The Ncurses library does NOT conform to +# this definition, although NcursesW does. +# +# HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library +# supports color functions and macros such as COLOR_PAIR, A_COLOR, +# COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the +# X/Open Base Curses definition, but are part of the Enhanced set of +# functions. The Ncurses library DOES support these functions, as does +# NcursesW. +# +# HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the +# library supports certain features present in SysV and BSD Curses but +# not defined in the X/Open definition. In particular, the functions +# getattrs(), getcurx() and getmaxx() are checked. +# +# To use the HAVE_xxx_H preprocessor symbols, insert the following into +# your system.h (or equivalent) header file: +# +# #if defined(HAVE_NCURSESW_CURSES_H) +# # include +# #elif defined(HAVE_NCURSESW_H) +# # include +# #elif defined(HAVE_NCURSES_CURSES_H) +# # include +# #elif defined(HAVE_NCURSES_H) +# # include +# #elif defined(HAVE_CURSES_H) +# # include +# #else +# # error "SysV or X/Open-compatible Curses header file required" +# #endif +# +# For previous users of this macro: you should not need to change +# anything in your configure.ac or Makefile.am, as the previous (serial +# 10) semantics are still valid. However, you should update your +# system.h (or equivalent) header file to the fragment shown above. +# You are encouraged also to make use of the extended functionality +# provided by this version of AX_WITH_CURSES, as well as in the +# additional macros AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and +# AX_WITH_CURSES_FORM. # # LICENSE # # Copyright (c) 2009 Mark Pulford # Copyright (c) 2009 Damian Pietras # Copyright (c) 2011 Reuben Thomas +# Copyright (c) 2011 John Zaitseff # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -58,65 +183,301 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 10 - +#serial 11 AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES]) -AC_DEFUN([AX_WITH_CURSES], - [AC_ARG_WITH(ncurses, [AS_HELP_STRING([--with-ncurses], - [Force the use of ncurses over curses])],,) - ax_save_LIBS="$LIBS" - AC_ARG_WITH(ncursesw, [AS_HELP_STRING([--without-ncursesw], - [Don't use ncursesw (wide character support)])],,) - if test ! "$CURSES_LIB" && test "$with_ncurses" != no && test "$with_ncursesw" != "no" - then - AC_CACHE_CHECK([for working ncursesw], ax_cv_ncursesw, - [LIBS="$ax_save_LIBS -lncursesw" - AC_TRY_LINK( - [#include ], - [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ], - ax_cv_ncursesw=yes, ax_cv_ncursesw=no)]) - if test "$ax_cv_ncursesw" = yes - then - AC_CHECK_HEADER([ncursesw/curses.h], AC_DEFINE([HAVE_NCURSESW_H], 1, - [Define if you have ncursesw.h])) - AC_DEFINE([HAVE_NCURSES_H], 1, [Define if you have ncursesw/curses.h]) - AC_DEFINE([HAVE_NCURSESW], 1, [Define if you have libncursesw]) - CURSES_LIB="-lncursesw" - ax_cv_ncurses=yes - ax_cv_curses=yes - fi - fi - if test ! "$CURSES_LIB" && test "$with_ncurses" != no && test "$with_ncursesw" != yes - then - AC_CACHE_CHECK([for working ncurses], ax_cv_ncurses, - [LIBS="$ax_save_LIBS -lncurses" - AC_TRY_LINK( - [#include ], - [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ], - ax_cv_ncurses=yes, ax_cv_ncurses=no)]) - if test "$ax_cv_ncurses" = yes - then - AC_DEFINE([HAVE_NCURSES_H],[1],[Define if you have ncurses.h]) - CURSES_LIB="-lncurses" - ax_cv_curses=yes - fi - fi - if test "$ax_cv_curses" != yes && test "$with_ncurses" != yes && test "$with_ncursesw" != yes - then - if test ! "$CURSES_LIB" - then - CURSES_LIB="-lcurses" - fi - AC_CACHE_CHECK([for working curses], ax_cv_curses, - [LIBS="$ax_save_LIBS $CURSES_LIB" - AC_TRY_LINK( - [#include ], - [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ], - ax_cv_curses=yes, ax_cv_curses=no)]) - if test "$ax_cv_curses" = yes - then - AC_DEFINE([HAVE_CURSES_H],[1],[Define if you have curses.h]) - fi - fi - LIBS="$ax_save_LIBS" +AC_DEFUN([AX_WITH_CURSES], [ + AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses]) + AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses], + [force the use of Ncurses or NcursesW])], + [], [with_ncurses=check]) + AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw], + [do not use NcursesW (wide character support)])], + [], [with_ncursesw=check]) + + ax_saved_LIBS=$LIBS + AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes], + [ax_with_plaincurses=no], [ax_with_plaincurses=check]) + + ax_cv_curses_which=no + + # Test for NcursesW + + AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [ + LIBS="$ax_saved_LIBS -lncursesw" + + AC_CACHE_CHECK([for NcursesW wide-character library], [ax_cv_ncursesw], [ + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], + [ax_cv_ncursesw=yes], [ax_cv_ncursesw=no]) + ]) + AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [ + AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library]) + ]) + + AS_IF([test "x$ax_cv_ncursesw" = xyes], [ + ax_cv_curses=yes + ax_cv_curses_which=ncursesw + CURSES_LIB="-lncursesw" + AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present]) + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) + + AC_CACHE_CHECK([for ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + attr_t d = WA_NORMAL; + cchar_t e; + wint_t f; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + wattr_set(stdscr, d, 0, NULL); + wget_wch(stdscr, &f); + ]])], + [ax_cv_header_ncursesw_curses_h=yes], + [ax_cv_header_ncursesw_curses_h=no]) + ]) + AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [ + ax_cv_curses_enhanced=yes + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if is present]) + ]) + + AC_CACHE_CHECK([for ncursesw.h], [ax_cv_header_ncursesw_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + attr_t d = WA_NORMAL; + cchar_t e; + wint_t f; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + wattr_set(stdscr, d, 0, NULL); + wget_wch(stdscr, &f); + ]])], + [ax_cv_header_ncursesw_h=yes], + [ax_cv_header_ncursesw_h=no]) + ]) + AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [ + ax_cv_curses_enhanced=yes + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if is present]) + ]) + + AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno], [ + AC_MSG_WARN([could not find either ncursesw/curses.h or ncursesw.h]) + ]) + ]) + ]) + + # Test for Ncurses + + AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [ + LIBS="$ax_saved_LIBS -lncurses" + + AC_CACHE_CHECK([for Ncurses library], [ax_cv_ncurses], [ + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], + [ax_cv_ncurses=yes], [ax_cv_ncurses=no]) + ]) + AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [ + AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library]) + ]) + + AS_IF([test "x$ax_cv_ncurses" = xyes], [ + ax_cv_curses=yes + ax_cv_curses_which=ncurses + CURSES_LIB="-lncurses" + AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present]) + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) + + AC_CACHE_CHECK([for ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + ]])], + [ax_cv_header_ncurses_curses_h=yes], + [ax_cv_header_ncurses_curses_h=no]) + ]) + AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [ + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if is present]) + ]) + + AC_CACHE_CHECK([for ncurses.h], [ax_cv_header_ncurses_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + ]])], + [ax_cv_header_ncurses_h=yes], + [ax_cv_header_ncurses_h=no]) + ]) + AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [ + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) + ]) + + AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [ + AC_MSG_WARN([could not find either ncurses/curses.h or ncurses.h]) + ]) + ]) + ]) + + # Test for plain Curses (or if CURSES_LIB was set by user) + + AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [ + AS_IF([test "x$CURSES_LIB" = x], [ + LIBS="$ax_saved_LIBS $CURSES_LIB" + ], [ + LIBS="$ax_saved_LIBS -lcurses" + ]) + + AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [ + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], + [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no]) + ]) + + AS_IF([test "x$ax_cv_plaincurses" = xyes], [ + ax_cv_curses=yes + ax_cv_curses_which=plaincurses + AS_IF([test "x$CURSES_LIB" = x], [ + CURSES_LIB="-lcurses" + ]) + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) + + # Check for base conformance (and header file) + + AC_CACHE_CHECK([for curses.h], [ax_cv_header_curses_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + initscr(); + ]])], + [ax_cv_header_curses_h=yes], + [ax_cv_header_curses_h=no]) + ]) + AS_IF([test "x$ax_cv_header_curses_h" = xyes], [ + AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if is present]) + + # Check for X/Open Enhanced conformance + + AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + @%:@ifndef _XOPEN_CURSES + @%:@error "this Curses library is not enhanced" + "this Curses library is not enhanced" + @%:@endif + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + attr_t d = WA_NORMAL; + cchar_t e; + wint_t f; + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + wattr_set(stdscr, d, 0, NULL); + wget_wch(stdscr, &f); + ]])], + [ax_cv_plaincurses_enhanced=yes], + [ax_cv_plaincurses_enhanced=no]) + ]) + AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [ + ax_cv_curses_enhanced=yes + ax_cv_curses_color=yes + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + ]) + + # Check for color functions + + AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + ]])], + [ax_cv_plaincurses_color=yes], + [ax_cv_plaincurses_color=no]) + ]) + AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [ + ax_cv_curses_color=yes + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + ]) + + # Check for obsolete functions + + AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + ]])], + [ax_cv_plaincurses_obsolete=yes], + [ax_cv_plaincurses_obsolete=no]) + ]) + AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [ + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + ]) + ]) + + AS_IF([test "x$ax_cv_header_curses_h" = xno], [ + AC_MSG_WARN([could not find curses.h]) + ]) + ]) + ]) + + AS_IF([test "x$ax_cv_curses" != xyes], [ax_cv_curses=no]) + AS_IF([test "x$ax_cv_curses_enhanced" != xyes], [ax_cv_curses_enhanced=no]) + AS_IF([test "x$ax_cv_curses_color" != xyes], [ax_cv_curses_color=no]) + AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no]) + + LIBS=$ax_saved_LIBS ])dnl diff --git a/src/system.h b/src/system.h index b239940..7d0a80b 100644 --- a/src/system.h +++ b/src/system.h @@ -76,14 +76,18 @@ // X/Open-compatible Curses library -#if defined(HAVE_NCURSESW) && defined(HAVE_NCURSESW_H) +#if defined(HAVE_NCURSESW_CURSES_H) # include +#elif defined(HAVE_NCURSESW_H) +# include +#elif defined(HAVE_NCURSES_CURSES_H) +# include #elif defined(HAVE_NCURSES_H) # include #elif defined(HAVE_CURSES_H) # include #else -# error "X/Open-compatible Curses library required" +# error "X/Open-compatible Curses header file required" #endif From b16a785f3eea6fdcd02041ce06701835d2303b70 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Thu, 28 Jul 2011 22:21:52 +1000 Subject: [PATCH 07/12] Add _XOPEN_SOURCE_EXTENDED for parts of the compile and link checks Older versions of NcursesW require _XOPEN_SOURCE_EXTENDED to be defined to access the wide-character interfaces. --- m4/ax_with_curses.m4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/m4/ax_with_curses.m4 b/m4/ax_with_curses.m4 index fdbc34f..e58d7ff 100644 --- a/m4/ax_with_curses.m4 +++ b/m4/ax_with_curses.m4 @@ -222,6 +222,7 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_CACHE_CHECK([for ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; @@ -252,6 +253,7 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_CACHE_CHECK([for ncursesw.h], [ax_cv_header_ncursesw_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; @@ -400,6 +402,7 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include @%:@ifndef _XOPEN_CURSES @%:@error "this Curses library is not enhanced" @@ -431,7 +434,8 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@include + @%:@define _XOPEN_SOURCE_EXTENDED 1 + @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; From 880a63ee95276460b404517cab25855ca7acbf45 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Thu, 28 Jul 2011 22:29:55 +1000 Subject: [PATCH 08/12] Define a check for under NcursesW, as used in FreeBSD --- m4/ax_with_curses.m4 | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/m4/ax_with_curses.m4 b/m4/ax_with_curses.m4 index e58d7ff..e939446 100644 --- a/m4/ax_with_curses.m4 +++ b/m4/ax_with_curses.m4 @@ -282,8 +282,39 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if is present]) ]) - AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno], [ - AC_MSG_WARN([could not find either ncursesw/curses.h or ncursesw.h]) + AC_CACHE_CHECK([for ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@define _XOPEN_SOURCE_EXTENDED 1 + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + attr_t d = WA_NORMAL; + cchar_t e; + wint_t f; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + wattr_set(stdscr, d, 0, NULL); + wget_wch(stdscr, &f); + ]])], + [ax_cv_header_ncurses_h_with_ncursesw=yes], + [ax_cv_header_ncurses_h_with_ncursesw=no]) + ]) + AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [ + ax_cv_curses_enhanced=yes + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) + ]) + + AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno], [ + AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h]) ]) ]) ]) @@ -355,7 +386,7 @@ AC_DEFUN([AX_WITH_CURSES], [ ]) AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [ - AC_MSG_WARN([could not find either ncurses/curses.h or ncurses.h]) + AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h]) ]) ]) ]) @@ -473,7 +504,7 @@ AC_DEFUN([AX_WITH_CURSES], [ ]) AS_IF([test "x$ax_cv_header_curses_h" = xno], [ - AC_MSG_WARN([could not find curses.h]) + AC_MSG_WARN([could not find a working curses.h]) ]) ]) ]) From d4e8ee09e6d3b331fcf829c8963dad3537dbb8a4 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Thu, 28 Jul 2011 22:33:24 +1000 Subject: [PATCH 09/12] Add the word "working" to some checks --- m4/ax_with_curses.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/m4/ax_with_curses.m4 b/m4/ax_with_curses.m4 index e939446..a976fb2 100644 --- a/m4/ax_with_curses.m4 +++ b/m4/ax_with_curses.m4 @@ -220,7 +220,7 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) - AC_CACHE_CHECK([for ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [ + AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include @@ -251,7 +251,7 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if is present]) ]) - AC_CACHE_CHECK([for ncursesw.h], [ax_cv_header_ncursesw_h], [ + AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include @@ -282,7 +282,7 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if is present]) ]) - AC_CACHE_CHECK([for ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [ + AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include @@ -339,7 +339,7 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) - AC_CACHE_CHECK([for ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [ + AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ @@ -362,7 +362,7 @@ AC_DEFUN([AX_WITH_CURSES], [ AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if is present]) ]) - AC_CACHE_CHECK([for ncurses.h], [ax_cv_header_ncurses_h], [ + AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ @@ -415,7 +415,7 @@ AC_DEFUN([AX_WITH_CURSES], [ # Check for base conformance (and header file) - AC_CACHE_CHECK([for curses.h], [ax_cv_header_curses_h], [ + AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ From 6afcaa0532104b2cf39efc4c8128012a1911e132 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Thu, 28 Jul 2011 22:51:40 +1000 Subject: [PATCH 10/12] Correct a bug in the AC_DEFINE wording --- m4/ax_with_curses.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/ax_with_curses.m4 b/m4/ax_with_curses.m4 index a976fb2..7973276 100644 --- a/m4/ax_with_curses.m4 +++ b/m4/ax_with_curses.m4 @@ -382,7 +382,7 @@ AC_DEFUN([AX_WITH_CURSES], [ ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) - AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) + AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) ]) AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [ From d1d7716667ac927eaabf584312c7a360e2cfb07d Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Fri, 29 Jul 2011 11:51:21 +1000 Subject: [PATCH 11/12] Update ax_with_curses.m4 to latest version from the Autoconf Archive --- m4/ax_with_curses.m4 | 88 ++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/m4/ax_with_curses.m4 b/m4/ax_with_curses.m4 index 7973276..5399b85 100644 --- a/m4/ax_with_curses.m4 +++ b/m4/ax_with_curses.m4 @@ -8,17 +8,17 @@ # # DESCRIPTION # -# This macro checks whether a SysV or X/Open-compatible Curses library -# is present, along with the associated header file. The NcursesW +# This macro checks whether a SysV or X/Open-compatible Curses library is +# present, along with the associated header file. The NcursesW # (wide-character) library is searched for first, followed by Ncurses, # then the system-default plain Curses. The first library found is the # one returned. # # The following options are understood: --with-ncursesw, --with-ncurses, -# --without-ncursesw, --without-ncurses. The "--with" options force -# the macro to use that particular library, terminating with an error -# if not found. The "--without" options simply skip the check for that -# library. The effect on the search pattern is: +# --without-ncursesw, --without-ncurses. The "--with" options force the +# macro to use that particular library, terminating with an error if not +# found. The "--without" options simply skip the check for that library. +# The effect on the search pattern is: # # (no options) - NcursesW, Ncurses, Curses # --with-ncurses --with-ncursesw - NcursesW only [*] @@ -31,10 +31,11 @@ # --without-ncurses - NcursesW, Curses # # [*] If the library is not found, abort the configure script. +# # [**] If the second library (Ncurses) is not found, abort configure. # -# The following preprocessor symbols may be defined by this macro if -# the appropriate conditions are met: +# The following preprocessor symbols may be defined by this macro if the +# appropriate conditions are met: # # HAVE_CURSES - if any SysV or X/Open Curses library found # HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions @@ -51,23 +52,23 @@ # # (These preprocessor symbols are discussed later in this document.) # -# The following output variable is defined by this macro; it is -# precious and may be overridden on the ./configure command line: +# The following output variable is defined by this macro; it is precious +# and may be overridden on the ./configure command line: # # CURSES_LIB - library to add to xxx_LDADD # -# The library listed in CURSES_LIB is NOT added to LIBS by default. -# You need to add CURSES_LIB to the appropriate xxx_LDADD line in your +# The library listed in CURSES_LIB is NOT added to LIBS by default. You +# need to add CURSES_LIB to the appropriate xxx_LDADD line in your # Makefile.am. For example: # # prog_LDADD = @CURSES_LIB@ # -# If CURSES_LIB is set on the configure command line (such as by -# running "./configure CURSES_LIB=-lmycurses"), then the only header -# searched for is . The user may use the CPPFLAGS precious -# variable to override the standard #include search path. If the user -# needs to specify an alternative path for a library (such as for a -# non-standard NcurseW), the user should use the LDFLAGS variable. +# If CURSES_LIB is set on the configure command line (such as by running +# "./configure CURSES_LIB=-lmycurses"), then the only header searched for +# is . The user may use the CPPFLAGS precious variable to +# override the standard #include search path. If the user needs to +# specify an alternative path for a library (such as for a non-standard +# NcurseW), the user should use the LDFLAGS variable. # # The following shell variables may be defined by this macro: # @@ -81,36 +82,35 @@ # ax_cv_plaincurses - set to "yes" if plain Curses library found # ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no" # -# These variables can be used in your configure.ac to determine the -# level of support you need from the Curses library. For example, if -# you must have either Ncurses or NcursesW, you could include: +# These variables can be used in your configure.ac to determine the level +# of support you need from the Curses library. For example, if you must +# have either Ncurses or NcursesW, you could include: # # AX_WITH_CURSES # if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then # AX_MSG_ERROR([requires either NcursesW or Ncurses library]) # fi # -# If any Curses library will do (but one must be present and must -# support color), you could use: +# If any Curses library will do (but one must be present and must support +# color), you could use: # # AX_WITH_CURSES # if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then # AC_MSG_ERROR([requires an X/Open-compatible Curses library with color]) # fi # -# Certain preprocessor symbols and shell variables defined by this -# macro can be used to determine various features of the Curses -# library. In particular, HAVE_CURSES and ax_cv_curses are defined if -# the Curses library found conforms to the traditional SysV and/or -# X/Open Base Curses definition. Any working Curses library conforms -# to this level. +# Certain preprocessor symbols and shell variables defined by this macro +# can be used to determine various features of the Curses library. In +# particular, HAVE_CURSES and ax_cv_curses are defined if the Curses +# library found conforms to the traditional SysV and/or X/Open Base Curses +# definition. Any working Curses library conforms to this level. # # HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the -# library supports the X/Open Enhanced Curses definition. In -# particular, the wide-character types attr_t, cchar_t and wint_t, the -# functions wattr_set() and wget_wch() and the macros WA_NORMAL and -# _XOPEN_CURSES are checked. The Ncurses library does NOT conform to -# this definition, although NcursesW does. +# library supports the X/Open Enhanced Curses definition. In particular, +# the wide-character types attr_t, cchar_t and wint_t, the functions +# wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES +# are checked. The Ncurses library does NOT conform to this definition, +# although NcursesW does. # # HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library # supports color functions and macros such as COLOR_PAIR, A_COLOR, @@ -120,8 +120,8 @@ # NcursesW. # # HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the -# library supports certain features present in SysV and BSD Curses but -# not defined in the X/Open definition. In particular, the functions +# library supports certain features present in SysV and BSD Curses but not +# defined in the X/Open definition. In particular, the functions # getattrs(), getcurx() and getmaxx() are checked. # # To use the HAVE_xxx_H preprocessor symbols, insert the following into @@ -141,14 +141,13 @@ # # error "SysV or X/Open-compatible Curses header file required" # #endif # -# For previous users of this macro: you should not need to change -# anything in your configure.ac or Makefile.am, as the previous (serial -# 10) semantics are still valid. However, you should update your -# system.h (or equivalent) header file to the fragment shown above. -# You are encouraged also to make use of the extended functionality -# provided by this version of AX_WITH_CURSES, as well as in the -# additional macros AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and -# AX_WITH_CURSES_FORM. +# For previous users of this macro: you should not need to change anything +# in your configure.ac or Makefile.am, as the previous (serial 10) +# semantics are still valid. However, you should update your system.h (or +# equivalent) header file to the fragment shown above. You are encouraged +# also to make use of the extended functionality provided by this version +# of AX_WITH_CURSES, as well as in the additional macros +# AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM. # # LICENSE # @@ -184,6 +183,7 @@ # exception to the GPL to apply to your modified version as well. #serial 11 + AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES]) AC_DEFUN([AX_WITH_CURSES], [ AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses]) From 9599707f674fbc82afb62f089a9feba4e971e73c Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Fri, 29 Jul 2011 12:17:16 +1000 Subject: [PATCH 12/12] Add information about version 7.1 of Star Traders --- NEWS | 9 +++++++++ configure.ac | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index d9f54c9..fdc32a6 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,15 @@ consult the Subversion repository for "trader" on The ZAP Group web server at http://www.zap.org.au/services/svn/. +Version 7.1 (29th July, 2011) +----------------------------- + +A minor updated release to fix configuration problems on some platforms. +In particular, some systems could not find the Curses libraries or header +files, so the Autoconf macro that performed the search was rewritten and +extended. + + Version 7.0 (25th July, 2011) ----------------------------- diff --git a/configure.ac b/configure.ac index 4990ac8..c343cfd 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see http://www.gnu.org/licenses/. -AC_INIT([Star Traders], [7.0], [J.Zaitseff@zap.org.au], [trader], [http://www.zap.org.au/software/trader/]) +AC_INIT([Star Traders], [7.1], [J.Zaitseff@zap.org.au], [trader], [http://www.zap.org.au/software/trader/]) AC_DEFINE([PACKAGE_AUTHOR], ["John Zaitseff"], [Package author]) AC_PREREQ([2.67])