Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc 1. fix build problem CITRUS=no



details:   https://anonhg.NetBSD.org/src/rev/86ec2f8c83a6
branches:  trunk
changeset: 755271:86ec2f8c83a6
user:      tnozaki <tnozaki%NetBSD.org@localhost>
date:      Sun May 30 08:28:53 2010 +0000

description:
1. fix build problem CITRUS=no
2. make CITRUS={yes,no} knob friendly with libc/compat.

diffstat:

 lib/libc/Makefile             |   6 +++++-
 lib/libc/Makefile.inc         |   4 +++-
 lib/libc/citrus/Makefile.inc  |   6 +-----
 lib/libc/locale/Makefile.inc  |  24 +++++++++---------------
 lib/libc/locale/bsdctype.c    |   7 ++-----
 lib/libc/locale/bsdctype.h    |   4 +++-
 lib/libc/locale/iswctype_sb.c |   6 +++---
 lib/libc/locale/localeio.c    |  10 +++++-----
 8 files changed, 31 insertions(+), 36 deletions(-)

diffs (223 lines):

diff -r 79cf62b7a109 -r 86ec2f8c83a6 lib/libc/Makefile
--- a/lib/libc/Makefile Sun May 30 07:57:08 2010 +0000
+++ b/lib/libc/Makefile Sun May 30 08:28:53 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.141 2010/04/25 00:54:46 joerg Exp $
+#      $NetBSD: Makefile,v 1.142 2010/05/30 08:28:53 tnozaki Exp $
 #      @(#)Makefile    8.2 (Berkeley) 2/3/94
 #
 # All library objects contain sccsid strings by default; they may be
@@ -57,7 +57,9 @@
 .include "${.CURDIR}/atomic/Makefile.inc"
 .include "${.CURDIR}/cdb/Makefile.inc"
 .include "${.CURDIR}/db/Makefile.inc"
+.if (${CITRUS} == "yes")
 .include "${.CURDIR}/citrus/Makefile.inc"
+.endif
 .include "${.CURDIR}/compat-43/Makefile.inc"
 .include "${.CURDIR}/dlfcn/Makefile.inc"
 .include "${.CURDIR}/gdtoa/Makefile.inc"
@@ -132,7 +134,9 @@
 # workaround for I18N stuffs: build singlebyte setlocale() for libc.a,
 # multibyte for libc.so.  the quirk should be removed when we support
 # dlopen() from within statically linked binaries.
+.if (${CITRUS} == "yes")
 CSHLIBFLAGS+=  -D_I18N_DYNAMIC
+.endif
 
 .include <bsd.lib.mk>
 
diff -r 79cf62b7a109 -r 86ec2f8c83a6 lib/libc/Makefile.inc
--- a/lib/libc/Makefile.inc     Sun May 30 07:57:08 2010 +0000
+++ b/lib/libc/Makefile.inc     Sun May 30 08:28:53 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.5 2010/03/22 01:29:29 mrg Exp $
+#      $NetBSD: Makefile.inc,v 1.6 2010/05/30 08:28:53 tnozaki Exp $
 #      @(#)Makefile    8.2 (Berkeley) 2/3/94
 #
 # All library objects contain sccsid strings by default; they may be
@@ -21,6 +21,8 @@
 
 USE_SHLIBDIR=  yes
 
+CITRUS?=       yes
+
 .include <bsd.own.mk>
 
 WARNS=4
diff -r 79cf62b7a109 -r 86ec2f8c83a6 lib/libc/citrus/Makefile.inc
--- a/lib/libc/citrus/Makefile.inc      Sun May 30 07:57:08 2010 +0000
+++ b/lib/libc/citrus/Makefile.inc      Sun May 30 08:28:53 2010 +0000
@@ -1,11 +1,8 @@
-#      $NetBSD: Makefile.inc,v 1.7 2009/01/11 02:46:24 christos Exp $
+#      $NetBSD: Makefile.inc,v 1.8 2010/05/30 08:28:53 tnozaki Exp $
 
 # sources
 .PATH: ${ARCHDIR}/citrus ${.CURDIR}/citrus
 
