Greg changes merged
author'Laurent Bessard <laurent.bessard@lolitech.fr>'
Fri, 16 Oct 2009 10:50:16 +0200
changeset 420 c093ec48f2fd
parent 419 1cdae505be9e (current diff)
parent 418 01f6bfc01251 (diff)
child 421 c9ec111ad275
Greg changes merged
plugger.py
plugins/c_ext/c_ext.py
--- a/plugger.py	Fri Oct 16 10:37:53 2009 +0200
+++ b/plugger.py	Fri Oct 16 10:50:16 2009 +0200
@@ -658,9 +658,6 @@
 else:
     exe_ext=""
 
-iec2c_path = os.path.join(base_folder, "matiec", "iec2c"+exe_ext)
-ieclib_path = os.path.join(base_folder, "matiec", "lib")
-
 # import for project creation timestamping
 from threading import Timer, Lock, Thread, Semaphore
 from time import localtime
@@ -747,6 +744,9 @@
         self._connector = None
         self.Deleting = False
         
+        self.iec2c_path = os.path.join(base_folder, "matiec", "iec2c"+exe_ext)
+        self.ieclib_path = os.path.join(base_folder, "matiec", "lib")
+        
         # Setup debug information
         self.IECdebug_datas = {}
         self.IECdebug_lock = Lock()
@@ -807,6 +807,12 @@
     def GetPlugRoot(self):
         return self
 
+    def GetIECLibPath(self):
+        return self.ieclib_path
+    
+    def GetIEC2cPath(self):
+        return self.iec2c_path
+    
     def GetCurrentLocation(self):
         return ()
 
@@ -1056,8 +1062,8 @@
         status, result, err_result = ProcessLogger(
                self.logger,
                "\"%s\" -f -I \"%s\" -T \"%s\" \"%s\""%(
-                         iec2c_path,
-                         ieclib_path, 
+                         self.iec2c_path,
+                         self.ieclib_path, 
                          buildpath,
                          self._getIECcodepath()),
                no_stdout=True, no_stderr=True).spin()
@@ -1107,7 +1113,7 @@
         # Keep track of generated C files for later use by self.PlugGenerate_C
         self.PLCGeneratedCFiles = C_files
         # compute CFLAGS for plc
-        self.plcCFLAGS = "\"-I"+ieclib_path+"\""
+        self.plcCFLAGS = "\"-I"+self.ieclib_path+"\""
         return True
 
     def GetBuilder(self):
@@ -1274,9 +1280,9 @@
             plc_main_code = targets.code("plc_common_main") % {
                 "calls_prototypes":"\n".join([(
                       "int __init_%(s)s(int argc,char **argv);\n"+
-                      "void __cleanup_%(s)s();\n"+
-                      "void __retrieve_%(s)s();\n"+
-                      "void __publish_%(s)s();")%{'s':locstr} for locstr in locstrs]),
+                      "void __cleanup_%(s)s(void);\n"+
+                      "void __retrieve_%(s)s(void);\n"+
+                      "void __publish_%(s)s(void);")%{'s':locstr} for locstr in locstrs]),
                 "retrieve_calls":"\n    ".join([
                       "__retrieve_%s();"%locstr for locstr in locstrs]),
                 "publish_calls":"\n    ".join([ #Call publish in reverse order
--- a/plugins/c_ext/c_ext.py	Fri Oct 16 10:37:53 2009 +0200
+++ b/plugins/c_ext/c_ext.py	Fri Oct 16 10:50:16 2009 +0200
@@ -341,7 +341,7 @@
         cfile.write(text)
         cfile.close()
         
-        matiec_flags = " -I%s"%os.path.abspath(self.GetPlugRoot().GetIECLibPath())
+        matiec_flags = '"-I%s"'%os.path.abspath(self.GetPlugRoot().GetIECLibPath())
         
         return [(Gen_Cfile_path, str(self.CExtension.getCFLAGS() + matiec_flags))],str(self.CExtension.getLDFLAGS()),True
         
--- a/plugins/python/python.py	Fri Oct 16 10:37:53 2009 +0200
+++ b/plugins/python/python.py	Fri Oct 16 10:50:16 2009 +0200
@@ -264,9 +264,6 @@
         runtimefile.write(self.GetPythonCode())
         runtimefile.close()
         
-        if wx.Platform == '__WXMSW__':
-            matiec_flags = " -I../../matiec/lib"
-        else:
-            matiec_flags = " -I../matiec/lib"
+        matiec_flags = '"-I%s"'%os.path.abspath(self.GetPlugRoot().GetIECLibPath())
         
         return [(Gen_Pythonfile_path, matiec_flags)], "", True, ("runtime_%s.py"%location_str, file(runtimefile_path,"rb"))