Patch #3152 2011-05-06 12:58

tomjnx

compiler plugin: add support for Keil C51/CX51
Download
3152-compiler_plugi.patch (44.6 KB)
Category
Plugin::FeatureAdd
Status
Accepted
Close date
2013-01-05 15:36
Assigned to
alpha0010
diff --git a/src/include/compiler.h b/src/include/compiler.h
index cea2eb4..eba07f2 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -177,6 +177,7 @@ struct CompilerSwitches
     wxString libExtension;        // a
     bool linkerNeedsLibPrefix;    // when adding a link library, linker needs prefix?
     bool linkerNeedsLibExtension; // when adding a link library, linker needs extension?
+    bool linkerNeedsPathresolution; // linker does not support libDirs; C::B must resolve file paths
     bool supportsPCH;             // supports pre-compiled headers?
     wxString PCHExtension;        // pre-compiled headers extension
     bool UseFlatObjects;          // Use Flat object file names (no extra subdirs)?
@@ -184,12 +185,20 @@ struct CompilerSwitches
                                   // well with relative paths, therefore for GCC it is better to specify the source
                                   // full to the compiler in a full path notation, for all other compilers it is
                                   // suggested to keep this switch at false
+    wxChar includeDirSeparator;   // space
+    wxChar libDirSeparator;       // space
+    wxChar objectSeparator;       // space
+    int statusSuccess;            // 0
     bool Use83Paths;              // This is mainly a workaround for the resource compiler under Windows, apparently
                                   // it doesn't deal well with spaces in the (include) path even if the path is quoted,
                                   // therefore use 8.3 notation without spaces on Windows.
                                   // However, this will apply to all include path's as other tools might have the
                                   // same issue and it won't hurt to apply it to all include directories, if enabled.
 
+                                  // therefore use 8.3 notation without spaces on Windows.
+                                  // However, this will apply to all include path's as other tools might have the
+                                  // same issue and it won't hurt to apply it to all include directories, if enabled.
+
     CompilerSwitches(); // constructor initializing the members, specific compilers should overrule if needed
 };
 
diff --git a/src/include/compilercommandgenerator.h b/src/include/compilercommandgenerator.h
index 9657662..3a8d2d7 100644
--- a/src/include/compilercommandgenerator.h
+++ b/src/include/compilercommandgenerator.h
@@ -68,6 +68,11 @@ class DLLIMPORT CompilerCommandGenerator
         virtual void DoBuildScripts(cbProject* project, CompileTargetBase* target, const wxString& funcName);
         virtual wxString GetOrderedOptions(const ProjectBuildTarget* target, OptionsRelationType rel, const wxString& project_options, const wxString& target_options);
         virtual wxArrayString GetOrderedOptions(const ProjectBuildTarget* target, OptionsRelationType rel, const wxArrayString& project_options, const wxArrayString& target_options);
+        virtual wxArrayString GetOrderedIncludeDirs(Compiler* compiler, ProjectBuildTarget* target);
+        virtual wxArrayString GetOrderedLibrariesDirs(Compiler* compiler, ProjectBuildTarget* target);
+        virtual wxArrayString GetOrderedResourceIncludeDirs(Compiler* compiler, ProjectBuildTarget* target);
+        static wxString MakeOptString(const wxArrayString& arr, const wxString& opt, wxChar separator = _T(' '));
+        static wxString PathSearch(const wxArrayString& arr, const wxString& filename);
         virtual wxString SetupOutputFilenames(Compiler* compiler, ProjectBuildTarget* target);
         virtual wxString SetupIncludeDirs(Compiler* compiler, ProjectBuildTarget* target);
         virtual wxString SetupLibrariesDirs(Compiler* compiler, ProjectBuildTarget* target);
diff --git a/src/plugins/compilergcc/Makefile.am b/src/plugins/compilergcc/Makefile.am
index 2e07e90..7879221 100644
--- a/src/plugins/compilergcc/Makefile.am
+++ b/src/plugins/compilergcc/Makefile.am
@@ -26,6 +26,8 @@ libcompiler_la_SOURCES = advancedcompileroptionsdlg.cpp \
             compilergcc.cpp \
             compilerGDC.cpp \
             compilerICC.cpp \
+            compilerIAR.cpp \
+            compilerKeilC51.cpp \
             compilerLCC.cpp \
             compilermessages.cpp \
             compilerMINGW.cpp \
@@ -51,6 +53,8 @@ noinst_HEADERS = advancedcompileroptionsdlg.h \
             compilerG95.h \
             compilerGDC.h \
             compilerICC.h \
+            compilerIAR.h \
+            compilerKeilC51.h \
             compilerLCC.h \
             compilermessages.h \
             compilerMINGW.h \
diff --git a/src/plugins/compilergcc/advancedcompileroptionsdlg.cpp b/src/plugins/compilergcc/advancedcompileroptionsdlg.cpp
index dac7186..dd6501c 100644
--- a/src/plugins/compilergcc/advancedcompileroptionsdlg.cpp
+++ b/src/plugins/compilergcc/advancedcompileroptionsdlg.cpp
@@ -114,6 +114,7 @@ void AdvancedCompilerOptionsDlg::ReadCompilerO
download for full patch...
alpha0010 2012-12-25 14:33
tomjnx 2012-12-27 00:30

Updated; now includes both keil C51 and IAR 8051 compiler drivers; adapted to the new XML compiler framework

tomjnx 2012-12-27 00:38

I give up. Berlios seems to strip new files from the patch.

A complete patch can be found here:

http://www.baycom.org/~tom/cb/keiliarcompilers.patch

alpha0010 2013-01-05 15:36

In trunk; thank you.