Index: plugins/compilergcc/compilerLCC.h
===================================================================
--- plugins/compilergcc/compilerLCC.h	(revision 0)
+++ plugins/compilergcc/compilerLCC.h	(revision 0)
@@ -0,0 +1,24 @@
+#ifdef __WXMSW__
+// this compiler is valid only in windows
+
+#ifndef COMPILER_LCC_H
+#define COMPILER_LCC_H
+
+#include <compiler.h>
+
+class CompilerLCC : public Compiler
+{
+  public:
+    CompilerLCC();
+    virtual ~CompilerLCC();
+    virtual void Reset();
+    virtual void LoadDefaultRegExArray();
+    virtual AutoDetectResult AutoDetectInstallationDir();
+  protected:
+    virtual Compiler* CreateCopy();
+  private:
+};
+
+#endif // COMPILER_LCC_H
+
+#endif // __WXMSW__

Property changes on: plugins\compilergcc\compilerLCC.h
___________________________________________________________________
Name: svn:eol-style
   + LF

Index: plugins/compilergcc/compilerLCC.cpp
===================================================================
--- plugins/compilergcc/compilerLCC.cpp	(revision 0)
+++ plugins/compilergcc/compilerLCC.cpp	(revision 0)
@@ -0,0 +1,240 @@
+#ifdef __WXMSW__
+// this compiler is valid only in windows
+
+/*
+* This file is part of Code::Blocks Studio, an open-source cross-platform IDE
+* Copyright (C) 2006  Yiannis An. Mandravellos
+*
+* This program is distributed under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+*/
+
+#include <sdk.h>
+#include "compilerLCC.h"
+#include <wx/intl.h>
+#include <wx/regex.h>
+#include <wx/config.h>
+#include <wx/fileconf.h>
+#include <wx/msgdlg.h>
+#include <wx/log.h>
+
+#include <wx/msw/registry.h>
+
+CompilerLCC::CompilerLCC()
+    : Compiler(_("LCC Compiler"), _T("lcc"))
+{
+    Reset();
+}
+
+CompilerLCC::~CompilerLCC()
+{
+    //dtor
+}
+
+Compiler * CompilerLCC::CreateCopy()
+{
+    return new CompilerLCC(*this);
+}
+
+void CompilerLCC::Reset()
+{
+    m_Programs.C = _T("lcc.exe");
+    m_Programs.CPP = _T("lcc.exe");
+    m_Programs.LD = _T("lcclnk.exe");
+    m_Programs.DBG = _T("cdb.exe");
+    m_Programs.LIB = _T("lcclib.exe");
+    m_Programs.WINDRES = _T("lrc.exe");
+    m_Programs.MAKE = _T("make.exe");
+
+    m_Switches.includeDirs = _T("-I");
+    m_Switches.libDirs = _T("-L");
+    m_Switches.linkLibs = _T("");
+    m_Switches.defines = _T("-D");
+    m_Switches.genericSwitch = _T("-");
+    m_Switches.objectExtension = _T("obj");
+
+    m_Switches.needDependencies = true;
+    m_Switches.forceCompilerUseQuotes = false;
+    m_Switches.forceLinkerUseQuotes = false;
+    m_Switches.logging = clogSimple; // clogFull;
+    m_Switches.libPrefix = _T("");
+    m_Switches.libExtension = _T("lib");
+    m_Switches.linkerNeedsLibPrefix = false;
+    m_Switches.linkerNeedsLibExtension = true;
+    m_Switches.buildMethod = cbmDirect;
+
+    m_Options.ClearOptions();
+
+    // General
+    wxString category = _("General");
+    m_Options.AddOption(_("Generate the debugging information."), _T("-g2"), category, _T(""),
+                true,
+                _T("-O"),
+                _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
+    m_Options.AddOption(_("Arrange for function stack tracing. If a trap occurs, the function stack will be displayed."), _T("-g3"), category, _T(""),
+                true,
+                _T("-O"),
+                _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
+    m_Options.AddOption(_("Arrange for function stack and line number tracing."), _T("-g4"), category, _T(""),
+                true,
+                _T("-O"),
+                _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
+    m_Options.AddOption(_("Arrange for function stack, line number, and return call stack corruption tracing."), _T("-g5"), category, _T(""),
+                true,
+                _T("-O"),
+                _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
+
+    m_Options.AddOption(_("Inject code into the generated program to measure execution time. Incompatible with debug level higher than 2!"), _T("-profile"), category);
+    m_Options.AddOption(_("All warnings will be active"), _T("-A"), category);
+    m_Options.AddOption(_("Check the given source for errors. No object file is generated."), _T("-check"), category);
+    m_Options.AddOption(_("No warnings will be emitted. Errors will be still printed."), _T("-nw"), category);
+    m_Options.AddOption(_("Warn when a local variable shadows a global one."), _T("-shadows"), category);
+    m_Options.AddOption(_("Warns about unused assignments and suppresses the dead code."), _T("-unused"), category);
+    m_Options.AddOption(_("Generate code to test for overflow for all additions, subtractions and multiplications."), _T("-overflowcheck"), category);
+
+    // optimization
+    category = _("Optimization");
+    m_Options.AddOption(_("Optimize the output. This activates the peephole optimizer."), _T("-O"), category);
+    m_Options.AddOption(_("Enable Pentium III instructions."), _T("-p6"), category);
+    m_Options.AddOption(_("The inline directive is ignored."), _T("-fno-inline"), category);
+    m_Options.AddOption(_("Use declarations for lcclibc.dll. Don't forget the -dynamic option for the linker!"), _T("-libcdll"), category);
+    m_Options.AddOption(_("Set the default alignment in structures to no alignment at all."), _T("-Zp1"), category);
+    m_Options.AddOption(_("Set the default alignment in structures to 2."), _T("-Zp2"), category);
+    m_Options.AddOption(_("Set the default alignment in structures to 4."), _T("-Zp4"), category);
+    m_Options.AddOption(_("Set the default alignment in structures to 8."), _T("-Zp8"), category);
+    m_Options.AddOption(_("Set the default alignment in structures to 16."), _T("-Zp16"), category);
+
+    // misc
+    category = _("Miscellaneous");
+    m_Options.AddOption(_("Disallow the language extensions of lcc-win32."), _T("-ansic"), category);
+    m_Options.AddOption(_("Print in standard output each include file recursively."), _T("-M1"), category);
+    m_Options.AddOption(_("Do not query the registry for the lib path."), _T("-noregistrylookup"), category);
+
+    m_Commands[(int)ctCompileObjectCmd]   = _T("$compiler -c $includes $options $file -Fo$object");
+    m_Commands[(int)ctGenDependenciesCmd] = _T("");
+    m_Commands[(int)ctCompileResourceCmd] = _T("$rescomp $res_includes $file -fo$resource_output");
+    m_Commands[(int)ctLinkExeCmd]         = _T("$linker $libdirs $link_options $link_objects $link_resobjects $libs -o $exe_output");
+    m_Commands[(int)ctLinkConsoleExeCmd]  = _T("$linker -subsystem console $libdirs $link_options $link_objects $link_resobjects $libs -o $exe_output");
+    m_Commands[(int)ctLinkDynamicCmd]     = _T("$linker -dll $libdirs $link_options $link_objects $link_resobjects $libs -o $exe_output");
+    m_Commands[(int)ctLinkStaticCmd]      = _T("$lib_linker $link_objects $link_resobjects -OUT:$static_output");
+
+    LoadDefaultRegExArray();
+
+    m_CompilerOptions.Clear();
+    m_LinkerOptions.Clear();
+    m_LinkLibs.Clear();
+    m_CmdsBefore.Clear();
+    m_CmdsAfter.Clear();
+}
+
+void CompilerLCC::LoadDefaultRegExArray()
+{
+    m_RegExes.Clear();
+
+    // Syntax: RegExStruct("Type", cltType, RegExp, (RegExp)#Message, (RegExp)#Filename, (RegExp)#Line))
+
+    // Helper:
+    // RegExp for file name (Win32):    ([ \tA-Za-z0-9_:+/\\.-]+)
+    // RegExp for alphanumeric:         ([0-9A-Za-z]+)
+    // RegExp for hexa-decimal:         ([0-9A-Fa-fXx]+)
+    // RegExp for hexa-decimal (0x...): (0x[0-9A-Fa-f]+)
+
+    // Preprocessor error
+    // GCC way:   myapp.c:3:21: stdlib1.h: No such file or directory
+    // LCC way:   cpp: myapp.c:3 Could not find include file <stdlib1.h>
+    m_RegExes.Add(RegExStruct(_("Preprocessor error"), cltError, _T("cpp:[ \t]([ \tA-Za-z0-9_:+/\\.-]+):([0-9]+)[ \t](.*)"), 3, 1, 2));
+
+    // Compiler warnings:
+    // GCC way:   myapp.c:7: warning: unused variable `i'
+    // LCC way:   Warning myapp.c: 7  local 'int i' is not referenced
+    m_RegExes.Add(RegExStruct(_("Compiler warning"), cltWarning, _T("[Ww]arning[ \t]([ \tA-Za-z0-9_:+/\\.-]+):[ \t]([0-9]+)[ \t]+(.*)"), 3, 1, 2));
+
+    // Compiler errors:
+    // GCC way:   myapp.c:7: error: `into' undeclared (first use in this function)
+    // LCC way:   Error myapp.c: 7  undeclared identifier 'into'
+    m_RegExes.Add(RegExStruct(_("Compiler error"), cltError, _T("[Ee]rror[ \t]([ \tA-Za-z0-9_:+/\\.-]+):[ \t]([0-9]+)[ \t]+(.*)"), 3, 1, 2));
+
+    // Linker errors:
+    // GCC way:   gcc.EXE: mylib.a: No such file or directory
+    // LCC way:   cannot open mylib.lib
+    m_RegExes.Add(RegExStruct(_("Linker error"), cltError, _T("(cannot open)[ \t]([ \tA-Za-z0-9_:+/\\.-]+)"), 1, 2, 0, 2));
+
+    // Undefined references:
+    // GCC way:   myapp.o:myapp.c:(.text+0x4c): undefined reference to `dummy'
+    // LCC way:   myapp.obj .text: undefined reference to '_dummy'
+    m_RegExes.Add(RegExStruct(_("Undefined reference"), cltError, _T("([ \tA-Za-z0-9_:+/\\.-]+)[ \t].text:[ \t](undefined reference.*)"), 2, 1));
+
+    // Misc.
+    m_RegExes.Add(RegExStruct(_("General warning"), cltWarning, _T("([Ww]arning[ \t].*)"), 1));
+    m_RegExes.Add(RegExStruct(_("General error"),   cltError,   _T("([Ee]rror[ \t].*)"),   1));
+}
+
+AutoDetectResult CompilerLCC::AutoDetectInstallationDir()
+{
+    wxLogNull ln;
+    wxRegKey key; // defaults to HKCR
+
+    key.SetName(_T("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\lcc-win32 (base system)_is1"));
+    if (key.Open())
+    {
+        // found; read it
+        key.QueryValue(_T("Inno Setup: App Path"), m_MasterPath);
+    }
+
+    if (    m_MasterPath.IsEmpty()
+        || !wxFileExists(m_MasterPath + wxFILE_SEP_PATH + wxT("bin") + wxFILE_SEP_PATH + m_Programs.C))
+    {
+        // No uninstall information, try the lcclnk libpath
+        key.SetName(_T("HKEY_CURRENT_USER\\Software\\lcc\\lcclnk"));
+        if (key.Open())
+        {
+            // found; read it
+            key.QueryValue(_T("libpath"), m_MasterPath);
+        }
+        if (   !m_MasterPath.IsEmpty()
+            && (m_MasterPath.Length()>4)
+            && (m_MasterPath.Lower().Right(4)==_T("\\lib")) )
+        {
+          // Remove the lib path to point to the LCC root folder
+          m_MasterPath.Remove( (m_MasterPath.Length()-5), 4);
+        }
+    }
+
+    // It's better to prefer the libpath from above
+    if (    m_MasterPath.IsEmpty()
+        || !wxFileExists(m_MasterPath + wxFILE_SEP_PATH + wxT("bin") + wxFILE_SEP_PATH + m_Programs.C))
+    {
+        // No uninstall information, try the compiler include path
+        key.SetName(_T("HKEY_CURRENT_USER\\Software\\lcc\\compiler"));
+        if (key.Open())
+        {
+            // found; read it
+            key.QueryValue(_T("includepath"), m_MasterPath);
+        }
+        if (   !m_MasterPath.IsEmpty()
+            && (m_MasterPath.Length()>8)
+            && (m_MasterPath.Lower().Right(8)==_T("\\include")) )
+        {
+          // Remove the include path to point to the LCC root folder
+          m_MasterPath.Remove( (m_MasterPath.Length()-9), 8);
+        }
+    }
+
+    if (    m_MasterPath.IsEmpty()
+        || !wxFileExists(m_MasterPath + wxFILE_SEP_PATH + wxT("bin") + wxFILE_SEP_PATH + m_Programs.C))
+    {
+        // just a guess; the default installation dir
+        m_MasterPath = wxT("C:\\lcc");
+    }
+
+    if (!m_MasterPath.IsEmpty())
+    {
+        AddIncludeDir(m_MasterPath + wxFILE_SEP_PATH + wxT("include"));
+        AddLibDir(m_MasterPath + wxFILE_SEP_PATH + wxT("lib"));
+        m_ExtraPaths.Add(m_MasterPath + wxFILE_SEP_PATH + wxT("bin"));
+    }
+
+    return wxFileExists(m_MasterPath + wxFILE_SEP_PATH + wxT("bin") + wxFILE_SEP_PATH + m_Programs.C) ? adrDetected : adrGuessed;
+}
+
+#endif // __WXMSW__

Property changes on: plugins\compilergcc\compilerLCC.cpp
___________________________________________________________________
Name: svn:eol-style
   + LF

Index: plugins/compilergcc/compilergcc.cpp
===================================================================
--- plugins/compilergcc/compilergcc.cpp	(revision 2438)
+++ plugins/compilergcc/compilergcc.cpp	(working copy)
@@ -61,6 +61,7 @@
     #include "compilerGDC.h"
     #include "compilerDMD.h"
 	#include "compilerGNUARM.h"
+    #include "compilerLCC.h"
 #endif
 #ifdef __WXMAC__
     #include "compilerGDC.h"
@@ -248,6 +249,7 @@
 	CompilerFactory::RegisterCompiler(new CompilerGDC);
 	CompilerFactory::RegisterCompiler(new CompilerDMD);
 	CompilerFactory::RegisterCompiler(new CompilerGNUARM);
+	CompilerFactory::RegisterCompiler(new CompilerLCC);
 #endif
 #ifdef __WXMAC__
 	CompilerFactory::RegisterCompiler(new CompilerGDC);
Index: plugins/compilergcc/Makefile.am
===================================================================
--- plugins/compilergcc/Makefile.am	(revision 2438)
+++ plugins/compilergcc/Makefile.am	(working copy)
@@ -26,6 +26,7 @@
 			compilergcc.cpp \
 			compilerGDC.cpp \
 			compilerICC.cpp \
+			compilerLCC.cpp \
 			compilermessages.cpp \
 			compilerMINGW.cpp \
 			compilerMINGWgenerator.cpp \
@@ -46,6 +47,7 @@
 			compilergcc.h \
 			compilerGDC.h \
 			compilerICC.h \
+			compilerLCC.h \
 			compilermessages.h \
 			compilerMINGW.h \
 			compilerMINGWgenerator.h \
