summaryrefslogtreecommitdiff
path: root/mk/platform
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2017-05-31 22:55:01 +0000
committerjlam <jlam@pkgsrc.org>2017-05-31 22:55:01 +0000
commit1736ec7d3842096a90ccd4b495c54b6112ca2a2f (patch)
tree7f75d2a479481f19d0e963e6fa99877a8233c7bc /mk/platform
parent910f60a4bf41ed4bd5967ccd747e67eaa861a064 (diff)
downloadpkgsrc-1736ec7d3842096a90ccd4b495c54b6112ca2a2f.tar.gz
Move detection of shared library type into the platform file.
Only four platforms, all BSDs, need to resolve "ELF/a.out" into either ELF or a.out. Calculate it directly in the platform file and return the value in ${_OPSYS_SHLIB_TYPE} and export that value in bsd.prefs.mk as ${SHLIB_TYPE}. Instead of requiring the file(1) tool, we can expect the base system of those BSDs to have /usr/bin/file, so make use of it directly.
Diffstat (limited to 'mk/platform')
-rw-r--r--mk/platform/BSDOS.mk12
-rw-r--r--mk/platform/FreeBSD.mk12
-rw-r--r--mk/platform/NetBSD.mk12
-rw-r--r--mk/platform/OpenBSD.mk12
4 files changed, 40 insertions, 8 deletions
diff --git a/mk/platform/BSDOS.mk b/mk/platform/BSDOS.mk
index c5245977ccd..c6b4afee846 100644
--- a/mk/platform/BSDOS.mk
+++ b/mk/platform/BSDOS.mk
@@ -1,4 +1,4 @@
-# $NetBSD: BSDOS.mk,v 1.34 2016/03/10 16:58:19 jperkin Exp $
+# $NetBSD: BSDOS.mk,v 1.35 2017/05/31 22:55:01 jlam Exp $
#
# Variable definitions for the BSD/OS operating system.
@@ -50,7 +50,15 @@ _OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
_OPSYS_PERL_REQD= # no base version of perl required
_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
-_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_OPSYS_SHLIB_TYPE= ${_OPSYS_SHLIB_TYPE_cmd:sh} # shared library type
+_OPSYS_SHLIB_TYPE_cmd= \
+ output=`/usr/bin/file /sbin/sysctl`; \
+ case $$output in \
+ *ELF*dynamically*) echo ELF ;; \
+ *shared*library*) echo a.out ;; \
+ *dynamically*) echo a.out ;; \
+ *) echo ELF ;; \
+ esac
_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
_PATCH_BACKUP_ARG?= -V simple -b -z # switch to patch(1) for backup suffix
_USE_RPATH= yes # add rpath to LDFLAGS
diff --git a/mk/platform/FreeBSD.mk b/mk/platform/FreeBSD.mk
index ffc25bff70d..1ef291df4fa 100644
--- a/mk/platform/FreeBSD.mk
+++ b/mk/platform/FreeBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: FreeBSD.mk,v 1.34 2017/05/18 01:29:56 khorben Exp $
+# $NetBSD: FreeBSD.mk,v 1.35 2017/05/31 22:55:01 jlam Exp $
#
# Variable definitions for the FreeBSD operating system.
@@ -47,7 +47,15 @@ _OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
_OPSYS_PERL_REQD= # no base version of perl required
_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
-_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_OPSYS_SHLIB_TYPE= ${_OPSYS_SHLIB_TYPE_cmd:sh} # shared library type
+_OPSYS_SHLIB_TYPE_cmd= \
+ output=`/usr/bin/file /sbin/sysctl`; \
+ case $$output in \
+ *ELF*dynamically*) echo ELF ;; \
+ *shared*library*) echo a.out ;; \
+ *dynamically*) echo a.out ;; \
+ *) echo ELF ;; \
+ esac
_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
_PATCH_BACKUP_ARG?= -V simple -b # switch to patch(1) for backup suffix
_USE_RPATH= yes # add rpath to LDFLAGS
diff --git a/mk/platform/NetBSD.mk b/mk/platform/NetBSD.mk
index 8a1a9c9d550..63aca1ff295 100644
--- a/mk/platform/NetBSD.mk
+++ b/mk/platform/NetBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.mk,v 1.49 2016/10/27 12:29:17 wiz Exp $
+# $NetBSD: NetBSD.mk,v 1.50 2017/05/31 22:55:01 jlam Exp $
#
# Variable definitions for the NetBSD operating system.
@@ -71,7 +71,15 @@ _OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
_OPSYS_PERL_REQD= # no base version of perl required
_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
-_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_OPSYS_SHLIB_TYPE= ${_OPSYS_SHLIB_TYPE_cmd:sh} # shared library type
+_OPSYS_SHLIB_TYPE_cmd= \
+ output=`/usr/bin/file /sbin/sysctl`; \
+ case $$output in \
+ *ELF*dynamically*) echo ELF ;; \
+ *shared*library*) echo a.out ;; \
+ *dynamically*) echo a.out ;; \
+ *) echo ELF ;; \
+ esac
_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
_PATCH_BACKUP_ARG?= -V simple --suffix # switch to patch(1) for backup suffix
_USE_RPATH= yes # add rpath to LDFLAGS
diff --git a/mk/platform/OpenBSD.mk b/mk/platform/OpenBSD.mk
index 706f13735c6..818f2df3531 100644
--- a/mk/platform/OpenBSD.mk
+++ b/mk/platform/OpenBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: OpenBSD.mk,v 1.41 2016/10/28 09:21:08 jperkin Exp $
+# $NetBSD: OpenBSD.mk,v 1.42 2017/05/31 22:55:01 jlam Exp $
#
# Variable definitions for the OpenBSD operating system.
@@ -51,7 +51,15 @@ _OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
_OPSYS_PERL_REQD= # no base version of perl required
_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
-_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_OPSYS_SHLIB_TYPE= ${_OPSYS_SHLIB_TYPE_cmd:sh} # shared library type
+_OPSYS_SHLIB_TYPE_cmd= \
+ output=`/usr/bin/file /sbin/sysctl`; \
+ case $$output in \
+ *ELF*dynamically*) echo ELF ;; \
+ *shared*library*) echo a.out ;; \
+ *dynamically*) echo a.out ;; \
+ *) echo ELF ;; \
+ esac
_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
.if ${OS_VERSION} >= 3.4
_PATCH_BACKUP_ARG?= -V simple -z # switch to patch(1) for backup suffix