mirror of
https://git.musl-libc.org/git/musl
synced 2025-03-22 18:42:57 +03:00
keep user-provided CFLAGS/LDFLAGS separate from those added by configure
this way, overriding these variables on the make command line (or just re-passing the originally-passed values when invoking make) won't suppress use of the flags added by configure.
This commit is contained in:
parent
fda365a530
commit
4cd8b47259
10
Makefile
10
Makefile
@ -24,17 +24,21 @@ GENH_INT = src/internal/version.h
|
|||||||
IMPH = src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h
|
IMPH = src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h
|
||||||
|
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
LDFLAGS_AUTO =
|
||||||
LIBCC = -lgcc
|
LIBCC = -lgcc
|
||||||
CPPFLAGS =
|
CPPFLAGS =
|
||||||
CFLAGS = -Os -pipe
|
CFLAGS =
|
||||||
|
CFLAGS_AUTO = -Os -pipe
|
||||||
CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc
|
CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc
|
||||||
|
|
||||||
CFLAGS_ALL = $(CFLAGS_C99FSE)
|
CFLAGS_ALL = $(CFLAGS_C99FSE)
|
||||||
CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I./arch/$(ARCH) -I./src/internal -I./include
|
CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I./arch/$(ARCH) -I./src/internal -I./include
|
||||||
CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS)
|
CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS)
|
||||||
CFLAGS_ALL_STATIC = $(CFLAGS_ALL)
|
CFLAGS_ALL_STATIC = $(CFLAGS_ALL)
|
||||||
CFLAGS_ALL_SHARED = $(CFLAGS_ALL) -fPIC -DSHARED
|
CFLAGS_ALL_SHARED = $(CFLAGS_ALL) -fPIC -DSHARED
|
||||||
|
|
||||||
|
LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS)
|
||||||
|
|
||||||
AR = $(CROSS_COMPILE)ar
|
AR = $(CROSS_COMPILE)ar
|
||||||
RANLIB = $(CROSS_COMPILE)ranlib
|
RANLIB = $(CROSS_COMPILE)ranlib
|
||||||
INSTALL = ./tools/install.sh
|
INSTALL = ./tools/install.sh
|
||||||
@ -146,7 +150,7 @@ endif
|
|||||||
$(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $<
|
$(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $<
|
||||||
|
|
||||||
lib/libc.so: $(LOBJS)
|
lib/libc.so: $(LOBJS)
|
||||||
$(CC) $(CFLAGS_ALL_SHARED) $(LDFLAGS) -nostdlib -shared \
|
$(CC) $(CFLAGS_ALL_SHARED) $(LDFLAGS_ALL) -nostdlib -shared \
|
||||||
-Wl,-e,_dlstart -Wl,-Bsymbolic-functions \
|
-Wl,-e,_dlstart -Wl,-Bsymbolic-functions \
|
||||||
-o $@ $(LOBJS) $(LIBCC)
|
-o $@ $(LOBJS) $(LIBCC)
|
||||||
|
|
||||||
|
6
configure
vendored
6
configure
vendored
@ -629,12 +629,14 @@ libdir = $libdir
|
|||||||
includedir = $includedir
|
includedir = $includedir
|
||||||
syslibdir = $syslibdir
|
syslibdir = $syslibdir
|
||||||
CC = $CC
|
CC = $CC
|
||||||
CFLAGS = $CFLAGS_AUTO $CFLAGS
|
CFLAGS = $CFLAGS
|
||||||
|
CFLAGS_AUTO = $CFLAGS_AUTO
|
||||||
CFLAGS_C99FSE = $CFLAGS_C99FSE
|
CFLAGS_C99FSE = $CFLAGS_C99FSE
|
||||||
CFLAGS_MEMOPS = $CFLAGS_MEMOPS
|
CFLAGS_MEMOPS = $CFLAGS_MEMOPS
|
||||||
CFLAGS_NOSSP = $CFLAGS_NOSSP
|
CFLAGS_NOSSP = $CFLAGS_NOSSP
|
||||||
CPPFLAGS = $CPPFLAGS
|
CPPFLAGS = $CPPFLAGS
|
||||||
LDFLAGS = $LDFLAGS_AUTO $LDFLAGS
|
LDFLAGS = $LDFLAGS
|
||||||
|
LDFLAGS_AUTO = $LDFLAGS_AUTO
|
||||||
CROSS_COMPILE = $CROSS_COMPILE
|
CROSS_COMPILE = $CROSS_COMPILE
|
||||||
LIBCC = $LIBCC
|
LIBCC = $LIBCC
|
||||||
OPTIMIZE_GLOBS = $OPTIMIZE_GLOBS
|
OPTIMIZE_GLOBS = $OPTIMIZE_GLOBS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user