summarylogtreecommitdiffstats
path: root/expose-cargs-and-largs-makefile.patch
blob: 8cbe752d6cabcb869e9b39e128941403f52043f1 (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
--- Makefile.in-orig	2022-09-28 16:33:19.000000000 +1000
+++ Makefile.in	2022-11-15 21:15:27.002332097 +1100
@@ -68,14 +68,22 @@
 install: install-clean install-static
 endif
 
+ifneq ($(strip $(CFLAGS)),)
+CARGS := -cargs $(CFLAGS)
+endif
+
+ifneq ($(strip $(LDFLAGS)),)
+LARGS := -largs $(LDFLAGS)
+endif
+
 static:
-	${GPRBUILD} -p -XLIBRARY_TYPE=static ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA}
+	${GPRBUILD} -p -XLIBRARY_TYPE=static ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA} $(CARGS) $(LARGS)
 
 shared relocatable:
-	${GPRBUILD} -p -XLIBRARY_TYPE=relocatable ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA}
+	${GPRBUILD} -p -XLIBRARY_TYPE=relocatable ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA} $(CARGS) $(LARGS)
 
 static-pic:
-	${GPRBUILD} -p -XLIBRARY_TYPE=static-pic ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA}
+	${GPRBUILD} -p -XLIBRARY_TYPE=static-pic ${GPROPTS} xmlada.gpr ${GPROPTS_EXTRA} $(CARGS) $(LARGS)
 
 # Rebuild the tests (and not the XML/Ada code itself)
 test: force