Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From b27c253bfb78fa3c5f416e6caee101098a4b58cc Mon Sep 17 00:00:00 2001 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 12 Jul 2017 18:09:46 -0700 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 4 | Subject: [PATCH] build: Adjust CFLAGS/LDFLAGS to append values passed from env |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 5 | |
| 6 | For musl we have to pass additional arguments via cflags and ldflags |
| 7 | to link in librirpc, make room for those changes to take effect |
| 8 | |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 10 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 11 | --- |
| 12 | scripts/build | 2 +- |
| 13 | src/Makefile | 14 +++++++------- |
| 14 | 2 files changed, 8 insertions(+), 8 deletions(-) |
| 15 | |
| 16 | diff --git a/scripts/build b/scripts/build |
| 17 | index 34a1371..3786741 100755 |
| 18 | --- a/scripts/build |
| 19 | +++ b/scripts/build |
| 20 | @@ -18,7 +18,7 @@ done |
| 21 | |
| 22 | trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BASE}$$.o ${BASE}$$; exit 1' 1 2 15 |
| 23 | |
| 24 | -LDLIBS=-lm |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 25 | +LDLIBS="$LDLIBS -lm" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 26 | |
| 27 | # check for HP-UX's ANSI compiler |
| 28 | echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c |
| 29 | diff --git a/src/Makefile b/src/Makefile |
| 30 | index d9efd54..96467d7 100644 |
| 31 | --- a/src/Makefile |
| 32 | +++ b/src/Makefile |
| 33 | @@ -112,8 +112,8 @@ LIBOBJS= $O/lib_tcp.o $O/lib_udp.o $O/lib_unix.o $O/lib_timing.o \ |
| 34 | $O/lib_sched.o |
| 35 | |
| 36 | lmbench: $(UTILS) |
| 37 | - @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all |
| 38 | - -@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt |
| 39 | + @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all |
| 40 | + -@env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt |
| 41 | |
| 42 | results: lmbench |
| 43 | @env OS="${OS}" ../scripts/config-run |
| 44 | @@ -137,7 +137,7 @@ os: lmbench |
| 45 | @env OS="${OS}" BENCHMARK_HARDWARE=NO BENCHMARK_OS=YES ../scripts/results |
| 46 | |
| 47 | install: lmbench |
| 48 | - @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target |
| 49 | + @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target |
| 50 | |
| 51 | install-target: |
| 52 | if [ ! -d $(BASE) ]; then mkdir $(BASE); fi |
| 53 | @@ -155,16 +155,16 @@ all: $(EXES) $O/lmbench |
| 54 | opt: $(OPT_EXES) |
| 55 | asm: $(ASMS) |
| 56 | $(ASMS): |
| 57 | - $(CC) -S $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ `basename $@ .s`.c |
| 58 | + $(CC) -S $(CFLAGS) $(CPPFLAGS) -o $@ `basename $@ .s`.c $(LDFLAGS) |
| 59 | |
| 60 | Wall: |
| 61 | - @env CFLAGS="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt |
| 62 | + @env CFLAGS+="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt |
| 63 | |
| 64 | debug: |
| 65 | - @env CFLAGS="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt |
| 66 | + @env CFLAGS+="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt |
| 67 | |
| 68 | assembler: |
| 69 | - @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm |
| 70 | + @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm |
| 71 | |
| 72 | |
| 73 | tag: |