The following is a script I use to do this:
Code: Select all
#!/bin/bash
WXROOT="/home/wxsfs/wxWidgets-2.9.5"
WXPREFIX="/opt/wxWidgets"
#WXCONFIGPATH="/usr/local/bin"
WXCONFIGPATH="/root/my-applications/bin"
WXBUILD=${WXROOT}/gtkbuild
cd ${WXROOT}
rm -r -f ${WXBUILD}
mkdir -p ${WXBUILD}
cd ${WXBUILD}
../configure --enable-unicode --disable-debug_flag --disable-shared --disable-compat28 --prefix=${WXPREFIX} --with-gtk
make
make install
rm *.o
ln -s "${WXPREFIX}/bin/wx-config" "${WXCONFIGPATH}/wx-config"
ln -s "${WXPREFIX}/bin/wxrc" "${WXCONFIGPATH}/wxrc"
exit
WXROOT is simply the path to the directory created by extracting their tar.bz2 file.
WXPREFIX defines where it will end up. It would be easy to just install it into /usr/local, but then it's not quite so easy to cleanup if you want to replace it. So I always install it some where else.
WXCONFIGPATH has to be a directory that appears in the "PATH" list. Compilers and IDE's need to be able to run "wx-config" without specifying any path.
(The script also makes a link for "wxrc", just in case you find a use for it.)
The other main consideration with building wxWidgets, is "shared" or "disable-shared". I choose "disable-shared" because then I'm finished at this point. But, if "shared" is chosen, then a mechanism to make the shared libraries available to the program at runtime needs to be setup, on this machine, and on every machine where the application is installed.
I know if at least 3 ways to make shared libraries available to a program at runtime:
1) Put links to the libraries in a directory in the "LD_LIBRARY_PATH" list.
2) Run the application via a wrapper script that modifies the "LD_LIBRARY_PATH" list, just before executing the application.
3) Use the "rpath" facility to embed a path to the libraries within the applications executable file.
Anyway, these runtime issues don't bother me anymore.
gyro