From 191bf464071d7cd21095b9f1d119c05fd8306493 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 19 Oct 2001 15:17:39 +0000 Subject: [PATCH] aclocal.m4 (AM_WITH_NLS): AC_DEFINE HAVE_LIBINTL_H and USE_INCLUDED_LIBINTL when appropriate. * aclocal.m4 (AM_WITH_NLS): AC_DEFINE HAVE_LIBINTL_H and USE_INCLUDED_LIBINTL when appropriate. * configure, config.in: Regenerate. * Makefile.in (datadir): Set to @datadir@. (intl.o): Also depend on $(CONFIG_H) and system.h. * intl.c: Factor out common gettext initialization sequence. (gcc_init_libintl): New function. * intl.h: Include intl/libgnuintl.h if USE_INCLUDED_LIBINTL; otherwise include libintl.h if HAVE_LIBINTL_H; otherwise turn off NLS. Add multiple include guard. No need to #ifdef-guard an #undef. Prototype gcc_init_libintl here. * collect2.c (main), cppmain.c (general_init), gcc.c (main), gcov.c (main), protoize.c (main), toplev.c (toplev_main): Use gcc_init_libintl. intl: * Makefile.in: Don't copy libgnuintl.h anywhere. From-SVN: r46348 --- gcc/ChangeLog | 19 +++++++++ gcc/Makefile.in | 5 +-- gcc/aclocal.m4 | 11 ++++- gcc/collect2.c | 13 +----- gcc/config.in | 9 +++- gcc/configure | 98 ++++++++++++++++++++++++-------------------- gcc/cppmain.c | 13 +----- gcc/gcc.c | 13 +----- gcc/gcov.c | 13 +----- gcc/intl.c | 46 +++++++++++++++++++-- gcc/intl.h | 35 ++++++++++------ gcc/intl/ChangeLog | 4 ++ gcc/intl/Makefile.in | 8 ++-- gcc/protoize.c | 13 +----- gcc/toplev.c | 13 +----- 15 files changed, 173 insertions(+), 140 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d8acd6cc84b..00440f601b3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +2001-10-19 Zack Weinberg + + * aclocal.m4 (AM_WITH_NLS): AC_DEFINE HAVE_LIBINTL_H and + USE_INCLUDED_LIBINTL when appropriate. + * configure, config.in: Regenerate. + * Makefile.in (datadir): Set to @datadir@. + (intl.o): Also depend on $(CONFIG_H) and system.h. + + * intl.c: Factor out common gettext initialization sequence. + (gcc_init_libintl): New function. + * intl.h: Include intl/libgnuintl.h if USE_INCLUDED_LIBINTL; + otherwise include libintl.h if HAVE_LIBINTL_H; otherwise turn + off NLS. Add multiple include guard. No need to #ifdef-guard + an #undef. Prototype gcc_init_libintl here. + + * collect2.c (main), cppmain.c (general_init), gcc.c (main), + gcov.c (main), protoize.c (main), toplev.c (toplev_main): + Use gcc_init_libintl. + 2001-10-19 Catherine Moore * config/stormy16/stormy16.h (ASM_COMMENT_START): Define. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 27a3111b113..b1bf1c3627e 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -313,7 +313,7 @@ infodir = @infodir@ # Where cpp should go besides $prefix/bin if necessary cpp_install_dir = @cpp_install_dir@ # where the locale files go -datadir = $(prefix)/@DATADIRNAME@ +datadir = @datadir@ localedir = $(datadir)/locale # Extension (if any) to put in installed man-page filename. manext = .1 @@ -1962,8 +1962,7 @@ $(HOST_PREFIX_1)ggc-none.o: ggc-none.c $(HCONFIG_H) $(SYSTEM_H) # # Remake internationalization support. - -intl.o: intl.c intl.h Makefile +intl.o: intl.c $(CONFIG_H) system.h intl.h Makefile $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ -DLOCALEDIR=\"$(localedir)\" \ -c $(srcdir)/intl.c diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index b94336956fa..1b4c5ad4d00 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -1406,8 +1406,11 @@ AC_DEFUN([AM_WITH_NLS], define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc]) define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl]) +dnl GCC LOCAL: Expose presence of libintl.h to C code. AC_CHECK_HEADER(libintl.h, - [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, + [AC_DEFINE([HAVE_LIBINTL_H], 1, + [Define if you have the header file.]) + AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include extern int _nl_msg_cat_cntr;], [bindtextdomain ("", ""); @@ -1605,6 +1608,12 @@ changequote([,])dnl AC_SUBST(INTLOBJS) AC_SUBST(POFILES) AC_SUBST(POSUB) +dnl GCC LOCAL: Make USE_INCLUDED_LIBINTL visible to C code. + if test $USE_INCLUDED_LIBINTL = yes; then + AC_DEFINE([USE_INCLUDED_LIBINTL], 1, + [Define to use the libintl included with this package instead of any + version in the system libraries.]) + fi dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= diff --git a/gcc/collect2.c b/gcc/collect2.c index c8fafc3e2c1..c850608fe63 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -873,18 +873,7 @@ main (argc, argv) signal (SIGCHLD, SIG_DFL); #endif -/* LC_CTYPE determines the character set used by the terminal so it has be set - to output messages correctly. */ - -#ifdef HAVE_LC_MESSAGES - setlocale (LC_CTYPE, ""); - setlocale (LC_MESSAGES, ""); -#else - setlocale (LC_ALL, ""); -#endif - - (void) bindtextdomain (PACKAGE, localedir); - (void) textdomain (PACKAGE); + gcc_init_libintl (); /* Do not invoke xcalloc before this point, since locale needs to be set first, in case a diagnostic is issued. */ diff --git a/gcc/config.in b/gcc/config.in index 46ea80143d0..5f390986be2 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1,4 +1,4 @@ -/* config.in. Generated automatically from configure.in by autoheader. */ +/* config.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define if using alloca.c. */ #undef C_ALLOCA @@ -511,9 +511,16 @@ is requested. */ #undef ENABLE_NLS +/* Define if you have the header file. */ +#undef HAVE_LIBINTL_H + /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT +/* Define to use the libintl included with this package instead of any + version in the system libraries. */ +#undef USE_INCLUDED_LIBINTL + /* Define to 1 if installation paths should be looked up in Windows32 Registry. Ignored on non windows32 hosts. */ #undef ENABLE_WIN32_REGISTRY diff --git a/gcc/configure b/gcc/configure index 3d6e6be54bd..7ff635d6dad 100755 --- a/gcc/configure +++ b/gcc/configure @@ -2057,7 +2057,7 @@ EOF fi # Find some useful tools -for ac_prog in gawk mawk nawk awk +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 @@ -6132,13 +6132,17 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6 -echo "configure:6137: checking for GNU gettext in libc" >&5 + cat >> confdefs.h <<\EOF +#define HAVE_LIBINTL_H 1 +EOF + + echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6 +echo "configure:6141: checking for GNU gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < extern int _nl_msg_cat_cntr; @@ -6147,7 +6151,7 @@ bindtextdomain ("", ""); return (int) gettext ("") + _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:6151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gnugettext1_libc=yes else @@ -6163,14 +6167,14 @@ echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6 if test "$gt_cv_func_gnugettext1_libc" != "yes"; then echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6 -echo "configure:6167: checking for GNU gettext in libintl" >&5 +echo "configure:6171: checking for GNU gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -lintl $LIBICONV" cat > conftest.$ac_ext < extern int _nl_msg_cat_cntr; @@ -6179,7 +6183,7 @@ bindtextdomain ("", ""); return (int) gettext ("") + _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:6183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gnugettext1_libintl=yes else @@ -6212,12 +6216,12 @@ EOF for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6216: checking for $ac_func" >&5 +echo "configure:6220: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6269,7 +6273,7 @@ done # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6273: checking for $ac_word" >&5 +echo "configure:6277: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6303,7 +6307,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6307: checking for $ac_word" >&5 +echo "configure:6311: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6340,7 +6344,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6344: checking for $ac_word" >&5 +echo "configure:6348: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6390,7 +6394,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6394: checking for $ac_word" >&5 +echo "configure:6398: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6424,7 +6428,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6428: checking for $ac_word" >&5 +echo "configure:6432: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6460,7 +6464,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6464: checking for $ac_word" >&5 +echo "configure:6468: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6531,7 +6535,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6535: checking for $ac_word" >&5 +echo "configure:6539: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6564,7 +6568,7 @@ done ac_verc_fail=yes else echo $ac_n "checking version of bison""... $ac_c" 1>&6 -echo "configure:6568: checking version of bison" >&5 +echo "configure:6572: checking version of bison" >&5 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; @@ -6592,6 +6596,12 @@ echo "configure:6568: checking version of bison" >&5 + if test $USE_INCLUDED_LIBINTL = yes; then + cat >> confdefs.h <<\EOF +#define USE_INCLUDED_LIBINTL 1 +EOF + + fi nls_cv_header_intl= nls_cv_header_libgt= @@ -6611,7 +6621,7 @@ echo "configure:6568: checking version of bison" >&5 LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:6615: checking for catalogs to be installed" >&5 +echo "configure:6625: checking for catalogs to be installed" >&5 NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no @@ -6662,7 +6672,7 @@ fi case $host_os in win32 | pe | cygwin* | mingw32* | uwin*) echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6 -echo "configure:6666: checking whether windows registry support is requested" >&5 +echo "configure:6676: checking whether windows registry support is requested" >&5 if test "x$enable_win32_registry" != xno; then cat >> confdefs.h <<\EOF #define ENABLE_WIN32_REGISTRY 1 @@ -6671,14 +6681,14 @@ EOF echo "$ac_t""yes" 1>&6 echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6 -echo "configure:6675: checking for library containing RegOpenKeyExA" >&5 +echo "configure:6685: checking for library containing RegOpenKeyExA" >&5 if eval "test \"`echo '$''{'ac_cv_search_RegOpenKeyExA'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_RegOpenKeyExA="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_RegOpenKeyExA="none required" else @@ -6700,7 +6710,7 @@ rm -f conftest* test "$ac_cv_search_RegOpenKeyExA" = "no" && for i in advapi32; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_RegOpenKeyExA="-l$i" break @@ -6753,7 +6763,7 @@ esac if test "x$enable_win32_registry" != xno; then echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6 -echo "configure:6757: checking registry key on windows hosts" >&5 +echo "configure:6767: checking registry key on windows hosts" >&5 cat >> confdefs.h <&6 -echo "configure:6940: checking what assembler to use" >&5 +echo "configure:6950: checking what assembler to use" >&5 gcc_cv_as= gcc_cv_gas_major_version= gcc_cv_gas_minor_version= @@ -7022,7 +7032,7 @@ fi # Figure out what nm we will be using. echo $ac_n "checking what nm to use""... $ac_c" 1>&6 -echo "configure:7026: checking what nm to use" >&5 +echo "configure:7036: checking what nm to use" >&5 if test -x nm$host_exeext; then gcc_cv_nm=./nm$host_exeext elif test x$host = x$target; then @@ -7033,7 +7043,7 @@ echo "$ac_t""$gcc_cv_nm" 1>&6 # Figure out what assembler alignment features are present. echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6 -echo "configure:7037: checking assembler alignment features" >&5 +echo "configure:7047: checking assembler alignment features" >&5 gcc_cv_as_alignment_features=none if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then # Gas version 2.6 and later support for .balign and .p2align. @@ -7081,7 +7091,7 @@ fi echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6 echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6 -echo "configure:7085: checking assembler subsection support" >&5 +echo "configure:7095: checking assembler subsection support" >&5 gcc_cv_as_subsections=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then @@ -7121,7 +7131,7 @@ fi echo "$ac_t""$gcc_cv_as_subsections" 1>&6 echo $ac_n "checking assembler weak support""... $ac_c" 1>&6 -echo "configure:7125: checking assembler weak support" >&5 +echo "configure:7135: checking assembler weak support" >&5 gcc_cv_as_weak=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then @@ -7144,7 +7154,7 @@ fi echo "$ac_t""$gcc_cv_as_weak" 1>&6 echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6 -echo "configure:7148: checking assembler hidden support" >&5 +echo "configure:7158: checking assembler hidden support" >&5 gcc_cv_as_hidden=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then @@ -7168,7 +7178,7 @@ fi echo "$ac_t""$gcc_cv_as_hidden" 1>&6 echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6 -echo "configure:7172: checking assembler leb128 support" >&5 +echo "configure:7182: checking assembler leb128 support" >&5 gcc_cv_as_leb128=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then @@ -7213,7 +7223,7 @@ fi echo "$ac_t""$gcc_cv_as_leb128" 1>&6 echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6 -echo "configure:7217: checking assembler eh_frame optimization" >&5 +echo "configure:7227: checking assembler eh_frame optimization" >&5 gcc_cv_as_eh_frame=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then @@ -7294,7 +7304,7 @@ fi echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6 echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6 -echo "configure:7298: checking assembler section merging support" >&5 +echo "configure:7308: checking assembler section merging support" >&5 gcc_cv_as_shf_merge=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then @@ -7319,7 +7329,7 @@ echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6 case "$target" in sparc*-*-*) echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6 -echo "configure:7323: checking assembler .register pseudo-op support" >&5 +echo "configure:7333: checking assembler .register pseudo-op support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7347,7 +7357,7 @@ EOF fi echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6 -echo "configure:7351: checking assembler supports -relax" >&5 +echo "configure:7361: checking assembler supports -relax" >&5 if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7377,7 +7387,7 @@ EOF case "$tm_file" in *64*) echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""... $ac_c" 1>&6 -echo "configure:7381: checking for 64 bit support in assembler ($gcc_cv_as)" >&5 +echo "configure:7391: checking for 64 bit support in assembler ($gcc_cv_as)" >&5 if eval "test \"`echo '$''{'gcc_cv_as_flags64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7422,7 +7432,7 @@ EOF if test "x$gcc_cv_as_flags64" != xno; then echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6 -echo "configure:7426: checking for assembler offsetable %lo() support" >&5 +echo "configure:7436: checking for assembler offsetable %lo() support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7462,7 +7472,7 @@ EOF i[34567]86-*-* | x86_64-*-*) echo $ac_n "checking assembler instructions""... $ac_c" 1>&6 -echo "configure:7466: checking assembler instructions" >&5 +echo "configure:7476: checking assembler instructions" >&5 gcc_cv_as_instructions= if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then @@ -7489,7 +7499,7 @@ EOF echo "$ac_t""$gcc_cv_as_instructions" 1>&6 echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6 -echo "configure:7493: checking assembler GOTOFF in data directives" >&5 +echo "configure:7503: checking assembler GOTOFF in data directives" >&5 gcc_cv_as_gotoff_in_data=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x then @@ -7519,7 +7529,7 @@ EOF esac echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6 -echo "configure:7523: checking assembler dwarf2 debug_line support" >&5 +echo "configure:7533: checking assembler dwarf2 debug_line support" >&5 gcc_cv_as_dwarf2_debug_line=no # ??? Not all targets support dwarf2 debug_line, even within a version # of gas. Moreover, we need to emit a valid instruction to trigger any @@ -7711,7 +7721,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:7715: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:7725: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" diff --git a/gcc/cppmain.c b/gcc/cppmain.c index a70b41732ae..246c1522ab2 100644 --- a/gcc/cppmain.c +++ b/gcc/cppmain.c @@ -100,18 +100,7 @@ general_init (argv0) xmalloc_set_program_name (progname); -/* LC_CTYPE determines the character set used by the terminal so it - has to be set to output messages correctly. */ - -#ifdef HAVE_LC_MESSAGES - setlocale (LC_CTYPE, ""); - setlocale (LC_MESSAGES, ""); -#else - setlocale (LC_ALL, ""); -#endif - - (void) bindtextdomain (PACKAGE, localedir); - (void) textdomain (PACKAGE); + gcc_init_libintl (); } /* Handle switches, preprocess and output. */ diff --git a/gcc/gcc.c b/gcc/gcc.c index f49804019ea..df036e9c7e9 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -5559,18 +5559,7 @@ main (argc, argv) GCC_DRIVER_HOST_INITIALIZATION; #endif -/* LC_CTYPE determines the character set used by the terminal so it has be set - to output messages correctly. */ - -#ifdef HAVE_LC_MESSAGES - setlocale (LC_CTYPE, ""); - setlocale (LC_MESSAGES, ""); -#else - setlocale (LC_ALL, ""); -#endif - - (void) bindtextdomain (PACKAGE, localedir); - (void) textdomain (PACKAGE); + gcc_init_libintl (); if (signal (SIGINT, SIG_IGN) != SIG_IGN) signal (SIGINT, fatal_error); diff --git a/gcc/gcov.c b/gcc/gcov.c index dbafe81ace0..7386b01ec29 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -243,18 +243,7 @@ main (argc, argv) int argc; char **argv; { -/* LC_CTYPE determines the character set used by the terminal so it has be set - to output messages correctly. */ - -#ifdef HAVE_LC_MESSAGES - setlocale (LC_CTYPE, ""); - setlocale (LC_MESSAGES, ""); -#else - setlocale (LC_ALL, ""); -#endif - - (void) bindtextdomain (PACKAGE, localedir); - (void) textdomain (PACKAGE); + gcc_init_libintl (); process_args (argc, argv); diff --git a/gcc/intl.c b/gcc/intl.c index 761daf33e06..feefc3e5f63 100644 --- a/gcc/intl.c +++ b/gcc/intl.c @@ -1,6 +1,46 @@ -/* intl.c - internationalization */ +/* Message translation utilities. + Copyright (C) 2001 Free Software Foundation, Inc. -#include "ansidecl.h" +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +#include "config.h" +#include "system.h" #include "intl.h" -const char localedir[] = LOCALEDIR; +#ifdef ENABLE_NLS + +/* Initialize the translation library for GCC. This performs the + appropriate sequence of calls - setlocale, bindtextdomain, + textdomain. LC_CTYPE determines the character set used by the + terminal, so it has be set to output messages correctly. */ + +void +gcc_init_libintl () +{ +#ifdef HAVE_LC_MESSAGES + setlocale (LC_CTYPE, ""); + setlocale (LC_MESSAGES, ""); +#else + setlocale (LC_ALL, ""); +#endif + + (void) bindtextdomain (PACKAGE, LOCALEDIR); + (void) textdomain (PACKAGE); +} + +#endif diff --git a/gcc/intl.h b/gcc/intl.h index 07b72b59bb1..8a9b35a66fd 100644 --- a/gcc/intl.h +++ b/gcc/intl.h @@ -1,5 +1,5 @@ /* intl.h - internationalization - Copyright 1998 Free Software Foundation, Inc. + Copyright 1998, 2001 Free Software Foundation, Inc. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,6 +16,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef GCC_INTL_H +#define GCC_INTL_H + #ifdef HAVE_LOCALE_H # include #endif @@ -24,23 +27,27 @@ # define setlocale(category, locale) (locale) #endif -#ifdef ENABLE_NLS -# include - extern const char localedir[]; +#ifdef USE_INCLUDED_LIBINTL +# include #else -/* Stubs that do something close enough. */ -# ifdef textdomain -# undef textdomain +# ifdef HAVE_LIBINTL_H +# include +# else +# undef ENABLE_NLS # endif +#endif + +#ifdef ENABLE_NLS +extern void gcc_init_libintl PARAMS ((void)); +#else +/* Stubs. */ +# undef textdomain # define textdomain(domain) (domain) -# ifdef bindtextdomain -# undef bindtextdomain -# endif +# undef bindtextdomain # define bindtextdomain(domain, directory) (domain) -# ifdef gettext -# undef gettext -# endif +# undef gettext # define gettext(msgid) (msgid) +# define gcc_init_libintl() /* nothing */ #endif #ifndef _ @@ -50,3 +57,5 @@ #ifndef N_ # define N_(msgid) (msgid) #endif + +#endif /* intl.h */ diff --git a/gcc/intl/ChangeLog b/gcc/intl/ChangeLog index b2018b84ec4..5d8bfcbfacb 100644 --- a/gcc/intl/ChangeLog +++ b/gcc/intl/ChangeLog @@ -1,3 +1,7 @@ +2001-10-19 Zack Weinberg + + * Makefile.in: Don't copy libgnuintl.h anywhere. + 2001-10-12 Zack Weinberg * Update entire directory from gettext 0.10.40. diff --git a/gcc/intl/Makefile.in b/gcc/intl/Makefile.in index acf050d59af..a4e0d6a403b 100644 --- a/gcc/intl/Makefile.in +++ b/gcc/intl/Makefile.in @@ -105,8 +105,9 @@ LTV_AGE=0 INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir) \ -I$(top_srcdir)/config -I$(top_srcdir)/../include +# GCC LOCAL: Removed libintl.h from all-yes. all: all-@USE_INCLUDED_LIBINTL@ -all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed +all-yes: libintl.$la charset.alias ref-add.sed ref-del.sed all-no: all-no-@BUILD_INCLUDED_LIBINTL@ all-no-yes: libgnuintl.$la all-no-no: @@ -124,8 +125,9 @@ libintl.la libgnuintl.la: $(OBJECTS) -rpath $(libdir) \ -no-undefined -libintl.h: libgnuintl.h - cp $(srcdir)/libgnuintl.h libintl.h +#GCC LOCAL: Do not install this file. +#libintl.h: libgnuintl.h +# cp $(srcdir)/libgnuintl.h libintl.h charset.alias: config.charset $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ diff --git a/gcc/protoize.c b/gcc/protoize.c index 8ed53af2c4f..001bf3b61c4 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -4584,18 +4584,7 @@ main (argc, argv) signal (SIGCHLD, SIG_DFL); #endif -/* LC_CTYPE determines the character set used by the terminal so it has be set - to output messages correctly. */ - -#ifdef HAVE_LC_MESSAGES - setlocale (LC_CTYPE, ""); - setlocale (LC_MESSAGES, ""); -#else - setlocale (LC_ALL, ""); -#endif - - (void) bindtextdomain (PACKAGE, localedir); - (void) textdomain (PACKAGE); + gcc_init_libintl (); cwd_buffer = getpwd (); if (!cwd_buffer) diff --git a/gcc/toplev.c b/gcc/toplev.c index ab83065e806..2df15e7f18c 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4622,18 +4622,7 @@ toplev_main (argc, argv) xmalloc_set_program_name (progname); -/* LC_CTYPE determines the character set used by the terminal so it has be set - to output messages correctly. */ - -#ifdef HAVE_LC_MESSAGES - setlocale (LC_CTYPE, ""); - setlocale (LC_MESSAGES, ""); -#else - setlocale (LC_ALL, ""); -#endif - - (void) bindtextdomain (PACKAGE, localedir); - (void) textdomain (PACKAGE); + gcc_init_libintl (); /* Install handler for SIGFPE, which may be received while we do compile-time floating point arithmetic. */ -- 2.30.2