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

Re: locale support on hpcmips



山本です。

From: "T.SHIOZAKI" <AoiMoe@imou.to>
> したがって、無用に Makefile が複雑になるようなら、
> いっそ常に付けるようにしてしまった方がいいでしょう。

無用ということはないと思いますが、
トレードオフですよね...。
# あまり share/mk をいじりたくないというのも... ;)

とりあえずパッチ作ってみたので(動くかどうかは知らない:D)
添付しますけど、
.if ${MKPICLIB} == "no"
CFLAGS+= -DDLRUNE
.endif
くらいのほうがいいですかねえ。

---
YAMAMOTO Takashi<yamt@mwd.biglobe.ne.jp>
Index: bsd.lib.mk
===================================================================
RCS file: /cvs/cvsroot/sharesrc/share/mk/bsd.lib.mk,v
retrieving revision 1.189
diff -u -r1.189 bsd.lib.mk
--- bsd.lib.mk	2001/11/02 07:25:58	1.189
+++ bsd.lib.mk	2001/11/13 00:21:14
@@ -84,8 +84,10 @@
 # SHLIB_LDENDFILE:	support .o file, call C++ file-level destructors
 # FPICFLAGS:		flags for ${FC} to compile .[fF] files to .so objects.
 # CPPICFLAGS:		flags for ${CPP} to preprocess .[sS] files for ${AS}
-# CPICFLAGS:		flags for ${CC} to compile .[cC] files to .so objects.
-# CAPICFLAGS		flags for {$CC} to compiling .[Ss] files
+# CPICFLAGS:		flags for ${CC} to compile .[cC] files to pic objects.
+# CSHLIBFLAGS:		flags for ${CC} to compile .[cC] files to .so objects.
+#			(usually includes ${CPICFLAGS})
+# CAPICFLAGS:		flags for ${CC} to compiling .[Ss] files
 #		 	(usually just ${CPPPICFLAGS} ${CPICFLAGS})
 # APICFLAGS:		flags for ${AS} to assemble .[sS] to .so objects.
 
@@ -135,6 +137,16 @@
 
 MKPICLIB?= yes
 
+.if ${MKPICLIB} != "no"
+CSHLIBFLAGS+= ${CPICFLAGS}
+.endif
+
+.if defined(CSHLIBFLAGS) && !empty(CSHLIBFLAGS)
+MKSHLIBOBJS= yes
+.else
+MKSHLIBOBJS= no
+.endif
+
 # Platform-independent linker flags for ELF shared libraries
 .if ${OBJECT_FMT} == "ELF"
 SHLIB_SOVERSION=	${SHLIB_MAJOR}
@@ -168,10 +180,10 @@
 
 .c.so:
 .if defined(COPTS) && !empty(COPTS:M*-g*)
-	${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+	${COMPILE.c} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .else
-	@echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
-	@${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+	@echo ${COMPILE.c:Q} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
+	@${COMPILE.c} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}.o
 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
 	@rm -f ${.TARGET}.o
 .endif
@@ -201,10 +213,10 @@
 
 .cc.so .C.so:
 .if defined(COPTS) && !empty(COPTS:M*-g*)
-	${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+	${COMPILE.cc} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .else
 	@echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
-	@${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+	@${COMPILE.cc} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}.o
 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
 	@rm -f ${.TARGET}.o
 .endif
@@ -264,10 +276,10 @@
 
 .m.so:
 .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
-	${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+	${COMPILE.m} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .else
 	@echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
-	@${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+	@${COMPILE.m} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}.o
 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
 	@rm -f ${.TARGET}.o
 .endif
@@ -306,7 +318,15 @@
 
 .if ${MKPIC} != "no"
 .if ${MKPICLIB} == "no"
+.if ${MKSHLIBOBJS} != "no"
+# make _pic.a, which isn't really pic,
+# since it's needed for making shared lib.
+# but don't install it.
+SOLIB=lib${LIB}_pic.a
+SOBJS+=${OBJS:.o=.so}
+.else
 SOLIB=lib${LIB}.a
+.endif
 .else
 SOLIB=lib${LIB}_pic.a
 _LIBS+=${SOLIB}
Index: Makefile
===================================================================
RCS file: /cvs/cvsroot/basesrc/lib/libc/Makefile,v
retrieving revision 1.99
diff -u -r1.99 Makefile
--- Makefile	2001/09/02 13:13:41	1.99
+++ Makefile	2001/11/13 00:51:35
@@ -137,4 +137,4 @@
 # workaround for lib/libc/locale: build singlebyte setlocale() for libc.a,
 # multibyte for libc.so.  the quirk should be removed when we support
 # dlopen() from within statically linked binaries.
-CPICFLAGS+=	-DDLRUNE
+CSHLIBFLAGS+=	-DDLRUNE