summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2004-01-10 09:52:56 +0000
committergrant <grant@pkgsrc.org>2004-01-10 09:52:56 +0000
commitf15ae156a41b82bfb46ec857a1a9f67b281454e0 (patch)
treeca780a05c5fb9fca50a7445eaa0a261ee879894d /mk/bsd.pkg.mk
parente9311a8f2d23901b57452be8b8d9ea796f97b0d2 (diff)
downloadpkgsrc-f15ae156a41b82bfb46ec857a1a9f67b281454e0.tar.gz
backout previous until it can be done a better way.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r--mk/bsd.pkg.mk50
1 files changed, 38 insertions, 12 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 5724d7cd67b..159a7bea5f4 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1341 2004/01/10 08:38:43 grant Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1342 2004/01/10 09:52:56 grant Exp $
#
# This file is in the public domain.
#
@@ -98,14 +98,6 @@ CHECK_SHLIBS?= YES # run check-shlibs after install
SHLIB_HANDLING?= YES # do automatic shared lib handling
NOCLEAN?= NO # don't clean up after update
-.if exists(/usr/lib/libc.dylib)
-SHLIB_TYPE= dylib
-.elif ${OPSYS} == "AIX"
-SHLIB_TYPE= aixlib
-.else
-SHLIB_TYPE= ${OBJECT_FMT}
-.endif
-
PKGBASE?= ${PKGNAME:C/-[^-]*$//}
PKGVERSION?= ${PKGNAME:C/^.*-//}
PKGWILDCARD?= ${PKGBASE}-[0-9]*
@@ -2875,10 +2867,11 @@ do-shlib-handling:
${_PKG_SILENT}${_PKG_DEBUG} \
sos=`${EGREP} -h -x '.*/lib[^/]+\.so' ${PLIST} || ${TRUE}`; \
if [ "$$sos" != "" ]; then \
+ shlib_type=`${MAKE} ${MAKEFLAGS} show-shlib-type`; \
if [ "${SHLIB_PLIST_MODE}" = "0" ]; then \
- ${ECHO_MSG} "${_PKGSRC_IN}> [Automatic ${SHLIB_TYPE} shared object handling]"; \
+ ${ECHO_MSG} "${_PKGSRC_IN}> [Automatic $$shlib_type shared object handling]"; \
fi; \
- case "${SHLIB_TYPE}" in \
+ case "$$shlib_type" in \
ELF) ;; \
"a.out") \
${AWK} '${_AOUT_AWK}' <${PLIST} >${PLIST}.tmp ; \
@@ -2974,6 +2967,38 @@ check-shlibs:
fi
.endif # NO_PKG_REGISTER
+
+.if !target(show-shlib-type)
+# Show the shared lib type being built: one of ELF, a.out, dylib, or none
+.PHONY: show-shlib-type
+show-shlib-type:
+. if exists(/usr/lib/libc.dylib)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ ${ECHO} "dylib"
+. elif ${OPSYS} == "AIX"
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ ${ECHO} "aixlib"
+. else
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ cd ${WRKDIR} && \
+ sotype=none; \
+ if [ "X${MKPIC}" != "Xno" -a "X${NOPIC}" = "X" ]; then \
+ ${ECHO} "int main() { exit(0); }" > a.$$$$.c; \
+ ${CC} ${CFLAGS} a.$$$$.c -o a.$$$$.out; \
+ case `${FILE_CMD} a.$$$$.out` in \
+ *ELF*dynamically*) \
+ sotype=ELF ;; \
+ *shared*library*) \
+ sotype="a.out" ;; \
+ *dynamically*) \
+ sotype="a.out" ;; \
+ esac; \
+ fi; \
+ ${ECHO} "$$sotype"; \
+ ${RM} -f a.$$$$.c a.$$$$.out
+. endif # libc.dylib
+.endif
+
.PHONY: acquire-extract-lock acquire-patch-lock acquire-tools-lock
.PHONY: acquire-buildlink-lock acquire-configure-lock acquire-build-lock
acquire-extract-lock:
@@ -4479,7 +4504,8 @@ print-PLIST:
${_PKG_SILENT}${_PKG_DEBUG}\
${ECHO} '@comment $$'NetBSD'$$'
${_PKG_SILENT}${_PKG_DEBUG}\
- case "${SHLIB_TYPE}" in \
+ shlib_type=`${MAKE} ${MAKEFLAGS} show-shlib-type`; \
+ case $$shlib_type in \
"a.out") genlinks=1 ;; \
*) genlinks=0 ;; \
esac; \