Subject: libexec/ld.elf_so vs. MKPICINSTALL=no
To: None <tech-toolchain@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: tech-toolchain
Date: 02/22/2003 08:23:03
Revision 1.48 of libexec/ld.elf_so/Makefile tried to work around
missing LIBC_PIC:

-DPADD+=	${LIBC_PIC}
+DPADD+=	${CLIBOBJ}/libc_pic.a ${LIBC_PIC}
+
+# One of these may not exist at link time, so avoid make errors.
+${DPADD}:
+	@true

I don't know if it used to work but it doesn't now (and the @true rule
looks extremely strange anyway).


Currently, a build with MKPICINSTALL=no will fail in libexec/ld.so_elf
with "don't know how to make ${LIBC_PIC}", if LIBC_PIC doesn't exist.
But if ${CLIBOBJ}/libc_pic.a doesn't exist, make considers it ok.

Experiments show that it's the .MADE: ${LIBC_PIC} rule in bsd.prog.mk
that causes make to consider non-existing ${LIBC_PIC} to be
"non-existent and no sources...", while non-existent
${CLIBOBJ}/libc_pic.a is just a "library" (cf make.c:Make_OODate)


My make(1) clue is not enough to figure what's the right way to deal
with it.  Does the following patch to libexec/ld.elf_so/Makefile looks
correct?

Index: Makefile
===================================================================
RCS file: /cvsroot/src/libexec/ld.elf_so/Makefile,v
retrieving revision 1.59
diff -u -r1.59 Makefile
--- Makefile	2002/10/05 15:52:15	1.59
+++ Makefile	2003/02/22 05:22:16
@@ -50,11 +50,10 @@
 .endif
 
 LDADD+=	-L${CLIBOBJ} -L${DESTDIR}${LIBDIR} -non_shared -lc_pic
-DPADD+=	${CLIBOBJ}/libc_pic.a ${LIBC_PIC}
-
-# One of these may not exist at link time, so avoid make errors.
-${DPADD}:
-	@true
+.if ${MKPICINSTALL} != "no" 
+DPADD+=	${LIBC_PIC}
+.endif
+DPADD+=	${CLIBOBJ}/libc_pic.a
 
 STRIPFLAG=
 

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen