From 191bf464071d7cd21095b9f1d119c05fd8306493 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 19 Oct 2001 15:17:39 +0000 Subject: 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/intl.h | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'gcc/intl.h') diff --git a/gcc/intl.h b/gcc/intl.h index 07b72b5..8a9b35a 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 */ -- cgit v1.1