Building an Non-Unicode Win32 Code::Blocks

From Code::Blocks


Prerequisites

Working Code::Blocks

Code::Blocks Source Code

Non-Unicode build of wxWidgets

GnuWin32 sed.exe

http://gnuwin32.sourceforge.net/packages.html

Modifying Code::Blocks project files

sed script file

ANSI.sed

s/<Variable name="WX_SUFFIX" value="u" \/>/<Variable name="WX_SUFFIX" value="" \/>/g
s/<Add option="-DwxUSE_UNICODE" \/>$/<Add option="-DwxUSE_UNICODE=0" \/>$/g
s/<Add option="-DwxUSE_UNICODE=1" \/>$/<Add option="-DwxUSE_UNICODE=0" \/>$/g

sed-ANSI-out.bat

setlocal
REM Set to the folder containing the SED script
set SEDFOLDER=%CD%
REM Set to the sed script file name
set SEDFILE=ANSI.sed

REM set to the Top Code::Blocks folder
set CBFOLDER=%CD%\codeblocks

cd %CBFOLDER%\src
sed --separate --file=%SEDFOLDER%\%SEDFILE% CodeBlocks.cbp > CodeBlocks-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\AutoVersioning
sed --separate --file=%SEDFOLDER%\%SEDFILE% AutoVersioning.cbp > AutoVersioning-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\BrowseTracker
sed --separate --file=%SEDFOLDER%\%SEDFILE% BrowseTracker.cbp > BrowseTracker-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\byogames
sed --separate --file=%SEDFOLDER%\%SEDFILE% byogames.cbp > byogames-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\cb_koders
sed --separate --file=%SEDFOLDER%\%SEDFILE% cb_koders.cbp > cb_koders-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\codesnippets
sed --separate --file=%SEDFOLDER%\%SEDFILE% codesnippets.cbp > codesnippets-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\codestat
sed --separate --file=%SEDFOLDER%\%SEDFILE% codestat.cbp > codestat-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\copystrings
sed --separate --file=%SEDFOLDER%\%SEDFILE% copystrings.cbp > copystrings-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\devpak_plugin
sed --separate --file=%SEDFOLDER%\%SEDFILE% DevPakPlugin.cbp > DevPakPlugin-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\dragscroll
sed --separate --file=%SEDFOLDER%\%SEDFILE% dragscroll.cbp > dragscroll-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\envvars
sed --separate --file=%SEDFOLDER%\%SEDFILE% envvars.cbp > envvars-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\headerfixup
sed --separate --file=%SEDFOLDER%\%SEDFILE% headerfixup.cbp > headerfixup-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\help_plugin
sed --separate --file=%SEDFOLDER%\%SEDFILE% help-plugin.cbp > help-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\keybinder
sed --separate --file=%SEDFOLDER%\%SEDFILE% keybinder.cbp > keybinder-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\lib_finder
sed --separate --file=%SEDFOLDER%\%SEDFILE% lib_finder.cbp > lib_finder-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\profiler
sed --separate --file=%SEDFOLDER%\%SEDFILE% cbprofiler.cbp > cbprofiler-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\regex_testbed
sed --separate --file=%SEDFOLDER%\%SEDFILE% RegExTestbed.cbp > RegExTestbed-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\source_exporter
sed --separate --file=%SEDFOLDER%\%SEDFILE% Exporter.cbp > Exporter-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\symtab
sed --separate --file=%SEDFOLDER%\%SEDFILE% symtab.cbp > symtab-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\ThreadSearch
sed --separate --file=%SEDFOLDER%\%SEDFILE% ThreadSearch.cbp > ThreadSearch-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\wxSmith
sed --separate --file=%SEDFOLDER%\%SEDFILE% wxSmith.cbp > wxSmith-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\wxSmithContribItems
sed --separate --file=%SEDFOLDER%\%SEDFILE% wxSmithContribItems.cbp > wxSmithContribItems-ANSI.cbp

cd %CBFOLDER%\src\plugins\contrib\HexEditor
sed --separate --file=%SEDFOLDER%\%SEDFILE% HexEditor-win.cbp > HexEditor-win-ANSI.cbp

cd %CBFOLDER%\src\tools\cb_share_config
sed --separate --file=%SEDFOLDER%\%SEDFILE% cb_share_config.cbp > cb_share_config-ANSI.cbp

PAUSE

ContribPlugins-ANSI.workspace

<CodeBlocks_workspace_file>