From cb2f05ed72575a2d5769a7772a935eda461ad0b8 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 17 Oct 1995 02:14:34 +0000 Subject: [PATCH] * locale/Makefile (aux): Add SYS_libc. * locale/SYS_libc.c: New file. * libc-symbols.h (_): New macro. * configure.in (libc_cv_asm_set_directive): Link program into conftest instead of letting it default to a.out. --- ChangeLog | 7 +++++++ configure.in | 2 +- libc-symbols.h | 19 +++++++++++++++++++ locale/Makefile | 2 +- locale/SYS_libc.c | 4 ++++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 locale/SYS_libc.c diff --git a/ChangeLog b/ChangeLog index f427e33..c0f61f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ Mon Oct 16 03:22:37 1995 Roland McGrath + * locale/Makefile (aux): Add SYS_libc. + * locale/SYS_libc.c: New file. + * libc-symbols.h (_): New macro. + + * configure.in (libc_cv_asm_set_directive): Link program into + conftest instead of letting it default to a.out. + * elf/Makefile (install-others): Add missing slash. * elf/ldd.sh.in: Prepend `./' to relative file names so ld.so diff --git a/configure.in b/configure.in index dbfb695..ead6813 100644 --- a/configure.in +++ b/configure.in @@ -373,7 +373,7 @@ extern int glibc_conftest_frobozz; main () { printf ("%d\n", glibc_conftest_frobozz); } EOF if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ - conftest.s conftest1.c 1>&AC_FD_CC 2>&AC_FD_CC; then + -o conftest conftest.s conftest1.c 1>&AC_FD_CC 2>&AC_FD_CC; then libc_cv_asm_set_directive=yes else libc_cv_asm_set_directive=no diff --git a/libc-symbols.h b/libc-symbols.h index 1b6d1d0..7997c8d 100644 --- a/libc-symbols.h +++ b/libc-symbols.h @@ -46,7 +46,26 @@ Cambridge, MA 02139, USA. */ tests this symbol to see if it is being compiled as part of the C library. */ #define _LIBC 1 +/* + + + Define the macro `_' for conveniently marking translatable strings + in the libc source code. */ +#include +extern const char _libc_intl_domainname[]; +#ifdef dgettext +/* This is defined as an optimizing macro, so use it. */ +#define _(msgid) dgettext (_libc_intl_domainname, (msgid)) +#else +/* Be sure to use only the __ name when `dgettext' is a plain function + instead of an optimizing macro. */ +#define _(msgid) __dgettext (_libc_intl_domainname, (msgid)) +#endif + +/* + +*/ /* The symbols in all the user (non-_) macros are C symbols. Predefined should be HAVE_WEAK_SYMBOLS and/or HAVE_ELF and/or HAVE_GNU_LD. HAVE_WEAK_SYMBOLS is implied by the other two. HAVE_GNU_LD without diff --git a/locale/Makefile b/locale/Makefile index 1a37f44..8865fc3 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -28,7 +28,7 @@ distribute = localeinfo.h categories.def \ keyword.gperf keyword.h localedef.h token.h error.h routines = setlocale loadlocale localeconv nl_langinfo categories = ctype messages monetary numeric time collate -aux = $(categories:%=lc-%) $(categories:%=C-%) +aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc others = localedef locale install-bin = localedef locale extra-objs = $(localedef-modules:=.o) $(locale-modules:=.o) \ diff --git a/locale/SYS_libc.c b/locale/SYS_libc.c new file mode 100644 index 0000000..99db8e6 --- /dev/null +++ b/locale/SYS_libc.c @@ -0,0 +1,4 @@ +/* Define a constant for the dgettext domainname for libc internal messages, + so the string constant is not repeated in dozens of object files. */ + +const char _libc_intl_domainname[] = "SYS_libc"; -- 2.7.4