diff options
author | dim <dim@FreeBSD.org> | 2013-12-22 17:51:33 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-12-22 17:51:33 +0000 |
commit | b8e518528f02b85edc31c8aaab7dce50b2c0637a (patch) | |
tree | be47307173b9efd3ad49c05d4784734effcc6646 /gnu | |
parent | 47ed2e723641d37c7d409d6ce11d4786823dc8e8 (diff) | |
download | FreeBSD-src-b8e518528f02b85edc31c8aaab7dce50b2c0637a.zip FreeBSD-src-b8e518528f02b85edc31c8aaab7dce50b2c0637a.tar.gz |
To avoid having to explicitly test COMPILER_TYPE for setting
clang-specific or gcc-specific flags, introduce the following new
variables for use in Makefiles:
CFLAGS.clang
CFLAGS.gcc
CXXFLAGS.clang
CXXFLAGS.gcc
In bsd.sys.mk, these get appended to the regular CFLAGS or CXXFLAGS for
the right compiler.
MFC after: 1 week
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/lib/csu/Makefile | 4 | ||||
-rw-r--r-- | gnu/lib/libgcc/Makefile | 4 | ||||
-rw-r--r-- | gnu/lib/libstdc++/Makefile | 4 | ||||
-rw-r--r-- | gnu/lib/libsupc++/Makefile | 4 |
4 files changed, 4 insertions, 12 deletions
diff --git a/gnu/lib/csu/Makefile b/gnu/lib/csu/Makefile index 05327f7..02f540b 100644 --- a/gnu/lib/csu/Makefile +++ b/gnu/lib/csu/Makefile @@ -15,9 +15,7 @@ OBJS= crtbegin.o crtend.o crtbeginT.o SOBJS= crtbeginS.o crtendS.o CSTD?= gnu89 CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3 -.if ${COMPILER_TYPE} == "gcc" -CFLAGS+= -finhibit-size-directive -fno-toplevel-reorder -.endif +CFLAGS.gcc+= -finhibit-size-directive -fno-toplevel-reorder CFLAGS+= -fno-inline-functions -fno-exceptions \ -fno-zero-initialized-in-bss -fno-asynchronous-unwind-tables \ -fno-omit-frame-pointer diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile index 092e321..d9521d4 100644 --- a/gnu/lib/libgcc/Makefile +++ b/gnu/lib/libgcc/Makefile @@ -112,9 +112,7 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 .if ${TARGET_CPUARCH} == "arm" # from config/arm/t-strongarm-elf CFLAGS+= -Dinhibit_libc -fno-inline -.if ${COMPILER_TYPE} == "clang" -CFLAGS+= -fheinous-gnu-extensions -.endif +CFLAGS.clang+= -fheinous-gnu-extensions LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = _dvmd_tls _bb_init_func diff --git a/gnu/lib/libstdc++/Makefile b/gnu/lib/libstdc++/Makefile index 935a899..b0d45d6 100644 --- a/gnu/lib/libstdc++/Makefile +++ b/gnu/lib/libstdc++/Makefile @@ -637,6 +637,4 @@ CLEANFILES+= ${VERSION_MAP} # Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98. CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} -.if ${COMPILER_TYPE} == "clang" -CXXFLAGS+= -stdlib=libstdc++ -.endif +CXXFLAGS.clang+= -stdlib=libstdc++ diff --git a/gnu/lib/libsupc++/Makefile b/gnu/lib/libsupc++/Makefile index 630387a..acf1b58 100644 --- a/gnu/lib/libsupc++/Makefile +++ b/gnu/lib/libsupc++/Makefile @@ -57,6 +57,4 @@ VERSION_MAP= ${.CURDIR}/Version.map # Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98. CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} -.if ${COMPILER_TYPE} == "clang" -CXXFLAGS+= -stdlib=libstdc++ -.endif +CXXFLAGS.clang+= -stdlib=libstdc++ |