* support/scripts/sdcc.nsi: fixed bug in IsNT, LogicLib-isation of AddToPath and...
[fw/sdcc] / support / valdiag / valdiag.py
index 2a4ed7502e4f61e733ad78dbe497c687c7212acd..74b423bf468518e3f8490c445c39379499c777c4 100644 (file)
@@ -28,11 +28,14 @@ macrodefs = {}
 
 gcc = {
     "CC":"gcc",
-    "CCFLAGS":"-c -Wall",
+    "CCFLAGS":"-c -Wall -DPORT_HOST=1",
     "CCDEF":"-D",
     "CCOUTPUT":"-o",
+    "C89":"-std=c89",
+    "C99":"-std=c99",
     "defined": {
-        "__GNUC__":"1"
+        "__GNUC__":"1",
+        "GCC":"1"
     },
     "ignoremsg": [
     ]
@@ -43,6 +46,8 @@ sdcc = {
     "CCFLAGS":"-c -m{port}",
     "CCDEF":"-D",
     "CCOUTPUT":"-o",
+    "C89":"--std-sdcc89",
+    "C99":"--std-sdcc99",
     "defined": {
         "SDCC":"1",
         "SDCC_{port}":"1",
@@ -266,7 +271,13 @@ failurecount = 0
 
 for testname in testcases.keys():
     ccdef = compilermode["CCDEF"]+testname
-    cmd = string.join([cc,ccflags,ccdef,inputfilename])
+    if testname[-3:] == "C89":
+        ccstd = compilermode["C89"]
+    elif testname[-3:] == "C99":
+        ccstd = compilermode["C99"]
+    else:
+        ccstd = ""
+    cmd = string.join([cc,ccflags,ccstd,ccdef,inputfilename])
     print
     print cmd
     spawn = popen2.Popen4(cmd)