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:   riastradh
Date:           Tue Apr 16 21:15:45 UTC 2024

Modified Files:
        pkgsrc/mk: bsd.prefs.mk

Log Message:
bsd.prefs.mk: Fix MACHINE_ARCH and OS_VERSION references.

1. Use MACHINE_ARCH before the NATIVE_MACHINE_ARCH switcheroo -- this
   one is special because the native MACHINE_ARCH is baked into
   make(1) to begin with, and we switch MACHINE_ARCH to be the
   cross-compilation target later on.

2. Use NATIVE_OS_VERSION for determining things related to the native
   OS version before OS_VERSION is defined.  Otherwise it might not
   work very well to expand OS_VERSION eagerly when it's not defined
   yet!

Should fix problems on FreeBSD, Haiku, and Linux in the wake of my
cross-compilation changes:

https://mail-index.netbsd.org/pkgsrc-changes/2024/04/12/msg296929.html

While here: Add comments on what HOST_MACHINE_ARCH is for.


To generate a diff of this commit:
cvs rdiff -u -r1.447 -r1.448 pkgsrc/mk/bsd.prefs.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.prefs.mk
diff -u pkgsrc/mk/bsd.prefs.mk:1.447 pkgsrc/mk/bsd.prefs.mk:1.448
--- pkgsrc/mk/bsd.prefs.mk:1.447        Fri Apr 12 19:58:22 2024
+++ pkgsrc/mk/bsd.prefs.mk      Tue Apr 16 21:15:45 2024
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.447 2024/04/12 19:58:22 riastradh Exp $
+# $NetBSD: bsd.prefs.mk,v 1.448 2024/04/16 21:15:45 riastradh Exp $
 #
 # This file includes the mk.conf file, which contains the user settings.
 #
@@ -158,6 +158,9 @@ MACHINE_GNU_ARCH?=          ${GNU_ARCH.${MACHINE
 .if ${NATIVE_OPSYS} == "NetBSD"
 NATIVE_LOWER_OPSYS?=   netbsd
 
+# Ensure HOST_MACHINE_ARCH is set for native-but-compat builds, such as
+# building i386 packages on an amd64 system with compat32 libraries.
+# This is not quite a cross-build, so not NATIVE_ or CROSS_ here.
 .  if !defined(HOST_MACHINE_ARCH)
 HOST_MACHINE_ARCH!=    ${UNAME} -m
 MAKEFLAGS+=            HOST_MACHINE_ARCH=${HOST_MACHINE_ARCH:Q}
@@ -197,17 +200,17 @@ NATIVE_LOWER_OPSYS?=      dragonfly
 NATIVE_LOWER_VENDOR?=  pc
 
 .elif ${NATIVE_OPSYS} == "FreeBSD"
-NATIVE_OS_VERSION:=            ${OS_VERSION:C/-.*$//}
+NATIVE_OS_VERSION:=            ${NATIVE_OS_VERSION:C/-.*$//}
 NATIVE_LOWER_OPSYS?=           freebsd
-NATIVE_LOWER_OPSYS_VERSUFFIX=  ${OS_VERSION:C/([0-9]*).*/\1/}
-.  if ${MACHINE_ARCH} == "i386"
+NATIVE_LOWER_OPSYS_VERSUFFIX=  ${NATIVE_OS_VERSION:C/([0-9]*).*/\1/}
+.  if ${MACHINE_ARCH} == "i386"                # pre-NATIVE_MACHINE_ARCH switcheroo
 NATIVE_LOWER_VENDOR?=          pc
 .  endif
 NATIVE_LOWER_VENDOR?=          unknown
 
 .elif ${NATIVE_OPSYS} == "Haiku"
 NATIVE_LOWER_OPSYS?=           haiku
-.  if ${NATIVE_MACHINE_ARCH} == "i386"
+.  if ${MACHINE_ARCH} == "i386"                # pre-NATIVE_MACHINE_ARCH switcheroo
 NATIVE_LOWER_VENDOR?=          pc
 .  endif
 
@@ -255,7 +258,7 @@ NATIVE_LOWER_VENDOR?=               slackware
 NATIVE_LOWER_VENDOR?=          ssd
 .  elif !empty(CHROMEOS_RELEASE_NAME)
 NATIVE_LOWER_VENDOR?=          chromeos
-.  elif ${NATIVE_MACHINE_ARCH} == "i386"
+.  elif ${MACHINE_ARCH} == "i386"      # pre-NATIVE_MACHINE_ARCH switcheroo
 NATIVE_LOWER_VENDOR?=          pc
 .  endif
 NATIVE_LOWER_VENDOR?=          unknown
@@ -264,7 +267,9 @@ NATIVE_OS_VARIANT:=         ${NATIVE_OS_VARIANT
 .  if ${NATIVE_OS_VARIANT} != "Microsoft"
 NATIVE_OS_VARIANT=             ${NATIVE_LOWER_VENDOR}
 .  endif
-# XXX NATIVE_HOST_MACHINE_ARCH?  ???
+# Ensure HOST_MACHINE_ARCH is set for native-but-compat builds, such as
+# building i386 packages on an amd64 system with compat32 libraries.
+# This is not quite a cross-build, so not NATIVE_ or CROSS_ here.
 .  if !defined(HOST_MACHINE_ARCH)
 HOST_MACHINE_ARCH!=    ${UNAME} -m
 MAKEFLAGS+=            HOST_MACHINE_ARCH=${HOST_MACHINE_ARCH:Q}



Home | Main Index | Thread Index | Old Index