Commit 2bfdc161fb8ff31122b830a17fdc11589832bf8e

Werner Lemberg 2021-05-29T00:27:40

[build] Allow overriding of `ANSIFLAGS` for GNU make build. * builds/*: Implement it.

diff --git a/ChangeLog b/ChangeLog
index cecb207..9d74964 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-05-29  Werner Lemberg  <wl@gnu.org>
+
+	[build] Allow overriding of `ANSIFLAGS` for GNU make build.
+
+	* builds/*: Implement it.
+
 2021-05-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	[type42] Fix auto-hinting.
diff --git a/builds/ansi/ansi-def.mk b/builds/ansi/ansi-def.mk
index 2e8f43f..218d5c0 100644
--- a/builds/ansi/ansi-def.mk
+++ b/builds/ansi/ansi-def.mk
@@ -71,7 +71,7 @@ CFLAGS ?= -c
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSIFLAGS :=
+ANSIFLAGS ?=
 
 
 # EOF
diff --git a/builds/beos/beos-def.mk b/builds/beos/beos-def.mk
index 25d036b..d7d63b3 100644
--- a/builds/beos/beos-def.mk
+++ b/builds/beos/beos-def.mk
@@ -73,7 +73,7 @@ CFLAGS ?= -c
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSIFLAGS :=
+ANSIFLAGS ?=
 
 
 # EOF
diff --git a/builds/compiler/ansi-cc.mk b/builds/compiler/ansi-cc.mk
index fb8b608..e73e6fc 100644
--- a/builds/compiler/ansi-cc.mk
+++ b/builds/compiler/ansi-cc.mk
@@ -68,7 +68,7 @@ CFLAGS ?= -c
 #
 #  we assume the compiler is already strictly ANSI
 #
-ANSIFLAGS :=
+ANSIFLAGS ?=
 
 
 # Library linking
diff --git a/builds/compiler/bcc-dev.mk b/builds/compiler/bcc-dev.mk
index 68a6861..7180452 100644
--- a/builds/compiler/bcc-dev.mk
+++ b/builds/compiler/bcc-dev.mk
@@ -67,7 +67,7 @@ CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSIFLAGS := -A
+ANSIFLAGS ?= -A
 
 
 # Library linking
diff --git a/builds/compiler/bcc.mk b/builds/compiler/bcc.mk
index 47ba0df..321db10 100644
--- a/builds/compiler/bcc.mk
+++ b/builds/compiler/bcc.mk
@@ -67,7 +67,7 @@ CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSIFLAGS := -A
+ANSIFLAGS ?= -A
 
 
 # Library linking
diff --git a/builds/compiler/emx.mk b/builds/compiler/emx.mk
index 0e79994..b3b6047 100644
--- a/builds/compiler/emx.mk
+++ b/builds/compiler/emx.mk
@@ -65,7 +65,7 @@ CFLAGS ?= -c -g -O6 -Wall
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSIFLAGS :=
+ANSIFLAGS ?=
 
 
 # Library linking
diff --git a/builds/compiler/gcc-dev.mk b/builds/compiler/gcc-dev.mk
index 84370a5..f01192f 100644
--- a/builds/compiler/gcc-dev.mk
+++ b/builds/compiler/gcc-dev.mk
@@ -82,8 +82,9 @@ ifndef CFLAGS
 endif
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
+# You can override this on the command line.
 #
-ANSIFLAGS := -std=c99 -pedantic
+ANSIFLAGS ?= -std=c99 -pedantic
 
 
 # Library linking
diff --git a/builds/compiler/gcc.mk b/builds/compiler/gcc.mk
index 017453b..ede20b2 100644
--- a/builds/compiler/gcc.mk
+++ b/builds/compiler/gcc.mk
@@ -65,7 +65,7 @@ CFLAGS ?= -c -g -O3 -Wall
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSIFLAGS := -std=c99 -pedantic
+ANSIFLAGS ?= -std=c99 -pedantic
 
 
 # Library linking
diff --git a/builds/compiler/intelc.mk b/builds/compiler/intelc.mk
index 1ff8ca7..e5dcf90 100644
--- a/builds/compiler/intelc.mk
+++ b/builds/compiler/intelc.mk
@@ -74,7 +74,7 @@ CFLAGS ?= /nologo /c /Ox /G5 /W3 /Qwd32
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSIFLAGS := /Qansi_alias /Za
+ANSIFLAGS ?= /Qansi_alias /Za
 
 # Library linking
 #
diff --git a/builds/compiler/unix-lcc.mk b/builds/compiler/unix-lcc.mk
index fe4326a..40322b4 100644
--- a/builds/compiler/unix-lcc.mk
+++ b/builds/compiler/unix-lcc.mk
@@ -71,7 +71,7 @@ CFLAGS ?= -c -g
 #
 #  the "-A" flag simply increments verbosity about non ANSI code
 #
-ANSIFLAGS := -A
+ANSIFLAGS ?= -A
 
 
 # library linking
diff --git a/builds/compiler/visualc.mk b/builds/compiler/visualc.mk
index ccaee01..dc6998a 100644
--- a/builds/compiler/visualc.mk
+++ b/builds/compiler/visualc.mk
@@ -70,7 +70,7 @@ CFLAGS ?= /nologo /c /Ox /W3 /WX
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSIFLAGS := /Za /D_CRT_SECURE_NO_DEPRECATE
+ANSIFLAGS ?= /Za /D_CRT_SECURE_NO_DEPRECATE
 
 
 # Library linking
diff --git a/builds/compiler/watcom.mk b/builds/compiler/watcom.mk
index f5b071b..c1d1b66 100644
--- a/builds/compiler/watcom.mk
+++ b/builds/compiler/watcom.mk
@@ -67,7 +67,7 @@ CFLAGS ?= -zq
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSIFLAGS := -za
+ANSIFLAGS ?= -za
 
 
 # Library linking
diff --git a/builds/compiler/win-lcc.mk b/builds/compiler/win-lcc.mk
index e17afc2..27fbc30 100644
--- a/builds/compiler/win-lcc.mk
+++ b/builds/compiler/win-lcc.mk
@@ -69,7 +69,7 @@ CFLAGS ?= -c -g2 -O
 #
 #  LCC is pure ANSI anyway!
 #
-ANSIFLAGS :=
+ANSIFLAGS ?=
 
 
 # library linking