summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-10-02 06:08:43 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2013-10-02 06:08:43 -0400
commit2bcced58978bc698527f9c8cb4c6ca682c270d2f (patch)
tree750fb1bc4b8dceb64e87d1c59c6eacacd3c711ab /ext
parent0438bf9389f8cdfa76c532e4f288c2256bdca9ff (diff)
downloadgem5-2bcced58978bc698527f9c8cb4c6ca682c270d2f.tar.xz
ext: Fix fputils compiler flags to ensure ISO C99
The fp code relies on C99, and depending on gcc version, the default is to use c89. This patch adds -std=c99 when using gcc to ensure the code is compiled in ISO C99 mode.
Diffstat (limited to 'ext')
-rw-r--r--ext/fputils/SConscript14
1 files changed, 11 insertions, 3 deletions
diff --git a/ext/fputils/SConscript b/ext/fputils/SConscript
index 0d9f63adf..9c5685264 100644
--- a/ext/fputils/SConscript
+++ b/ext/fputils/SConscript
@@ -30,11 +30,19 @@
Import('main')
-main.Library('fputils', [
- main.SharedObject('fp80.c'),
+main.Prepend(CPPPATH=Dir('./include'))
+
+fpenv = main.Clone()
+
+# By default gcc uses c89 and clang uses c99. For fputils to compile
+# we need to use c99.
+if fpenv['GCC']:
+ fpenv.Append(CCFLAGS=['-std=c99'])
+
+fpenv.Library('fputils', [
+ fpenv.SharedObject('fp80.c'),
])
-main.Prepend(CPPPATH=Dir('./include'))
main.Append(LIBS=['fputils'])
main.Prepend(LIBPATH=[Dir('.')])