This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix a passel of libintl/libiconv issues


This patch corrects a bunch of issues related to the new libintl.  In
particular, it should make it possible to bootstrap again on Cygwin
hosts, where the old gettext probe macro and the new one disagree on
whether or not there's an acceptable gettext provided with the system.

Also addressed are the failure to probe xgettext/msgfmt properly; the
syntax errors in gcc/Makefile.in (I have no idea how that bug got
through a bootstrap on my system, but it did); paving the way for
proper dependencies on ../iconv/libiconv.a when we have it; proper
setting of several #defines in libintl, the victim of an over-eager
move to config.h; and a bunch more cruft removal.

The scheme used here is to configure libintl first, then have gcc's
configure script examine the results of that configuration rather than
repeating all the work.  We don't go through the cache because it
might have been disabled, and would be more complicated; instead I
have config.status generate a file with the necessary information.
This means that the very messy autoconf macros shipped with gettext
can be isolated in the intl directory, rather than muck up the
others.  A consequence of this is that if you build in an uberbaum
tree (which has the old intl that doesn't generate this file) GCC will
silently flip into --disable-nls mode.  This should be a temporary
situation, and is certainly better than bootstrap failure.

I have tested this on i686-linux and i686-netbsd1.6, and I have been
told that it solves the bootstrap problems on cygwin.  It does not
address the issue with system-provided iconv not knowing how to
convert UTF-8 to UCS-[42][LB]E; that will be the subject of a patch
which I hope to write tomorrow afternoon, when I am awake enough to do
bit fiddling.  I do not have access to any such system, so I would
appreciate help testing that patch once it is written.

One final note, I would like to come up with a policy for throwing .m4
files in the top level config directory.  In this patch I did that for
one of the two .m4 files I slurped out of the gettext distro; but the
other one I inlined into gcc/aclocal.m4, because it seemed awfully
small.  However, an all-or-nothing policy probably makes more sense.
There are other things than aclocal fragments in the top level config
directory but I suspect they are not long for this world.  Thoughts?

zw

top:
        * Makefile.tpl (configure-gcc): Depend on maybe-configure-intl.
        * Makefile.in: Regenerate.
config:
        * gettext.m4: Delete all former contents.
        (ZW_GNU_GETTEXT_SISTER_DIR): New macro.
        * progtest.m4: New file.
gcc:
        * Makefile.in (top_builddir): Set to "..", not ".".
        (INTLLIBS, INTLDEPS): Delete.
        (LIBINTL, LIBINTL_DEP, LIBICONV_DEP): New variables to be substituted.
        (LIBDEPS): Add $(LIBICONV_DEP).
        (LIBS): Take out $(INTLLIBS), add $(LIBINTL) and $(LIBICONV).
        (INCLUDES): Replace -I../intl with @INCINTL@.
        ($(top_builddir)/intl/libintl.a): Delete rule.
        (stage2-start, stage3-start, stage4-start, stageprofile-start,
        stagefeedback-start): Use $$ for variable to be evaluated by
        shell, not make.
        * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
        HAVE_LC_MESSAGES, HAVE_STPCPY): Delete.
        * aclocal.m4: sinclude ../config/progtest.m4.  Add
        contents of lcmessage.m4 from gettext distro.
        * configure.in: Check for wchar.h and setlocale.  Set
        LIBICONV_DEP to the empty string and substitute it.
        Call AM_LC_MESSAGES.  Delete AC_ARG_ENABLE for --enable-nls;
        this is handled elsewhere.  Use ZW_GNU_GETTEXT_SISTER_DIR,
        not CY_GNU_GETTEXT.  Clear $LIBICONV if its text is included
        in $LIBINTL, to avoid linking it twice.
        * configure, config.in: Regenerate.
intl:
        * README: Update.
        * Makefile.in (INSTALL, INSTALL_DATA, MKINSTALLDIRS,
        mkinstalldirs, gettextsrcdir, l): Delete.
        (COMPILE): Add $(DEFS-$@), remove $(XCFLAGS).
        (HEADERS): libgnuintl.h not libgnuintl.h.in.  Remove os2compat.h.
        (SOURCES): Remove os2compat.c.
        (DEFS-dcigettext.o, DEFS-localealias.o, DEFS-localcharset.o,
        DEFS-relocatable.o): New.
        (all-yes): Add config.intl.
        (libintl.h): Use cp, not cat.
        (INCLUDES): Remove -I..
        (TAGS, CTAGS, ID): Word wrap.
        (mostlyclean, distclean): Remove junk.
        (config.intl): New rule.
        * aclocal.m4: sinclude ../config/progtest.m4 instead of
        including it inline.
        * config.intl.in: New file.
        * configure.in: Take out unnecessary AC_CONFIG_AUX_DIR.
        Take out AC_DEFINEs for LOCALEDIR, LOCALE_ALIAS_PATH,
        LIBDIR, INSTALLDIR.  Set LIBINTL_DEP and INCINTL and AC_SUBST
        them.  Add config.intl to AC_OUTPUT.
        * os2compat.c, os2compat.h: Delete, unused.

===================================================================
Index: Makefile.tpl
--- Makefile.tpl	4 Jul 2003 23:07:22 -0000	1.64
+++ Makefile.tpl	8 Jul 2003 05:05:26 -0000
@@ -1285,7 +1285,8 @@ gcc-no-fixedincludes:
 
 # Host modules specific to gcc.
 # GCC needs to identify certain tools.
-configure-gcc: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
+# GCC also needs the information exported by the intl configure script.
+configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
 all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
 # This is a slightly kludgy method of getting dependencies on 
 # all-build-libiberty correct; it would be better to build it every time.
