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:           Fri Jan 26 03:25:47 UTC 2024

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

Log Message:
bsd.prefs.mk: Set cross MACHINE_ARCH/destdir right after bsd.own.mk.

This puts it before defaults/mk.conf, which has no effect here --
there's no default TARGET_ARCH, MAKEOBJDIR, or CROSS_DESTDIR in
defaults/mk.conf, and defaults/mk.conf is not affected by
MACHINE_ARCH (immediately, anyway), CROSS_DESTDIR, or _CROSS_DESTDIR.

Later we'll add more variables like MACHINE_ARCH here affected by a
TARGET_* variable, including OBJECT_FMT.  This will allow us to
handle OBJECT_FMT via TARGET_OBJECT_FMT before the next stanza which
provides OPSYS-based defaults for OBJECT_FMT.

No change for native builds since this only moves around a block
gated on USE_CROSS_COMPILE = yes.


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 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.438 pkgsrc/mk/bsd.prefs.mk:1.439
--- pkgsrc/mk/bsd.prefs.mk:1.438        Fri Jan 26 03:25:36 2024
+++ pkgsrc/mk/bsd.prefs.mk      Fri Jan 26 03:25:47 2024
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.438 2024/01/26 03:25:36 riastradh Exp $
+# $NetBSD: bsd.prefs.mk,v 1.439 2024/01/26 03:25:47 riastradh Exp $
 #
 # This file includes the mk.conf file, which contains the user settings.
 #
@@ -389,6 +389,28 @@ PKGPATH?=          ${.CURDIR:C|.*/([^/]*/[^/]*)$
 # Load the settings from MAKECONF, which is /etc/mk.conf by default.
 .include <bsd.own.mk>
 
+# When cross-compilation support is requested, the following options
+# must be specified as well or guessable:
+# - MACHINE_ARCH is set to TARGET_ARCH if set.
+# - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH.
+# - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR
+# - DESTDIR support is required
+#
+# _CROSS_DESTDIR is set for internal use to avoid conditionalising
+# the use.
+
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.  if defined(TARGET_ARCH)
+MACHINE_ARCH=  ${TARGET_ARCH}
+.  endif
+CROSS_DESTDIR?=        ${MAKEOBJDIR}/destdir.${MACHINE_ARCH}
+.  if !exists(${CROSS_DESTDIR}/usr/include/stddef.h)
+PKG_FAIL_REASON+=      "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete"
+.  else
+_CROSS_DESTDIR=        ${CROSS_DESTDIR}
+.  endif
+.endif
+
 .if ${OPSYS} == "OpenBSD"
 .  if defined(ELF_TOOLCHAIN) && ${ELF_TOOLCHAIN} == "yes"
 OBJECT_FMT?=   ELF
@@ -450,28 +472,6 @@ SHAREMODE?=                ${DOCMODE}
        @${FALSE}
 .endif
 
-# When cross-compilation support is requested, the following options
-# must be specified as well or guessable:
-# - MACHINE_ARCH is set to TARGET_ARCH if set.
-# - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH.
-# - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR
-# - DESTDIR support is required
-#
-# _CROSS_DESTDIR is set for internal use to avoid conditionalising
-# the use.
-
-.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
-.  if defined(TARGET_ARCH)
-MACHINE_ARCH=  ${TARGET_ARCH}
-.  endif
-CROSS_DESTDIR?=        ${MAKEOBJDIR}/destdir.${MACHINE_ARCH}
-.  if !exists(${CROSS_DESTDIR}/usr/include/stddef.h)
-PKG_FAIL_REASON+=      "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete"
-.  else
-_CROSS_DESTDIR=        ${CROSS_DESTDIR}
-.  endif
-.endif
-
 # Load the OS-specific definitions for program variables.  Default to loading
 # the NetBSD ones if an OS-specific file doesn't exist.
 .if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk)



Home | Main Index | Thread Index | Old Index