Browse code

pkg/kamailio/deb: easier way to set CC_EXTRA_OPTS and LD_EXTRA_OPTS

Victor Seva authored on 07/02/2015 16:54:26
Showing 6 changed files
... ...
@@ -108,9 +108,11 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
108 108
 endif
109 109
 
110 110
 # CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
111
+CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS)
112
+CC_EXTRA_OPTS += $(shell dpkg-buildflags --get CFLAGS)
113
+CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
111 114
 # LDFLAGS -> LD_EXTRA_OPTS
112
-CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
113
-sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
115
+LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
114 116
 
115 117
 configure: configure-stamp
116 118
 configure-stamp:
... ...
@@ -120,7 +122,8 @@ configure-stamp:
120 122
 			cfg_target=/etc/kamailio/ \
121 123
 			basedir=$(CURDIR)/debian/kamailio \
122 124
 			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
123
-			$(CUSTOM_BUILDFLAGS) \
125
+			CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \
126
+			LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \
124 127
 			group_include="kstandard"
125 128
 
126 129
 	touch configure-stamp
... ...
@@ -108,9 +108,11 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
108 108
 endif
109 109
 
110 110
 # CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
111
+CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS)
112
+CC_EXTRA_OPTS += $(shell dpkg-buildflags --get CFLAGS)
113
+CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
111 114
 # LDFLAGS -> LD_EXTRA_OPTS
112
-CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
113
-sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
115
+LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
114 116
 
115 117
 configure: configure-stamp
116 118
 configure-stamp:
... ...
@@ -120,7 +122,8 @@ configure-stamp:
120 122
 			cfg_target=/etc/kamailio/ \
121 123
 			basedir=$(CURDIR)/debian/kamailio \
122 124
 			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
123
-			$(CUSTOM_BUILDFLAGS) \
125
+			CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \
126
+			LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \
124 127
 			group_include="kstandard"
125 128
 
126 129
 	touch configure-stamp
... ...
@@ -107,9 +107,11 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
107 107
 endif
108 108
 
109 109
 # CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
110
+CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS)
111
+CC_EXTRA_OPTS += $(shell dpkg-buildflags --get CFLAGS)
112
+CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
110 113
 # LDFLAGS -> LD_EXTRA_OPTS
111
-CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
112
-sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
114
+LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
113 115
 
114 116
 configure: configure-stamp
115 117
 configure-stamp:
... ...
@@ -119,7 +121,8 @@ configure-stamp:
119 121
 			cfg_target=/etc/kamailio/ \
120 122
 			basedir=$(CURDIR)/debian/kamailio \
121 123
 			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
122
-			$(CUSTOM_BUILDFLAGS) \
124
+			CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \
125
+			LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \
123 126
 			group_include="kstandard"
124 127
 
125 128
 	touch configure-stamp
... ...
@@ -105,8 +105,11 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
105 105
 endif
106 106
 
107 107
 # CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
108
+CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS)
109
+CC_EXTRA_OPTS += $(shell dpkg-buildflags --get CFLAGS)
110
+CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
108 111
 # LDFLAGS -> LD_EXTRA_OPTS
109
-sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
112
+LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
110 113
 
111 114
 configure: configure-stamp
112 115
 configure-stamp:
... ...
@@ -116,7 +119,8 @@ configure-stamp:
116 119
 			cfg_target=/etc/kamailio/ \
117 120
 			basedir=$(CURDIR)/debian/kamailio \
118 121
 			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
119
-			$(CUSTOM_BUILDFLAGS) \
122
+			CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \
123
+			LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \
120 124
 			group_include="kstandard"
121 125
 
122 126
 	touch configure-stamp
... ...
@@ -108,9 +108,11 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
108 108
 endif
109 109
 
110 110
 # CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
111
+CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS)
112
+CC_EXTRA_OPTS += $(shell dpkg-buildflags --get CFLAGS)
113
+CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
111 114
 # LDFLAGS -> LD_EXTRA_OPTS
112
-CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
113
-sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
115
+LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
114 116
 
115 117
 configure: configure-stamp
116 118
 configure-stamp:
... ...
@@ -120,7 +122,8 @@ configure-stamp:
120 122
 			cfg_target=/etc/kamailio/ \
121 123
 			basedir=$(CURDIR)/debian/kamailio \
122 124
 			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
123
-			$(CUSTOM_BUILDFLAGS) \
125
+			CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \
126
+			LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \
124 127
 			group_include="kstandard"
125 128
 
126 129
 	touch configure-stamp
... ...
@@ -107,9 +107,11 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
107 107
 endif
108 108
 
109 109
 # CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS
110
+CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS)
111
+CC_EXTRA_OPTS += $(shell dpkg-buildflags --get CFLAGS)
112
+CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
110 113
 # LDFLAGS -> LD_EXTRA_OPTS
111
-CUSTOM_BUILDFLAGS:=$(shell dpkg-buildflags --export=configure| \
112
-sed -e 's/" CPPFLAGS="/ /' -e 's/CFLAGS/CC_EXTRA_OPTS/g' -e 's/LDFLAGS/LD_EXTRA_OPTS/g')
114
+LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
113 115
 
114 116
 configure: configure-stamp
115 117
 configure-stamp:
... ...
@@ -119,7 +121,8 @@ configure-stamp:
119 121
 			cfg_target=/etc/kamailio/ \
120 122
 			basedir=$(CURDIR)/debian/kamailio \
121 123
 			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
122
-			$(CUSTOM_BUILDFLAGS) \
124
+			CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \
125
+			LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \
123 126
 			group_include="kstandard"
124 127
 
125 128
 	touch configure-stamp