OSDN Git Service

Some more buildroot-motivated fixes. Avoid installing some headers, as
authorManuel Novoa III <mjn3@codepoet.org>
Wed, 3 Sep 2003 07:23:15 +0000 (07:23 -0000)
committerManuel Novoa III <mjn3@codepoet.org>
Wed, 3 Sep 2003 07:23:15 +0000 (07:23 -0000)
well as stub libintl, depending on configuration.

Makefile
libc/misc/Makefile
libc/misc/gnu/obstack.c

index 4523799..bcf1c35 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,10 @@ noconfig_targets := menuconfig config oldconfig randconfig \
 TOPDIR=./
 include Rules.mak
 
-DIRS = extra ldso libc libcrypt libresolv libnsl libutil libm libpthread libintl
+DIRS = extra ldso libc libcrypt libresolv libnsl libutil libm libpthread
+ifeq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
+       DIRS += libintl
+endif
 
 ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
 
@@ -48,7 +51,9 @@ ifeq ($(strip $(HAVE_SHARED)),y)
        @$(MAKE) -C libutil shared
        @$(MAKE) -C libm shared
        @$(MAKE) -C libpthread shared
+ifeq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
        @$(MAKE) -C libintl shared
+endif
 else
 ifeq ($(SHARED_TARGET),)
        @echo
@@ -177,6 +182,23 @@ install_dev:
        install -d $(PREFIX)$(DEVEL_PREFIX)/include
        -install -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)/lib/
        tar -chf - include | tar -xf - -C $(PREFIX)$(DEVEL_PREFIX);
+ifneq ($(strip $(UCLIBC_HAS_WCHAR)),y)
+       # Remove wide char headers if no wide char support.
+       rm $(PREFIX)$(DEVEL_PREFIX)/include/wctype.h
+       rm $(PREFIX)$(DEVEL_PREFIX)/include/wchar.h
+endif
+ifneq ($(strip $(UCLIBC_HAS_LOCALE)),y)
+       # Remove iconv header if no locale support.
+       rm $(PREFIX)$(DEVEL_PREFIX)/include/iconv.h
+endif
+ifneq ($(strip $(UCLIBC_HAS_XLOCALE)),y)
+       # Remove xlocale header if no extended locale support.
+       rm $(PREFIX)$(DEVEL_PREFIX)/include/xlocale.h
+endif
+ifneq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
+       # Remove libintl header if no gettext support.
+       rm $(PREFIX)$(DEVEL_PREFIX)/include/libintl.h
+endif
        -@for i in `find  $(PREFIX)$(DEVEL_PREFIX) -type d` ; do \
            chmod -f 755 $$i; chmod -f 644 $$i/*.h; \
        done;
index 24a9635..8758982 100644 (file)
@@ -27,7 +27,7 @@ include $(TOPDIR)Rules.mak
 
 DIRS = assert ctype dirent file fnmatch glob internals \
        mntent syslog time utmp sysvipc statfs \
-       error ttyent gnu search intl locale
+       error ttyent gnu search locale
 ifeq ($(strip $(UCLIBC_HAS_REGEX)),y)
 DIRS += regex
 endif
@@ -40,6 +40,9 @@ endif
 ifeq ($(strip $(UCLIBC_HAS_WCHAR)),y)
 DIRS += wctype wchar
 endif
+ifeq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
+DIRS += intl
+endif
 
 all: libc.a
 
index a3f7f3f..0db0ad3 100644 (file)
@@ -463,7 +463,8 @@ _obstack_memory_used (h)
 \f
 /* Define the error handler.  */
 # ifndef _
-#  if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
+/* #  if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC */
+#  ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 #   include <libintl.h>
 #   ifndef _
 #    define _(Str) __dcgettext (NULL, Str, LC_MESSAGES)