===================================================================
Index: Makefile.in
--- Makefile.in	4 Jul 2003 23:07:22 -0000	1.180
+++ Makefile.in	8 Jul 2003 05:05:26 -0000
@@ -23740,7 +23740,8 @@ gcc-no-fixedincludes:
 
 # Host modules specific to gcc.
 # GCC needs to identify certain tools.
-configure-gcc: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
+# GCC also needs the information exported by the intl configure script.
+configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
 all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
 # This is a slightly kludgy method of getting dependencies on 
 # all-build-libiberty correct; it would be better to build it every time.
===================================================================
Index: config/gettext.m4
--- config/gettext.m4	4 Jul 2003 18:18:43 -0000	1.1
+++ config/gettext.m4	8 Jul 2003 05:05:26 -0000
@@ -1,361 +1,66 @@
-# This file is derived from `gettext.m4'.  The difference is that the
-# included macros assume Cygnus-style source and build trees.
-
-#serial 1
-dnl This test replaces the one in autoconf.
-dnl Currently this macro should have the same name as the autoconf macro
-dnl because gettext's gettext.m4 (distributed in the automake package)
-dnl still uses it.  Otherwise, the use in gettext.m4 makes autoheader
-dnl give these diagnostics:
-dnl   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
-dnl   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
-
-undefine([AC_ISC_POSIX])
-AC_DEFUN(AC_ISC_POSIX,
-  [
-    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
-    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
-  ]
-)
-
-# Macro to add for using GNU gettext.
-# Ulrich Drepper <drepper@cygnus.com>, 1995.
+# intl sister-directory configuration rules.
 #
