From 257f0f14207d9baf41902fa25da2580aec34848c Mon Sep 17 00:00:00 2001 From: seb Date: Tue, 10 Jun 2003 20:20:39 +0000 Subject: GNU TeXinfo's gettext.h unconditionally include locale.h when __sun is defined by cpp. Hence the build was quite broken on Solaris. Fix by adding configure bits to check for locale.h, setlocale() and LC_MESSAGES. Build is now ok on Solaris 9 and Solaris 8. Bump PKGREVISION. --- pkgtools/pkg_install-info/Makefile | 4 +- pkgtools/pkg_install-info/files/config.h.in | 9 ++ pkgtools/pkg_install-info/files/configure | 143 ++++++++++++++++++++++++++- pkgtools/pkg_install-info/files/configure.ac | 18 +++- 4 files changed, 168 insertions(+), 6 deletions(-) (limited to 'pkgtools/pkg_install-info') diff --git a/pkgtools/pkg_install-info/Makefile b/pkgtools/pkg_install-info/Makefile index e76c8844803..77d0d71d361 100644 --- a/pkgtools/pkg_install-info/Makefile +++ b/pkgtools/pkg_install-info/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.2 2003/06/10 07:02:11 seb Exp $ +# $NetBSD: Makefile,v 1.3 2003/06/10 20:20:39 seb Exp $ # DISTNAME= pkg_install-info-${VERSION} -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkg_install-info/files/config.h.in b/pkgtools/pkg_install-info/files/config.h.in index b96d9d04a47..2f511f0d6e9 100644 --- a/pkgtools/pkg_install-info/files/config.h.in +++ b/pkgtools/pkg_install-info/files/config.h.in @@ -6,12 +6,21 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define if your file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H diff --git a/pkgtools/pkg_install-info/files/configure b/pkgtools/pkg_install-info/files/configure index 2cb345f352c..8dc1955877d 100755 --- a/pkgtools/pkg_install-info/files/configure +++ b/pkgtools/pkg_install-info/files/configure @@ -2622,7 +2622,8 @@ done -for ac_header in fcntl.h limits.h memory.h stdlib.h string.h strings.h sys/file.h unistd.h + +for ac_header in fcntl.h limits.h locale.h memory.h stdlib.h string.h strings.h sys/file.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -2982,6 +2983,90 @@ fi # Checks for library functions. +for ac_func in setlocale +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: 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 $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* 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 (); +/* 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 +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' 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:$LINENO: 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 <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + for ac_func in strdup strerror strncasecmp @@ -3071,6 +3156,62 @@ done +# +if test $ac_cv_header_locale_h = yes; then + echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 +echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 +if test "${am_cv_val_LC_MESSAGES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +return LC_MESSAGES + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_val_LC_MESSAGES=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_val_LC_MESSAGES=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 +echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 + if test $am_cv_val_LC_MESSAGES = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LC_MESSAGES 1 +_ACEOF + + fi +fi + + # ac_config_files="$ac_config_files Makefile" diff --git a/pkgtools/pkg_install-info/files/configure.ac b/pkgtools/pkg_install-info/files/configure.ac index 3f0e47d607f..ff87b23038d 100644 --- a/pkgtools/pkg_install-info/files/configure.ac +++ b/pkgtools/pkg_install-info/files/configure.ac @@ -1,5 +1,5 @@ # -*- Autoconf -*- -# $NetBSD: configure.ac,v 1.1.1.1 2003/06/09 22:16:15 seb Exp $ +# $NetBSD: configure.ac,v 1.2 2003/06/10 20:20:40 seb Exp $ # # Process this file with autoconf to produce a configure script. @@ -14,7 +14,7 @@ AC_CONFIG_HEADER([config.h]) # Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h limits.h memory.h stdlib.h string.h strings.h sys/file.h unistd.h]) +AC_CHECK_HEADERS([fcntl.h limits.h locale.h memory.h stdlib.h string.h strings.h sys/file.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STAT @@ -26,9 +26,21 @@ dnl AC_FUNC_ERROR_AT_LINE dnl AC_FUNC_MALLOC dnl AC_FUNC_REALLOC dnl AC_FUNC_STRCOLL -dnl AC_CHECK_FUNCS([strchr]) +AC_CHECK_FUNCS([setlocale]) AC_REPLACE_FUNCS([strdup strerror strncasecmp]) +# +if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi +fi + + # AC_CONFIG_FILES([Makefile]) AC_OUTPUT -- cgit v1.2.3