Add DESTDIR support for crt{begin,end}.o (powerpc only so far)
authorniklas <niklas@openbsd.org>
Wed, 15 Jan 1997 00:36:56 +0000 (00:36 +0000)
committerniklas <niklas@openbsd.org>
Wed, 15 Jan 1997 00:36:56 +0000 (00:36 +0000)
share/mk/bsd.prog.mk
sys/arch/powerpc/patches

index e1b31f5..86a21eb 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: bsd.prog.mk,v 1.7 1996/12/08 14:42:32 downsj Exp $
+#      $OpenBSD: bsd.prog.mk,v 1.8 1997/01/15 00:36:56 niklas Exp $
 #      $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $
 #      @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
 
 
 CFLAGS+=       ${COPTS}
 
+.if (${MACHINE_ARCH} == "powerpc")
+CRTBEGIN?=       ${DESTDIR}/usr/lib/crtbegin.o
+CRTEND?=         ${DESTDIR}/usr/lib/crtend.o
+.endif
+
 LIBCRT0?=      ${DESTDIR}/usr/lib/crt0.o
 LIBC?=         ${DESTDIR}/usr/lib/libc.a
 LIBCOMPAT?=    ${DESTDIR}/usr/lib/libcompat.a
@@ -69,12 +74,12 @@ LOBJS+=     ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
 .if defined(OBJS) && !empty(OBJS)
 .if defined(DESTDIR)
 
-${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
-       ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${OBJS} ${LDADD} -lgcc -lc -lgcc
+${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD}
+       ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${CRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${CRTEND}
 
 .else
 
-${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
+${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD}
        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
 
 .endif # defined(DESTDIR)
index c64d0d2..c869028 100644 (file)
@@ -131,24 +131,6 @@ diff -r1.9 fdisk.c
 ---
 >      if (getshort(&mboot.signature) != BOOT_MAGIC) {
 >              warnx("invalid fdisk partition table found!\n");
-Index: src/share/mk/bsd.prog.mk
-#      Support DESTDIR compilation under elf.
-#      This is needed for alpha, but not currently
-#      needed for mips because they still use stabs.
-===================================================================
-RCS file: /cvs/src/share/mk/bsd.prog.mk,v
-retrieving revision 1.7
-diff -r1.7 bsd.prog.mk
-14a15,19
-> .if (${MACHINE_ARCH} == "powerpc")
-> CRTBEGIN?=       ${DESTDIR}/usr/lib/crtbegin.o
-> CRTEND?=         ${DESTDIR}/usr/lib/crtend.o
-> .endif
-> 
-73c78
-<      ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${OBJS} ${LDADD} -lgcc -lc -lgcc
----
->      ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${CRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${CRTEND}
 Index: src/sys/kern/vfs_cache.c
 # Probably a bug in the port, but this makes the system MANY TIMES
 # more stablility.