-# This file file be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 3
-
-AC_DEFUN(CY_WITH_NLS,
-  [AC_MSG_CHECKING([whether NLS is requested])
-    dnl Default is enabled NLS
-    AC_ARG_ENABLE(nls,
-      [  --disable-nls           do not use Native Language Support],
-      USE_NLS=$enableval, USE_NLS=yes)
-    AC_MSG_RESULT($USE_NLS)
-    AC_SUBST(USE_NLS)
-
-    USE_INCLUDED_LIBINTL=no
-
-    dnl If we use NLS figure out what method
-    if test "$USE_NLS" = "yes"; then
-      AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
-      AC_MSG_CHECKING([whether included gettext is requested])
-      AC_ARG_WITH(included-gettext,
-        [  --with-included-gettext use the GNU gettext library included here],
-        nls_cv_force_use_gnu_gettext=$withval,
-        nls_cv_force_use_gnu_gettext=no)
-      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
-
-      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
-      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
-        dnl User does not insist on using GNU NLS library.  Figure out what
-        dnl to use.  If gettext or catgets are available (in this order) we
-        dnl use this.  Else we have to fall back to GNU NLS library.
-	dnl catgets is only used if permitted by option --with-catgets.
-	nls_cv_header_intl=
-	nls_cv_header_libgt=
-	CATOBJEXT=NONE
-
-	AC_CHECK_HEADER(libintl.h,
-	  [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
-	    [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
-	       gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
-
-	   if test "$gt_cv_func_gettext_libc" != "yes"; then
-	     AC_CHECK_LIB(intl, bindtextdomain,
-	       [AC_CACHE_CHECK([for gettext in libintl],
-		 gt_cv_func_gettext_libintl,
-		 [AC_TRY_LINK([], [return (int) gettext ("")],
-		 gt_cv_func_gettext_libintl=yes,
-		 gt_cv_func_gettext_libintl=no)])])
-	   fi
-
-	   if test "$gt_cv_func_gettext_libc" = "yes" \
-	      || test "$gt_cv_func_gettext_libintl" = "yes"; then
-	      AC_DEFINE(HAVE_GETTEXT, 1,
-			[Define as 1 if you have gettext and don't want to use GNU gettext.])
-	      AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
-		[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
-	      if test "$MSGFMT" != "no"; then
-		AC_CHECK_FUNCS(dcgettext)
-		AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
-		AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-		  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
-		AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
-			       return _nl_msg_cat_cntr],
-		  [CATOBJEXT=.gmo
-		   DATADIRNAME=share],
-		  [CATOBJEXT=.mo
-		   DATADIRNAME=lib])
-		INSTOBJEXT=.mo
-	      fi
-	    fi
-	])
-
-	dnl In the standard gettext, we would now check for catgets.
-        dnl However, we never want to use catgets for our releases.
 
-        if test "$CATOBJEXT" = "NONE"; then
-	  dnl Neither gettext nor catgets in included in the C library.
-	  dnl Fall back on GNU gettext library.
-	  nls_cv_use_gnu_gettext=yes
-        fi
-      fi
-
-      if test "$nls_cv_use_gnu_gettext" = "yes"; then
-        dnl Mark actions used to generate GNU NLS library.
-        INTLOBJS="\$(GETTOBJS)"
-        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
-	  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
-        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
-        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-	  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
-        AC_SUBST(MSGFMT)
-	USE_INCLUDED_LIBINTL=yes
-        CATOBJEXT=.gmo
-        INSTOBJEXT=.mo
-        DATADIRNAME=share
-	INTLDEPS='$(top_builddir)/../intl/libintl.a'
-	INTLLIBS=$INTLDEPS
-	LIBS=`echo $LIBS | sed -e 's/-lintl//'`
-        nls_cv_header_intl=libintl.h
-        nls_cv_header_libgt=libgettext.h
-      fi
-
-      dnl Test whether we really found GNU xgettext.
-      if test "$XGETTEXT" != ":"; then
-	dnl If it is no GNU xgettext we define it as : so that the
-	dnl Makefiles still can work.
-	if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
-	  : ;
-	else
-	  AC_MSG_RESULT(
-	    [found xgettext programs is not GNU xgettext; ignore it])
-	  XGETTEXT=":"
-	fi
-      fi
-
-      # We need to process the po/ directory.
-      POSUB=po
+# The idea behind this macro is that there's no need to repeat all the
+# autoconf probes done by the intl directory - it's already done them
+# for us.  In fact, there's no need even to look at the cache for the
+# answers.  All we need to do is nab a few pieces of information.
+# The intl directory is set up to make this easy, by generating a
+# small file which can be sourced as a shell script; then we produce
+# the necessary substitutions and definitions for this directory.
+
+AC_DEFUN(ZW_GNU_GETTEXT_SISTER_DIR,
+[# If we haven't got the data from the intl directory,
+# assume NLS is disabled.
+USE_NLS=no	AC_SUBST(USE_NLS)
+LIBINTL=	AC_SUBST(LIBINTL)
+LIBINTL_DEP=	AC_SUBST(LIBINTL_DEP)
+INCINTL=	AC_SUBST(INCINTL)
+XGETTEXT=	AC_SUBST(XGETTEXT)
+GMSGFMT=	AC_SUBST(GMSGFMT)
+POSUB=		AC_SUBST(POSUB)
+if test -f ../intl/config.intl; then
+  . ../intl/config.intl
+fi
+AC_MSG_CHECKING([whether NLS is requested])
+if test x"$USE_NLS" != xyes; then
+  AC_MSG_RESULT(no)
+else
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(ENABLE_NLS, 1, 
+ [Define to 1 if translation of program messages to the 
+  user's native language is requested.])
+
+  AC_MSG_CHECKING(for catalogs to be installed)
+  # Look for .po and .gmo files in the source directory.
+  CATALOGS=  AC_SUBST(CATALOGS)
+  XLINGUAS=
+  for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do
+    # If there aren't any .gmo files the shell will give us the
+    # literal string "../path/to/srcdir/po/*.gmo" which has to be
+    # weeded out.
+    case "$cat" in *\**)
+      continue;;
+    esac
+    # The quadruple backslash is collapsed to a double backslash
+    # by the backticks, then collapsed again by the double quotes,
+    # leaving us with one backslash in the sed expression (right
+    # before the dot that mustn't act as a wildcard).
+    cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"`
+    lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"`
+    # The user is allowed to set LINGUAS to a list of languages to
+    # install catalogs for.  If it's empty that means "all of them."
+    if test "x$LINGUAS" = x; then
+      CATALOGS="$CATALOGS $cat"
+      XLINGUAS="$XLINGUAS $lang"
     else
-      DATADIRNAME=share
-      nls_cv_header_intl=libintl.h
-      nls_cv_header_libgt=libgettext.h
-    fi
-
-    # If this is used in GNU gettext we have to set USE_NLS to `yes'
-    # because some of the sources are only built for this goal.
-    if test "$PACKAGE" = gettext; then
-      USE_NLS=yes
-      USE_INCLUDED_LIBINTL=yes
-    fi
-
-    dnl These rules are solely for the distribution goal.  While doing this
-    dnl we only have to keep exactly one list of the available catalogs
-    dnl in configure.in.
-    for lang in $ALL_LINGUAS; do
-      GMOFILES="$GMOFILES $lang.gmo"
-      POFILES="$POFILES $lang.po"
-    done
-
-    dnl Make all variables we use known to autoconf.
-    AC_SUBST(USE_INCLUDED_LIBINTL)
-    AC_SUBST(CATALOGS)
-    AC_SUBST(CATOBJEXT)
-    AC_SUBST(DATADIRNAME)
-    AC_SUBST(GMOFILES)
-    AC_SUBST(INSTOBJEXT)
-    AC_SUBST(INTLDEPS)
-    AC_SUBST(INTLLIBS)
-    AC_SUBST(INTLOBJS)
-    AC_SUBST(POFILES)
-    AC_SUBST(POSUB)
-  ])
-
-AC_DEFUN(CY_GNU_GETTEXT,
-  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-   AC_REQUIRE([AC_PROG_CC])dnl
-   AC_REQUIRE([AC_PROG_RANLIB])dnl
-   AC_REQUIRE([AC_ISC_POSIX])dnl
-   AC_REQUIRE([AC_HEADER_STDC])dnl
-   AC_REQUIRE([AC_C_CONST])dnl
-   AC_REQUIRE([AC_C_INLINE])dnl
-   AC_REQUIRE([AC_TYPE_OFF_T])dnl
-   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
-   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
-   AC_REQUIRE([AC_FUNC_MMAP])dnl
-
-   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
-unistd.h values.h sys/param.h])
-   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
-__argz_count __argz_stringify __argz_next])
-
-   if test "${ac_cv_func_stpcpy+set}" != "set"; then
-     AC_CHECK_FUNCS(stpcpy)
-   fi
-   if test "${ac_cv_func_stpcpy}" = "yes"; then
-     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
-   fi
-
-   AM_LC_MESSAGES
-   CY_WITH_NLS
-
-   if test "x$CATOBJEXT" != "x"; then
-     if test "x$ALL_LINGUAS" = "x"; then
-       LINGUAS=
-     else
-       AC_MSG_CHECKING(for catalogs to be installed)
-       NEW_LINGUAS=
-       for lang in ${LINGUAS=$ALL_LINGUAS}; do
-         case "$ALL_LINGUAS" in
-          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
-         esac
-       done
-       LINGUAS=$NEW_LINGUAS
-       AC_MSG_RESULT($LINGUAS)
-     fi
-
-     dnl Construct list of names of catalog files to be constructed.
-     if test -n "$LINGUAS"; then
-       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
-     fi
-   fi
-
-   dnl The reference to <locale.h> in the installed <libintl.h> file
-   dnl must be resolved because we cannot expect the users of this
-   dnl to define HAVE_LOCALE_H.
-   if test $ac_cv_header_locale_h = yes; then
-     INCLUDE_LOCALE_H="#include <locale.h>"
-   else
-     INCLUDE_LOCALE_H="\
-/* The system does not provide the header <locale.h>.  Take care yourself.  */"
-   fi
-   AC_SUBST(INCLUDE_LOCALE_H)
-
-   dnl Determine which catalog format we have (if any is needed)
-   dnl For now we know about two different formats:
-   dnl   Linux libc-5 and the normal X/Open format
-   if test -f $srcdir/po2tbl.sed.in; then
-      if test "$CATOBJEXT" = ".cat"; then
-	 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
-
-	 dnl Transform the SED scripts while copying because some dumb SEDs
-         dnl cannot handle comments.
-	 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
-      fi
-      dnl po2tbl.sed is always needed.
-      sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
-	 $srcdir/po2tbl.sed.in > po2tbl.sed
-   fi
-
-   dnl In the intl/Makefile.in we have a special dependency which makes
-   dnl only sense for gettext.  We comment this out for non-gettext
-   dnl packages.
-   if test "$PACKAGE" = "gettext"; then
-     GT_NO="#NO#"
-     GT_YES=
-   else
-     GT_NO=
-     GT_YES="#YES#"
-   fi
-   AC_SUBST(GT_NO)
-   AC_SUBST(GT_YES)
-
-   MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
-   AC_SUBST(MKINSTALLDIRS)
-
-   dnl *** For now the libtool support in intl/Makefile is not for real.
-   l=
-   AC_SUBST(l)
-
-   dnl Generate list of files to be processed by xgettext which will
-   dnl be included in po/Makefile.  But only do this if the po directory
-   dnl exists in srcdir and contains POTFILES.in.
-   if test -f $srcdir/po/POTFILES.in; then
-      test -d po || mkdir po
-      if test "x$srcdir" != "x."; then
-	 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
-	    posrcprefix="$srcdir/"
-	 else
-	    posrcprefix="../$srcdir/"
-	 fi
-      else
-	 posrcprefix="../"
-      fi
-      rm -f po/POTFILES
-      sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
-	 < $srcdir/po/POTFILES.in > po/POTFILES
-   fi
-  ])
-
-# Search path for a program which passes the given test.
-# Ulrich Drepper <drepper@cygnus.com>, 1996.
-#
-# This file file be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
-dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN(AM_PATH_PROG_WITH_TEST,
-[# Extract the first word of "$2", so it can be a program name with args.
-set dummy $2; ac_word=[$]2
-AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
-[case "[$]$1" in
-  /*)
-  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
-  ;;
-  *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in ifelse([$5], , $PATH, [$5]); do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      if [$3]; then
-	ac_cv_path_$1="$ac_dir/$ac_word"
-	break
-      fi
+      case "$LINGUAS" in *$lang*)
+        CATALOGS="$CATALOGS $cat"
+        XLINGUAS="$XLINGUAS $lang"
+        ;;
+      esac
     fi
   done
-  IFS="$ac_save_ifs"
-dnl If no 4th arg is given, leave the cache variable unset,
-dnl so AC_PATH_PROGS will keep looking.
-ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
-])dnl
-  ;;
-esac])dnl
-$1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
-  AC_MSG_RESULT([$]$1)
-else
-  AC_MSG_RESULT(no)
-fi
-AC_SUBST($1)dnl
-])
-
-# Check whether LC_MESSAGES is available in <locale.h>.
-# Ulrich Drepper <drepper@cygnus.com>, 1995.
-#
-# This file file be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-AC_DEFUN(AM_LC_MESSAGES,
-  [if test $ac_cv_header_locale_h = yes; then
-    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
-      [AC_TRY_LINK([#include <locale.h>], [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 locale.h file contains LC_MESSAGES.])
-    fi
-  fi])
+  LINGUAS="$XLINGUAS"
+  AC_MSG_RESULT($LINGUAS)
+fi])
===================================================================
Index: config/progtest.m4
--- config/progtest.m4	1 Jan 1970 00:00:00 -0000
+++ config/progtest.m4	8 Jul 2003 05:05:26 -0000
@@ -0,0 +1,91 @@
+# progtest.m4 serial 3 (gettext-0.12)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+# Search path for a program which passes the given test.
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  [[\\/]]* | ?:[[\\/]]*)
+    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in ifelse([$5], , $PATH, [$5]); do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          if [$3]; then
+            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+    ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
===================================================================
Index: gcc/Makefile.in
--- gcc/Makefile.in	7 Jul 2003 11:12:25 -0000	1.1103
+++ gcc/Makefile.in	8 Jul 2003 05:05:28 -0000
@@ -83,7 +83,7 @@ parsedir = $(srcdir)
 docobjdir = $(srcdir)/doc
 
 # Top build directory, relative to here.
-top_builddir = .
+top_builddir = ..
 # objdir is set by configure.
 # It's normally the absolute path to the current directory.
 objdir = @objdir@
@@ -434,11 +434,12 @@ tmpdir = /tmp
 USE_NLS = @USE_NLS@
 
 # Internationalization library.
-INTLLIBS = @INTLLIBS@
-INTLDEPS = @INTLDEPS@
+LIBINTL = @LIBINTL@
+LIBINTL_DEP = @LIBINTL_DEP@
 
 # Character encoding conversion library.
 LIBICONV = @LIBICONV@
+LIBICONV_DEP = @LIBICONV_DEP@
 
 # The GC method to be used on this system.
 GGC=@GGC@.o
@@ -682,7 +683,7 @@ LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = @FORBUILD@/libiberty/libiberty.a
 
 # Dependencies on the intl and portability libraries.
-LIBDEPS= $(INTLDEPS) $(LIBIBERTY)
+LIBDEPS= $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP)
 
 # Likewise, for use in the tools that must run on this machine
 # even if we are cross-building GCC.
@@ -690,7 +691,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
 
 # How to link with both our special library facilities
 # and the system's installed libraries.
-LIBS =	$(INTLLIBS) @LIBS@ $(LIBIBERTY) $(LIBICONV)
+LIBS = @LIBS@ $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
 
 # Any system libraries needed just for GNAT.
 SYSLIBS = @GNAT_LIBEXC@
@@ -719,7 +720,7 @@ BUILD_VARRAY = $(BUILD_PREFIX)varray.o
 # currently being compiled, in both source trees, to be examined as well.
 # libintl.h will be found in ../intl if we are using the included libintl.
 INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
-	   -I$(srcdir)/config -I$(srcdir)/../include -I../intl
+	   -I$(srcdir)/config -I$(srcdir)/../include @INCINTL@
 
 # Always use -I$(srcdir)/config when compiling.
 .c.o:
@@ -2316,8 +2317,6 @@ intl.o: intl.c $(CONFIG_H) $(SYSTEM_H) c
 	  -DLOCALEDIR=\"$(localedir)\" \
 	  -c $(srcdir)/intl.c $(OUTPUT_OPTION)
 
-$(top_builddir)/intl/libintl.a: intl.all
-
 # Make-lang.in should add dependencies of po-generated on any generated
 # files which need to be scanned by gettext (usually Yacc-generated parsers).
 po-generated: $(parsedir)/c-parse.c
@@ -3766,7 +3765,7 @@ stage1: force stage1-start lang.stage1
 stage2-start:
 	-if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
 	$(MAKE) -f libgcc.mk libgcc-stage-start stage=stage2
-	-subdirs="$(SUBDIRS)"; for dir in $subdirs; \
+	-subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
 	 do \
 	   if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
 	 done
@@ -3795,7 +3794,7 @@ stage2: force stage2-start lang.stage2
 stage3-start:
 	-if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
 	$(MAKE) -f libgcc.mk libgcc-stage-start stage=stage3
-	-subdirs="$(SUBDIRS)"; for dir in $subdirs; \
+	-subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
 	 do \
 	   if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
 	 done
@@ -3824,7 +3823,7 @@ stage3: force stage3-start lang.stage3
 stage4-start:
 	-if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
 	$(MAKE) -f libgcc.mk libgcc-stage-start stage=stage4
-	-subdirs="$(SUBDIRS)"; for dir in $subdirs; \
+	-subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
 	 do \
 	   if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
 	 done
@@ -3853,7 +3852,7 @@ stage4: force stage4-start lang.stage4
 stageprofile-start:
 	-if [ -d stageprofile ] ; then true ; else mkdir stageprofile ; fi
 	$(MAKE) -f libgcc.mk libgcc-stage-start stage=stageprofile
-	-subdirs="$(SUBDIRS)"; for dir in $subdirs; \
+	-subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
 	 do \
 	   if [ -d stageprofile/$$dir ] ; then true ; else mkdir stageprofile/$$dir ; fi ; \
 	 done
@@ -3880,7 +3879,7 @@ stageprofile: force stageprofile-start l
 stagefeedback-start:
 	-if [ -d stagefeedback ] ; then true ; else mkdir stagefeedback ; fi
 	$(MAKE) -f libgcc.mk libgcc-stage-start stage=stagefeedback
-	-subdirs="$(SUBDIRS)"; for dir in $subdirs; \
+	-subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
 	 do \
 	   if [ -d stagefeedback/$$dir ] ; then true ; else mkdir stagefeedback/$$dir ; fi ; \
 	 done
===================================================================
Index: gcc/acconfig.h
--- gcc/acconfig.h	9 Oct 2001 22:40:11 -0000	1.52
+++ gcc/acconfig.h	8 Jul 2003 05:05:28 -0000
@@ -1,18 +1,3 @@
-/* Define to 1 if NLS is requested.  */
-#undef ENABLE_NLS
-
-/* Define as 1 if you have catgets and don't want to use GNU gettext.  */
-#undef HAVE_CATGETS
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext.  */
-#undef HAVE_GETTEXT
-
-/* Define if your locale.h file contains LC_MESSAGES.  */
-#undef HAVE_LC_MESSAGES
-
-/* Define as 1 if you have the stpcpy function.  */
-#undef HAVE_STPCPY
-
 /* Define if your assembler supports specifying the maximum number
    of bytes to skip when using the GAS .p2align command.  */
 #undef HAVE_GAS_MAX_SKIP_P2ALIGN
===================================================================
Index: gcc/aclocal.m4
--- gcc/aclocal.m4	4 Jul 2003 18:18:47 -0000	1.72
+++ gcc/aclocal.m4	8 Jul 2003 05:05:28 -0000
@@ -1,6 +1,7 @@
 sinclude(../config/acx.m4)
 sinclude(../config/accross.m4)
 sinclude(../config/gettext.m4)
+sinclude(../config/progtest.m4)
 
 dnl See if stdbool.h properly defines bool and true/false.
 AC_DEFUN(gcc_AC_HEADER_STDBOOL,
@@ -687,3 +688,35 @@ ifelse([$5],[],[],[else $5])
 fi
 ]) []dnl # gcc_GAS_VERSION_GTE_IFELSE
 
+# lcmessage.m4 serial 3 (gettext-0.11.3)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+
+AC_DEFUN([AM_LC_MESSAGES],
+[
+  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+    [AC_TRY_LINK([#include <locale.h>], [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 <locale.h> file defines LC_MESSAGES.])
+  fi
+])
===================================================================
Index: gcc/configure.in
--- gcc/configure.in	8 Jul 2003 01:45:25 -0000	1.699
+++ gcc/configure.in	8 Jul 2003 05:05:33 -0000
@@ -680,7 +680,7 @@ AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
 		 fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
 		 sys/resource.h sys/param.h sys/times.h sys/stat.h \
-		 direct.h malloc.h langinfo.h ldfcn.h wchar.h)
+		 direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h)
 
 # Check for thread headers.
 AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
@@ -775,7 +775,8 @@ dnl gcc_AC_C_ENUM_BF_UNSIGNED
 AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
 	sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
 	fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \
-        scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore)
+        scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \
+        setlocale)
 
 if test x$ac_cv_func_mbstowcs = xyes; then
   AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,
@@ -836,6 +837,11 @@ esac
 AC_FUNC_VFORK
 
 AM_ICONV
+# Until we have in-tree GNU iconv:
+LIBICONV_DEP=
+AC_SUBST(LIBICONV_DEP)
+
+AM_LC_MESSAGES
 
 # We will need to find libiberty.h and ansidecl.h
 saved_CFLAGS="$CFLAGS"
@@ -1196,20 +1202,13 @@ VERSION="$gcc_version"
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
 
-# Enable NLS support by default
-AC_ARG_ENABLE(nls,
-  [  --enable-nls            use Native Language Support (default)],
-  , enable_nls=yes)
-
-# if cross compiling, disable NLS support.
-# It's not worth the trouble, at least for now.
+ZW_GNU_GETTEXT_SISTER_DIR
 
-if test "${build}" != "${host}" && test "x$enable_nls" = "xyes"; then
-  AC_MSG_WARN(Disabling NLS support for canadian cross compiler.)
-  enable_nls=no
-fi
-
-CY_GNU_GETTEXT
+# If LIBINTL contains LIBICONV, then clear LIBICONV so we don't get
+# -liconv on the link line twice.
+case "$LIBINTL" in *$LIBICONV*)
+	LIBICONV= ;;
+esac
 
 # Windows32 Registry support for specifying GCC installation paths.
 AC_ARG_ENABLE(win32-registry,
===================================================================
Index: intl/Makefile.in
--- intl/Makefile.in	4 Jul 2003 18:18:54 -0000	1.1
+++ intl/Makefile.in	8 Jul 2003 05:05:39 -0000
@@ -36,16 +36,8 @@ libdir = @libdir@
 includedir = @includedir@
 datadir = @datadir@
 localedir = $(datadir)/locale
-gettextsrcdir = $(datadir)/gettext/intl
 aliaspath = $(localedir)
 
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
-
-l = @INTL_LIBTOOL_SUFFIX_PREFIX@
-
 AR = ar
 CC = @CC@
 RANLIB = @RANLIB@
@@ -57,7 +49,7 @@ LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 DEFS = -DHAVE_CONFIG_H
 
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+COMPILE = $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(DEFS-$@) $(INCLUDES)
 
 HEADERS = \
   gmo.h \
@@ -68,8 +60,7 @@ HEADERS = \
   eval-plural.h \
   localcharset.h \
   relocatable.h \
-  os2compat.h \
-  libgnuintl.h.in
+  libgnuintl.h
 SOURCES = \
   bindtextdom.c \
   dcgettext.c \
@@ -92,7 +83,6 @@ SOURCES = \
   localename.c \
   log.c \
   osdep.c \
-  os2compat.c \
   intl-compat.c
 OBJECTS = \
   bindtextdom.o \
@@ -118,8 +108,13 @@ OBJECTS = \
   osdep.o \
   intl-compat.o
 
+DEFS-dcigettext.o = -DLOCALEDIR="\"$(localedir)\""
+DEFS-localealias.o = -DLOCALE_ALIAS_PATH="\"$(aliaspath)\""
+DEFS-localcharset.o = -DLIBDIR="\"$(libdir)\""
+DEFS-relocatable.o = -DINSTALLDIR="\"$(libdir)\""
+
 all: all-@USE_INCLUDED_LIBINTL@
-all-yes: libintl.a libintl.h
+all-yes: libintl.a libintl.h config.intl
 all-no: # nothing
 
 libintl.a: $(OBJECTS)
@@ -128,7 +123,7 @@ libintl.a: $(OBJECTS)
 	$(RANLIB) $@
 
 libintl.h: $(srcdir)/libgnuintl.h
-	cat $(srcdir)/libgnuintl.h > $@
+	cp $(srcdir)/libgnuintl.h $@
 
 .SUFFIXES:
 .SUFFIXES: .c .y .o
@@ -140,7 +135,7 @@ libintl.h: $(srcdir)/libgnuintl.h
 	$(YACC) $(YFLAGS) --output $@ $<
 	rm -f $*.h
 
-INCLUDES = -I. -I$(srcdir) -I..
+INCLUDES = -I. -I$(srcdir)
 
 check: all
 
@@ -167,35 +162,27 @@ localcharset.o: localcharset.h
 localealias.o localcharset.o relocatable.o: relocatable.h
 
 tags: TAGS
-
 TAGS: $(HEADERS) $(SOURCES)
-	here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
+	here=`pwd`; cd $(srcdir) && \
+		etags -o $$here/TAGS $(HEADERS) $(SOURCES)
 
 ctags: CTAGS
-
 CTAGS: $(HEADERS) $(SOURCES)
-	here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
+	here=`pwd`; cd $(srcdir) && \
+		ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
 
 id: ID
-
 ID: $(HEADERS) $(SOURCES)
-	here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
-
+	here=`pwd`; cd $(srcdir) && \
+		mkid -f$$here/ID $(HEADERS) $(SOURCES)
 
 mostlyclean:
-	rm -f *.a *.la *.o *.obj *.lo core core.*
-	rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
-	rm -f -r .libs _libs
+	rm -f *.a *.la *.o *.obj *.lo core core.* libintl.h
 
 clean: mostlyclean
 
 distclean: clean
 	rm -f Makefile ID TAGS
-	if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
-	  rm -f ChangeLog.inst $(DISTFILES.normal); \
-	else \
-	  : ; \
-	fi
 
 maintainer-clean: distclean
 
@@ -206,6 +193,9 @@ distdir:
 
 Makefile: Makefile.in config.status
 	CONFIG_HEADERS= CONFIG_FILES=Makefile $(SHELL) ./config.status
+
+config.intl: config.intl.in config.status
+	CONFIG_HEADERS= CONFIG_FILES=config.intl $(SHELL) ./config.status
 
 config.h: cstamp-h; @:
 cstamp-h: config.h.in config.status
===================================================================
Index: intl/README
--- intl/README	4 Jul 2003 18:18:54 -0000	1.1
+++ intl/README	8 Jul 2003 05:05:39 -0000
@@ -10,13 +10,14 @@ gettext developers first.  However, note
 * The files COPYING.LIB-2.0 and COPYING.LIB-2.1 are redundant with the
   top-level COPYING.LIB and have therefore been removed.
 
-* The files config.charset, ref-add.sin, and ref-del.sin are not used
-  in this setup and have therefore been removed.
+* The files config.charset, ref-add.sin, ref-del.sin, os2compat.c,
+  and os2compat.h are not used in this setup and have therefore been 
+  removed.
 
 * aclocal.m4 was constructed following the instructions printed by
   "gettextize" from the files that gettext 0.12.1 installs in
   $(prefix)/share/aclocal.
 
-* configure.in and Makefile.in were written for this directory
-  layout, by Zack Weinberg <zack@codesourcery.com>.  Please direct
-  patches for these files to gcc-patches@gcc.gnu.org.
+* configure.in, config.intl.in, and Makefile.in were written for this
+  directory layout, by Zack Weinberg <zack@codesourcery.com>.  Please
+  direct patches for these files to gcc-patches@gcc.gnu.org.
===================================================================
Index: intl/aclocal.m4
--- intl/aclocal.m4	4 Jul 2003 18:18:54 -0000	1.1
+++ intl/aclocal.m4	8 Jul 2003 05:05:40 -0000
@@ -674,97 +674,7 @@ AC_DEFUN([AM_MKINSTALLDIRS],
   AC_SUBST(MKINSTALLDIRS)
 ])
 
-# progtest.m4 serial 3 (gettext-0.12)
-dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
-
-# Search path for a program which passes the given test.
-
-dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
-dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN([AM_PATH_PROG_WITH_TEST],
-[
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-# Find out how to test for executable files. Don't use a zero-byte file,
-# as systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
-  ac_executable_p="test -x"
-else
-  ac_executable_p="test -f"
-fi
-rm -f conf$$.file
-
-# Extract the first word of "$2", so it can be a program name with args.
-set dummy $2; ac_word=[$]2
-AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
-[case "[$]$1" in
-  [[\\/]]* | ?:[[\\/]]*)
-    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
-    ;;
-  *)
-    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in ifelse([$5], , $PATH, [$5]); do
-      IFS="$ac_save_IFS"
-      test -z "$ac_dir" && ac_dir=.
-      for ac_exec_ext in '' $ac_executable_extensions; do
-        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
-          if [$3]; then
-            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
-            break 2
-          fi
-        fi
-      done
-    done
-    IFS="$ac_save_IFS"
-dnl If no 4th arg is given, leave the cache variable unset,
-dnl so AC_PATH_PROGS will keep looking.
-ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
-])dnl
-    ;;
-esac])dnl
-$1="$ac_cv_path_$1"
-if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
-  AC_MSG_RESULT([$]$1)
-else
-  AC_MSG_RESULT(no)
-fi
-AC_SUBST($1)dnl
-])
+sinclude(../config/progtest.m4)
 
 # lib-link.m4 serial 4 (gettext-0.12)
 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
