]> git.ipfire.org Git - pakfire.git/commitdiff
macros: Move CFLAGS/CXXFLAGS/LDFLAGS into the build section
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 12 Dec 2022 17:06:21 +0000 (17:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 12 Dec 2022 17:06:21 +0000 (17:06 +0000)
This is where they belong and it makes it easier to modify them in the
build section of individual packages.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
macros/cflags.macro

index 1175d95f1cd1e3b74f886152f87a5f510c65836d..8635a3c3e2ba2fcaf3eea8ba187e2077d2569b69 100644 (file)
@@ -1,45 +1,47 @@
-# Export CFLAGS
-export CFLAGS = # empty
+build
+       # Export CFLAGS
+       export CFLAGS = # empty
 
-# Export CXXFLAGS
-export CXXFLAGS = %{CFLAGS}
+       # Export CXXFLAGS
+       export CXXFLAGS = %{CFLAGS}
 
-# Export LDFLAGS
-export LDFLAGS  = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now
+       # Export LDFLAGS
+       export LDFLAGS  = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now
 
-# Enable optimisation and compile in debugging information
-CFLAGS = -O2 -g
+       # Enable optimisation and compile in debugging information
+       CFLAGS = -O2 -g
 
-# Enable all compiler warnings
-CFLAGS += -Wall -Werror=format-security
+       # Enable all compiler warnings
+       CFLAGS += -Wall -Werror=format-security
 
-# Fortify Source
-CFLAGS += -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=3
+       # Fortify Source
+       CFLAGS += -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=3
 
-# Build Position Independent Code
-CFLAGS += -fPIC
+       # Build Position Independent Code
+       CFLAGS += -fPIC
 
-# Enable Stack Smashing Protection
-CFLAGS += -fstack-protector-strong
+       # Enable Stack Smashing Protection
+       CFLAGS += -fstack-protector-strong
 
-# Enable unwind tables
-CFLAGS += -funwind-tables -fasynchronous-unwind-tables
+       # Enable unwind tables
+       CFLAGS += -funwind-tables -fasynchronous-unwind-tables
 
-# Enable Stack Clash Protection
-CFLAGS += -fstack-clash-protection
+       # Enable Stack Clash Protection
+       CFLAGS += -fstack-clash-protection
 
-# Tell the compiler where the source will be put
-CFLAGS += -fdebug-prefix-map=%{DIR_SRC}=%{debugsourcedir}
+       # Tell the compiler where the source will be put
+       CFLAGS += -fdebug-prefix-map=%{DIR_SRC}=%{debugsourcedir}
 
-# Arch: x86_64
-CFLAGS_x86_64 = -m64 -march=x86-64-v2 -mtune=generic
+       # Arch: x86_64
+       CFLAGS_x86_64 = -m64 -march=x86-64-v2 -mtune=generic
 
-# Arch: aarch64
-CFLAGS_aarch64 = -mbranch-protection=standard
+       # Arch: aarch64
+       CFLAGS_aarch64 = -mbranch-protection=standard
 
-# Append architecture optimisations
-CFLAGS += %{CFLAGS_%{DISTRO_ARCH}}
+       # Append architecture optimisations
+       CFLAGS += %{CFLAGS_%{DISTRO_ARCH}}
 
-# Enable LTO
-LTO_CFLAGS = -flto=auto -ffat-lto-objects
-CFLAGS += %{LTO_CFLAGS}
+       # Enable LTO
+       LTO_CFLAGS = -flto=auto -ffat-lto-objects
+       CFLAGS += %{LTO_CFLAGS}
+end