29 # Assumes Platform.gmk has been included before this file. |
29 # Assumes Platform.gmk has been included before this file. |
30 # |
30 # |
31 # These input UTILS_* variables can be defined at anytime, ideally once. |
31 # These input UTILS_* variables can be defined at anytime, ideally once. |
32 # Unix Commands: Normally /bin/, /usr/bin/. or C:/mksnt/mksnt/ |
32 # Unix Commands: Normally /bin/, /usr/bin/. or C:/mksnt/mksnt/ |
33 # UTILS_COMMAND_PATH |
33 # UTILS_COMMAND_PATH |
34 # /usr/bin/ |
34 # /usr/bin/ |
35 # UTILS_USR_BIN_PATH |
35 # UTILS_USR_BIN_PATH |
36 # /usr/ccs/bin/ (sccs, m4, lex, yacc, as, ar, strip, mcs) |
36 # /usr/ccs/bin/ (sccs, m4, lex, yacc, as, ar, strip, mcs) |
37 # UTILS_CCS_BIN_PATH |
37 # UTILS_CCS_BIN_PATH |
38 # Dev Tools: zip, unzip, etc that we may have special versions of |
38 # Dev Tools: zip, unzip, etc that we may have special versions of |
39 # UTILS_DEVTOOL_PATH |
39 # UTILS_DEVTOOL_PATH |
49 ifeq ($(PLATFORM),linux) |
49 ifeq ($(PLATFORM),linux) |
50 UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) |
50 UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) |
51 UTILS_USR_BIN_PATH=$(USRBIN_PATH) |
51 UTILS_USR_BIN_PATH=$(USRBIN_PATH) |
52 UTILS_CCS_BIN_PATH=$(USRBIN_PATH) |
52 UTILS_CCS_BIN_PATH=$(USRBIN_PATH) |
53 UTILS_DEVTOOL_PATH=$(USRBIN_PATH) |
53 UTILS_DEVTOOL_PATH=$(USRBIN_PATH) |
|
54 endif |
|
55 |
|
56 ifeq ($(PLATFORM),bsd) |
|
57 UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) |
|
58 UTILS_USR_BIN_PATH=$(USRBIN_PATH) |
|
59 UTILS_CCS_BIN_PATH=$(USRBIN_PATH) |
|
60 UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH) |
54 endif |
61 endif |
55 |
62 |
56 ifeq ($(PLATFORM),solaris) |
63 ifeq ($(PLATFORM),solaris) |
57 UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) |
64 UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) |
58 UTILS_USR_BIN_PATH=$(UNIXCOMMAND_PATH) |
65 UTILS_USR_BIN_PATH=$(UNIXCOMMAND_PATH) |
164 $(wildcard $(UTILS_USR_BIN_PATH)basename)) |
171 $(wildcard $(UTILS_USR_BIN_PATH)basename)) |
165 # RPM 4 has replaced "rpm -b" with an entirely new utility "rpmbuild". |
172 # RPM 4 has replaced "rpm -b" with an entirely new utility "rpmbuild". |
166 # Also, some distribution (Ubuntu, Debian, others?) place the rpm command |
173 # Also, some distribution (Ubuntu, Debian, others?) place the rpm command |
167 # itself in /usr/bin rather than it's traditional home in /bin. |
174 # itself in /usr/bin rather than it's traditional home in /bin. |
168 RPM=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpm) \ |
175 RPM=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpm) \ |
169 $(wildcard $(UTILS_USR_BIN_PATH)rpm)) |
176 $(wildcard $(UTILS_USR_BIN_PATH)rpm)) |
170 RPMBUILD=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpmbuild) \ |
177 RPMBUILD=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpmbuild) \ |
171 $(wildcard $(UTILS_USR_BIN_PATH)rpmbuild) \ |
178 $(wildcard $(UTILS_USR_BIN_PATH)rpmbuild) \ |
172 $(wildcard $(UTILS_COMMAND_PATH)rpm) \ |
179 $(wildcard $(UTILS_COMMAND_PATH)rpm) \ |
173 $(wildcard $(UTILS_USR_BIN_PATH)rpm)) |
180 $(wildcard $(UTILS_USR_BIN_PATH)rpm)) |
174 # Most Linux distros have "sort" in /bin. Ubuntu, Debian and perhaps |
181 # Most Linux distros have "sort" in /bin. Ubuntu, Debian and perhaps |
175 # others have it in /usr/bin. |
182 # others have it in /usr/bin. |
176 SORT=$(firstword $(wildcard $(UTILS_COMMAND_PATH)sort) \ |
183 SORT=$(firstword $(wildcard $(UTILS_COMMAND_PATH)sort) \ |
177 $(wildcard $(UTILS_USR_BIN_PATH)sort)) |
184 $(wildcard $(UTILS_USR_BIN_PATH)sort)) |
178 NAWK = $(USRBIN_PATH)gawk |
185 NAWK = $(USRBIN_PATH)gawk |
179 # Intrinsic unix command, with backslash-escaped character interpretation |
186 # Intrinsic unix command, with backslash-escaped character interpretation |
180 ECHO = /bin/echo -e |
187 ECHO = /bin/echo -e |
181 # These are really in UTILS_USR_BIN_PATH on Linux (only sccs is not) |
188 # These are really in UTILS_USR_BIN_PATH on Linux (only sccs is not) |
182 AR = $(UTILS_USR_BIN_PATH)ar |
189 AR = $(UTILS_USR_BIN_PATH)ar |
196 # (not using -e will cause build failure when using /bin/bash) |
203 # (not using -e will cause build failure when using /bin/bash) |
197 # (using -e breaks something else) |
204 # (using -e breaks something else) |
198 ECHO = /usr/bin/echo |
205 ECHO = /usr/bin/echo |
199 endif |
206 endif |
200 |
207 |
|
208 # BSD specific |
|
209 ifeq ($(PLATFORM),bsd) |
|
210 BASENAME = $(UTILS_USR_BIN_PATH)basename |
|
211 EGREP = $(UTILS_USR_BIN_PATH)egrep |
|
212 EXPR = $(UTILS_COMMAND_PATH)expr |
|
213 FMT = $(UTILS_USR_BIN_PATH)fmt |
|
214 GREP = $(UTILS_USR_BIN_PATH)grep |
|
215 GUNZIP = $(UTILS_USR_BIN_PATH)gunzip |
|
216 ID = $(UTILS_USR_BIN_PATH)id |
|
217 MSGFMT = $(UTILS_DEVTOOL_PATH)msgfmt |
|
218 SED = $(UTILS_USR_BIN_PATH)sed |
|
219 SORT = $(UTILS_USR_BIN_PATH)sort |
|
220 TEST = $(UTILS_COMMAND_PATH)test |
|
221 TOUCH = $(UTILS_USR_BIN_PATH)touch |
|
222 TRUE = $(UTILS_USR_BIN_PATH)true |
|
223 UNAME = $(UTILS_USR_BIN_PATH)uname |
|
224 # BSD OS_VENDOR specific |
|
225 ifeq ($(OS_VENDOR), Apple) |
|
226 NAWK = $(UTILS_USR_BIN_PATH)awk |
|
227 UNZIPSFX = $(UTILS_USR_BIN_PATH)unzipsfx |
|
228 ZIPEXE = $(UTILS_USR_BIN_PATH)zip |
|
229 else |
|
230 UNZIP = $(UTILS_DEVTOOL_PATH)unzip |
|
231 endif |
|
232 ifeq ($(OS_VENDOR), OpenBSD) |
|
233 NAWK = $(UTILS_USR_BIN_PATH)awk |
|
234 else |
|
235 CPIO = $(UTILS_USR_BIN_PATH)cpio |
|
236 TAR = $(UTILS_USR_BIN_PATH)tar |
|
237 endif |
|
238 endif |