Construction Steps
1- Building Code::Blocks
(The process is described in the Code::Blocks wiki. A detailed description is provided on this page by XunXun)
Summary:
- get latest valid MinGW
- get selected WxWidgets source (was 2.8.11 for EP v1.0.0)
- Compile WxWidget under MinGW:
Static build command: make -f makefile.gcc CPPFLAGS=-Os LDFLAGS=-s SHARED=1 BUILD=release UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0 MONOLITHIC=1 OFFICIAL_BUILD=1 RUNTIME_LIBS=static >nul
There may be linking errors. Do not worry, see this Code::Blocks forum thread
- Build and install the Boost libraries (only for compiling the NassiSchniederman CB plugin)
- Retrieve desired SVN number for Code::Blocks and
- build Code::Blocks and the plugins "contrib" workspace using the latest nightly build and previously built WxWidget. - call src\update.bat to obtain CB build in src\output subdirectory.
- Copy the wxwidgets dll (xmsw28u####.dll) to src\output.
Your newly built Code::Blocks IDE is in src\output.
2- Construction of Code::Blocks EDU-Portable
- Create a CodeBlocks-EP directory, called from here on <CB_dir>. Copy the previously produced output directory contents to <CB_dir>.
- Install the latest MinGW into <CB_dir> MinGW subdirectory.
- Install programmer fonts into <CB_dir>\share\codeblocks\fonts.
(at least DejaVuSansMono, Inconsolata hinted distributed with the CbLauncher, and Anonymous Pro).
- Set Inconsolata at 13point as the current editor font in Settings->Editor settings->Font.
- Set syntax highlighting to milder values: operator->187-0-0, Comment(normal)->128-128-128, Comment(documentation)->0-64-128 italics
- Select to not "show line numbers" in editor settings.
- In "Margins and caret" set right margin to a visible line, colour 238-238-238 (just visible) at 90 characters.
- Create a "tool" subdirectory of the installation.
- Install GDB with Python support inside MinGW/bin( http://code.google.com/p/qp-gcc/wiki/GDB )
- Modify global variables:
tool -> Base::$(CODEBLOCKS)\tool
inc -> Base:$(CODEBLOCKS)\include
lib -> Base:$(CODEBLOCKS)\lib
boost -> Base:$(CODEBLOCKS)\sdk\boost include:$(#BT)\include lib:$(#BT)\lib
wx -> Base:$(CODEBLOCKS)\sdk\wx include:$(#WX)\include lib:$(#WX)\lib
sdl -> Base:$(CODEBLOCKS)\sdk\sdl include:$(#SDL)\include lib:$(#SDL)\lib
winbgim -> Base:$(CODEBLOCKS)\sdk\winbgim include:$(#WINBGIM)\include lib:$(#WINBGIM)\lib
koolplot -> Base:$(CODEBLOCKS)\sdk\koolplot include:$(#KOOLPLOT)\include lib:$(#KOOLPLOT)\lib
grx -> Base:$(CODEBLOCKS)\sdk\grx include:$(#GRX)\include lib:$(#GRX)\lib
glut -> Base:$(CODEBLOCKS)\sdk\glut include:$(#GLUT)\include lib:$(#GLUT)\lib
dx -> Base:$(CODEBLOCKS)\sdk\dx include:$(#DX)\include lib:$(#DX)\lib
fltk -> Base:$(CODEBLOCKS)\sdk\fltk
- Modify global Codeblocks settings:
Global Compiler Settings:
* Compiler settings (tick):
- In C mode, support all ISO C90 programs, In C++ mode, remove GNU extensions..[-ansi]
- Enable all compiler warnings ... [-Wall]
- Enable warnings demanded by strict ISO C and ISO C++ [-pedantic]Other settings:
* Compiler loging: Full command line
- Install tools:
* In the tools menu:
Command Prompt -> executable:cmd Working directory:${TARGET_OUTPUT_DIR} parameters: /t:F0 /K title $(PROJECT_NAME} && prompt $(PROJECT_NAME}\${TARGET_OUTPUT_DIR}$$G$$S Launch visible detached, no output redirect
Output Dir -> Executable:explorer.exe Working directory:${TARGET_OUTPUT_DIR} Launch visible detached, no output redirect
Project Dir -> Executable:explorer.exe Working directory:$(PROJECT_DIR) Launch visible detached, no output redirect
---separator---
Launch in new console and wait for keypress when doneResEdit -> Executable:$(CODEBLOCKS)\tool\resedit\ResEdit.exe Working directory: $(PROJECT_DIR)$(TARGET_NAME) Launch visible detached, no output redirect
Fluid (fltk GUI design tool) -> Executable:$(CODEBLOCKS)\tool\fluid\fluid.exe Working directory: $(PROJECT_DIR) Launch visible detached, no output redirect
---separator---UPX (compress target exe) -> Executable:$(#TOOL)\upx.exe Parameters:$(PROJECT_DIR)$(TARGET_OUTPUT_FILE) Working directory:$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)
Error# Lookup -> Executable:$(CODEBLOCKS)\tool\ErrorMsg.exe Launch visible detached, no output redirect
Dependency Walker -> Executable:$(CODEBLOCKS)\tool\Depends.Exe Launch visible detached, no output redirect
* In the tools (tool) directory (..\Codeblocks\tool):
- Install latest AStyle, including docs, into "astyle" subdirectory of "tool".
- Install the latest Doxygen with it's html help in a "doxygen" subdirectory of "tool".
- Install the latest Cccc in a "cccc" subdirectory of "tool".
- Install the latest Graphviz in its "graphviz" subdirectory of "tool"
- Install the latest CppCheck in "cppcheck" subdirectory of "tool"
- Install the latest Fluid in "fluid" subdirectory of "tool"
- Install the latest CppCheck in "cppcheck" subdirectory of "tool"
- Install latest UPX into "tool" directory.
- Install latest resedit into "resedit" subdirectory of "tool"
- Install latest ErrMsg.exe and ErrMsgHelp.txt in the "tool" directory
- Install latest dependency walker (http://www.dependencywalker.com) in tool directory
NOTE: The tool programs obtained via an installer can be installed in a host directory on the building machine, their directories copied to the "tool" directory of Codeblocks, then the programs uninstalled from the host machine.
- Install all plugins but disable a few. Add:
- Install extra SDK libraries:
boost
dx
glut
winbgim
koolplot
sdl
grx
sqlite
fltk
wx in $(CODEBLOCKS)\sdk\wx setup.h \include \lib (only GCC stuff).
- Get copy setup.h from
- Recompile and install the latest CBLauncher
- Reduce visible libraries (by out-commenting lines in "CodeBlocks\share\codeblocks\templates\wizard\config.script") to show only:
- Code::Blocks plugins
- Console application
- Static library
- Dynamic Link Library
- Shared library
- Empty project
- Graphics:
- Win32 GUI project
- WinBGIm project
- Koolplot project
- GRX project
- glut project
- fltk project
- wxWidgets project
- Install winbgim, koolplot, grx, fltk project wizards directories in CodeBlocks\share\codeblocks\templates\wizard\
- Move wizards and modified config.script from ...\Codeblocks\AppData\codeblocks\share\codeblocks\templates\wizard
to .
...\Codeblocks\share\codeblocks\templates\wizard
- Ensure projects wizards call:
C99StrictOn(project, Wizard.GetCompilerID()); for C
and
Cpp98StrictOn(project, Wizard.GetCompilerID()); for C++also for old libraries (winbgim, koolplot, grx) that do not respect const char * parameters,
// Suppress "const string to char *" warning
project.AddCompilerOption(_T("-Wno-write-strings")); This for Console projects, winbgim, koolplot
ensure that wizard\common_functions.script contains functions C99StrictOn() and Cpp98StrictOn().
- Update and Install Help files with at least:
* C and C++ Reference $(CODEBLOCKS)\tool\keyHH.exe -#klink $(keyword) $(CODEBLOCKS)\help\chm\c-cppreference.chm (default help file) Have something common to C and C++ (e.g. math) as default keyword.
* Programmer's Help $(CODEBLOCKS)\help\programmerGuide.htm
* wxwidget $(CODEBLOCKS)\help\chm\wx.chm
* Code::Blocks Manual $(CODEBLOCKS)\help\chm\CBmanual_en.chm (update each time as it is continuously maintained).
- Build installer and update web page.
(Keep old version in archives on site and on disk.)