void CompilerLCC::Reset()
{
    m_RegistryUpdated = false; // Check the registry another time on IsValid()

    m_Options.ClearOptions();
    LoadDefaultOptions(GetID());

    LoadDefaultRegExArray();

    m_CompilerOptions.Clear();
    m_LinkerOptions.Clear();
    m_LinkLibs.Clear();
    m_CmdsBefore.Clear();
    m_CmdsAfter.Clear();
}
void CompilerGNUPOWERPC::Reset()
{
    if (platform::windows)
    {
        m_Programs.C = _T("ppc-gcc.exe");
        m_Programs.CPP = _T("ppc-g++.exe");
        m_Programs.LD = _T("ppc-g++.exe");
        m_Programs.DBG = _T("ppc-insight.exe");
        m_Programs.LIB = _T("ppc-ar.exe");
        m_Programs.WINDRES = _T("");
        m_Programs.MAKE = _T("make.exe");
    }
    else
    {
        m_Programs.C = _T("ppc-gcc");
        m_Programs.CPP = _T("ppc-g++");
        m_Programs.LD = _T("ppc-g++");
        m_Programs.DBG = _T("ppc-insight");
        m_Programs.LIB = _T("ppc-ar");
        m_Programs.WINDRES = _T("");
        m_Programs.MAKE = _T("make");
    }
    m_Switches.includeDirs = _T("-I");
    m_Switches.libDirs = _T("-L");
    m_Switches.linkLibs = _T("-l");
    m_Switches.defines = _T("-D");
    m_Switches.genericSwitch = _T("-");
    m_Switches.objectExtension = _T("o");
    m_Switches.needDependencies = true;
    m_Switches.forceCompilerUseQuotes = false;
    m_Switches.forceLinkerUseQuotes = false;
    m_Switches.logging = clogFull;
    m_Switches.libPrefix = _T("lib");
    m_Switches.libExtension = _T("a");
    m_Switches.linkerNeedsLibPrefix = false;
    m_Switches.linkerNeedsLibExtension = false;

    // Summary of GCC options: http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html

    m_Options.ClearOptions();
    m_Options.AddOption(_("Produce debugging symbols"),
                        _T("-g"),
                        _("Debugging"),
                        _T(""),
                        true,
                        _T("-O -O1 -O2 -O3 -Os"),
                        _("You have optimizations enabled. This will make debugging difficult because variables may be optimized away etc."));
    wxString gprof_link = _T("-pg");
    if (platform::windows)
        gprof_link = _T("-pg -lgmon");
    m_Options.AddOption(_("Profile code when executed"), _T("-pg"), _("Profiling"), gprof_link);

    wxString category = _("Warnings");

    // warnings
    m_Options.AddOption(_("In C mode, support all ISO C90 programs. In C++ mode, remove GNU extensions that conflict with ISO C++"), _T("-ansi"), category);
    m_Options.AddOption(_("Enable all compiler warnings (overrides every other setting)"), _T("-Wall"), category);
    m_Options.AddOption(_("Enable standard compiler warnings"), _T("-W"), category);
    m_Options.AddOption(_("Stop compiling after first error"), _T("-Wfatal-errors"), category);
    m_Options.AddOption(_("Inhibit all warning messages"), _T("-w"), category);
    m_Options.AddOption(_("Enable warnings demanded by strict ISO C and ISO C++"), _T("-pedantic"), category);
    m_Options.AddOption(_("Treat as errors the warnings demanded by strict ISO C and ISO C++"), _T("-pedantic-errors"), category);
    m_Options.AddOption(_("Warn if main() is not conformant"), _T("-Wmain"), category);

    category = _("General Options");

    // general options
    m_Options.AddOption(_("Output an error if same variable is declared without extern in different modules"), _T("-fno-common"), category);
    m_Options.AddOption(_("Save intermediate files in the build directory"), _T("-save-temps"), category);

    // Startup options
    category = _("Linker and startup code");
    m_Options.AddOption(_("do not link against the default crt0.o, so you can add your own startup code (PowerPC specific)"), _T("-nocrt0"), category);
    m_Options.AddOption(_("do not link against standard system startup files"), _T("-nostartfiles"), category);
    m_Options.AddOption(_("only search library directories explicitly specified on the command line"), _T("-nostdlib"), category);

    // optimization
    category = _("Optimization");
    m_Options.AddOption(_("Strip all symbols from binary (minimizes size)"), _T(""), category, _T("-s"), true, _T("-g -ggdb"), _("Stripping the binary will strip debugging symbols as well!"));
    m_Options.AddOption(_("Optimize generated code (for speed)"), _T("-O"), category);
    m_Options.AddOption(_("Optimize more (for speed)"), _T("-O1"), category);
    m_Options.AddOption(_("Optimize even more (for speed)"), _T("-O2"), category);
    m_Options.AddOption(_("Optimize fully (for speed)"), _T("-O3"), category);
    m_Options.AddOption(_("Optimize generated code (for size)"), _T("-Os"), category);
    m_Options.AddOption(_("Expensive optimizations"), _T("-fexpensive-optimizations"), category);
    m_Options.AddOption(_("No instruction scheduling before reload"), _T("-fno-schedule-insns"), category);
    m_Options.AddOption(_("No instruction scheduling after reload"), _T("-fno-schedule-insns2"), category);

    // machine dependent options
    category = _("PowerPC achitecture specific");

    m_Options.AddOption(_("Generate 32-bit code"), _T("-m32"), category);
    m_Options.AddOption(_("Use EABI"), _T("-meabi"), category);
    m_Options.AddOption(_("Produce big endian code"), _T("-mbig-endian"), category);
    m_Options.AddOption(_("Produce little endian code"), _T("-mlittle-endian"), category);
    m_Options.AddOption(_("Do not allow bit-fields to cross word boundaries"), _T("-mno-bit-word"), category);
    m_Options.AddOption(_("Align to the base type of the bit-field"), _T("-mbit-align"), category);
    m_Options.AddOption(_("Do not generate single field mfcr instruction"), _T("-mno-mfcrf"), category);
    m_Options.AddOption(_("Generate single field mfcr instruction"), _T("-mmfcrf"), category);
    m_Options.AddOption(_("Generate load/store with update instructions"), _T("-mupdate"), category);
    m_Options.AddOption(_("Generate load/store multiple instructions"), _T("-mmultiple"), category);
    m_Options.AddOption(_("Do not use hardware floating point"), _T("-msoft-float"), category);
    m_Options.AddOption(_("Use hardware floating point"), _T("-mhard-float"), category);
    m_Options.AddOption(_("Select method for sdata handling"), _T("-msdata="), category);
    m_Options.AddOption(_("Specify alignment of structure fields default/natural"), _T("-malign="), category);
    m_Options.AddOption(_("Avoid all range limits on call instructions"), _T("-mlongcall"), category);
    m_Options.AddOption(_("Using floating point in the GPRs"), _T("-mfloat-gprs=yes"), category);
    m_Options.AddOption(_("Not using floating point in the GPRs"), _T("-mfloat-gprs=no"), category);
//    m_Options.AddOption(_("Specify size of long double (64 or 128 bits)"), _T("-mlong-double="), category);
    m_Options.AddOption(_("Enable debug output"), _T("-mdebug"), category);
    m_Options.AddOption(_("Schedule code for given CPU"), _T("-mtune="), category);
    m_Options.AddOption(_("Allow symbolic names for registers"), _T("-mregnames"), category);
    m_Options.AddOption(_("Do not allow symbolic names for registers"), _T("-mno-regnames"), category);
    m_Options.AddOption(_("Support for GCC's -mrelocatble option"), _T("-mrelocatable"), category);
    m_Options.AddOption(_("Support for GCC's -mrelocatble-lib option"), _T("-mrelocatable-lib"), category);

    // machine dependent options
    category = _("PowerPC MCU derivatives");

    m_Options.AddOption(_("Select CPU PowerPC 5xx"), _T("-mcpu=505"), category);
    m_Options.AddOption(_("Select CPU PowerPC 823"), _T("-mcpu=823"), category);
    m_Options.AddOption(_("Select PowerPC 5200"), _T("-mcpu=603e -msoft-float"), category);

    m_Commands[(int)ctCompileObjectCmd].push_back(CompilerTool(_T("$compiler $options $includes -c $file -o $object")));
    m_Commands[(int)ctGenDependenciesCmd].push_back(CompilerTool(_T("$compiler -MM $options -MF $dep_object -MT $object $includes $file")));
    m_Commands[(int)ctCompileResourceCmd].push_back(CompilerTool(_T("$rescomp -i $file -J rc -o $resource_output -O coff $res_includes")));
    m_Commands[(int)ctLinkConsoleExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs")));
    if (platform::windows)
    {
        m_Commands[(int)ctLinkExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs -mwindows")));
        m_Commands[(int)ctLinkDynamicCmd].push_back(CompilerTool(_T("$linker -shared -Wl,--output-def=$def_output -Wl,--out-implib=$static_output -Wl,--dll $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs")));
    }
    else
    {
        m_Commands[(int)ctLinkExeCmd] = m_Commands[(int)ctLinkConsoleExeCmd]; // no -mwindows
        m_Commands[(int)ctLinkDynamicCmd].push_back(CompilerTool(_T("$linker -shared $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs")));
    }
    m_Commands[(int)ctLinkStaticCmd].push_back(CompilerTool(_T("$lib_linker -rs $static_output $link_objects")));
    m_Commands[(int)ctLinkNativeCmd] = m_Commands[(int)ctLinkConsoleExeCmd]; // unsupported currently

    LoadDefaultRegExArray();

    m_CompilerOptions.Clear();
    m_LinkerOptions.Clear();
    m_LinkLibs.Clear();
    m_CmdsBefore.Clear();
    m_CmdsAfter.Clear();
}
Exemple #3
0
void CompilerOW::Reset()
{
    /*
     *  Define compiler suite programs. I have chosen to use wcl386 for all
     *  to provide as consistent a set of options as possible.
     */

	m_Programs.C                = wxT("wcl386.exe");
	m_Programs.CPP              = wxT("wcl386.exe");
	m_Programs.LD               = wxT("wlink.exe");
	m_Programs.LIB              = wxT("wlib.exe");
	m_Programs.WINDRES          = wxT("wrc.exe");
	m_Programs.MAKE             = wxT("wmake.exe");

	m_Switches.includeDirs      = wxT("-i");
	m_Switches.libDirs          = wxT("LIBP ");
	m_Switches.linkLibs         = wxT("");
	m_Switches.libPrefix        = wxT("");
	m_Switches.libExtension     = wxT("lib");
	m_Switches.defines          = wxT("-d");
	m_Switches.genericSwitch    = wxT("-");
	m_Switches.objectExtension  = wxT("obj");

	m_Switches.needDependencies = false;
	m_Switches.forceCompilerUseQuotes = false;
	m_Switches.forceLinkerUseQuotes = false;
	m_Switches.logging = clogSimple;
	m_Switches.linkerNeedsLibPrefix = false;
	m_Switches.linkerNeedsLibExtension = true;

    m_Options.ClearOptions();
//	m_Options.AddOption(_("Produce debugging symbols"),
//				"-g",
//				_("Debugging"),
//				"",
//				true,
//				"-o -o+space",
//				_("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));


    wxString   category = wxT("General");

    m_Options.AddOption(wxT("treat source files as C code"), wxT("-cc"), category);
    m_Options.AddOption(wxT("treat source files as C++ code"), wxT("-cc++"), category);
    m_Options.AddOption(wxT("ignore the WCL386 environment variable"), wxT("-y"), category);


    category = wxT("Processor options");
    m_Options.AddOption(wxT("386 register calling conventions"), wxT("-3r"), category);
    m_Options.AddOption(wxT("386 stack calling conventions"), wxT("-3s"), category);
    m_Options.AddOption(wxT("486 register calling conventions"), wxT("-4r"), category);
    m_Options.AddOption(wxT("486 stack calling conventions"), wxT("-4s"), category);
    m_Options.AddOption(wxT("Pentium register calling conventions"), wxT("-5r"), category);
    m_Options.AddOption(wxT("Pentium stack calling conventions"), wxT("-5s"), category);
    m_Options.AddOption(wxT("Pentium Pro register call conventions"), wxT("-6r"), category);
    m_Options.AddOption(wxT("Pentium Pro stack call conventions"), wxT("-6s"), category);

    category = wxT("Floating-point processor options");

    m_Options.AddOption(wxT("calls to floating-point library"), wxT("-fpc"), category);
    m_Options.AddOption(wxT("enable Pentium FDIV check"), wxT("-fpd"), category);
    m_Options.AddOption(wxT("inline 80x87 with emulation"), wxT("-fpi"), category);
    m_Options.AddOption(wxT("inline 80x87"), wxT("-fpi87"), category);
    m_Options.AddOption(wxT("use old floating-point conventions"), wxT("-fpr"), category);
    m_Options.AddOption(wxT("generate 287 floating-point code"), wxT("-fp2"), category);
    m_Options.AddOption(wxT("generate 387 floating-point code"), wxT("-fp3"), category);
    m_Options.AddOption(wxT("optimize floating-point for Pentium"), wxT("-fp5"), category);
    m_Options.AddOption(wxT("optimize floating-point for Pentium Pro"), wxT("-fp6"), category);

    category = wxT("Executable type options");

    m_Options.AddOption(wxT("compile and link for DOS"), wxT("-bcl=dos"), category);
    m_Options.AddOption(wxT("compile and link for Linux"), wxT("-bcl=linux"), category);
    m_Options.AddOption(wxT("compile and link for NT (includes Win32)"), wxT("-bcl=nt"), category);
    m_Options.AddOption(wxT("compile and link for OS/2"), wxT("-bcl=os2"), category);
    m_Options.AddOption(wxT("compile and link for QNX"), wxT("-bcl=qnx"), category);
    m_Options.AddOption(wxT("compile and link for Windows"), wxT("-bcl=windows"), category);

    category = wxT("Object type options");

    m_Options.AddOption(wxT("compile for DOS"), wxT("-bt=dos"), category);
    m_Options.AddOption(wxT("compile for Linux"), wxT("-bt=linux"), category);
    m_Options.AddOption(wxT("compile for NetWare"), wxT("-bt=netware"), category);
    m_Options.AddOption(wxT("compile for NetWare 5 and later"), wxT("-bt=netware5"), category);
    m_Options.AddOption(wxT("compile for NT (includes Win32)"), wxT("-bt=nt"), category);
    m_Options.AddOption(wxT("compile for OS/2"), wxT("-bt=os2"), category);
    m_Options.AddOption(wxT("compile for QNX"), wxT("-bt=qnx"), category);
    m_Options.AddOption(wxT("compile for Windows"), wxT("-bt=windows"), category);

    category = wxT("Compiler options");

    m_Options.AddOption(wxT("generate browsing information"), wxT("-db"), category);
    m_Options.AddOption(wxT("set error limit number (set ERROR_LIMIT in custom variables)"), wxT("-e=$(ERROR_LIMIT)"), category);
    m_Options.AddOption(wxT("call epilogue hook routine"), wxT("-ee"), category);
    m_Options.AddOption(wxT("full paths in messages"), wxT("-ef"), category);
    m_Options.AddOption(wxT("force enums to be type int"), wxT("-ei"), category);
    m_Options.AddOption(wxT("minimum base type for enum is int"), wxT("-em"), category);
    m_Options.AddOption(wxT("emit routine names in the code"), wxT("-en"), category);
    m_Options.AddOption(wxT("call prologue hook routine"), wxT("-ep"), category);
    m_Options.AddOption(wxT("call prologue hook routine with n bytes of stack (set PROLOGUE_STACK in custom variables)"), wxT("-ep=$(PROLOGUE_STACK)"), category);
    m_Options.AddOption(wxT("do not display error messages"), wxT("-eq"), category);
    m_Options.AddOption(wxT("P5 profiling"), wxT("-et"), category);
    m_Options.AddOption(wxT("generate PharLap EZ-OMF object"), wxT("-ez"), category);
    m_Options.AddOption(wxT("generate pre-compiled header (set PCH_FILE in custom variables)"), wxT("-fh=$(PCH_FILE)"), category);
    m_Options.AddOption(wxT("generate pre-compiled header (Quiet) (set PCH_FILE in custom variables)"), wxT("-fhq=$(PCH_FILE)"), category);
    m_Options.AddOption(wxT("(C++) only read PCH"), wxT("-fhr"), category);
    m_Options.AddOption(wxT("(C++) only write PCH"), wxT("-fhw"), category);
    m_Options.AddOption(wxT("(C++) don't count PCH warnings"), wxT("-fhwe"), category);

    // This should be a multiple option. We can define multiple force includes
    m_Options.AddOption(wxT("force include of file (define FORCE_INCLUDE in custom variables)"), wxT("-fi=$(FORCE_INCLUDE)"), category);
    // This one is mandatory in the ctCompileObjectCmd
    //m_Options.AddOption(wxT("set object file name"), wxT("-fo=<file>"), category);
    m_Options.AddOption(wxT("set error file name (define ERROR_FILE in custom variables)"), wxT("-fr=$(ERROR_FILE)"), category);
    m_Options.AddOption(wxT("(C++) check for 8.3 file names"), wxT("-ft"), category);
    m_Options.AddOption(wxT("(C++) no check for 8.3 file names"), wxT("-fx"), category);
    m_Options.AddOption(wxT("set code group name (define CODEGROUP in custom variables)"), wxT("-g=$(CODEGROUP)"), category);
    m_Options.AddOption(wxT("change char default to signed"), wxT("-j"), category);
    m_Options.AddOption(wxT("set CODE class name (define CODECLASS in custom variables)"), wxT("-nc=$(CODECLASS)"), category);
    m_Options.AddOption(wxT("set data segment name (define DATANAME in custom variables)"), wxT("-nd=$(DATANAME)"), category);
    m_Options.AddOption(wxT("set module name (define MODULENAME in custom variables)"), wxT("-nm=$(MODULENAME)"), category);
    m_Options.AddOption(wxT("set text segment name (define TEXTNAME in custom variables)"), wxT("-nt=$(TEXTNAME)"), category);
    m_Options.AddOption(wxT("save/restore segregs across calls"), wxT("-r"), category);
    m_Options.AddOption(wxT("promote function args/rets to int"), wxT("-ri"), category);
    m_Options.AddOption(wxT("remove stack overflow checks"), wxT("-s"), category);
    m_Options.AddOption(wxT("generate calls to grow the stack"), wxT("-sg"), category);
    m_Options.AddOption(wxT("touch stack through SS first"), wxT("-st"), category);
    m_Options.AddOption(wxT("output func declarations to .def"), wxT("-v"), category);
    m_Options.AddOption(wxT("VC++ compat: alloca allowed in arg lists"), wxT("-vcap"), category);
    m_Options.AddOption(wxT("(C++) enable RTTI"), wxT("-xr"), category);
    m_Options.AddOption(wxT("disable language extensions (ANSI/ISO compliance)"), wxT("-za"), category);
    m_Options.AddOption(wxT("enable language extensions"), wxT("-ze"), category);
    m_Options.AddOption(wxT("place strings in CODE segment"), wxT("-zc"), category);
    m_Options.AddOption(wxT("DS not pegged to DGROUP"), wxT("-zdf"), category);
    m_Options.AddOption(wxT("DS pegged to DGROUP"), wxT("-zdp"), category);
    m_Options.AddOption(wxT("load DS directly from DGROUP"), wxT("-zdl"), category);
    m_Options.AddOption(wxT("Allow code-generator to use FS"), wxT("-zff"), category);
    m_Options.AddOption(wxT("Do not allow code-generator to use FS"), wxT("-zfp"), category);
    m_Options.AddOption(wxT("Allow code-generator to use GS"), wxT("-zgf"), category);
    m_Options.AddOption(wxT("Do not allow code-generator to use GS"), wxT("-zgp"), category);
    m_Options.AddOption(wxT("Allow arithmetic on void derived type"), wxT("-zev"), category);
    m_Options.AddOption(wxT("function prototype using base type"), wxT("-zg"), category);
    // Duplicate to -zk0
    //m_Options.AddOption(wxT("Double byte chars in strings (Japanese DBCS)"), wxT("-zk"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Japanese DBCS)"), wxT("-zk0"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Japanese DBCS - translate to Unicode)"), wxT("-zk0u"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Trad Chinese or Taiwanese DBCS)"), wxT("-zk1"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Korean Hangeul) DBCS)"), wxT("-zk2"), category);
    m_Options.AddOption(wxT("Double byte chars in strings (Use current code page)"), wxT("-zkl"), category);
    m_Options.AddOption(wxT("Translate characters to Unicode (specify UNI_CP in custom variables)"), wxT("-zku=$(UNI_CP)"), category);
    m_Options.AddOption(wxT("remove default library information"), wxT("-zl"), category);
    m_Options.AddOption(wxT("remove file dependency information"), wxT("-zld"), category);
    m_Options.AddOption(wxT("place functions in separate segments"), wxT("-zm"), category);
    m_Options.AddOption(wxT("(C++) zm with near calls allowed"), wxT("-zmf"), category);
    m_Options.AddOption(wxT("struct packing align 1 byte"), wxT("-zp1"), category);
    m_Options.AddOption(wxT("struct packing align 2 byte"), wxT("-zp2"), category);
    m_Options.AddOption(wxT("struct packing align 4 byte"), wxT("-zp4"), category);
    m_Options.AddOption(wxT("struct packing align 8 byte"), wxT("-zp8"), category);
    m_Options.AddOption(wxT("struct packing align 16 byte"), wxT("-zp16"), category);
    m_Options.AddOption(wxT("warning when padding a struct"), wxT("-zpw"), category);
    m_Options.AddOption(wxT("operate quietly"), wxT("-zq"), category);
    m_Options.AddOption(wxT("check syntax only"), wxT("-zs"), category);
    m_Options.AddOption(wxT("set data threshold (set DATA_THRESHOLD in custom variables)"), wxT("-zt=$(DATA_THRESHOLD)"), category);
    m_Options.AddOption(wxT("Do not assume SS contains DGROUP"), wxT("-zu"), category);
    m_Options.AddOption(wxT("(C++) enable virt. fun. removal opt"), wxT("-zv"), category);
    m_Options.AddOption(wxT("generate code for MS Windows"), wxT("-zw"), category);
    m_Options.AddOption(wxT("remove @size from __stdcall func."), wxT("-zz"), category);

    category = wxT("Memory model options");

    m_Options.AddOption(wxT("memory model flat"), wxT("-mf"), category);
    m_Options.AddOption(wxT("memory model small"), wxT("-ms"), category);
    m_Options.AddOption(wxT("memory model medium"), wxT("-mm"), category);
    m_Options.AddOption(wxT("memory model compact"), wxT("-mc"), category);
    m_Options.AddOption(wxT("memory model large"), wxT("-ml"), category);
    m_Options.AddOption(wxT("memory model huge"), wxT("-mh"), category);

    category = wxT("Warning options");

    m_Options.AddOption(wxT("set warning level to 0 (suppress warnings)"), wxT("-w=0"), category);
    m_Options.AddOption(wxT("set warning level to 1"), wxT("-w=1"), category);
    m_Options.AddOption(wxT("set warning level to 2"), wxT("-w=2"), category);
    m_Options.AddOption(wxT("set warning level to 3"), wxT("-w=3"), category);
    m_Options.AddOption(wxT("disable warning message (define DIS_WARN in custom variables)"), wxT("-wcd=$(DIS_WARN)"), category);
    m_Options.AddOption(wxT("enable warning message (define ENA_WARN in custom variables)"), wxT("-wce=$(ENA_WARN)"), category);
    m_Options.AddOption(wxT("treat all warnings as errors"), wxT("-we"), category);
    m_Options.AddOption(wxT("set warning level to max"), wxT("-wx"), category);

    category = wxT("Debugging options");

    m_Options.AddOption(wxT("no debugging information"), wxT("-d0"), category);
    m_Options.AddOption(wxT("line number debugging information"), wxT("-d1"), category);
    m_Options.AddOption(wxT("(C) line number debugging information plus typing information for global symbols and local structs and arrays"), wxT("-d1+"), category);
    m_Options.AddOption(wxT("full symbolic debugging information"), wxT("-d2"), category);
    m_Options.AddOption(wxT("(C++) d2 and debug inlines; emit inlines as external out-of-line functions"), wxT("-d2i"), category);
    m_Options.AddOption(wxT("(C++) d2 and debug inlines; emit inlines as static out-of-line functions"), wxT("-d2s"), category);
    m_Options.AddOption(wxT("(C++) d2 but without type names"), wxT("-d2t"), category);
    m_Options.AddOption(wxT("full symbolic debugging with unreferenced type names"), wxT("-d3"), category);
    m_Options.AddOption(wxT("(C++) d3 plus debug inlines; emit inlines as external out-of-line functions"), wxT("-d3i"), category);
    m_Options.AddOption(wxT("(C++) d3 plus debug inlines; emit inlines as static out-of-line functions"), wxT("-d3s"), category);
    m_Options.AddOption(wxT("codeview debug format"), wxT("-hc"), category);
    m_Options.AddOption(wxT("dwarf debug format"), wxT("-hd"), category);
    m_Options.AddOption(wxT("watcom debug format"), wxT("-hw"), category);

    category = wxT("Optimization options");

    m_Options.AddOption(wxT("relax alias checking"), wxT("-oa"), category);
    m_Options.AddOption(wxT("branch prediction"), wxT("-ob"), category);
    m_Options.AddOption(wxT("disable call/ret optimization"), wxT("-oc"), category);
    m_Options.AddOption(wxT("disable optimizations"), wxT("-od"), category);
    m_Options.AddOption(wxT("expand functions inline (specify INLINE_NUM in custom variables)"), wxT("-oe=$(INLINE_NUM)"), category);
    m_Options.AddOption(wxT("generate traceable stack frames"), wxT("-of"), category);
    m_Options.AddOption(wxT("always generate traceable stack frames"), wxT("-of+"), category);
    m_Options.AddOption(wxT("enable repeated optimizations"), wxT("-oh"), category);
    m_Options.AddOption(wxT("inline intrinsic functions"), wxT("-oi"), category);
    m_Options.AddOption(wxT("(C++) oi with max inlining depth"), wxT("-oi+"), category);
    m_Options.AddOption(wxT("control flow entry/exit sequence"), wxT("-ok"), category);
    m_Options.AddOption(wxT("perform loop optimizations"), wxT("-ol"), category);
    m_Options.AddOption(wxT("ol with loop unrolling"), wxT("-ol+"), category);
    m_Options.AddOption(wxT("generate inline math functions"), wxT("-om"), category);
    m_Options.AddOption(wxT("numerically unstable floating-point"), wxT("-on"), category);
    m_Options.AddOption(wxT("continue compile when low on memory"), wxT("-oo"), category);
    m_Options.AddOption(wxT("improve floating-point consistency"), wxT("-op"), category);
    m_Options.AddOption(wxT("re-order instructions to avoid stalls"), wxT("-or"), category);
    m_Options.AddOption(wxT("optimize for space"), wxT("-os"), category);
    m_Options.AddOption(wxT("optimize for time"), wxT("-ot"), category);
    m_Options.AddOption(wxT("ensure unique addresses for functions"), wxT("-ou"), category);
    m_Options.AddOption(wxT("maximum optimization (-obmiler -s)"), wxT("-ox"), category);

    category = wxT("C++ exception handling options");

    m_Options.AddOption(wxT("no exception handling"), wxT("-xd"), category);
    m_Options.AddOption(wxT("no exception handling: space"), wxT("-xds"), category);
    // duplicate to -xd
    //m_Options.AddOption(wxT("no exception handling"), wxT("-xdt"), category);
    m_Options.AddOption(wxT("exception handling: balanced"), wxT("-xs"), category);
    m_Options.AddOption(wxT("exception handling: space"), wxT("-xss"), category);
    m_Options.AddOption(wxT("exception handling: time"), wxT("-xst"), category);

    category = wxT("Preprocessor options");

    //  defined in m_Switches.defines
    //  m_Options.AddOption(wxT("Define macro"), wxT("-d"), category);
    // difficult to support
    //  m_Options.AddOption(wxT("Extend -d syntax"), wxT(""), category);
    //  This one is mandatory in the ctCompileObjectCmd
    //  m_Options.AddOption(wxT("set object file name"), wxT("-fo=<file>"), category);
    //  Specified by m_Switches.includeDirs
    //  m_Options.AddOption(wxT("include directory"), wxT("-i"), category);
    m_Options.AddOption(wxT("number of spaces in tab stop (set TAB_STOP in custom variables)"), wxT("-t=$(TAB_STOP)"), category);
    // multi-option
    //m_Options.AddOption(wxT("set #pragma on"), wxT("-tp=$(PRAGMA_NAMES)"), category);
    // multi-option
    //m_Options.AddOption(wxT("undefine macro name"), wxT("-u"), category);
    /*
     *  options are -pcelw=n
     */
    m_Options.AddOption(wxT("preprocess source file"), wxT("-p"), category);
    m_Options.AddOption(wxT("preprocess source file (preserve comments)"), wxT("-pc"), category);
    m_Options.AddOption(wxT("preprocess source file (insert #line directives)"), wxT("-pl"), category);
    m_Options.AddOption(wxT("(C++) preprocess file (encrypt identifiers)"), wxT("-pe"), category);
    //

    category = wxT("Linker options");

    m_Options.AddOption(wxT("build Dynamic link library"), wxT("-bd"), category);
    m_Options.AddOption(wxT("build Multi-thread application"), wxT("-bm"), category);
    m_Options.AddOption(wxT("build with dll run-time library"), wxT("-br"), category);
    m_Options.AddOption(wxT("build default Windowing appllication"), wxT("-bw"), category);
    m_Options.AddOption(wxT("write directives"), wxT("-fd"), category);
    m_Options.AddOption(wxT("write directives (define DIRECTIVE_FILE in custom variables)"), wxT("-fd=$(DIRECTIVE_FILE)"), category);
    // mandatory in link commands
    //m_Options.AddOption(wxT("name executable file"), wxT("-fe=<file>"), category);
    m_Options.AddOption(wxT("generate map file"), wxT("-fm"), category);
    m_Options.AddOption(wxT("generate map file (define MAP_FILE in custom variables)"), wxT("-fm=$(MAP_FILE)"), category);
    m_Options.AddOption(wxT("set stack size (define STACK_SIZE in custom variables)"), wxT("-k$(STACK_SIZE)"), category);
    m_Options.AddOption(wxT("link for the specified OS (define TARGET_OS in custom variables)"), wxT("-l=$(TARGET_OS)"), category);
    m_Options.AddOption(wxT("make names case sensitive"), wxT("-x"), category);
    m_Options.AddOption(wxT("additional directive file (specify LINK_DIRECTIVES in custom variables)"), wxT("@$(LINK_VARIABLES)"), category);
    // ????
    // m_Options.AddOption(wxT("following parameters are linker options"), wxT("-"), category);


    m_Commands[(int)ctCompileObjectCmd]
       .push_back( CompilerTool(wxT("$compiler -q -c $options $includes -fo=$object $file")) );
    m_Commands[(int)ctCompileResourceCmd]
       .push_back( CompilerTool(wxT("$rescomp -q -r -fo=$resource_output $res_includes $file")) );
    m_Commands[(int)ctLinkExeCmd]
       .push_back( CompilerTool(wxT("$linker option quiet $link_options $libdirs $link_objects name $exe_output $libs $link_resobjects")) );
    m_Commands[(int)ctLinkConsoleExeCmd]
       .push_back( CompilerTool(wxT("$linker option quiet $link_options $libdirs $link_objects name $exe_output $libs $link_resobjects")) );
    m_Commands[(int)ctLinkDynamicCmd]
       .push_back( CompilerTool(wxT("$linker option quiet $link_options $libdirs name $exe_output $libs $link_objects")) );
    m_Commands[(int)ctLinkStaticCmd]
       .push_back( CompilerTool(wxT("$lib_linker -q $static_output $link_objects")) );
    m_Commands[(int)ctLinkNativeCmd] = m_Commands[(int)ctLinkConsoleExeCmd]; // unsupported currently

    LoadDefaultRegExArray();

    m_CompilerOptions.Clear();
    m_LinkerOptions.Clear();
    m_LinkLibs.Clear();
    m_CmdsBefore.Clear();
    m_CmdsAfter.Clear();
}
void CompilerGNUTRICORE::Reset()
{
    if (platform::windows)
    {
        m_Programs.C = _T("tricore-gcc.exe");
        m_Programs.CPP = _T("tricore-g++.exe");
        m_Programs.LD = _T("tricore-g++.exe");
        m_Programs.DBG = _T("tricore-insight.exe");
        m_Programs.LIB = _T("tricore-ar.exe");
        m_Programs.WINDRES = _T("");
        m_Programs.MAKE = _T("make.exe");
    }
    else
    {
        m_Programs.C = _T("tricore-gcc");
        m_Programs.CPP = _T("tricore-g++");
        m_Programs.LD = _T("tricore-g++");
        m_Programs.DBG = _T("tricore-insight");
        m_Programs.LIB = _T("tricore-ar");
        m_Programs.WINDRES = _T("");
        m_Programs.MAKE = _T("make");
    }
    m_Switches.includeDirs = _T("-I");
    m_Switches.libDirs = _T("-L");
    m_Switches.linkLibs = _T("-l");
    m_Switches.defines = _T("-D");
    m_Switches.genericSwitch = _T("-");
    m_Switches.objectExtension = _T("o");
    m_Switches.needDependencies = true;
    m_Switches.forceCompilerUseQuotes = false;
    m_Switches.forceLinkerUseQuotes = false;
    m_Switches.logging = clogFull;
    m_Switches.libPrefix = _T("lib");
    m_Switches.libExtension = _T("a");
    m_Switches.linkerNeedsLibPrefix = false;
    m_Switches.linkerNeedsLibExtension = false;

    // Summary of GCC options: http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html

    m_Options.ClearOptions();
    m_Options.AddOption(_("Produce debugging symbols"),
                        _T("-g"),
                        _("Debugging"),
                        _T(""),
                        true,
                        _T("-O -O1 -O2 -O3 -Os"),
                        _("You have optimizations enabled. This will make debugging difficult because variables may be optimized away etc."));
    wxString gprof_link = _T("-pg");
    if (platform::windows)
        gprof_link = _T("-pg -lgmon");
    m_Options.AddOption(_("Profile code when executed"), _T("-pg"), _("Profiling"), gprof_link);

    wxString category = _("Warnings");

    // warnings
    m_Options.AddOption(_("In C mode, support all ISO C90 programs. In C++ mode, remove GNU extensions that conflict with ISO C++"), _T("-ansi"), category);
    m_Options.AddOption(_("Enable all compiler warnings (overrides every other setting)"), _T("-Wall"), category);
    m_Options.AddOption(_("Enable standard compiler warnings"), _T("-W"), category);
    m_Options.AddOption(_("Stop compiling after first error"), _T("-Wfatal-errors"), category);
    m_Options.AddOption(_("Inhibit all warning messages"), _T("-w"), category);
    m_Options.AddOption(_("Enable warnings demanded by strict ISO C and ISO C++"), _T("-pedantic"), category);
    m_Options.AddOption(_("Treat as errors the warnings demanded by strict ISO C and ISO C++"), _T("-pedantic-errors"), category);
    m_Options.AddOption(_("Warn if main() is not conformant"), _T("-Wmain"), category);

    category = _("General Options");

    // general options
    m_Options.AddOption(_("Output an error if same variable is declared without extern in different modules"), _T("-fno-common"), category);
    m_Options.AddOption(_("Do not allocate to an enum type only as many bytes as it needs for the declared range of possible values"), _T("-fno-short-enums"), category);
    m_Options.AddOption(_("Save intermediate files in the build directory"), _T("-save-temps"), category);

    // Startup options
    category = _("Linker and startup code");
    m_Options.AddOption(_("do not link against the default crt0.o, so you can add your own startup code (TriCore specific)"), _T("-nocrt0"), category);
    m_Options.AddOption(_("do not link against standard system startup files"), _T("-nostartfiles"), category);
    m_Options.AddOption(_("only search library directories explicitly specified on the command line"), _T("-nostdlib"), category);

    // optimization
    category = _("Optimization");
    m_Options.AddOption(_("Strip all symbols from binary (minimizes size)"), _T(""), category, _T("-s"), true, _T("-g -ggdb"), _("Stripping the binary will strip debugging symbols as well!"));
    m_Options.AddOption(_("Optimize generated code (for speed)"), _T("-O"), category);
    m_Options.AddOption(_("Optimize more (for speed)"), _T("-O1"), category);
    m_Options.AddOption(_("Optimize even more (for speed)"), _T("-O2"), category);
    m_Options.AddOption(_("Optimize fully (for speed)"), _T("-O3"), category);
    m_Options.AddOption(_("Optimize generated code (for size)"), _T("-Os"), category);
    m_Options.AddOption(_("Expensive optimizations"), _T("-fexpensive-optimizations"), category);
    m_Options.AddOption(_("No instruction scheduling before reload"), _T("-fno-schedule-insns"), category);
    m_Options.AddOption(_("No instruction scheduling after reload"), _T("-fno-schedule-insns2"), category);

    // machine dependent options
    category = _("TriCore achitecture specific");

    m_Options.AddOption(_("jump tables in text section"), _T("-mjumptable-in-textsection"), category);
    m_Options.AddOption(_("include C source lines into assembler output"), _T("-masm-source-lines"), category);
    m_Options.AddOption(_("base relative addresses for small data objects"), _T("-msmall-pid"), category);
    m_Options.AddOption(_("allow _bit in structures and unions"), _T("-mbits-struct-unions"), category);
    m_Options.AddOption(_("allow callee and caller in different sections"), _T("-mnocallerrors"), category);
    m_Options.AddOption(_("allocate data in aligned section"), _T("-maligned-data-sections"), category);
    m_Options.AddOption(_("enable attribute alignedaccess"), _T("-maligned-access"), category);
    m_Options.AddOption(_("use optimized single float emulation"), _T("-moptfp"), category);
    m_Options.AddOption(_("layout bitfields EABI conform"), _T("-meabi-bitfields"), category);
    m_Options.AddOption(_("EABI conform"), _T("-meabi"), category);

    // machine dependent options
    category = _("TriCore MCU derivatives");

    m_Options.AddOption(_("TriCore TC1130"), _T("-mcpu=tc1130"), category);
    m_Options.AddOption(_("TriCore TC1130 BA step"), _T("-mcpu=tc1130ba"), category);
    m_Options.AddOption(_("TriCore TC1161"), _T("-mcpu=tc1161"), category);
    m_Options.AddOption(_("TriCore TC1162"), _T("-mcpu=tc1162"), category);
    m_Options.AddOption(_("TriCore TC1762"), _T("-mcpu=tc1762"), category);
    m_Options.AddOption(_("TriCore TC1765"), _T("-mcpu=tc1765"), category);
    m_Options.AddOption(_("TriCore TC1766"), _T("-mcpu=tc1766"), category);
    m_Options.AddOption(_("TriCore TC1767"), _T("-mcpu=tc1767"), category);
    m_Options.AddOption(_("TriCore TC1775"), _T("-mcpu=tc1775"), category);
    m_Options.AddOption(_("TriCore TC1792"), _T("-mcpu=tc1792"), category);
    m_Options.AddOption(_("TriCore TC1796"), _T("-mcpu=tc1796"), category);
    m_Options.AddOption(_("TriCore TC1797"), _T("-mcpu=tc1797"), category);
    m_Options.AddOption(_("TriCore TC1920"), _T("-mcpu=tc1920"), category);

    m_Commands[(int)ctCompileObjectCmd].push_back(CompilerTool(_T("$compiler $options $includes -c $file -o $object")));
    m_Commands[(int)ctGenDependenciesCmd].push_back(CompilerTool(_T("$compiler -MM $options -MF $dep_object -MT $object $includes $file")));
    m_Commands[(int)ctCompileResourceCmd].push_back(CompilerTool(_T("$rescomp -i $file -J rc -o $resource_output -O coff $res_includes")));
    m_Commands[(int)ctLinkConsoleExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs")));
    if (platform::windows)
    {
        m_Commands[(int)ctLinkExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs -mwindows")));
        m_Commands[(int)ctLinkDynamicCmd].push_back(CompilerTool(_T("$linker -shared -Wl,--output-def=$def_output -Wl,--out-implib=$static_output -Wl,--dll $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs")));
    }
    else
    {
        m_Commands[(int)ctLinkExeCmd] = m_Commands[(int)ctLinkConsoleExeCmd]; // no -mwindows
        m_Commands[(int)ctLinkDynamicCmd].push_back(CompilerTool(_T("$linker -shared $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs")));
    }
    m_Commands[(int)ctLinkStaticCmd].push_back(CompilerTool(_T("$lib_linker -rs $static_output $link_objects")));
    m_Commands[(int)ctLinkNativeCmd] = m_Commands[(int)ctLinkConsoleExeCmd]; // unsupported currently

    LoadDefaultRegExArray();

    m_CompilerOptions.Clear();
    m_LinkerOptions.Clear();
    m_LinkLibs.Clear();
    m_CmdsBefore.Clear();
    m_CmdsAfter.Clear();
}