| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: bsd.prefs.mk,v 1.437 2024/01/13 20:21:23 riastradh Exp $ | | 1 | # $NetBSD: bsd.prefs.mk,v 1.438 2024/01/26 03:25:36 riastradh Exp $ |
2 | # | | 2 | # |
3 | # This file includes the mk.conf file, which contains the user settings. | | 3 | # This file includes the mk.conf file, which contains the user settings. |
4 | # | | 4 | # |
5 | # Packages should include this file before any of the .if directives, as | | 5 | # Packages should include this file before any of the .if directives, as |
6 | # well as before modifying variables like CFLAGS, LDFLAGS, and so on. | | 6 | # well as before modifying variables like CFLAGS, LDFLAGS, and so on. |
7 | # Otherwise the behavior may be unexpected. | | 7 | # Otherwise the behavior may be unexpected. |
8 | # | | 8 | # |
9 | # When mk.conf is included by this file, the following variables are | | 9 | # When mk.conf is included by this file, the following variables are |
10 | # defined: | | 10 | # defined: |
11 | # | | 11 | # |
12 | # ACCEPTABLE_LICENSES | | 12 | # ACCEPTABLE_LICENSES |
13 | # This variable is set to the list of Open Source licenses. See | | 13 | # This variable is set to the list of Open Source licenses. See |
14 | # mk/license.mk for details. | | 14 | # mk/license.mk for details. |
| @@ -331,26 +331,31 @@ LOWER_OPSYS:= ${OPSYS:tl} | | | @@ -331,26 +331,31 @@ LOWER_OPSYS:= ${OPSYS:tl} |
331 | # Now commit the version values computed above, eliding the :sh | | 331 | # Now commit the version values computed above, eliding the :sh |
332 | OS_VERSION:= ${OS_VERSION} | | 332 | OS_VERSION:= ${OS_VERSION} |
333 | | | 333 | |
334 | MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q} | | 334 | MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q} |
335 | | | 335 | |
336 | LOWER_VENDOR?= # empty ("arch--opsys") | | 336 | LOWER_VENDOR?= # empty ("arch--opsys") |
337 | | | 337 | |
338 | NATIVE_MACHINE_ARCH:= ${MACHINE_ARCH} | | 338 | NATIVE_MACHINE_ARCH:= ${MACHINE_ARCH} |
339 | NATIVE_MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${NATIVE_MACHINE_ARCH} | | 339 | NATIVE_MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${NATIVE_MACHINE_ARCH} |
340 | MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} | | 340 | MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} |
341 | NATIVE_MACHINE_GNU_PLATFORM?= ${NATIVE_MACHINE_GNU_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${NATIVE_APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}${NATIVE_APPEND_ABI} | | 341 | NATIVE_MACHINE_GNU_PLATFORM?= ${NATIVE_MACHINE_GNU_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${NATIVE_APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}${NATIVE_APPEND_ABI} |
342 | MACHINE_GNU_PLATFORM?= ${MACHINE_GNU_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}${APPEND_ABI} | | 342 | MACHINE_GNU_PLATFORM?= ${MACHINE_GNU_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}${APPEND_ABI} |
343 | | | 343 | |
| | | 344 | # Set this before <bsd.own.mk> does, since it doesn't know about Darwin |
| | | 345 | .if ${OPSYS} == "Darwin" |
| | | 346 | OBJECT_FMT?= Mach-O |
| | | 347 | .endif |
| | | 348 | |
344 | # | | 349 | # |
345 | # cross-libtool is special -- it is built as a native package, but it | | 350 | # cross-libtool is special -- it is built as a native package, but it |
346 | # needs tools set up as if for a cross-compiled package because it | | 351 | # needs tools set up as if for a cross-compiled package because it |
347 | # remembers the paths for use to later assist in cross-compiling other | | 352 | # remembers the paths for use to later assist in cross-compiling other |
348 | # packages. | | 353 | # packages. |
349 | # | | 354 | # |
350 | # So normally TOOLS_USE_CROSS_COMPILE is the same as USE_CROSS_COMPILE, | | 355 | # So normally TOOLS_USE_CROSS_COMPILE is the same as USE_CROSS_COMPILE, |
351 | # but for cross-libtool, we set TOOLS_USE_CROSS_COMPILE=yes while doing | | 356 | # but for cross-libtool, we set TOOLS_USE_CROSS_COMPILE=yes while doing |
352 | # the rest of the native package build with USE_CROSS_COMPILE=no. | | 357 | # the rest of the native package build with USE_CROSS_COMPILE=no. |
353 | # | | 358 | # |
354 | # This can't live inside the cross-libtool makefile because the | | 359 | # This can't live inside the cross-libtool makefile because the |
355 | # TARGET_ARCH / MACHINE_ARCH / NATIVE_MACHINE_ARCH switcheroo has to | | 360 | # TARGET_ARCH / MACHINE_ARCH / NATIVE_MACHINE_ARCH switcheroo has to |
356 | # happen in the middle of this file -- after NATIVE_MACHINE_ARCH is | | 361 | # happen in the middle of this file -- after NATIVE_MACHINE_ARCH is |
| @@ -366,31 +371,26 @@ _BUILD_DEFS.MACHINE_GNU_ARCH= ${NATIVE_M | | | @@ -366,31 +371,26 @@ _BUILD_DEFS.MACHINE_GNU_ARCH= ${NATIVE_M |
366 | TOOLS_USE_CROSS_COMPILE= yes | | 371 | TOOLS_USE_CROSS_COMPILE= yes |
367 | .else | | 372 | .else |
368 | TOOLS_USE_CROSS_COMPILE= ${USE_CROSS_COMPILE:Uno} | | 373 | TOOLS_USE_CROSS_COMPILE= ${USE_CROSS_COMPILE:Uno} |
369 | .endif | | 374 | .endif |
370 | | | 375 | |
371 | # Needed to prevent an "install:" target from being created in bsd.own.mk. | | 376 | # Needed to prevent an "install:" target from being created in bsd.own.mk. |
372 | NEED_OWN_INSTALL_TARGET=no | | 377 | NEED_OWN_INSTALL_TARGET=no |
373 | | | 378 | |
374 | # This prevents default use of the cross-tool harness in the "src" tree, | | 379 | # This prevents default use of the cross-tool harness in the "src" tree, |
375 | # in the odd possible case of someone extracting "pkgsrc" underneath "src". | | 380 | # in the odd possible case of someone extracting "pkgsrc" underneath "src". |
376 | USETOOLS= no | | 381 | USETOOLS= no |
377 | MAKE_ENV+= USETOOLS=no | | 382 | MAKE_ENV+= USETOOLS=no |
378 | | | 383 | |
379 | # Set this before <bsd.own.mk> does, since it doesn't know about Darwin | | | |
380 | .if ${OPSYS} == "Darwin" | | | |
381 | OBJECT_FMT?= Mach-O | | | |
382 | .endif | | | |
383 | | | | |
384 | ACCEPTABLE_LICENSES?= ${DEFAULT_ACCEPTABLE_LICENSES} | | 384 | ACCEPTABLE_LICENSES?= ${DEFAULT_ACCEPTABLE_LICENSES} |
385 | | | 385 | |
386 | # Provide PKGPATH early on so that mk.conf can use it. | | 386 | # Provide PKGPATH early on so that mk.conf can use it. |
387 | PKGPATH?= ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|} | | 387 | PKGPATH?= ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|} |
388 | | | 388 | |
389 | # Load the settings from MAKECONF, which is /etc/mk.conf by default. | | 389 | # Load the settings from MAKECONF, which is /etc/mk.conf by default. |
390 | .include <bsd.own.mk> | | 390 | .include <bsd.own.mk> |
391 | | | 391 | |
392 | .if ${OPSYS} == "OpenBSD" | | 392 | .if ${OPSYS} == "OpenBSD" |
393 | . if defined(ELF_TOOLCHAIN) && ${ELF_TOOLCHAIN} == "yes" | | 393 | . if defined(ELF_TOOLCHAIN) && ${ELF_TOOLCHAIN} == "yes" |
394 | OBJECT_FMT?= ELF | | 394 | OBJECT_FMT?= ELF |
395 | . else | | 395 | . else |
396 | OBJECT_FMT?= a.out | | 396 | OBJECT_FMT?= a.out |