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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
From: Göran Weinholt <goran@weinholt.se>
Date: Sun, 18 Dec 2022 12:46:44 +0100
Subject: Pass through compiler flags to gcc
Forwarded: no
---
--- scm-5f3.orig/build.scm
+++ scm-5f3/build.scm
@@ -1041,6 +1041,8 @@
(include-spec "-I" parms)
(c-includes parms)
(c-flags parms)
+ (getenv "CPPFLAGS")
+ (getenv "CFLAGS")
files)
(truncate-up-to (map c->o files) #\/))))
(defcommand compile-dll-c-files linux
@@ -1076,6 +1078,7 @@
(string-append
(car (parameter-list-ref parms 'implvic))
oname ".so")
+ (getenv "CFLAGS")
objects
(map (lambda (l) (build:lib-ld-flag l platform))
(parameter-list-ref parms 'c-lib)))
@@ -1087,6 +1090,7 @@
(lambda (oname objects libs parms)
(and (batch:try-command
parms "gcc" "-rdynamic" "-o" oname
+ (getenv "LDFLAGS")
(must-be-first
'("pre-crt0.o" "ecrt0.o" "/usr/lib/crt0.o")
(append objects libs)))
--- scm-5f3.orig/Makefile
+++ scm-5f3/Makefile
@@ -350,7 +350,7 @@
# SCMLIT -- Make this first!
scmlit: $(ofiles) scmmain.o require.scm Makefile
- $(LD) -o scmlit $(ofiles) scmmain.o $(LIBS)
+ $(LD) -o scmlit $(ofiles) scmmain.o $(LDFLAGS) $(LIBS)
$(MAKE) checklit
scmflags.h: scmflags
scmflags:
@@ -362,7 +362,7 @@
-if (cmp -s newflags.h scmflags.h) then rm newflags.h; \
else mv newflags.h scmflags.h; fi
.c.o:
- $(CC) -c $(CFLAGS) $< -o $@
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
scm.o: scm.c scm.h scmfig.h scmflags.h patchlvl.h
scmmain.o: scmmain.c scm.h scmfig.h scmflags.h patchlvl.h
scl.o: scl.c scm.h scmfig.h scmflags.h
|