pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   jlam
Date:           Wed May 31 22:55:01 UTC 2017

Modified Files:
        pkgsrc/mk: bsd.pkg.mk bsd.prefs.mk
        pkgsrc/mk/platform: BSDOS.mk FreeBSD.mk NetBSD.mk OpenBSD.mk

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.2022 -r1.2023 pkgsrc/mk/bsd.pkg.mk
cvs rdiff -u -r1.390 -r1.391 pkgsrc/mk/bsd.prefs.mk
cvs rdiff -u -r1.34 -r1.35 pkgsrc/mk/platform/BSDOS.mk \
    pkgsrc/mk/platform/FreeBSD.mk
cvs rdiff -u -r1.49 -r1.50 pkgsrc/mk/platform/NetBSD.mk
cvs rdiff -u -r1.41 -r1.42 pkgsrc/mk/platform/OpenBSD.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/bsd.pkg.mk
diff -u pkgsrc/mk/bsd.pkg.mk:1.2022 pkgsrc/mk/bsd.pkg.mk:1.2023
--- pkgsrc/mk/bsd.pkg.mk:1.2022 Thu May  4 18:30:56 2017
+++ pkgsrc/mk/bsd.pkg.mk        Wed May 31 22:55:01 2017
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.2022 2017/05/04 18:30:56 joerg Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.2023 2017/05/31 22:55:01 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -371,11 +371,6 @@ USE_TOOLS+=                                                                \
 # bsd.wrapper.mk
 USE_TOOLS+=    expr
 
-# scripts/shlib-type
-.if ${_OPSYS_SHLIB_TYPE} == "ELF/a.out"
-USE_TOOLS+=    file
-.endif
-
 # INSTALL/DEINSTALL script framework
 .include "pkginstall/bsd.pkginstall.mk"
 

Index: pkgsrc/mk/bsd.prefs.mk
diff -u pkgsrc/mk/bsd.prefs.mk:1.390 pkgsrc/mk/bsd.prefs.mk:1.391
--- pkgsrc/mk/bsd.prefs.mk:1.390        Sun Apr 16 23:12:37 2017
+++ pkgsrc/mk/bsd.prefs.mk      Wed May 31 22:55:01 2017
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.390 2017/04/16 23:12:37 khorben Exp $
+# $NetBSD: bsd.prefs.mk,v 1.391 2017/05/31 22:55:01 jlam Exp $
 #
 # This file includes the mk.conf file, which contains the user settings.
 #
@@ -378,6 +378,9 @@ SHAREMODE?=         ${DOCMODE}
 PKG_FAIL_REASON+=      "missing mk/platform/${OPSYS}.mk"
 .endif
 
+# Set default SHLIB_TYPE to the ${OPSYS}-specific shared library type.
+SHLIB_TYPE?=           ${_OPSYS_SHLIB_TYPE}
+
 PKGDIRMODE?=           755
 
 # A meta-package is a package that does not have any files and whose

Index: pkgsrc/mk/platform/BSDOS.mk
diff -u pkgsrc/mk/platform/BSDOS.mk:1.34 pkgsrc/mk/platform/BSDOS.mk:1.35
--- pkgsrc/mk/platform/BSDOS.mk:1.34    Thu Mar 10 16:58:19 2016
+++ pkgsrc/mk/platform/BSDOS.mk Wed May 31 22:55:01 2017
@@ -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 gzi
 _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
Index: pkgsrc/mk/platform/FreeBSD.mk
diff -u pkgsrc/mk/platform/FreeBSD.mk:1.34 pkgsrc/mk/platform/FreeBSD.mk:1.35
--- pkgsrc/mk/platform/FreeBSD.mk:1.34  Thu May 18 01:29:56 2017
+++ pkgsrc/mk/platform/FreeBSD.mk       Wed May 31 22:55:01 2017
@@ -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 gzi
 _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

Index: pkgsrc/mk/platform/NetBSD.mk
diff -u pkgsrc/mk/platform/NetBSD.mk:1.49 pkgsrc/mk/platform/NetBSD.mk:1.50
--- pkgsrc/mk/platform/NetBSD.mk:1.49   Thu Oct 27 12:29:17 2016
+++ pkgsrc/mk/platform/NetBSD.mk        Wed May 31 22:55:01 2017
@@ -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 gzi
 _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

Index: pkgsrc/mk/platform/OpenBSD.mk
diff -u pkgsrc/mk/platform/OpenBSD.mk:1.41 pkgsrc/mk/platform/OpenBSD.mk:1.42
--- pkgsrc/mk/platform/OpenBSD.mk:1.41  Fri Oct 28 09:21:08 2016
+++ pkgsrc/mk/platform/OpenBSD.mk       Wed May 31 22:55:01 2017
@@ -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 gzi
 _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



Home | Main Index | Thread Index | Old Index