diff options
author | jperkin <jperkin@pkgsrc.org> | 2021-11-29 16:14:23 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2021-11-29 16:14:23 +0000 |
commit | 55d916c83dc800368c80038b28ab7afe2eddd236 (patch) | |
tree | 41c05d644645eb03ce890d1042e9389209862419 /mk | |
parent | 4e5b916ece1c6923550dd003c589866d8d30c5a1 (diff) | |
download | pkgsrc-55d916c83dc800368c80038b28ab7afe2eddd236.tar.gz |
mk: Use OPSYS_VERSION where appropriate.
Should improve readability and in some cases avoid potential failure due to
string comparisons being used. No other functional change intended.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.prefs.mk | 12 | ||||
-rw-r--r-- | mk/compiler/sunpro.mk | 6 | ||||
-rw-r--r-- | mk/platform/Darwin.mk | 28 | ||||
-rw-r--r-- | mk/platform/NetBSD.mk | 7 | ||||
-rw-r--r-- | mk/platform/OpenBSD.mk | 4 | ||||
-rw-r--r-- | mk/platform/SunOS.mk | 6 | ||||
-rw-r--r-- | mk/tools/tools.FreeBSD.mk | 4 |
7 files changed, 33 insertions, 34 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index 14712513152..fcf0d882335 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prefs.mk,v 1.412 2021/11/29 15:57:55 jperkin Exp $ +# $NetBSD: bsd.prefs.mk,v 1.413 2021/11/29 16:14:23 jperkin Exp $ # # This file includes the mk.conf file, which contains the user settings. # @@ -564,14 +564,14 @@ X11_TYPE?= modular X11BASE?= /usr/openwin . elif ${OPSYS} == "Cygwin" || ${OPSYS} == "IRIX" || ${OPSYS} == "OSF1" || ${OPSYS} == "HPUX" X11BASE?= /usr -. elif !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*) +. elif ${OPSYS} == "Darwin" +. if ${OPSYS_VERSION} < 100500 X11BASE?= /usr/X11R6 -. elif !empty(MACHINE_PLATFORM:MDarwin-9.*-*) || \ - !empty(MACHINE_PLATFORM:MDarwin-10.*-*) || \ - !empty(MACHINE_PLATFORM:MDarwin-11.*-*) +. elif ${OPSYS_VERSION} < 100800 X11BASE?= /usr/X11 -. elif !empty(MACHINE_PLATFORM:MDarwin-??.*-*) +. else X11BASE?= /opt/X11 +. endif . elif ${OPSYS} == "NetBSD" X11BASE?= /usr/X11R7 . elif exists(/usr/X11R7/lib/libX11.so) diff --git a/mk/compiler/sunpro.mk b/mk/compiler/sunpro.mk index 0e216e03b63..d6d84010ffc 100644 --- a/mk/compiler/sunpro.mk +++ b/mk/compiler/sunpro.mk @@ -1,4 +1,4 @@ -# $NetBSD: sunpro.mk,v 1.49 2015/05/03 23:16:41 joerg Exp $ +# $NetBSD: sunpro.mk,v 1.50 2021/11/29 16:14:23 jperkin Exp $ # # This is the compiler definition for the SUNWspro C compiler. # @@ -64,9 +64,9 @@ PKG_${t}:= ${SUNWSPROBASE}/bin/${n} # See PR 37200 .if !empty(USE_LANGUAGES:Mc99) _WRAP_EXTRA_ARGS.CC+= -xc99 -. if !empty(MACHINE_PLATFORM:MSunOS-5.[89]-*) +. if ${OPSYS_VERSION} < 051000 _WRAP_EXTRA_ARGS.CC+= -xc99=all,no_lib -. endif +. endif .endif # The Solaris linker uses "-R" for rpath directives. diff --git a/mk/platform/Darwin.mk b/mk/platform/Darwin.mk index ee3df0b092d..1cb443dcd9f 100644 --- a/mk/platform/Darwin.mk +++ b/mk/platform/Darwin.mk @@ -1,4 +1,4 @@ -# $NetBSD: Darwin.mk,v 1.109 2021/11/29 12:38:44 jperkin Exp $ +# $NetBSD: Darwin.mk,v 1.110 2021/11/29 16:14:23 jperkin Exp $ # # Variable definitions for the Darwin operating system. @@ -30,14 +30,15 @@ # # Tiger (and earlier) use Xfree 4.4.0 (and earlier) -.if empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*) +.if ${OPSYS_VERSION} < 100500 X11_TYPE?= native .endif .if !defined(CPP) || ${CPP} == "cpp" CPP= ${CC} -E ${CPP_PRECOMP_FLAGS} .endif -.if empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*) +# bash invoked as /bin/sh on Leopard and newer does not support echo -n. +.if ${OPSYS_VERSION} >= 100500 ECHO_N?= /bin/echo -n .else ECHO_N?= ${ECHO} -n @@ -153,14 +154,14 @@ _WRAP_EXTRA_ARGS.LD+= -arch arm64 # in the SDK directory. It may be that this can be set for all versions, but # for now keep the legacy behaviour and limit it to Big Sur onwards only. # -.if ${OS_VERSION:R} >= 20 +.if ${OPSYS_VERSION} >= 110000 DARWIN_NO_SYSTEM_LIBS= # defined _OPSYS_LIB_DIRS?= ${OSX_SDK_PATH}/usr/lib .else _OPSYS_LIB_DIRS?= /usr/lib .endif -.if ${OS_VERSION:R} >= 6 +.if ${OPSYS_VERSION} >= 100200 _OPSYS_HAS_INET6= yes # IPv6 is standard .else _OPSYS_HAS_INET6= no # IPv6 is not standard @@ -183,8 +184,8 @@ KRB5_DEFAULT?= mit-krb5 # # Builtin overrides. # -.if !empty(OS_VERSION:M[56].*) -USE_BUILTIN.dl= no # Darwin-[56].* uses devel/dlcompat +.if ${OPSYS_VERSION} < 100300 +USE_BUILTIN.dl= no # Use devel/dlcompat .endif # Builtin defaults which make sense for this platform. @@ -252,15 +253,14 @@ MAKE_ENV+= MACOSX_DEPLOYMENT_TARGET="10.4" CONFIGURE_ENV+= gl_cv_func_getcwd_abort_bug=no .endif -# Use "/bin/ksh" for buildlink3 wrapper script to improve build performance. -.if (!empty(OS_VERSION:M9.*) || !empty(OS_VERSION:M1[0-2].*) || \ - !empty(OS_VERSION:M1[4-9].*)) && \ - exists(/bin/ksh) +# Use ksh to improve wrapper script performance, except on buggy Mavericks. +.if exists(/bin/ksh) +. if ${OPSYS_VERSION} < 100900 || ${OPSYS_VERSION} >= 101000 WRAPPER_BIN_SH?= /bin/ksh +. endif .endif -# strnlen(3) wasn't included until Lion, pull it in from libnbcompat on prior -# releases. -.if ${OS_VERSION:R} < 11 +# strnlen(3) is available from Lion onwards +.if ${OPSYS_VERSION} < 100700 _OPSYS_MISSING_FEATURES+= strnlen .endif diff --git a/mk/platform/NetBSD.mk b/mk/platform/NetBSD.mk index 7f5e131ceb4..e4e03080cad 100644 --- a/mk/platform/NetBSD.mk +++ b/mk/platform/NetBSD.mk @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.mk,v 1.69 2021/11/09 12:04:43 nia Exp $ +# $NetBSD: NetBSD.mk,v 1.70 2021/11/29 16:14:23 jperkin Exp $ # # Variable definitions for the NetBSD operating system. @@ -43,7 +43,7 @@ ULIMIT_CMD_cputime?= ulimit -t `ulimit -H -t` # Native X11 is only supported on NetBSD-5 and later. # On NetBSD-5, native X11 has enough issues that we default # to modular. -.if empty(MACHINE_PLATFORM:MNetBSD-[0-5].*) +.if ${OPSYS_VERSION} >= 060000 X11_TYPE?= native .endif @@ -137,10 +137,9 @@ OPSYS_HAS_TIMERFD= # defined .endif # Register support for FORTIFY (with GCC) -.if !empty(OS_VERSION:M[2-6].*) # Disable on older versions, see: # http://mail-index.netbsd.org/pkgsrc-users/2017/08/07/msg025435.html -.else +.if ${OPSYS_VERSION} >= 070000 _OPSYS_SUPPORTS_FORTIFY=yes .endif diff --git a/mk/platform/OpenBSD.mk b/mk/platform/OpenBSD.mk index 9badf8121dd..c5af4bd6bb5 100644 --- a/mk/platform/OpenBSD.mk +++ b/mk/platform/OpenBSD.mk @@ -1,4 +1,4 @@ -# $NetBSD: OpenBSD.mk,v 1.43 2021/11/09 12:04:43 nia Exp $ +# $NetBSD: OpenBSD.mk,v 1.44 2021/11/29 16:14:23 jperkin Exp $ # # Variable definitions for the OpenBSD operating system. @@ -61,7 +61,7 @@ _OPSYS_SHLIB_TYPE_cmd= \ *) echo ELF ;; \ esac _PATCH_CAN_BACKUP= yes # native patch(1) can make backups -.if ${OS_VERSION} >= 3.4 +.if ${OPSYS_VERSION} >= 030400 _PATCH_BACKUP_ARG?= -V simple -z # switch to patch(1) for backup suffix .else _PATCH_BACKUP_ARG?= -V simple -b # switch to patch(1) for backup suffix diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk index 99efa57e12d..c3ec403cd6b 100644 --- a/mk/platform/SunOS.mk +++ b/mk/platform/SunOS.mk @@ -1,4 +1,4 @@ -# $NetBSD: SunOS.mk,v 1.81 2021/11/23 10:37:59 nia Exp $ +# $NetBSD: SunOS.mk,v 1.82 2021/11/29 16:14:23 jperkin Exp $ # # Variable definitions for the SunOS/Solaris operating system. @@ -40,7 +40,7 @@ MOTIF_TYPE_DEFAULT?= motif .endif # Use SMF by default if available. -.if empty(OS_VERSION:M5.[0-9]) +.if ${OPSYS_VERSION} >= 051000 INIT_SYSTEM?= smf .endif @@ -75,7 +75,7 @@ _OPSYS_MISSING_FEATURES= asprintf _OPSYS_MISSING_FEATURES+= err .endif -.if ${OS_VERSION} != "5.11" +.if ${OPSYS_VERSION} < 051100 _OPSYS_MISSING_FEATURES+= strnlen .endif diff --git a/mk/tools/tools.FreeBSD.mk b/mk/tools/tools.FreeBSD.mk index 29680fe5e5b..b05d6f24864 100644 --- a/mk/tools/tools.FreeBSD.mk +++ b/mk/tools/tools.FreeBSD.mk @@ -1,11 +1,11 @@ -# $NetBSD: tools.FreeBSD.mk,v 1.48 2019/02/12 18:40:16 triaxx Exp $ +# $NetBSD: tools.FreeBSD.mk,v 1.49 2021/11/29 16:14:23 jperkin Exp $ # # System-supplied tools for the FreeBSD operating system. TOOLS_PLATFORM.[?= [ # shell builtin TOOLS_PLATFORM.awk?= /usr/bin/awk TOOLS_PLATFORM.basename?= /usr/bin/basename -.if empty(MACHINE_PLATFORM:MFreeBSD-[0-4].*-*) && empty(MACHINE_PLATFORM:MFreeBSD-5.[0-3]-*) +.if ${OPSYS_VERSION} >= 050400 TOOLS_PLATFORM.bsdtar?= /usr/bin/tar .endif TOOLS_PLATFORM.byacc?= /usr/bin/yacc |