From cb29567ea13550651d9171455d22d57ca361ac01 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 25 Aug 2015 06:15:33 +0200
Subject: [PATCH] Drop gcc-specific compiler flags when gcc used is just
 non-GNU gcc mask.

---
 build/compiler_flags | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/build/compiler_flags b/build/compiler_flags
index 198da87..b17dac3 100644
--- a/build/compiler_flags
+++ b/build/compiler_flags
@@ -2,4 +2,12 @@
 # or any later version. For details on its copyright, license, and warranties,
 # see the file NOTICE in the root directory of the PlomRogue source package.
 
-CFLAGS='-std=c11 -pedantic-errors -Wall -Werror -Wextra -Wformat-security -O3'
+OFLAG='-O3'
+CFLAGS="-std=c11 -pedantic-errors -Wall -Werror -Wextra -Wformat-security $OFLAG"
+
+# For non-GNU gcc masks, drop all gcc-specific debugging flags.
+test=`stat --version 2>&1 | grep 'Free Software Foundation' | wc -l`
+if [ 1 -gt $test ]
+then
+    CFLAGS=$OFLAG
+fi
-- 
2.30.2