| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: bsd.prefs.mk,v 1.422 2022/06/07 10:04:25 jperkin Exp $ | | 1 | # $NetBSD: bsd.prefs.mk,v 1.423 2022/07/22 09:14:43 nia 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. |
| @@ -103,28 +103,34 @@ OS_VARIANT?= # empty | | | @@ -103,28 +103,34 @@ OS_VARIANT?= # empty |
103 | .if !defined(OS_VERSION) | | 103 | .if !defined(OS_VERSION) |
104 | _OS_VERSION_CMD= ${UNAME} -r | | 104 | _OS_VERSION_CMD= ${UNAME} -r |
105 | OS_VERSION= ${_OS_VERSION_CMD:sh} | | 105 | OS_VERSION= ${_OS_VERSION_CMD:sh} |
106 | MAKEFLAGS+= OS_VERSION=${OS_VERSION:Q} | | 106 | MAKEFLAGS+= OS_VERSION=${OS_VERSION:Q} |
107 | .endif | | 107 | .endif |
108 | | | 108 | |
109 | # | | 109 | # |
110 | # OPSYS_VERSION differs from OS_VERSION in that it should always evaluate to | | 110 | # OPSYS_VERSION differs from OS_VERSION in that it should always evaluate to |
111 | # an integer, allowing arithmetic expressions to simplify make(1) tests. The | | 111 | # an integer, allowing arithmetic expressions to simplify make(1) tests. The |
112 | # default command is likely correct for most OS, those that need to can set | | 112 | # default command is likely correct for most OS, those that need to can set |
113 | # it to a custom command in the later OPSYS-specific section. | | 113 | # it to a custom command in the later OPSYS-specific section. |
114 | # | | 114 | # |
115 | .if !defined(OPSYS_VERSION) | | 115 | .if !defined(OPSYS_VERSION) |
| | | 116 | . if ${OPSYS} == "NetBSD" && exists(/etc/release) |
| | | 117 | _OPSYS_VERSION_CMD= head -1 /etc/release | \ |
| | | 118 | sed -e "s,^NetBSD ,,g" | \ |
| | | 119 | awk -F. '{major=int($$1); minor=int($$2); if (minor>=100) minor=99; patch=int($$3); if (patch>=100) patch=99; printf "%02d%02d%02d", major, minor, patch}' |
| | | 120 | . else |
116 | _OPSYS_VERSION_CMD= ${UNAME} -r | \ | | 121 | _OPSYS_VERSION_CMD= ${UNAME} -r | \ |
117 | awk -F. '{major=int($$1); minor=int($$2); if (minor>=100) minor=99; patch=int($$3); if (patch>=100) patch=99; printf "%02d%02d%02d", major, minor, patch}' | | 122 | awk -F. '{major=int($$1); minor=int($$2); if (minor>=100) minor=99; patch=int($$3); if (patch>=100) patch=99; printf "%02d%02d%02d", major, minor, patch}' |
| | | 123 | . endif |
118 | OPSYS_VERSION= ${_OPSYS_VERSION_CMD:sh} | | 124 | OPSYS_VERSION= ${_OPSYS_VERSION_CMD:sh} |
119 | MAKEFLAGS+= OPSYS_VERSION=${OPSYS_VERSION:Q} | | 125 | MAKEFLAGS+= OPSYS_VERSION=${OPSYS_VERSION:Q} |
120 | .endif | | 126 | .endif |
121 | | | 127 | |
122 | # Preload these for architectures not in all variations of bsd.own.mk, | | 128 | # Preload these for architectures not in all variations of bsd.own.mk, |
123 | # which do not match their GNU names exactly. | | 129 | # which do not match their GNU names exactly. |
124 | GNU_ARCH.aarch64eb?= aarch64_be | | 130 | GNU_ARCH.aarch64eb?= aarch64_be |
125 | GNU_ARCH.coldfire?= m5407 | | 131 | GNU_ARCH.coldfire?= m5407 |
126 | GNU_ARCH.arm26?= arm | | 132 | GNU_ARCH.arm26?= arm |
127 | GNU_ARCH.arm32?= arm | | 133 | GNU_ARCH.arm32?= arm |
128 | GNU_ARCH.amd64?= x86_64 | | 134 | GNU_ARCH.amd64?= x86_64 |
129 | GNU_ARCH.earm?= arm | | 135 | GNU_ARCH.earm?= arm |
130 | GNU_ARCH.earmhf?= arm | | 136 | GNU_ARCH.earmhf?= arm |