Fix NetBSD and non-ncurses build. Simplify CPPFLAGS.

This commit is contained in:
Felicity Tarnell 2014-03-08 00:50:11 +00:00
parent 003ac6cca4
commit f25e283f21
9 changed files with 3513 additions and 50 deletions

View file

@ -12,9 +12,7 @@ VPATH = @top_srcdir@
CC = @CC@
MAKEDEPEND = @CC@ -M
# _GNU_SOURCE is required for wcsdup() on older version of glibc that don't
# implement XPG7.
CPPFLAGS = @CPPFLAGS@ -D_XOPEN_SOURCE=700 -D_XOPEN_SOURCE_EXTENDED -D__EXTENSIONS__
CPPFLAGS = @CPPFLAGS@ -D_XOPEN_SOURCE=700 -D_XOPEN_SOURCE_EXTENDED
CFLAGS = @CFLAGS@ -I@top_srcdir@ -I@top_builddir@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@

10
aclocal.m4 vendored
View file

@ -108,7 +108,7 @@
# 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
# wattr_set() and wget_wch() and the macros WA_BOLD and _XOPEN_CURSES
# are checked. The Ncurses library does NOT conform to this definition,
# although NcursesW does.
#
@ -228,7 +228,7 @@ AC_DEFUN([AX_WITH_CURSES], [
chtype a = A_BOLD;
int b = KEY_LEFT;
chtype c = COLOR_PAIR(1) & A_COLOR;
attr_t d = WA_NORMAL;
attr_t d = WA_BOLD;
cchar_t e;
wint_t f;
int g = getattrs(stdscr);
@ -259,7 +259,7 @@ AC_DEFUN([AX_WITH_CURSES], [
chtype a = A_BOLD;
int b = KEY_LEFT;
chtype c = COLOR_PAIR(1) & A_COLOR;
attr_t d = WA_NORMAL;
attr_t d = WA_BOLD;
cchar_t e;
wint_t f;
int g = getattrs(stdscr);
@ -290,7 +290,7 @@ AC_DEFUN([AX_WITH_CURSES], [
chtype a = A_BOLD;
int b = KEY_LEFT;
chtype c = COLOR_PAIR(1) & A_COLOR;
attr_t d = WA_NORMAL;
attr_t d = WA_BOLD;
cchar_t e;
wint_t f;
int g = getattrs(stdscr);
@ -443,7 +443,7 @@ AC_DEFUN([AX_WITH_CURSES], [
chtype a = A_BOLD;
int b = KEY_LEFT;
chtype c = COLOR_PAIR(1) & A_COLOR;
attr_t d = WA_NORMAL;
attr_t d = WA_BOLD;
cchar_t e;
wint_t f;
initscr();

1558
config.guess vendored Executable file

File diff suppressed because it is too large Load diff

1788
config.sub vendored Executable file

File diff suppressed because it is too large Load diff

165
configure vendored
View file

@ -638,6 +638,14 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
host_os
host_vendor
host_cpu
host
build_os
build_vendor
build_cpu
build
target_alias
host_alias
build_alias
@ -1288,6 +1296,10 @@ Fine tuning of the installation directories:
_ACEOF
cat <<\_ACEOF
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi
@ -2101,6 +2113,122 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers config.h"
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
if ${ac_cv_build+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_build
shift
build_cpu=$1
build_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
build_os=$*
IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
if ${ac_cv_host+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_host
shift
host_cpu=$1
host_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
host_os=$*
IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
case $host_os in
darwin*)
CPPFLAGS="$CPPFLAGS -D_DARWIN_USE_64_BIT_INODE=1"
;;
linux*)
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
;;
netbsd*)
CPPFLAGS="$CPPFLAGS -D_NETBSD_SOURCE"
;;
solaris*)
CPPFLAGS="-D__EXTENSIONS__ -D_XOPEN_SOURCE=700 -D_FILE_OFFSET_BITS=64"
;;
esac
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -2890,35 +3018,6 @@ 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_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@ -3120,7 +3219,7 @@ main ()
chtype a = A_BOLD;
int b = KEY_LEFT;
chtype c = COLOR_PAIR(1) & A_COLOR;
attr_t d = WA_NORMAL;
attr_t d = WA_BOLD;
cchar_t e;
wint_t f;
int g = getattrs(stdscr);
@ -3184,7 +3283,7 @@ main ()
chtype a = A_BOLD;
int b = KEY_LEFT;
chtype c = COLOR_PAIR(1) & A_COLOR;
attr_t d = WA_NORMAL;
attr_t d = WA_BOLD;
cchar_t e;
wint_t f;
int g = getattrs(stdscr);
@ -3248,7 +3347,7 @@ main ()
chtype a = A_BOLD;
int b = KEY_LEFT;
chtype c = COLOR_PAIR(1) & A_COLOR;
attr_t d = WA_NORMAL;
attr_t d = WA_BOLD;
cchar_t e;
wint_t f;
int g = getattrs(stdscr);
@ -3612,7 +3711,7 @@ main ()
chtype a = A_BOLD;
int b = KEY_LEFT;
chtype c = COLOR_PAIR(1) & A_COLOR;
attr_t d = WA_NORMAL;
attr_t d = WA_BOLD;
cchar_t e;
wint_t f;
initscr();

View file

@ -3,6 +3,23 @@ AC_INIT([RT/TTS], [D.84.0], [felicity@loreley.flyingparchment.org.uk])
AC_CONFIG_SRCDIR([tts.c])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST
case $host_os in
darwin*)
CPPFLAGS="$CPPFLAGS -D_DARWIN_USE_64_BIT_INODE=1"
;;
linux*)
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
;;
netbsd*)
CPPFLAGS="$CPPFLAGS -D_NETBSD_SOURCE"
;;
solaris*)
CPPFLAGS="-D__EXTENSIONS__ -D_FILE_OFFSET_BITS=64"
;;
esac
AC_PROG_CC
AC_PROG_INSTALL

3
str.c
View file

@ -8,6 +8,9 @@
* warranty.
*/
#include <stddef.h>
#include <wctype.h>
#include "str.h"
size_t

16
style.c
View file

@ -22,23 +22,23 @@ style_t sy_header = { 1, 0 },
sy_date = { 6, 0 };
static attrname_t attrnames[] = {
{ L"normal", WA_NORMAL },
{ L"bold", WA_BOLD },
{ L"normal", 0 },
{ L"bold", WA_BOLD },
{ L"reverse", WA_REVERSE },
{ L"blink", WA_BLINK },
{ L"dim", WA_DIM },
{ L"dim", WA_DIM },
{ L"underline", WA_UNDERLINE },
{ L"standout", WA_STANDOUT }
};
static colour_t colours[] = {
{ L"black", COLOR_BLACK },
{ L"red", COLOR_RED },
{ L"red", COLOR_RED },
{ L"green", COLOR_GREEN },
{ L"yellow", COLOR_YELLOW },
{ L"blue", COLOR_BLUE },
{ L"blue", COLOR_BLUE },
{ L"magenta", COLOR_MAGENTA },
{ L"cyan", COLOR_CYAN },
{ L"cyan", COLOR_CYAN },
{ L"white", COLOR_WHITE }
};
@ -79,7 +79,7 @@ style_clear(sy)
style_t *sy;
{
init_pair(sy->sy_pair, default_fg, default_bg);
sy->sy_attrs = WA_NORMAL;
sy->sy_attrs = 0;
}
int
@ -87,7 +87,7 @@ style_set(sy, fg, bg)
style_t *sy;
const wchar_t *fg, *bg;
{
sy->sy_attrs = WA_NORMAL;
sy->sy_attrs = 0;
init_pair(sy->sy_pair, default_fg, default_bg);
return style_add(sy, fg, bg);
}

2
ui.c
View file

@ -432,7 +432,7 @@ chtype oldbg;
time_t n;
int h, s, m;
wchar_t flags[10], stime[16], *p;
attr_t attrs = WA_NORMAL;
attr_t attrs = 0;
if (!showinv && en->en_flags.efl_invoiced)
continue;