summaryrefslogtreecommitdiff
path: root/mk/scripts
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-08-02 16:00:33 +0000
committerjlam <jlam@pkgsrc.org>2007-08-02 16:00:33 +0000
commit21129d3f69e09fb0ddad8790ba1a1efa2905add5 (patch)
tree19dcf5ca5333ac7cb192d5719cbe8972f19cf8f1 /mk/scripts
parent75b9a802514853f9855e124bd0e766a4b3207579 (diff)
downloadpkgsrc-21129d3f69e09fb0ddad8790ba1a1efa2905add5.tar.gz
Don't bother using environment variables to pass info the shlib-type
shell script. Just specify everything on the command line. Also, since shlib-type is a plain-old shell script with no bells and whistles, we can safely run it with "sh" and not "${SH}", which is necessary because "${SH}" isn't defined at this point.
Diffstat (limited to 'mk/scripts')
-rwxr-xr-xmk/scripts/shlib-type21
1 files changed, 10 insertions, 11 deletions
diff --git a/mk/scripts/shlib-type b/mk/scripts/shlib-type
index f6626a85843..4bcc2f8bf84 100755
--- a/mk/scripts/shlib-type
+++ b/mk/scripts/shlib-type
@@ -1,33 +1,32 @@
# /bin/sh
#
-# $NetBSD: shlib-type,v 1.2 2007/08/02 15:46:33 jlam Exp $
+# $NetBSD: shlib-type,v 1.3 2007/08/02 16:00:33 jlam Exp $
#
# This code is derived from software contributed to The NetBSD Foundation
# by Alistair Crooks.
#
# This script returns the the library format for the platform. If
-# the library format is "ELF/a.out", then we inspect "pkg_info" (which
-# should exist on a pkgsrc system) to determine the correct object
-# format (either ELF or a.out).
+# the library format is "ELF/a.out", then we inspect the specified
+# path to determine the correct object format (either ELF or a.out).
#
if [ -z "${FILE_CMD}" ]; then
FILE_CMD=file
fi
-if [ -z "${PKG_INFO_CMD}" ]; then
- PKG_INFO_CMD=/usr/sbin/pkg_info
-fi
-if [ $# -eq 0 ]; then
- echo 1>&2 "usage: shlib-type libformat"
+if [ $# -lt 2 ]; then
+ echo 1>&2 "usage: shlib-type libformat binpath"
exit 1
fi
+libformat="$1"
+binpath="$2"
+
sotype=none
case "$1" in
ELF/a.out)
- if [ -f "${PKG_INFO_CMD}" ]; then
- output=`${FILE_CMD} ${PKG_INFO_CMD} 2>/dev/null`
+ if [ -f "$binpath" ]; then
+ output=`${FILE_CMD} $binpath 2>/dev/null`
else
output=
fi