-CITRUS?=       yes
-
-.if ${CITRUS} == "yes"
 MODULE_SHLIB_MAJOR!= . ${NETBSDSRCDIR}/lib/i18n_module/shlib_version ; echo $$major
 CPPFLAGS.citrus_module.c+=-DI18NMODULE_MAJOR=${MODULE_SHLIB_MAJOR}
 SRCS+= citrus_bcs.c citrus_bcs_strtol.c citrus_bcs_strtoul.c \
@@ -26,4 +23,3 @@
 CPPFLAGS.citrus_lc_numeric.c+= -I${LIBCDIR}/locale
 CPPFLAGS.citrus_lc_time.c+=    -I${LIBCDIR}/locale
 CPPFLAGS.citrus_lc_messages.c+=        -I${LIBCDIR}/locale
-.endif
diff -r 79cf62b7a109 -r 86ec2f8c83a6 lib/libc/locale/Makefile.inc
--- a/lib/libc/locale/Makefile.inc      Sun May 30 07:57:08 2010 +0000
+++ b/lib/libc/locale/Makefile.inc      Sun May 30 08:28:53 2010 +0000
@@ -1,5 +1,5 @@
 #      from: @(#)Makefile.inc  5.1 (Berkeley) 2/18/91
-#      $NetBSD: Makefile.inc,v 1.54 2009/01/11 02:46:28 christos Exp $
+#      $NetBSD: Makefile.inc,v 1.55 2010/05/30 08:28:53 tnozaki Exp $
 
 # locale sources
 .PATH: ${ARCHDIR}/locale ${.CURDIR}/locale
@@ -12,20 +12,7 @@
        wcstol.c wcstoll.c wcstoimax.c wcstoul.c wcstoull.c wcstoumax.c \
        wcstod.c wcstof.c wcstold.c wcscoll.c wcsxfrm.c wcsftime.c
 
-.if ${CITRUS} == "no"
-RUNE=          no
-.endif
-
-RUNE?=         yes
-
-.if ${RUNE} == "no"
-# singlebyte locale - dummy
-CPPFLAGS+=     -UWITH_RUNE
-SRCS+= aliasname.c bsdctype.c localeio.c \
-       multibyte_sb.c iswctype_sb.c \
-       localeio_lc_ctype.c localeio_lc_monetary.c \
-       localeio_lc_numeric.c localeio_lc_time.c
-.else
+.if (${CITRUS} == "yes")
 # citrus multibyte locale support
 # we have quirk for libc.a - see the last part of lib/libc/Makefile
 CPPFLAGS+=     -DWITH_RUNE -I${.CURDIR}
@@ -36,6 +23,13 @@
 CPPFLAGS.runetable.c+=         -I${LIBCDIR}/citrus
 CPPFLAGS.multibyte_c90.c+=     -I${LIBCDIR}/citrus
 CPPFLAGS.multibyte_amd1.c+=    -I${LIBCDIR}/citrus
+.else
+# singlebyte locale - dummy
+CPPFLAGS+=     -UWITH_RUNE
+SRCS+= aliasname.c bsdctype.c localeio.c \
+       multibyte_sb.c iswctype_sb.c \
+       localeio_lc_ctype.c localeio_lc_monetary.c \
+       localeio_lc_numeric.c localeio_lc_time.c
 .endif
 
 MAN+=  setlocale.3 nl_langinfo.3
