summarylogtreecommitdiffstats
path: root/expose-cargs-and-largs-makefile.patch
blob: 0bd38dd02e395760717dc14aecfc1119ebb26b3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- a/Makefile
+++ b/Makefile
@@ -67,6 +67,14 @@
    LIBGPR_TYPES=static
 endif
 
+ifneq ($(strip $(CFLAGS)),)
+   CARGS := -cargs $(CFLAGS)
+endif
+
+ifneq ($(strip $(LDFLAGS)),)
+   LARGS := -largs $(LDFLAGS)
+endif
+
 # Used to pass extra options to GPRBUILD, like -d for instance
 GPRBUILD_OPTIONS=
 
@@ -136,15 +144,15 @@
 
 libgpr.build.shared:
 	${BUILDER} -XLIBRARY_TYPE=relocatable \
-		-XXMLADA_BUILD=relocatable $(GPR_GPR)
+		-XXMLADA_BUILD=relocatable $(GPR_GPR) $(CARGS) $(LARGS)
 
 libgpr.build.static:
 	${BUILDER} -XLIBRARY_TYPE=static \
-		-XXMLADA_BUILD=static $(GPR_GPR)
+		-XXMLADA_BUILD=static $(GPR_GPR) $(CARGS) $(LARGS)
 
 libgpr.build.static-pic:
 	${BUILDER} -XLIBRARY_TYPE=static-pic \
-		-XXMLADA_BUILD=static-pic $(GPR_GPR)
+		-XXMLADA_BUILD=static-pic $(GPR_GPR) $(CARGS) $(LARGS)
 
 libgpr.install: libgpr.uninstall $(foreach t, $(LIBGPR_TYPES), libgpr.install.$(t))