[...] I know that the new wxWidgets will go into /usr/local/* instead of usr/lib....
not necessarily; you can use ./configure --prefix=/usr
Will CodeBlocks support this?
yes
Anyone done it?
yes for a long time, but I changed over to /usr a week ago due to the annoying LD_LIBRARY_PATH (see below). Not a problem for codeblocks but for some other progams in my case. I always use wxwidgets trunk; dare to "live at head" citing Titus Winter, head of google C++ library code base on his cppcon2017 talk.
Any gotcha's?
- you should deinstall the current wxWidgets before installing your own
- already installed packages may still depend on the wxwidgets provided by the distributor of your os. That's why I installed gnuplot and wxmaxima from source as well. Otherwise updating your os will remain annoying an error prone if you accidentially reinstall the original wxwidgets
- having installed wxwidgets into /usr/local and depending on the configuration of your dynamic linker you may have to use LD_LIBRARY_PATH=/usr/local/lib which is a bit hacky and less easy to use when you want to start programs like codeblocks via desktop icons etc.
- very rarely, an update breaks;
Any pointers to a "how to" other than the generic how to's already on both forums, which I have already read?
something like this Makefile?
.PHONY: clone update prerequisites bootstrap config all install clean
uname := $(shell uname -a)
uname_arch := $(findstring arch, $(uname))
uname_ubuntu := $(findstring buntu, $(uname))
uname_FreeBSD := $(findstring FreeBSD, $(uname))
uname_pi := $(findstring armv, $(uname))
ifeq (buntu,$(uname_ubuntu))
distro := ubuntu
#package_manager := apt-get
#package_install := $(package_manager) install --assume-yes
os_release := $(shell lsb_release --release | sed -e 's/Release:[ \t]*//')
endif
ifeq (arch,$(uname_arch))
distro := arch
package_manager := pacman
package_install := $(package_manager) --sync --noconfirm
endif
ifeq (FreeBSD,$(uname_FreeBSD))
package_manager := pkg
package_install := $(package_manager) install --yes
CFLAGS :=-I/usr/local/include
endif
ifeq (armv,$(uname_pi))
distro := raspbian
package_manager := apt-get
package_install := $(package_manager) install --assume-yes
endif
ifneq (,$(filter $(distro), ubuntu raspbian))
package_manager := apt-get
package_install := $(package_manager) install --assume-yes
endif
ifeq (buntu,$(uname_ubuntu))
ifeq (16.04,$(os_release))
CC=gcc-6
CXX=g++-6
endif
endif
ifeq (raspbian,$(distro))
CC=gcc
CXX=g++
endif
# https://solarianprogrammer.com/2017/12/08/raspberry-pi-raspbian-install-gcc-compile-cpp-17-programs/
BUILD=build
TRUNK=trunk
all:
(cd $(BUILD) && $(MAKE))
clone:
git clone --recurse-submodule --jobs=5 \
https://github.com/wxWidgets/wxWidgets.git $(TRUNK)
# wxwidgets transitioned all the third party libraries
# used by wxWidgets, such as libpng, libjpeg and so on, to use
# Git submodules instead of just subdirectories in the main repository.
# see: http://wxwidgets.blogspot.com/
# Sunday, November 12, 2017 "Surreptitious Submodule Switch"
## (cd $(TRUNK) && git submodule update --init)
update:
(cd $(TRUNK) && git pull --rebase)
prerequisites:
$(package_install) \
bison \
flex \
ifeq (buntu,$(uname_ubuntu))
$(package_install) \
libgtk-3-dev \
ifeq (raspbian,$(distro))
$(package_install) \
libgtk-3-dev \
endif
endif
ifeq (arch,$(uname_arch))
endif
bootstrap:
config:
-mkdir -p $(BUILD)
(cd $(BUILD) && ../$(TRUNK)/configure --prefix=/usr --with-cxx=14 )
# (cd $(BUILD) && ../$(TRUNK)/configure -with-gtk=3 --enable-cxx11 --with-cxx=11 --enable-stl )
# --enable-stl triggers compile-problem in codeblocks
# see: http://forums.codeblocks.org/index.php/topic,21763.msg148002.html#msg148002
install:
(cd $(BUILD) && $(MAKE) install)
ldconfig
checkinstall:
checkinstall $(MAKE) install
clean:
-rm -rf $(BUILD)
I regularly use this primitive Makefile. Its blunt, I know but works on arch, ubuntu, raspbian and occasionally on FreeBSD as you can see in the file. As for install, please be aware that its recommended to make a package for your distribution and install that instead of a plain old make install. That way you can safely deinstall it again. I do not know how to make a package for your os.
And most importantly - DO I have to start my existing projects all over from scratch?
It depends on the wxWidgets api stuff the projects use that has changed in syntax or semantics. Do your projects use the recommended wx-config instead of hard coded paths? Other than that I do not know. Do you have a spare computer or hard disk on which you can try this at arms length before you change it on your production system? Once you have scripted your installallation steps this becomes a lot easier to do and less scary.