Hi afb,
I want to create a development environment like this:
codeblocks_dev\wxwidgets_svn
codeblocks_dev\codeblocks_svn
and link codeblocks_svn against the wxwdigets_svn. I've tried to use the wxWidgets trunk but that did not work. I used this configure command:
./configure --enable-shared --enable-monolithic --enable-unicode --with-osx_cocoa --with-png=builtin --with-jpeg=builtin --with-tiff=builtin --with-expat=builtin/configure --enable-shared --enable-monolithic --enable-unicode --with-osx_cocoa --with-png=builtin --with-jpeg=builtin --with-tiff=builtin --with-expat=builtin --prefix=/Users/roxlu/Documents/programming/c++/codeblocks_dev/wxwidgets_svn/wxwidgets_build
Now, I want to build C::B against this wxwidgets compilation. But each time I tried I got different errors (from redefinition to incorrent function arguments). The errors I got were probably due to the fact I used the latest svn from wxWidgets. Do you have any idea how I can build C::B against a custom compiled wxWidgets?
Roxlu
Any suggestions?
Place:
on top of the ExternalLexer.h file. Just before these lines:
#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif
This should work. BTW: I've resolved many of such compiler errors in scintilla. If this works, please tell me and I'll apply it in trunk.
If this works, please tell me and I'll apply it in trunk.
Fix works for me.
There's another error in infowindow.h, but that's another story.
../../../../src/include/infowindow.h:29: error: 'wxScrollingDialog' does not name a type
Missing an #include "scrollingdialog.h". But these are "generic",
and not specific to the Mac OS X build or to the wxMac platform...
If you use pch on mac, try to delete them manually and see if it works.
Precompiled headers is the default, yes, unless using --disable-pch.
(There's also an old bug that it keeps the .gch files in the source dir,
instead of in the proper build directories but I've patched that locally
as I'm doing Universal Binary builds and thus doing more than one build)
But it built with these modifications:
Index: src/sdk/wxscintilla/src/scintilla/src/ExternalLexer.h
===================================================================
--- src/sdk/wxscintilla/src/scintilla/src/ExternalLexer.h (revision 6113)
+++ src/sdk/wxscintilla/src/scintilla/src/ExternalLexer.h (arbetskopia)
@@ -14,6 +14,8 @@
#define EXT_LEXER_DECL
#endif
+#include <string>
+
#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif
Index: src/include/infowindow.h
===================================================================
--- src/include/infowindow.h (revision 6113)
+++ src/include/infowindow.h (arbetskopia)
@@ -26,6 +26,7 @@
#include <wx/popupwin.h>
typedef wxPopupWindow wxInfoWindowBase;
#else
+ #include "scrollingdialog.h"
typedef wxScrollingDialog wxInfoWindowBase;
#endif
Index: src/plugins/contrib/wxSmith/propgrid/Makefile.am
===================================================================
--- src/plugins/contrib/wxSmith/propgrid/Makefile.am (revision 6113)
+++ src/plugins/contrib/wxSmith/propgrid/Makefile.am (arbetskopia)
@@ -1,4 +1,5 @@
INCLUDES = $(WX_CXXFLAGS) \
+ -I$(top_srcdir)/src/include \
-I$(srcdir)/contrib/include
AM_CPPFLAGS = -DWXMAKINGLIB_PROPGRID -DwxPG_USE_WXMODULE=0
Index: src/plugins/contrib/wxSmith/propgrid/contrib/src/propgrid/odcombo.cpp
===================================================================
--- src/plugins/contrib/wxSmith/propgrid/contrib/src/propgrid/odcombo.cpp (revision 6113)
+++ src/plugins/contrib/wxSmith/propgrid/contrib/src/propgrid/odcombo.cpp (arbetskopia)
@@ -104,6 +104,7 @@
#else
#undef USE_TRANSIENT_POPUP
#define USE_TRANSIENT_POPUP 0
+ #include "scrollingdialog.h"
#endif
// For versions < 2.6.2, don't enable transient popup. There may be
I haven't used the install_name_tool and Code::Blocks still runs, why?
Because all the paths exists under your local machine. AFAIR, the install_name_tool replaces the replaces the hard coded absolute path with something like
(Assuming you copies the dylib to be located under the same path as the exe)
install_name_tool -change /some/abs/path/wx-some-dylib @executable_path/wx-some-dylib ${file}
but since you compiled the binary on your machine the absolute paths will work OK as well - but they will probably fail on another Mac machine
Eran
Hi everyone!,
I finally finished the script I was working on. When you run it, you'll be asked a couple of questions. You need to download the svn versions of codeblocks and wxwidgets once before you can do anything.
It will compile wxWidgets for Mac 10.6 (with XCode installed previously) and C::B with all plugins (this will take a while). When everyting has been build it will create an application bundle and reset all the dynamic link locations using install_name_tool.
There is only one tiny thing left. When I try to create a new project, there are no projects to select from? (no icons maybe??)
update: Everything works now! I've got all the plugins!
(http://i50.tinypic.com/ek251j.png)
The script can be found here:
note that it's create for my needs and needs to be tested/tweaked when other people want to use it.
#!/bin/sh
#set -x
root_dir=${PWD}
if [ -d wxwidgets_svn ]
then
read -p "Remove wxWidgets 2.8 directory to start clean install? [y/n]: " continue
if test "${continue}" == "y" ; then
rm -r wxwidgets_svn
mkdir wxwidgets_svn
fi
else
mkdir wxwidgets_svn
fi
if [ -d codeblocks_svn ]
then
read -p "Remove CodeBlocks directory to start clean install? [y/n]: " continue
if test "${continue}" == "y"; then
rm -r codeblocks_svn
mkdir codeblocks_svn
fi
else
mkdir codeblocks_svn
fi
read -p "Download CodeBlocks from svn? [y/n]: " continue
if test "${continue}" == "y"; then
cd codeblocks_svn
svn co http://svn.berlios.de/svnroot/repos/codeblocks/trunk .
cd ..
fi
read -p "Download wxWidgets 2.8 from svn? [y/n]: " continue
if test "${continue}" == "y"; then
cd wxwidgets_svn
svn co http://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH .
fi
#------------------------- wxWidgets ---------------------------------------
read -p "Configure wxWidgets 2.8? [y/n]: " continue
if test "${continue}" == "y"; then
if [ ! -d ${root_dir}/wxwidgets_svn ]; then
echo "No wxWidgets directory found"
exit
fi
cd ${root_dir}/wxwidgets_svn
if [ -d build_custom ]; then
rm -r build_custom
fi
mkdir build_custom
cd build_custom
./../configure --enable-shared \
--enable-monolithic \
--enable-unicode \
--with-png=builtin \
--with-jpeg=builtin \
--with-tiff=builtin \
--with-expat=builtin/configure \
--enable-shared \
--enable-monolithic \
--enable-unicode \
--with-mac \
--with-expat=builtin \
CFLAGS="-arch i386" CXXFLAGS="-arch i386" CPPFLAGS="-arch i386" \
LDFLAGS="-arch i386" OBJCFLAGS="-arch i386" OBJCXXFLAGS="-arch i386"
fi
read -p "Compile wxWidgets 2.8 [y/n]: " continue
if test "${continue}" == "y"; then
cd ${root_dir}/wxwidgets_svn/build_custom
make
fi
read -p "Bootstrap Code::Blocks [y/n]: " continue
if test "${continue}" == "y"; then
cd ${root_dir}/codeblocks_svn
./bootstrap
fi
read -p "Configure Code::Blocks [y/n]: " continue
if test "${continue}" == "y"; then
if [ ! -d ${root_dir}/codeblocks_svn ]; then
echo "No CodeBlocks directory found"
exit
fi
cd ${root_dir}/codeblocks_svn
if [ -d custom_build ]; then
rm -r custom_build
fi
mkdir custom_build
cd custom_build
./../configure \
--prefix=${root_dir}/codeblocks_svn/custom_build/ \
--with-wxdir=./../../wxwidgets28_from_svn/custom_build/ \
CFLAGS="-arch i386" CXXFLAGS="-arch i386" \
CPPFLAGS="-arch i386" LDFLAGS="-arch i386" \
OBJCFLAGS="-arch i386" \
OBJCXXFLAGS="-arch i386" \
--with-contrib-plugins=all \
--enable-static \
--enable-debug \
--with-macosx \
--with-wxdir=${root_dir}/wxwidgets_svn/build_custom/ \
--with-wx-config=${root_dir}/wxwidgets_svn/build_custom/wx-config \
--with-wx-prefix=${root_dir}/wxwidgets_svn/build_custom/
fi
read -p "Compile and make Code::Blocks [y/n]: " continue
if test "${continue}" == "y"; then
cd ${root_dir}/codeblocks_svn/custom_build
make
fi
read -p "Create CodeBlocks.app bundle? [y/n]: " continue
if test "${continue}" == "y"; then
if [ -d ${root_dir}/app/CodeBlocks.app ]; then
read -p "An Codeblocks.app bundle already exists, remove first? [y/n]: " continue
if test "${continue}" == "y"; then
rm -r ${root_dir}/app/CodeBlocks.app
fi
fi
app_dir=${root_dir}/app/CodeBlocks.app
cb_dir=${root_dir}/codeblocks_svn
wx_dir=${root_dir}/wxwidgets_svn
mkdir -p ${app_dir}/Contents/MacOS
mkdir -p ${app_dir}/Contents/Resources/share/codeblocks
cp ${cb_dir}/custom_build/codeblocks.plist ${app_dir}/Contents/Info.plist
cp ${cb_dir}/src/src/resources/icons/*.icns ${app_dir}/Contents/Resources/
cp -r ${cb_dir}/custom_build/share/codeblocks/* ${app_dir}/Contents/Resources/share/codeblocks/
cp ${cb_dir}/custom_build/bin/codeblocks ${app_dir}/Contents/MacOS/CodeBlocks
cp ${cb_dir}/custom_build/lib/libcodeblocks.0.dylib ${app_dir}/Contents/MacOS/
cp ${cb_dir}/custom_build/lib/libwxsmithlib.0.dylib ${app_dir}/Contents/MacOS/
cp ${wx_dir}/build_custom/lib/libwx_macu-2.8.0.dylib ${app_dir}/Contents/MacOS/
chmod 777 ${app_dir}/Contents/MacOS/CodeBlocks
fi
read -p "Change dynamic lib paths? [y/n]: " continue
if test "${continue}" == "y"; then
# copy the plugins
cd ${root_dir}/codeblocks_svn/custom_build/src/plugins
mkdir -p ${root_dir}/app/CodeBlocks.app/Contents/Resources/share/codeblocks/plugins/
for dir in `find -type d . -mindepth 1 -maxdepth 1`; do
name=${dir##*/}
plugin=${root_dir}/codeblocks_svn/custom_build/src/plugins/${name}/.libs/lib${name}.so
if [ -f ${plugin} ]; then
cp ${plugin} ${root_dir}/app/CodeBlocks.app/Contents/Resources/share/codeblocks/
fi
done
cd ${root_dir}/app/CodeBlocks.app/Contents
install_name_tool -id @executable_path/libcodeblocks.0.dylib MacOS/libcodeblocks.0.dylib
install_name_tool -id @executable_path/libwxsmith.0.dylib MacOS/libwxsmithlib.0.dylib
install_name_tool -change ${root_dir}/codeblocks_svn/custom_build/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib MacOS/CodeBlocks
install_name_tool -change ${root_dir}/codeblocks_svn/custom_build//lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib MacOS/CodeBlocks
install_name_tool -change /usr/local/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib MacOS/libwxsmithlib.0.dylib
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib MacOS/CodeBlocks
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib MacOS/libcodeblocks.0.dylib
install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib MacOS/libwxsmithlib.0.dylib
for so in Resources/share/codeblocks/*.so; do
libcodeblocks=$(otool -L ${so} | grep libcodeblocks)
libcodeblocks=${libcodeblocks%%(*}
install_name_tool -change ${libcodeblocks} @executable_path/libcodeblocks.0.dylib ${so}
libwxsmith=$(otool -L ${so} | grep libwxsmithlib)
libwxsmith=${libwxsmith%%(*}
if test "${libwxsmith}" != ""; then
install_name_tool -change ${libwxsmith} @executable_path/libwxsmithlib.0.dylib ${so}
fi
libwx=$(otool -L ${so} | grep libwx_macu)
libwx=${libwx%%(*}
if test "${libwx}" != ""}; then
install_name_tool -change ${libwx} @executable_path/libwx_macu-2.8.0.dylib ${so}
fi
#install_name_tool -change /usr/local/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib ${so}
#install_name_tool -change /usr/local/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib ${so}
#install_name_tool -change /usr/local/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib ${so}
done
fi
Roxlu