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

Needed files

sed script file and batch files

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-plugin-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

Code::Blocks workspace file for Non-Unicode Build

ContribPlugins-ANSI.workspace

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="All contrib plugins">
<Project filename="tools/cb_share_config/cb_share_config-ANSI.cbp" />
<Project filename="tools/CBLauncher/CbLauncher-ANSI.cbp" />
<Project filename="tools/Addr2LineUI/Addr2LineUI-ANSI.cbp" />
<Project filename="plugins/codecompletion/cctest-ANSI.cbp" />
<Project filename="plugins/contrib/wxContribItems/wxContribItems-ANSI.cbp" />
<Project filename="plugins/contrib/wxSmith/wxSmith-ANSI.cbp" />
<Project filename="plugins/contrib/wxSmithContribItems/wxSmithContribItems-ANSI.cbp">
<Depends filename="plugins/contrib/lib_finder/lib_finder-ANSI.cbp" />
<Depends filename="plugins/contrib/wxSmith/wxSmith-ANSI.cbp" />
</Project>
<Project filename="plugins/contrib/wxSmithAui/wxSmithAui-ANSI.cbp">
<Depends filename="plugins/contrib/wxSmith/wxSmith-ANSI.cbp" />
</Project>
<Project filename="plugins/contrib/AutoVersioning/AutoVersioning-ANSI.cbp" active="1" />
<Project filename="plugins/contrib/BrowseTracker/BrowseTracker-ANSI.cbp" />
<Project filename="plugins/contrib/byogames/byogames-ANSI.cbp" />
<Project filename="plugins/contrib/cb_koders/cb_koders-ANSI.cbp" />
<Project filename="plugins/contrib/Cccc/Cccc-ANSI.cbp" />
<Project filename="plugins/contrib/codesnippets/codesnippets-ANSI.cbp" />
<Project filename="plugins/contrib/codestat/codestat-ANSI.cbp" />
<Project filename="plugins/contrib/copystrings/copystrings-ANSI.cbp" />
<Project filename="plugins/contrib/CppCheck/CppCheck-ANSI.cbp" />
<Project filename="plugins/contrib/Cscope/Cscope-ANSI.cbp" />
<Project filename="plugins/contrib/devpak_plugin/DevPakPlugin-ANSI.cbp" />
<Project filename="plugins/contrib/DoxyBlocks/DoxyBlocks-ANSI.cbp" />
<Project filename="plugins/contrib/dragscroll/dragscroll-ANSI.cbp" />
<Project filename="plugins/contrib/EditorConfig/EditorConfig-ANSI.cbp" />
<Project filename="plugins/contrib/EditorTweaks/EditorTweaks-ANSI.cbp" />
<Project filename="plugins/contrib/envvars/envvars-ANSI.cbp" />
<Project filename="plugins/contrib/FileManager/FileManager-ANSI.cbp" />
<Project filename="plugins/contrib/FortranProject/FortranProject_cbsvn-ANSI.cbp" />
<Project filename="plugins/contrib/headerfixup/headerfixup-ANSI.cbp" />
<Project filename="plugins/contrib/help_plugin/help-plugin-ANSI.cbp" />
<Project filename="plugins/contrib/HexEditor/HexEditor-ANSI.cbp" />
<Project filename="plugins/contrib/IncrementalSearch/IncrementalSearch-ANSI.cbp" />
<Project filename="plugins/contrib/keybinder/keybinder-ANSI.cbp" />
<Project filename="plugins/contrib/lib_finder/lib_finder-ANSI.cbp">
<Depends filename="plugins/contrib/wxContribItems/wxContribItems-ANSI.cbp" />
</Project>
<Project filename="plugins/contrib/MouseSap/MouseSap-ANSI.cbp" />
<Project filename="plugins/contrib/NassiShneiderman/NassiShneiderman-ANSI.cbp" />
<Project filename="plugins/contrib/profiler/cbprofiler-ANSI.cbp" />
<Project filename="plugins/contrib/regex_testbed/RegExTestbed-ANSI.cbp" />
<Project filename="plugins/contrib/ReopenEditor/ReopenEditor-ANSI.cbp" />
<Project filename="plugins/contrib/rndgen/rndgen-ANSI.cbp" />
<Project filename="plugins/contrib/SmartIndent/SmartIndent-ANSI.cbp" />
<Project filename="plugins/contrib/source_exporter/Exporter-ANSI.cbp" />
<Project filename="plugins/contrib/SpellChecker/SpellChecker-ANSI.cbp" />
<Project filename="plugins/contrib/symtab/symtab-ANSI.cbp" />
<Project filename="plugins/contrib/ThreadSearch/ThreadSearch-ANSI.cbp">
<Depends filename="plugins/contrib/wxContribItems/wxContribItems-ANSI.cbp" />
</Project>
<Project filename="plugins/contrib/ToolsPlus/ToolsPlus-ANSI.cbp" />
</Workspace>
</CodeBlocks_workspace_file>

Steps to modify Code::Blocks projects for Non-Unicode Build

Save the ANSI.sed script file to the folder above or in the Code::Blocks source.

  1. I save mine above the codeblocks folder that contains the Code::Blocks source.

Save the sed-ANSI-out.bat batch file to the folder above or in the Code::Blocks source

Edit the sed-ANSI-out.bat batch file so SEDFOLDER and CBFOLDER are set right

  1. SEDFOLDER needs to be the full path to the folder holding ANSI.sed script file.
  2. CBFOLDER needs to be the full path to the folder holding the Code::Blocks source.

Save the ContribPlugins-ANSI.workspace workspace file

  1. Save it in the folder that contains ContribPlugins.workspace normally the src folder.

Run the sed-ANSI-out.bat batch file

Use Codeblocks to Compile the project and workspace

  1. Compile CodeBlocks-ANSI.cbp
  2. Compile ContribPlugins-ANSI.workspace

Post Questions to this forum thread

  1. /index.php/topic,9258.msg66095.html#msg66095