| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: bsd.prefs.mk,v 1.433 2023/06/27 10:27:20 riastradh Exp $ | | 1 | # $NetBSD: bsd.prefs.mk,v 1.434 2023/06/27 10:36:40 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. |
| @@ -440,26 +440,48 @@ _PKGSRC_TOPDIR= ${.CURDIR}/../.. | | | @@ -440,26 +440,48 @@ _PKGSRC_TOPDIR= ${.CURDIR}/../.. |
440 | .include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf" | | 440 | .include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf" |
441 | | | 441 | |
442 | SHAREOWN?= ${DOCOWN} | | 442 | SHAREOWN?= ${DOCOWN} |
443 | SHAREGRP?= ${DOCGRP} | | 443 | SHAREGRP?= ${DOCGRP} |
444 | SHAREMODE?= ${DOCMODE} | | 444 | SHAREMODE?= ${DOCMODE} |
445 | | | 445 | |
446 | .if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__}) | | 446 | .if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__}) |
447 | .BEGIN: | | 447 | .BEGIN: |
448 | @${ECHO_MSG} "You CANNOT set PREFIX manually or in mk.conf. Set LOCALBASE or X11BASE" | | 448 | @${ECHO_MSG} "You CANNOT set PREFIX manually or in mk.conf. Set LOCALBASE or X11BASE" |
449 | @${ECHO_MSG} "depending on your needs. See the pkg system documentation for more info." | | 449 | @${ECHO_MSG} "depending on your needs. See the pkg system documentation for more info." |
450 | @${FALSE} | | 450 | @${FALSE} |
451 | .endif | | 451 | .endif |
452 | | | 452 | |
| | | 453 | # When cross-compilation support is requested, the following options |
| | | 454 | # must be specified as well or guessable: |
| | | 455 | # - MACHINE_ARCH is set to TARGET_ARCH if set. |
| | | 456 | # - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH. |
| | | 457 | # - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR |
| | | 458 | # - DESTDIR support is required |
| | | 459 | # |
| | | 460 | # _CROSS_DESTDIR is set for internal use to avoid conditionalising |
| | | 461 | # the use. |
| | | 462 | |
| | | 463 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) |
| | | 464 | . if defined(TARGET_ARCH) |
| | | 465 | MACHINE_ARCH= ${TARGET_ARCH} |
| | | 466 | . endif |
| | | 467 | CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH} |
| | | 468 | . if !exists(${CROSS_DESTDIR}/usr/include/stddef.h) |
| | | 469 | PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete" |
| | | 470 | . else |
| | | 471 | _CROSS_DESTDIR= ${CROSS_DESTDIR} |
| | | 472 | . endif |
| | | 473 | .endif |
| | | 474 | |
453 | # Load the OS-specific definitions for program variables. Default to loading | | 475 | # Load the OS-specific definitions for program variables. Default to loading |
454 | # the NetBSD ones if an OS-specific file doesn't exist. | | 476 | # the NetBSD ones if an OS-specific file doesn't exist. |
455 | .if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk) | | 477 | .if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk) |
456 | . include "${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk" | | 478 | . include "${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk" |
457 | .else | | 479 | .else |
458 | . include "${_PKGSRC_TOPDIR}/mk/platform/NetBSD.mk" | | 480 | . include "${_PKGSRC_TOPDIR}/mk/platform/NetBSD.mk" |
459 | PKG_FAIL_REASON+= "missing mk/platform/${OPSYS}.mk" | | 481 | PKG_FAIL_REASON+= "missing mk/platform/${OPSYS}.mk" |
460 | .endif | | 482 | .endif |
461 | | | 483 | |
462 | # Set default SHLIB_TYPE to the ${OPSYS}-specific shared library type. | | 484 | # Set default SHLIB_TYPE to the ${OPSYS}-specific shared library type. |
463 | SHLIB_TYPE?= ${_OPSYS_SHLIB_TYPE} | | 485 | SHLIB_TYPE?= ${_OPSYS_SHLIB_TYPE} |
464 | | | 486 | |
465 | PKGDIRMODE?= 755 | | 487 | PKGDIRMODE?= 755 |
| @@ -519,48 +541,26 @@ _MAKE_INSTALL_AS_ROOT= no | | | @@ -519,48 +541,26 @@ _MAKE_INSTALL_AS_ROOT= no |
519 | # was yes) | | 541 | # was yes) |
520 | _KEEP_BIN_PKGS?= no | | 542 | _KEEP_BIN_PKGS?= no |
521 | .if !empty(PKGSRC_KEEP_BIN_PKGS:U:M[Yy][Ee][Ss]) | | 543 | .if !empty(PKGSRC_KEEP_BIN_PKGS:U:M[Yy][Ee][Ss]) |
522 | _KEEP_BIN_PKGS= yes | | 544 | _KEEP_BIN_PKGS= yes |
523 | .endif | | 545 | .endif |
524 | | | 546 | |
525 | _MAKE_CLEAN_AS_ROOT?= no | | 547 | _MAKE_CLEAN_AS_ROOT?= no |
526 | # Whether to run the clean target as root. | | 548 | # Whether to run the clean target as root. |
527 | _MAKE_INSTALL_AS_ROOT?= yes | | 549 | _MAKE_INSTALL_AS_ROOT?= yes |
528 | # Whether to run the install target as root. | | 550 | # Whether to run the install target as root. |
529 | _MAKE_PACKAGE_AS_ROOT?= yes | | 551 | _MAKE_PACKAGE_AS_ROOT?= yes |
530 | # Whether to run the package target as root. | | 552 | # Whether to run the package target as root. |
531 | | | 553 | |
532 | # When cross-compilation support is requested, the following options | | | |
533 | # must be specified as well or guessable: | | | |
534 | # - MACHINE_ARCH is set to TARGET_ARCH if set. | | | |
535 | # - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH. | | | |
536 | # - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR | | | |
537 | # - DESTDIR support is required | | | |
538 | # | | | |
539 | # _CROSS_DESTDIR is set for internal use to avoid conditionalising | | | |
540 | # the use. | | | |
541 | | | | |
542 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | | | |
543 | . if defined(TARGET_ARCH) | | | |
544 | MACHINE_ARCH= ${TARGET_ARCH} | | | |
545 | . endif | | | |
546 | CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH} | | | |
547 | . if !exists(${CROSS_DESTDIR}/usr/include/stddef.h) | | | |
548 | PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete" | | | |
549 | . else | | | |
550 | _CROSS_DESTDIR= ${CROSS_DESTDIR} | | | |
551 | . endif | | | |
552 | .endif | | | |
553 | | | | |
554 | # TOOLS_CROSS_DESTDIR is used for the libtool build to make a wrapper | | 554 | # TOOLS_CROSS_DESTDIR is used for the libtool build to make a wrapper |
555 | # that points at the cross-destdir as sysroot, without setting | | 555 | # that points at the cross-destdir as sysroot, without setting |
556 | # _CROSS_DESTDIR because we're actually building a native package. | | 556 | # _CROSS_DESTDIR because we're actually building a native package. |
557 | TOOLS_CROSS_DESTDIR= ${CROSS_DESTDIR} | | 557 | TOOLS_CROSS_DESTDIR= ${CROSS_DESTDIR} |
558 | | | 558 | |
559 | # Depends on MACHINE_ARCH override above | | 559 | # Depends on MACHINE_ARCH override above |
560 | .if ${OPSYS} == "NetBSD" | | 560 | .if ${OPSYS} == "NetBSD" |
561 | # XXX NATIVE_OBJECT_FMT is a cop-out -- but seriously, who is going to | | 561 | # XXX NATIVE_OBJECT_FMT is a cop-out -- but seriously, who is going to |
562 | # do cross-builds on a NetBSD host that still uses a.out? | | 562 | # do cross-builds on a NetBSD host that still uses a.out? |
563 | NATIVE_OBJECT_FMT?= ${OBJECT_FMT} | | 563 | NATIVE_OBJECT_FMT?= ${OBJECT_FMT} |
564 | . if ${NATIVE_OBJECT_FMT} == "ELF" && \ | | 564 | . if ${NATIVE_OBJECT_FMT} == "ELF" && \ |
565 | (!empty(NATIVE_MACHINE_ARCH:Mearm*) || \ | | 565 | (!empty(NATIVE_MACHINE_ARCH:Mearm*) || \ |
566 | ${NATIVE_MACHINE_GNU_ARCH} == "arm" || \ | | 566 | ${NATIVE_MACHINE_GNU_ARCH} == "arm" || \ |