===================================================================
Index: intl/config.intl.in
--- intl/config.intl.in	1 Jan 1970 00:00:00 -0000
+++ intl/config.intl.in	8 Jul 2003 05:05:40 -0000
@@ -0,0 +1,12 @@
+# This file records the configuration of libintl in a form that
+# can be read back in by a configure script in a sister directory.
+# See config/gettext.m4 for its use.
+
+USE_NLS='@USE_NLS@'
+LIBINTL='@LIBINTL@'
+LIBINTL_DEP='@LIBINTL_DEP@'
+INCINTL='@INCINTL@'
+
+XGETTEXT='@XGETTEXT@'
+GMSGFMT='@GMSGFMT@'
+POSUB='@POSUB@'
===================================================================
Index: intl/configure.in
--- intl/configure.in	4 Jul 2003 18:18:54 -0000	1.1
+++ intl/configure.in	8 Jul 2003 05:05:41 -0000
@@ -1,19 +1,10 @@
 AC_PREREQ(2.13)
 AC_INIT(gettext.c)
-AC_CONFIG_AUX_DIR(..)
 AC_CONFIG_HEADER(config.h)
 AM_GNU_GETTEXT_VERSION(0.12.1)
 AM_GNU_GETTEXT
 
 dnl This replaces the extensive use of DEFS in the original Makefile.in.
-AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir",
-[Define to the directory holding the locale files.])
-AC_DEFINE_UNQUOTED(LOCALE_ALIAS_PATH, "$aliaspath",
-[Define to the locale alias path.])
-AC_DEFINE_UNQUOTED(LIBDIR, "$libdir",
-[Define to the library directory.])
-AC_DEFINE_UNQUOTED(INSTALLDIR, "$libdir",
-[Define to the installation directory.])
 AC_DEFINE(IN_LIBINTL, 1, [Define because this is libintl.])
 AC_DEFINE(IN_LIBRARY, 1, [Define because this is a library.])
 AC_DEFINE(DEPENDS_ON_LIBICONV, 1, [Define because we depend on libiconv.])
@@ -24,4 +15,13 @@ AC_DEFINE(set_relocation_prefix, libintl
 AC_DEFINE(relocate, libintl_relocate,
 [Define this entry point correctly.])
 
-AC_OUTPUT(Makefile)
+dnl Additional info for config.intl.
+LIBINTL_DEP=   AC_SUBST(LIBINTL_DEP)
+INCINTL=       AC_SUBST(INCINTL)
+
+if test $USE_INCLUDED_LIBINTL = yes; then
+  LIBINTL_DEP='${top_builddir}/intl/libintl.a'
+  INCINTL='-I${top_builddir}/intl'
+fi
+
+AC_OUTPUT(Makefile config.intl)
===================================================================
Index: intl/os2compat.c
--- intl/os2compat.c	4 Jul 2003 18:18:54 -0000	1.1
+++ intl/os2compat.c	1 Jan 1970 00:00:00 -0000
@@ -1,98 +0,0 @@
-/* OS/2 compatibility functions.
-   Copyright (C) 2001-2002 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU Library General Public License as published
-   by the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program 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
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-   USA.  */
-
-#define OS2_AWARE
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/param.h>
-
-/* A version of getenv() that works from DLLs */
-extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue);
-
-char *
-_nl_getenv (const char *name)
-{
-  unsigned char *value;
-  if (DosScanEnv (name, &value))
-    return NULL;
-  else
-    return value;
-}
-
-/* A fixed size buffer.  */
-char libintl_nl_default_dirname[MAXPATHLEN+1];
-
-char *_nlos2_libdir = NULL;
-char *_nlos2_localealiaspath = NULL;
-char *_nlos2_localedir = NULL;
-
-static __attribute__((constructor)) void
-nlos2_initialize ()
-{
-  char *root = getenv ("UNIXROOT");
-  char *gnulocaledir = getenv ("GNULOCALEDIR");
-
-  _nlos2_libdir = gnulocaledir;
-  if (!_nlos2_libdir)
-    {
-      if (root)
-        {
-          size_t sl = strlen (root);
-          _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1);
-          memcpy (_nlos2_libdir, root, sl);
-          memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1);
-        }
-      else
-        _nlos2_libdir = LIBDIR;
-    }
-
-  _nlos2_localealiaspath = gnulocaledir;
-  if (!_nlos2_localealiaspath)
-    {
-      if (root)
-        {
-          size_t sl = strlen (root);
-          _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1);
-          memcpy (_nlos2_localealiaspath, root, sl);
-          memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1);
-        }
-     else
-        _nlos2_localealiaspath = LOCALE_ALIAS_PATH;
-    }
-
-  _nlos2_localedir = gnulocaledir;
-  if (!_nlos2_localedir)
-    {
-      if (root)
-        {
-          size_t sl = strlen (root);
-          _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1);
-          memcpy (_nlos2_localedir, root, sl);
-          memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1);
-        }
-      else
-        _nlos2_localedir = LOCALEDIR;
-    }
-
-  if (strlen (_nlos2_localedir) <= MAXPATHLEN)
-    strcpy (libintl_nl_default_dirname, _nlos2_localedir);
-}
===================================================================
Index: intl/os2compat.h
--- intl/os2compat.h	4 Jul 2003 18:18:54 -0000	1.1
+++ intl/os2compat.h	1 Jan 1970 00:00:00 -0000
@@ -1,46 +0,0 @@
-/* OS/2 compatibility defines.
-   This file is intended to be included from config.h
-   Copyright (C) 2001-2002 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU Library General Public License as published
-   by the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program 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
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-   USA.  */
-
-/* When included from os2compat.h we need all the original definitions */
-#ifndef OS2_AWARE
-
-#undef LIBDIR
-#define LIBDIR			_nlos2_libdir
-extern char *_nlos2_libdir;
-
-#undef LOCALEDIR
-#define LOCALEDIR		_nlos2_localedir
-extern char *_nlos2_localedir;
-
-#undef LOCALE_ALIAS_PATH
-#define LOCALE_ALIAS_PATH	_nlos2_localealiaspath
-extern char *_nlos2_localealiaspath;
-
-#endif
-
-#undef HAVE_STRCASECMP
-#define HAVE_STRCASECMP 1
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
-
-/* We have our own getenv() which works even if library is compiled as DLL */
-#define getenv _nl_getenv
-
-/* Older versions of gettext used -1 as the value of LC_MESSAGES */
-#define LC_MESSAGES_COMPAT (-1)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]