summaryrefslogtreecommitdiff
path: root/share/mk
diff options
context:
space:
mode:
authorDale S. Rahn <rahnds@cvs.openbsd.org>2000-07-15 12:45:05 +0000
committerDale S. Rahn <rahnds@cvs.openbsd.org>2000-07-15 12:45:05 +0000
commit4086f8c110ab9d1e9eb174d12ed26629ec7ad645 (patch)
treedb063aa5984df5c28cec5cf2f683ab7900916116 /share/mk
parent0353fe4699dd92a0a5e736c168b324edfd5e5a60 (diff)
Build shared libraries as expected for the new libexec/ld.so. Currently
this is only used for the powerpc. The difference between this and the mips (both ELF) is that powerpc expects the soname field to be libX.{major}.{minor} and is to be built from the _pic version of the library.
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/bsd.lib.mk19
1 files changed, 13 insertions, 6 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 32754a2d021..341f2d2ce27 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -1,4 +1,4 @@
-# $OpenBSD: bsd.lib.mk,v 1.22 2000/05/16 06:15:00 niklas Exp $
+# $OpenBSD: bsd.lib.mk,v 1.23 2000/07/15 12:45:04 rahnds Exp $
# $NetBSD: bsd.lib.mk,v 1.67 1996/01/17 20:39:26 mycroft Exp $
# @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
@@ -169,18 +169,25 @@ lib${LIB}_pic.a:: ${SOBJS}
@${AR} cq lib${LIB}_pic.a `${LORDER} ${SOBJS} | tsort -q`
${RANLIB} lib${LIB}_pic.a
-.if (${MACHINE_ARCH} != "mips")
+.if (${MACHINE_ARCH} == "mips")
+lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}.a ${DPADD}
+ @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)
+ @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
+ $(LD) -x -shared --whole-archive -soname lib${LIB}.so.${SHLIB_MAJOR} \
+ -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib${LIB}.a ${LDADD}
+.elif (${MACHINE_ARCH} == "powerpc" )
lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}_pic.a ${DPADD}
@echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)
@rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
- $(LD) -x -Bshareable -Bforcearchive \
+ $(LD) -x -shared --whole-archive \
+ -soname lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib${LIB}_pic.a ${LDADD}
.else
-lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}.a ${DPADD}
+lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}_pic.a ${DPADD}
@echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)
@rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
- $(LD) -x -shared --whole-archive -soname lib${LIB}.so.${SHLIB_MAJOR} \
- -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib${LIB}.a ${LDADD}
+ $(LD) -x -Bshareable -Bforcearchive \
+ -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib${LIB}_pic.a ${LDADD}
.endif
LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}