[vlc-commits] contrib: make sure the debug flags are always set in the global CFLAGS

Steve Lhomme git at videolan.org
Wed Jul 24 06:54:04 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul 23 12:45:41 2019 +0200| [403de0d4662dd79095edff999e0afbfdd9e39e81] | committer: Steve Lhomme

contrib: make sure the debug flags are always set in the global CFLAGS

They are not supported by Meson but the CFLAGS but the global flags are used
in some contribs to add extra local flags. We would miss these flags otherwise.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=403de0d4662dd79095edff999e0afbfdd9e39e81
---

 contrib/src/main.mak | 45 ++++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 0f805e293d..64cbfe4de9 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -191,12 +191,6 @@ CFLAGS := $(CFLAGS) -gcodeview
 CXXFLAGS := $(CXXFLAGS) -gcodeview
 endif
 
-ifndef WITH_OPTIMIZATION
-DBGOPTIMFLAGS = -g -O0
-else
-DBGOPTIMFLAGS = -g -O2
-endif
-
 # Do not export those! Use HOSTVARS.
 
 # Do the FPU detection, after we have figured out our compilers and flags.
@@ -311,21 +305,6 @@ HOSTCONF += --with-pic
 PIC := -fPIC
 endif
 
-HOSTTOOLS := \
-	CC="$(CC)" CXX="$(CXX)" LD="$(LD)" \
-	AR="$(AR)" CCAS="$(CCAS)" RANLIB="$(RANLIB)" STRIP="$(STRIP)" \
-	PATH="$(PREFIX)/bin:$(PATH)"
-HOSTVARS := $(HOSTTOOLS) \
-	CPPFLAGS="$(CPPFLAGS)" \
-	CFLAGS="$(CFLAGS) $(DBGOPTIMFLAGS)" \
-	CXXFLAGS="$(CXXFLAGS) $(DBGOPTIMFLAGS)" \
-	LDFLAGS="$(LDFLAGS)"
-HOSTVARS_PIC := $(HOSTTOOLS) \
-	CPPFLAGS="$(CPPFLAGS) $(PIC)" \
-	CFLAGS="$(CFLAGS) $(DBGOPTIMFLAGS) $(PIC)" \
-	CXXFLAGS="$(CXXFLAGS) $(DBGOPTIMFLAGS) $(PIC)" \
-	LDFLAGS="$(LDFLAGS)"
-
 # For cross-compilation with meson, do not set compiler and flags
 # in HOSTVARS as meson will always use them for the BUILD machine compiler!
 ifdef HAVE_CROSS_COMPILE
@@ -338,6 +317,30 @@ HOSTVARS_MESON := $(HOSTTOOLS) \
 	LDFLAGS="$(LDFLAGS)"
 endif
 
+# Add these flags after Meson consumed the CFLAGS/CXXFLAGS
+ifndef WITH_OPTIMIZATION
+CFLAGS := $(CFLAGS) -g -O0
+CXXFLAGS := $(CXXFLAGS) -g -O0
+else
+CFLAGS := $(CFLAGS) -g -O2
+CXXFLAGS := $(CXXFLAGS) -g -O2
+endif
+
+HOSTTOOLS := \
+	CC="$(CC)" CXX="$(CXX)" LD="$(LD)" \
+	AR="$(AR)" CCAS="$(CCAS)" RANLIB="$(RANLIB)" STRIP="$(STRIP)" \
+	PATH="$(PREFIX)/bin:$(PATH)"
+HOSTVARS := $(HOSTTOOLS) \
+	CPPFLAGS="$(CPPFLAGS)" \
+	CFLAGS="$(CFLAGS)" \
+	CXXFLAGS="$(CXXFLAGS)" \
+	LDFLAGS="$(LDFLAGS)"
+HOSTVARS_PIC := $(HOSTTOOLS) \
+	CPPFLAGS="$(CPPFLAGS) $(PIC)" \
+	CFLAGS="$(CFLAGS) $(PIC)" \
+	CXXFLAGS="$(CXXFLAGS) $(PIC)" \
+	LDFLAGS="$(LDFLAGS)"
+
 download_git = \
 	rm -Rf -- "$(@:.tar.xz=)" && \
 	$(GIT) init --bare "$(@:.tar.xz=)" && \



More information about the vlc-commits mailing list