diff -r 79cf62b7a109 -r 86ec2f8c83a6 lib/libc/locale/bsdctype.c
--- a/lib/libc/locale/bsdctype.c        Sun May 30 07:57:08 2010 +0000
+++ b/lib/libc/locale/bsdctype.c        Sun May 30 08:28:53 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bsdctype.c,v 1.3 2010/05/22 06:38:15 tnozaki Exp $ */
+/* $NetBSD: bsdctype.c,v 1.4 2010/05/30 08:28:53 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,12 +28,9 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: bsdctype.c,v 1.3 2010/05/22 06:38:15 tnozaki Exp $");
+__RCSID("$NetBSD: bsdctype.c,v 1.4 2010/05/30 08:28:53 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
-#include <sys/types.h>
-#include <ctype.h>
-
 #include "bsdctype.h"
 
 const _BSDCTypeLocale _DefaultBSDCTypeLocale = {
diff -r 79cf62b7a109 -r 86ec2f8c83a6 lib/libc/locale/bsdctype.h
--- a/lib/libc/locale/bsdctype.h        Sun May 30 07:57:08 2010 +0000
+++ b/lib/libc/locale/bsdctype.h        Sun May 30 08:28:53 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bsdctype.h,v 1.2 2009/01/11 02:46:28 christos Exp $ */
+/* $NetBSD: bsdctype.h,v 1.3 2010/05/30 08:28:53 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -29,6 +29,8 @@
 #ifndef _BSDCTYPE_H_
 #define _BSDCTYPE_H_
 
+#include "ctype_local.h"
+
 typedef struct _BSDCTypeLocale {
        const unsigned char     *ctype_tab;
        const short             *tolower_tab;
diff -r 79cf62b7a109 -r 86ec2f8c83a6 lib/libc/locale/iswctype_sb.c
--- a/lib/libc/locale/iswctype_sb.c     Sun May 30 07:57:08 2010 +0000
+++ b/lib/libc/locale/iswctype_sb.c     Sun May 30 08:28:53 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iswctype_sb.c,v 1.8 2009/01/11 02:46:28 christos Exp $ */
+/* $NetBSD: iswctype_sb.c,v 1.9 2010/05/30 08:28:53 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: iswctype_sb.c,v 1.8 2009/01/11 02:46:28 christos Exp $");
+__RCSID("$NetBSD: iswctype_sb.c,v 1.9 2010/05/30 08:28:53 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -105,7 +105,7 @@
                 if (!strcmp(charclass, _wctype_decl[i].name))
                        return (wctype_t)__UNCONST(&_wctype_decl[i]);
        }
-       return (wctrans_t)NULL;
+       return (wctype_t)NULL;
 }
 
 struct _wctrans_priv_t {
diff -r 79cf62b7a109 -r 86ec2f8c83a6 lib/libc/locale/localeio.c
--- a/lib/libc/locale/localeio.c        Sun May 30 07:57:08 2010 +0000
+++ b/lib/libc/locale/localeio.c        Sun May 30 08:28:53 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: localeio.c,v 1.3 2009/01/11 02:46:28 christos Exp $    */
+/*     $NetBSD: localeio.c,v 1.4 2010/05/30 08:28:53 tnozaki Exp $     */
 /*
  * Copyright (c) 2008, The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: localeio.c,v 1.3 2009/01/11 02:46:28 christos Exp $");
+__RCSID("$NetBSD: localeio.c,v 1.4 2010/05/30 08:28:53 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -54,11 +54,11 @@
 __loadlocale(const char *name, size_t nstr, size_t nbytes,
     size_t localesize, void *currentlocale)
 {
-       int fd, i, ret;
+       int fd, ret;
        unsigned char **ap, *buf, *bp, *cp, *cbp, *ebp;
        unsigned char ***locale;
        struct stat st;
-       size_t bufsize;
+       size_t i, bufsize;
 
        _DIAGASSERT(name != NULL);
        _DIAGASSERT(localesize != 0);
@@ -86,7 +86,7 @@
        }
 
        ap = (unsigned char **)(void *)buf;
-       for (i = 0, ebp = buf + bufsize; i < nstr; i++) {
+       for (i = (size_t)0, ebp = buf + bufsize; i < nstr; i++) {
                ap[i] = bp;
                while (bp != ebp && *bp != '\n')
                        bp++;



Home | Main Index | Thread Index | Old Index