From: Bruno Haible Date: Thu, 14 Dec 2006 12:35:16 +0000 (+0000) Subject: Support platforms that lack tparm(). X-Git-Tag: v0.17~589 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=942d3f5a84c5543fe468319abb7fa75e4e9426f5;p=thirdparty%2Fgettext.git Support platforms that lack tparm(). --- diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog index 1532aa0f4..26b8e7fd5 100644 --- a/gnulib-local/ChangeLog +++ b/gnulib-local/ChangeLog @@ -1,3 +1,12 @@ +2006-12-13 Bruno Haible + + * lib/tparm.c: New file, based on a public-domain implementation part + of Cygwin. + * m4/termcap.m4 (gl_TERMCAP): AC_LIBOBJ of tparm.c if needed. + (gl_TERMCAP_BODY): Test whether the system has tparm(). + * modules/termcap (Files): Add lib/tparm.c. + (Depends-on): Add c-ctype. + 2006-12-13 Bruno Haible * modules/termcap-h (Include): Add termcap.h. diff --git a/gnulib-local/lib/termcap.h b/gnulib-local/lib/termcap.h index 50386d28c..1dec4ffb5 100644 --- a/gnulib-local/lib/termcap.h +++ b/gnulib-local/lib/termcap.h @@ -57,7 +57,8 @@ extern char * tparam (const char *str, void *buf, int bufsize, ...); /* API provided by - GNU ncurses in , , , - OSF/1 curses in , , - - Solaris, AIX, HP-UX, IRIX curses in . */ + - Solaris, AIX, HP-UX, IRIX curses in , + - gnulib's replacement. */ /* Instantiates a string capability with format strings. The return value is statically allocated and must not be freed. */ diff --git a/gnulib-local/m4/termcap.m4 b/gnulib-local/m4/termcap.m4 index 7cf37739a..f3161f373 100644 --- a/gnulib-local/m4/termcap.m4 +++ b/gnulib-local/m4/termcap.m4 @@ -1,4 +1,4 @@ -# termcap.m4 serial 2 (gettext-0.16.2) +# termcap.m4 serial 3 (gettext-0.16.2) dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,6 +9,9 @@ dnl From Bruno Haible. AC_DEFUN([gl_TERMCAP], [ AC_REQUIRE([gl_TERMCAP_BODY]) + if test $gl_func_tparam = no && test $gl_cv_func_tparm = no; then + AC_LIBOBJ([tparm]) + fi ]) AC_DEFUN([gl_TERMCAP_BODY], @@ -105,5 +108,23 @@ AC_DEFUN([gl_TERMCAP_BODY], if test $gl_cv_func_tparam = yes; then AC_DEFINE([HAVE_TPARAM], 1, [Define if tparam() is among the termcap library functions.]) + else + dnl Test whether a tparm() function is provided. It is missing e.g. + dnl in NetBSD 3.0 libtermcap. + AC_CACHE_CHECK([for tparm], [gl_cv_func_tparm], [ + gl_save_LIBS="$LIBS" + LIBS="$LIBS $LIBTERMCAP" + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCTERMCAP" + AC_TRY_LINK([extern + #ifdef __cplusplus + "C" + #endif + char * tparm (const char *, ...); + ], [return tparm ("\033\133%dm", 8);], + [gl_cv_func_tparm=yes], [gl_cv_func_tparm=no]) + CPPFLAGS="$gl_save_CPPFLAGS" + LIBS="$gl_save_LIBS" + ]) fi ]) diff --git a/gnulib-local/modules/termcap b/gnulib-local/modules/termcap index d119775bb..9939edee0 100644 --- a/gnulib-local/modules/termcap +++ b/gnulib-local/modules/termcap @@ -3,9 +3,11 @@ Information about terminal capabilities. Files: m4/termcap.m4 +lib/tparm.c Depends-on: havelib +c-ctype configure.ac: gl_TERMCAP