[Git][NTPsec/ntpsec][master] SUNCC doesn't support -std=gnu99, but only -std=c99

Eric S. Raymond gitlab at mg.gitlab.com
Sun Dec 18 03:28:52 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
393eff05 by Matt Selsky at 2016-12-17T22:28:05-05:00
SUNCC doesn't support -std=gnu99, but only -std=c99

- - - - -


2 changed files:

- wafhelpers/check_compiler.py
- wafhelpers/configure.py


Changes:

=====================================
wafhelpers/check_compiler.py
=====================================
--- a/wafhelpers/check_compiler.py
+++ b/wafhelpers/check_compiler.py
@@ -19,6 +19,8 @@ int main(void) {
 	printf("2");
 #elif __GNUC__
 	printf("3");
+#elif __SUNPRO_C
+	printf("4");
 #else
 	printf("255");
 #endif
@@ -36,6 +38,7 @@ def check_compiler(ctx):
 		1: ("COMPILER_CLANG",	"clang"),
 		2: ("COMPILER_ICC",		"ICC"),
 		3: ("COMPILER_GCC",		"GCC"),
+		4: ("COMPILER_SUNCC",	"SUNCC"),
 		255: ("COMPILER_GCC",	"Unknown (Defaulting to GCC)"),
 	}
 


=====================================
wafhelpers/configure.py
=====================================
--- a/wafhelpers/configure.py
+++ b/wafhelpers/configure.py
@@ -195,10 +195,14 @@ def cmd_configure(ctx, config):
                 ctx.define("DEBUG", 1, comment="Enable debug mode")
                 ctx.env.BISONFLAGS += ["--debug"]
 
+        ctx.env.CFLAGS += ["-Wall", "-Wextra", "-Wstrict-prototypes"]
         # We require some things that C99 doesn't enable, like pthreads.
-        # Thus -std=gnu99 rather than -std=c99 here.
-        ctx.env.CFLAGS += ["-Wall", "-Wextra", "-std=gnu99",
-			   "-Wstrict-prototypes"]
+        # Thus -std=gnu99 rather than -std=c99 here, if the compiler supports
+        # it.
+        if ctx.env.COMPILER_SUNCC:
+                ctx.env.CFLAGS += ["-std=c99"]
+        else:
+                ctx.env.CFLAGS += ["-std=gnu99"]
 
         # Check target platform.
         ctx.start_msg("Checking build target")



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/393eff055649ad233f3611d18abda9d5fee18b4f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161218/a5823d1e/attachment.html>


More information about the vc mailing list