diff options
| author | Ron Yorston <rmy@pobox.com> | 2024-02-20 12:53:39 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2024-02-20 13:11:01 +0000 |
| commit | 17992d06810a9b0c60bab404f720bbd7539bdb93 (patch) | |
| tree | e99c9776bc2dab67ebc87d27b291842571ac4e7e | |
| parent | 0200baa675d3b51c0f021da7728353ee7ceedba4 (diff) | |
| download | busybox-w32-17992d06810a9b0c60bab404f720bbd7539bdb93.tar.gz busybox-w32-17992d06810a9b0c60bab404f720bbd7539bdb93.tar.bz2 busybox-w32-17992d06810a9b0c60bab404f720bbd7539bdb93.zip | |
build system: fix for older GNU make
Commit 992387539 (build system: more clang/llvm tweaks) added a
test in scripts/Makefile.build which used the intcmp function.
This isn't present in GNU make prior to 4.4.
Rewrite the test so it works with older versions of GNU make.
| -rw-r--r-- | scripts/Makefile.build | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 2a9f451f3..cd5592b34 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -265,11 +265,17 @@ else | |||
| 265 | # zero or one object files. In the latter case copy the object to | 265 | # zero or one object files. In the latter case copy the object to |
| 266 | # the target. This avoids the need to use the linker: the llvm | 266 | # the target. This avoids the need to use the linker: the llvm |
| 267 | # linker doesn't support the -r option. | 267 | # linker doesn't support the -r option. |
| 268 | cmd_link_o_target = $(intcmp $(words $(obj-y)),1,\ | 268 | ifeq ($(words $(obj-y)),0) |
| 269 | rm -f $@; $(AR) rcs $@,\ | 269 | cmd_link_o_target = rm -f $@; $(AR) rcs $@ |
| 270 | cp $(obj-y) $@,\ | 270 | else |
| 271 | ifeq ($(words $(obj-y)),1) | ||
| 272 | cmd_link_o_target = cp $(obj-y) $@ | ||
| 273 | else | ||
| 274 | cmd_link_o_target = \ | ||
| 271 | $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^)) | 275 | $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^)) |
| 272 | endif | 276 | endif |
| 277 | endif | ||
| 278 | endif | ||
| 273 | 279 | ||
| 274 | $(builtin-target): $(obj-y) FORCE | 280 | $(builtin-target): $(obj-y) FORCE |
| 275 | $(call if_changed,link_o_target) | 281 | $(call if_changed,link_o_target) |
