Some things have changed in CVS:
- Code::Blocks is now using the GNU build system (autoconf/automake), at least for non-windows platforms :D
- All provided makefiles are now gone :shock:
- Many doc files have been moved from src/ to the top-level folder (COPYING, AUTHORS, etc)
Well, how does Code::Blocks build now?
I will update the relevant README files but until I do, here goes:
Windows
Download latest stable Code::Blocks if you don't already have it (shame on you!)
Open with it the CodeBlocks.cbp (wx2.4) or CodeBlocks.wx2.6.cbp (wx2.6) project file, edit the project's custom variables (to point to your wx installation) and build it.
Unix
The very first time you unpack the source (or checkout from CVS), you need to run ./bootstrap. This will create a sane building environment.
Then just do the usual stuff:
mkdir -p build/release
cd build/release
../../configure
make
sudo make install
or
mkdir -p build/debug
cd build/debug
../../configure --enable-debug
make
sudo make install
Use 'configure --help' to see what things you can enable/disable.
With that said, it works for me but I 'd like to know if people are having problems with it.
running ./bootstrap:
aclocal:configure.in:147: warning: macro `AM_PATH_WXCONFIG' not found in library
configure.in:147: error: possibly undefined macro: AM_PATH_WXCONFIG
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
root:/usr/src/codeblocks# wx-config --prefix
/opt/wx/2.6
This seems to work for me:
#echo `wx-config --prefix`/share/aclocal >> `aclocal --print-ac-dir`/dirlist
which creates on my system:
# cat /usr/share/aclocal/dirlist
/opt/wx/2.6/share/aclocal
one more thing:
make[4]: Entering directory `/usr/src/codeblocks/src/sdk/resources'
cd . && \
zip -j manager_resources.zip *.xrc images/*.png > /dev/null
mv ./manager_resources.zip .
mv: `./manager_resources.zip' and `./manager_resources.zip' are the same file
make[4]: *** [manager_resources.zip] Error 1
make[4]: Leaving directory `/usr/src/codeblocks/src/sdk/resources'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/src/codeblocks/src/sdk'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/src/codeblocks/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/codeblocks'
make: *** [all] Error 2
the Makefile in codeblocks/src/sdk/resources should probably use
mv -f
for after it zips the manager_resources (my $srcdir = .)
This part is failing now (same problem):
resources.zip:
cd $(top_srcdir)/src/src/resources && \
zip resources.zip *.xrc images/*.png images/16x16/*.png > /dev/
null
mv -f $(top_srcdir)/src/src/resources/resources.zip .
start_here.zip:
cd $(top_srcdir)/src/src/resources/start_here && \
zip start_here.zip *.htm* *.jpg > /dev/null
mv -f $(top_srcdir)/src/src/resources/start_here/start_here.zip .
I had to change those mv commands to mv -f
to get it to work.
I think this applies to all the resources directories (src/plugins/astyle/resources is the same).
(you're doing mkdir build; cd build; ../configure. I'm calling configure from the codeblocks directory...)
Edit: changing mv to mv -f doesn't actually work (same error). It was just not giving an error again since I was fixing the Makefiles as they failed and then running make again (which just reported nothing to do for that directory...)
I get the same thing. BT
Edit: line #s
#0 0x42a1e72a in gtk_widget_show () from /usr/lib/libgtk-x11-2.0.so.0
#1 0x00000175 in ?? ()
#2 0x42a45034 in __PRETTY_FUNCTION__.1 () from /usr/lib/libgtk-x11-2.0.so.0
#3 0x42a44226 in __PRETTY_FUNCTION__.0 () from /usr/lib/libgtk-x11-2.0.so.0
#4 0x0825a268 in ?? ()
#5 0xb7e31150 in ?? () from /opt/wx/2.6/lib/libwx_gtk2-2.6.so.0
#6 0xb7e31150 in ?? () from /opt/wx/2.6/lib/libwx_gtk2-2.6.so.0
#7 0x00000000 in ?? ()
#8 0xb7bc6d76 in wxNotebook::SetPageImage ()
from /opt/wx/2.6/lib/libwx_gtk2-2.6.so.0
#9 0xb7f3e4cd in MessageManager::DoAddLog (this=0x825a268, type=mltLog,
log=0x829e710) at messagemanager.cpp:254
#10 0xb7f3d370 in MessageManager (this=0x825a268, parent=0x8180568)
at messagemanager.cpp:104
#11 0xb7f3c44d in MessageManager::Get (parent=0x8180568)
at messagemanager.cpp:60
#12 0xb7f3b273 in Manager::GetMessageManager (this=0x823d710)
at manager.cpp:299
#13 0xb7f3a896 in Manager::Get (appWindow=0x8180568, notebook=0x823b8f0,
clientWin=0x0) at manager.cpp:110
#14 0x08066519 in MainFrame::CreateIDE (this=0x8180568) at main.cpp:440
#15 0x0806547d in MainFrame (this=0x8180568, lang=@0x80a0850, parent=0x0)
at main.cpp:372
#16 0x0805c259 in CodeBlocksApp::InitFrame (this=0x80a07f0) at app.cpp:183
---
erorr is:
Starting program: /usr/local/bin/codeblocks
[Thread debugging using libthread_db enabled]
[New Thread -1217038528 (LWP 30259)]
(codeblocks:30259): Gtk-CRITICAL **: file gtkpixmap.c: line 104 (gtk_pixmap_new)
: assertion `val != NULL' failed
(codeblocks:30259): Gtk-CRITICAL **: file gtkbox.c: line 373 (gtk_box_pack_start
): assertion `GTK_IS_WIDGET (child)' failed
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1217038528 (LWP 30259)]
0x42a1e72a in gtk_widget_show () from /usr/lib/libgtk-x11-2.0.so.0
root:/usr/local/share/codeblocks# ls
astyle.zip images start_here.zip
class_wizard.zip lexers templates
code_completion.zip manager_resources.zip tips.txt
compiler_gcc.zip plugins todo.zip
debugger_gdb.zip plugin_wizard.zip
defaultmimehandler.zip resources.zip
root:/usr/local/share/codeblocks# ls images/codecompletion/
class_folder.png enumerator.png preproc_folder.png
class.png enum.png preproc.png
ctor_private.png enums_folder.png symbols_folder.png
ctor_protected.png method_private.png var_private.png
ctor_public.png method_protected.png var_protected.png
dtor_private.png method_public.png var_public.png
dtor_protected.png namespace.png
dtor_public.png others_folder.png
No clue what changed in latest cvs configure script but it's not working on my system:
*** ./configure: line 22858: syntax error near unexpected token `ac_header'
*** ./configure: line 22858: `for ac_header in X11/Intrinsic.h'
if test $succeeded = yes; then
:
else
{ { echo "$as_me:$LINENO: error: Library requirements (gtkglextmm-1.0 libgl
ademm-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable
if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
echo "$as_me: error: Library requirements (gtkglextmm-1.0 libglademm-2.0) not me
t; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries
are in a nonstandard prefix so pkg-config can find them." >&2;}
{ (exit 1); exit 1; }; }
fi
;;
for ac_header in X11/Intrinsic.h
do
If those ;; semicolons are removed it doesn't error out there, but the if branches above don't work somehow (it doesn't include the libs it was looking for - Library requirements (gtkglextmm-1.0 libglademm-2.0) not met;). Not sure why configure seems to be broken (syntax errors :/ ). I am compiling against wx ansi debug if that makes a difference.
Edit: went back and set wx-config back to the non-debug version of wx, reran bootstrap and configure (no flags this time) and same error msg. configure worked yesterday with the same settings :(
looking at cvs it looks like it happens here:
checking for dlopen in -ldl... yes
checking for pthread_create in -lpthread... yes
checking for snprintf... yes
checking for vsnprintf... yes
./configure: line 22858: syntax error near unexpected token `ac_header'
./configure: line 22858: `for ac_header in X11/Intrinsic.h'
---
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF,,snprintf))
AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF,,vsnprintf))
**********************************
dnl versioning info for libtool
dnl Note this is the ABI version which is not the same as our actual library version
CODEBLOCKS_CURRENT=0
CODEBLOCKS_REVISION=1
CODEBLOCKS_AGE=1
CODEBLOCKS_VERSION_INFO=$CODEBLOCKS_CURRENT:$CODEBLOCKS_REVISION:$CODEBLOCKS_AGE
AC_SUBST(CODEBLOCKS_VERSION_INFO)
CODEBLOCKS_GET_PLATFORM
CODEBLOCKS_ENABLE_SETTINGS
dnl AM_OPTIONS_WXCONFIG AC_SUBST(CXXFLAGS)
AC_SUBST(CFLAGS)
AM_OPTIONS_WXCONFIG
Maybe it's the CODEBLOCKS_GET_PLATFORM ?
if test "${with_platform+set}" = set; then
withval="$with_platform"
CODEBLOCKS_PLATFORM=$withval
else
CODEBLOCKS_PLATFORM=gtk
fi;
PLATFORM_CFLAGS=""
PLATFORM_LIBS=""
case $CODEBLOCKS_PLATFORM in
gtk)
succeeded=no
if test -z "$PKG_CONFIG"; then
# Extract the first word of "pkg-config", so it can be a program name with a
rgs.
set dummy pkg-config; ac_word=$2
Does that case statement look right?
tested configure and make (--enable-debug) without error. make install failed (in place make):
make:
make[4]: Entering directory `/usr/src/codeblocks/src/src/resources'
cd . && zip ./resources.zip *.xrc images/*.png images/16x16/*.png > /dev/null
cd ./start_here && zip ./start_here.zip *.htm* *.jpg > /dev/null
make install:
make[5]: Entering directory `/usr/src/codeblocks/src/src/resources'
make[5]: Nothing to be done for `install-exec-am'.
cd ./start_here && zip ./start_here.zip *.htm* *.jpg > /dev/null
test -z "/usr/local/share/codeblocks" || mkdir -p -- "/usr/local/share/codeblock
s"
/bin/install -c -m 644 'resources.zip' '/usr/local/share/codeblocks/resources.z
ip'
/bin/install -c -m 644 './start_here.zip' '/usr/local/share/codeblocks/start_he
re.zip'
/bin/install: cannot stat `./start_here.zip': No such file or directory
#find . -iname start_here*
codeblocks/src/src/resources/start_here/start_here.zip
So it puts start_here.zip in the start_here/ subdirectory but then tries to install start here from the resources (parent) directory - instead of first changing to resources/start_here...