From ad41429085cb4de37aef72bee814b08acc8a2a35 Mon Sep 17 00:00:00 2001 From: Phil Edwards Date: Mon, 28 Apr 2003 21:03:19 +0000 Subject: [PATCH] configure.in: Test for libintl.h. 2003-04-28 Phil Edwards * configure.in: Test for libintl.h. * include/bits/c++config: Define __N for everybody. * include/bits/basic_string.h, include/bits/stl_bvector.h, include/bits/stl_deque.h, include/bits/stl_vector.h, include/std/std_bitset.h: Wrap all __throw* text with __N. * po/Makefile.am (pot): New rule, mostly working. * src/functexcept.cc: Call gettext on all __throw* arguments when -fexceptions is in effect. * po/Makefile.in, config.h.in, configure: Regenerate. From-SVN: r66185 --- libstdc++-v3/ChangeLog | 12 ++++ libstdc++-v3/config.h.in | 3 + libstdc++-v3/configure | 87 ++++++++++-------------- libstdc++-v3/configure.in | 2 +- libstdc++-v3/include/bits/basic_string.h | 8 +-- libstdc++-v3/include/bits/c++config | 6 ++ libstdc++-v3/include/bits/stl_bvector.h | 4 +- libstdc++-v3/include/bits/stl_deque.h | 2 +- libstdc++-v3/include/bits/stl_vector.h | 2 +- libstdc++-v3/include/std/std_bitset.h | 12 ++-- libstdc++-v3/po/Makefile.am | 9 +++ libstdc++-v3/po/Makefile.in | 44 +++++++----- libstdc++-v3/src/functexcept.cc | 28 +++++--- 13 files changed, 125 insertions(+), 94 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fa1adb1353a..75c88010ff0 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2003-04-28 Phil Edwards + + * configure.in: Test for libintl.h. + * include/bits/c++config: Define __N for everybody. + * include/bits/basic_string.h, include/bits/stl_bvector.h, + include/bits/stl_deque.h, include/bits/stl_vector.h, + include/std/std_bitset.h: Wrap all __throw* text with __N. + * po/Makefile.am (pot): New rule, mostly working. + * src/functexcept.cc: Call gettext on all __throw* arguments when + -fexceptions is in effect. + * po/Makefile.in, config.h.in, configure: Regenerate. + 2003-04-28 Petur Runolfsson PR libstdc++/9523 diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 36e2ae53692..efcda87839f 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -731,6 +731,9 @@ /* Define if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define if you have the header file. */ +#undef HAVE_LIBINTL_H + /* Define if you have the header file. */ #undef HAVE_LOCALE_H diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index c4a6a8822a9..d97826ef282 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -840,7 +840,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes - 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 @@ -1468,7 +1468,7 @@ else if { (eval echo configure:1469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.$ac_ext | *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -10527,7 +10527,7 @@ else # Check for available headers. for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \ machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \ - sys/types.h + sys/types.h libintl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -22992,7 +22992,7 @@ else fi rm -f conftest* - for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h + for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -23124,24 +23124,11 @@ else #include #include -#if HAVE_SYS_TYPES_H -# include -#endif - -#if HAVE_STDLIB_H -# include -#endif - -#if HAVE_SYS_STAT_H -# include -#endif - -#if HAVE_UNISTD_H -# include -#endif - /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include +# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -23249,7 +23236,7 @@ main() } EOF -if { (eval echo configure:23253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:23240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -23280,17 +23267,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:23284: checking for $ac_hdr" >&5 +echo "configure:23271: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:23294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:23281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -23323,7 +23310,7 @@ done # Can't do these in a loop, else the resulting syntax is wrong. cat > conftest.$ac_ext < #include @@ -23333,7 +23320,7 @@ int main() { int f = RLIMIT_DATA ; ; return 0; } EOF -if { (eval echo configure:23337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:23324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_mresult=1 else @@ -23350,7 +23337,7 @@ EOF cat > conftest.$ac_ext < #include @@ -23360,7 +23347,7 @@ int main() { int f = RLIMIT_RSS ; ; return 0; } EOF -if { (eval echo configure:23364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:23351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_mresult=1 else @@ -23377,7 +23364,7 @@ EOF cat > conftest.$ac_ext < #include @@ -23387,7 +23374,7 @@ int main() { int f = RLIMIT_VMEM ; ; return 0; } EOF -if { (eval echo configure:23391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:23378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_mresult=1 else @@ -23404,7 +23391,7 @@ EOF cat > conftest.$ac_ext < #include @@ -23414,7 +23401,7 @@ int main() { int f = RLIMIT_AS ; ; return 0; } EOF -if { (eval echo configure:23418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:23405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_mresult=1 else @@ -23436,7 +23423,7 @@ EOF else cat > conftest.$ac_ext < #include @@ -23446,7 +23433,7 @@ int main() { struct rlimit r; setrlimit(0, &r); ; return 0; } EOF -if { (eval echo configure:23450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:23437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_setrlimit=yes else @@ -23462,7 +23449,7 @@ fi fi echo $ac_n "checking for testsuite memory limit support""... $ac_c" 1>&6 -echo "configure:23466: checking for testsuite memory limit support" >&5 +echo "configure:23453: checking for testsuite memory limit support" >&5 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then ac_mem_limits=yes cat >> confdefs.h <<\EOF @@ -23478,7 +23465,7 @@ EOF # Look for setenv, so that extended locale tests can be performed. echo $ac_n "checking for setenv declaration""... $ac_c" 1>&6 -echo "configure:23482: checking for setenv declaration" >&5 +echo "configure:23469: checking for setenv declaration" >&5 if test x${glibcpp_cv_func_setenv_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_setenv_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -23493,14 +23480,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { setenv(0, 0, 0); ; return 0; } EOF -if { (eval echo configure:23504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:23491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_setenv_use=yes else @@ -23526,12 +23513,12 @@ fi for ac_func in setenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:23530: checking for $ac_func" >&5 +echo "configure:23517: 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:23545: \"$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 @@ -23631,18 +23618,18 @@ fi # Check to see if libgcc_s exists, indicating that shared libgcc is possible. if test $enable_symvers != no; then echo $ac_n "checking for shared libgcc""... $ac_c" 1>&6 -echo "configure:23635: checking for shared libgcc" >&5 +echo "configure:23622: checking for shared libgcc" >&5 ac_save_CFLAGS="$CFLAGS" CFLAGS=' -lgcc_s' cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:23633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_shared_libgcc=yes else @@ -23677,14 +23664,14 @@ if test $enable_symvers = yes ; then echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:23675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* enable_symvers=gnu else @@ -23730,7 +23717,7 @@ else GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE= fi echo $ac_n "checking versioning on shared library symbols""... $ac_c" 1>&6 -echo "configure:23734: checking versioning on shared library symbols" >&5 +echo "configure:23721: checking versioning on shared library symbols" >&5 echo "$ac_t""$enable_symvers" 1>&6 @@ -23817,7 +23804,7 @@ glibcpp_prefixdir=${prefix} # Process the option --with-gxx-include-dir= echo $ac_n "checking for --with-gxx-include-dir""... $ac_c" 1>&6 -echo "configure:23821: checking for --with-gxx-include-dir" >&5 +echo "configure:23808: checking for --with-gxx-include-dir" >&5 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given. if test "${with_gxx_include_dir+set}" = set; then withval="$with_gxx_include_dir" @@ -23841,7 +23828,7 @@ echo "$ac_t""$gxx_include_dir" 1>&6 # Process the option "--enable-version-specific-runtime-libs" echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6 -echo "configure:23845: checking for --enable-version-specific-runtime-libs" >&5 +echo "configure:23832: checking for --enable-version-specific-runtime-libs" >&5 # Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given. if test "${enable_version_specific_runtime_libs+set}" = set; then enableval="$enable_version_specific_runtime_libs" @@ -23892,7 +23879,7 @@ if test x"$glibcpp_toolexecdir" = x"no"; then fi echo $ac_n "checking for install location""... $ac_c" 1>&6 -echo "configure:23896: checking for install location" >&5 +echo "configure:23883: checking for install location" >&5 echo "$ac_t""$gxx_include_dir" 1>&6 diff --git a/libstdc++-v3/configure.in b/libstdc++-v3/configure.in index 553359b250c..09285aa28aa 100644 --- a/libstdc++-v3/configure.in +++ b/libstdc++-v3/configure.in @@ -401,7 +401,7 @@ else # Check for available headers. AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \ machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \ - sys/types.h]) + sys/types.h libintl.h]) GLIBCPP_CHECK_COMPILER_FEATURES GLIBCPP_CHECK_LINKER_FEATURES diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 61ddee3d6f8..bdbd2ddb18d 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -275,7 +275,7 @@ namespace std _M_check(size_type __pos) const { if (__pos > this->size()) - __throw_out_of_range("basic_string::_M_check"); + __throw_out_of_range(__N("basic_string::_M_check")); return _M_ibegin() + __pos; } @@ -447,7 +447,7 @@ namespace std at(size_type __n) const { if (__n >= this->size()) - __throw_out_of_range("basic_string::at"); + __throw_out_of_range(__N("basic_string::at")); return _M_data()[__n]; } @@ -455,7 +455,7 @@ namespace std at(size_type __n) { if (__n >= size()) - __throw_out_of_range("basic_string::at"); + __throw_out_of_range(__N("basic_string::at")); _M_leak(); return _M_data()[__n]; } @@ -818,7 +818,7 @@ namespace std substr(size_type __pos = 0, size_type __n = npos) const { if (__pos > this->size()) - __throw_out_of_range("basic_string::substr"); + __throw_out_of_range(__N("basic_string::substr")); return basic_string(*this, __pos, __n); } diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 2abaed7fe9c..21c10671118 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -97,4 +97,10 @@ # define _GLIBCPP_FAST_MATH 0 #endif +// This marks string literals in header files to be extracted for eventual +// translation. It is primarily used for messages in thrown exceptions; see +// src/functexcept.cc. We use __N because the more traditional _N is used +// for something else under certain OSes (see BADNAMES). +#define __N(msgid) (msgid) + // End of prewritten config; the discovered settings follow. diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index d334a729d23..29fd692235d 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -480,7 +480,7 @@ template void _M_range_check(size_type __n) const { if (__n >= this->size()) - __throw_out_of_range("vector"); + __throw_out_of_range(__N("vector")); } reference at(size_type __n) @@ -607,7 +607,7 @@ template void reserve(size_type __n) { if (__n > this->max_size()) - __throw_length_error("vector::reserve"); + __throw_length_error(__N("vector::reserve")); if (this->capacity() < __n) { _Bit_type * __q = _M_bit_alloc(__n); this->_M_finish = copy(begin(), end(), iterator(__q, 0)); diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index 916a1dc812e..63257e2dd8f 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -940,7 +940,7 @@ namespace std _M_range_check(size_type __n) const { if (__n >= this->size()) - __throw_out_of_range("deque [] access out of range"); + __throw_out_of_range(__N("std::deque [] access out of range")); } public: diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index f0da72adcb9..bf2881395c0 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -524,7 +524,7 @@ namespace std _M_range_check(size_type __n) const { if (__n >= this->size()) - __throw_out_of_range("vector [] access out of range"); + __throw_out_of_range(__N("std::vector [] access out of range")); } public: diff --git a/libstdc++-v3/include/std/std_bitset.h b/libstdc++-v3/include/std/std_bitset.h index c6e993a3e79..4292a4472dc 100644 --- a/libstdc++-v3/include/std/std_bitset.h +++ b/libstdc++-v3/include/std/std_bitset.h @@ -264,7 +264,7 @@ namespace std { for (size_t __i = 1; __i < _Nw; ++__i) if (_M_w[__i]) - __throw_overflow_error("bitset -- too large to fit in unsigned long"); + __throw_overflow_error(__N("bitset value is too large to fit in unsigned long")); return _M_w[0]; } @@ -466,7 +466,7 @@ namespace std // localized to this single should-never-get-this-far function. _WordT& _M_getword(size_t) const - { __throw_out_of_range("bitset -- zero-length"); return *new _WordT; } + { __throw_out_of_range(__N("bitset is zero-length")); return *new _WordT; } _WordT _M_hiword() const { return 0; } @@ -862,7 +862,7 @@ namespace std set(size_t __pos, bool __val = true) { if (__pos >= _Nb) - __throw_out_of_range("bitset -- set() argument too large"); + __throw_out_of_range(__N("bitset::set() argument too large")); return _Unchecked_set(__pos, __val); } @@ -887,7 +887,7 @@ namespace std reset(size_t __pos) { if (__pos >= _Nb) - __throw_out_of_range("bitset -- reset() argument too large"); + __throw_out_of_range(__N("bitset::reset() argument too large")); return _Unchecked_reset(__pos); } @@ -911,7 +911,7 @@ namespace std flip(size_t __pos) { if (__pos >= _Nb) - __throw_out_of_range("bitset -- flip() argument too large"); + __throw_out_of_range(__N("bitset::flip() argument too large")); return _Unchecked_flip(__pos); } @@ -1014,7 +1014,7 @@ namespace std test(size_t __pos) const { if (__pos >= _Nb) - __throw_out_of_range("bitset -- test() argument too large"); + __throw_out_of_range(__N("bitset::test() argument too large")); return _Unchecked_test(__pos); } diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am index 95b0553252a..9065757c32b 100644 --- a/libstdc++-v3/po/Makefile.am +++ b/libstdc++-v3/po/Makefile.am @@ -22,6 +22,7 @@ ## USA. PACKAGE = @PACKAGE@ +glibcpp_srcdir = @glibcpp_srcdir@ # Location of installation directories. mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs @@ -77,5 +78,13 @@ install-data-local-yes: all-local-yes $(INSTALL_DATA) $$cat $$install_dir/$(PACKAGE).mo; \ done +# Maintainence of the .po template file. This rule is never run automatically, +# and updates the source directory. +pot: + cd $(glibcpp_srcdir); \ + xgettext --default-domain=$(PACKAGE) --add-comments --c++ --debug \ + --join-existing -o po/$(PACKAGE).pot --keyword=__N \ + `grep -r -l '__N(".*")' .` + # Specify what gets cleaned up on a 'make clean' CLEANFILES = $(LOCALE_OUT) diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in index 1bf53048120..a579970ce3c 100644 --- a/libstdc++-v3/po/Makefile.in +++ b/libstdc++-v3/po/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -133,7 +133,6 @@ glibcpp_basedir = @glibcpp_basedir@ glibcpp_builddir = @glibcpp_builddir@ glibcpp_localedir = @glibcpp_localedir@ glibcpp_prefixdir = @glibcpp_prefixdir@ -glibcpp_srcdir = @glibcpp_srcdir@ glibcpp_thread_h = @glibcpp_thread_h@ glibcpp_toolexecdir = @glibcpp_toolexecdir@ glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@ @@ -144,6 +143,7 @@ libtool_VERSION = @libtool_VERSION@ toplevel_srcdir = @toplevel_srcdir@ PACKAGE = @PACKAGE@ +glibcpp_srcdir = @glibcpp_srcdir@ # Location of installation directories. mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs @@ -159,9 +159,7 @@ LOCALE_OUT = @glibcpp_MOFILES@ MSGFMT = msgfmt # Necessary files. -DISTFILES = \ - Makefile.am Makefile.in string_literals.cc POTFILES.in $(PACKAGE).pot \ - $(LOCALE_IN) +DISTFILES = Makefile.am Makefile.in string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN) # Specify what gets cleaned up on a 'make clean' @@ -176,15 +174,15 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in -TAR = gtar +TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: .SUFFIXES: .mo .po $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --cygnus po/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu po/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -197,8 +195,13 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = po distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu po/Makefile @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ + d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ @@ -211,12 +214,10 @@ info-am: info: info-am dvi-am: dvi: dvi-am -check-am: +check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am -install-info-am: -install-info: install-info-am install-exec-am: install-exec: install-exec-am @@ -265,12 +266,11 @@ maintainer-clean-am: maintainer-clean-generic distclean-am maintainer-clean: maintainer-clean-am .PHONY: tags distdir info-am info dvi-am dvi check check-am \ -installcheck-am installcheck install-info-am install-info \ -install-exec-am install-exec install-data-local install-data-am \ -install-data install-am install uninstall-am uninstall all-local \ -all-redirect all-am all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-am uninstall all-local all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean .po.mo: @@ -309,6 +309,14 @@ install-data-local-yes: all-local-yes $(INSTALL_DATA) $$cat $$install_dir/$(PACKAGE).mo; \ done +# Maintainence of the .po template file. This rule is never run automatically, +# and updates the source directory. +pot: + cd $(glibcpp_srcdir); \ + xgettext --default-domain=$(PACKAGE) --add-comments --c++ --debug \ + --join-existing -o po/$(PACKAGE).pot --keyword=__N \ + `grep -r -l '__N(".*")' .` + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/libstdc++-v3/src/functexcept.cc b/libstdc++-v3/src/functexcept.cc index dab6f2f3199..82a0e881e3f 100644 --- a/libstdc++-v3/src/functexcept.cc +++ b/libstdc++-v3/src/functexcept.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -32,6 +32,12 @@ #include #include #include +#ifdef _GLIBCPP_HAVE_LIBINTL_H +# include +# define _(msgid) gettext (msgid) +#else +# define _(msgid) (msgid) +#endif namespace std { @@ -54,43 +60,43 @@ namespace std void __throw_logic_error(const char* __s) - { throw logic_error(__s); } + { throw logic_error(_(__s)); } void __throw_domain_error(const char* __s) - { throw domain_error(__s); } + { throw domain_error(_(__s)); } void __throw_invalid_argument(const char* __s) - { throw invalid_argument(__s); } + { throw invalid_argument(_(__s)); } void __throw_length_error(const char* __s) - { throw length_error(__s); } + { throw length_error(_(__s)); } void __throw_out_of_range(const char* __s) - { throw out_of_range(__s); } + { throw out_of_range(_(__s)); } void __throw_runtime_error(const char* __s) - { throw runtime_error(__s); } + { throw runtime_error(_(__s)); } void __throw_range_error(const char* __s) - { throw range_error(__s); } + { throw range_error(_(__s)); } void __throw_overflow_error(const char* __s) - { throw overflow_error(__s); } + { throw overflow_error(_(__s)); } void __throw_underflow_error(const char* __s) - { throw underflow_error(__s); } + { throw underflow_error(_(__s)); } void __throw_ios_failure(const char* __s) - { throw ios_base::failure(__s); } + { throw ios_base::failure(_(__s)); } #else void __throw_bad_exception(void) -- 2.30.2