Inspired by ftm's script, I decided to put together a quick script that worked for other platforms too. It uh... got a little out of hand
Anyway, misc/setup-ext-libs.bash in the chdkptp source is the result.
It probably doesn't work completely on mac, but I think it should be pretty close. Feedback would be greatly appreciated.
It should work out of the box for many linux platforms (including raspberry pi) and windows with msys or msys2
It tries to do the following
* Download required source and/or binary packages
* extract sources and apply any required patches
* build
* extract or copy files required by chdkptp build a standardize directory tree
* copy runtime shared libraries to chdkptp/lib
The script has a bunch of options, which can be seen by passing -help
Most of the steps above can be skipped by passing a -no* option.
-pretend prints what it would do without doing anything
By default, files are only downloaded if they don't exist in the archive directory.
The script in a standardized directory tree, which defaults to extlibs/ under the chdkptp source directory. The default makefile settings are set to use this tree, so a customized config.mk should no longer be required in most cases.
The chdkptp makefiles now attempt to build GUI if you pass GUI=1 on the make command line. You should make clean between GUI and non-GUI builds.
The extlibs tree contains
/archive : downloaded zip + tgz files.
/src : extracted and patched sources
/built : built or extracted libraries, includes etc, and logs from builds.
On windows, only pre-compiled CD and IUP are supported.
On intel Linux, it defaults to pre-compiled but this can be overridden with -force-tec-src. Tecgraph appears to have stopped distributing 32 bit binaries for later versions of IUP, so build from source will become the default for those at some point. On Ubuntu, I found building from source avoided some GUI uglyness.
On other platforms, it attempts to build the minimum CD / IUP components. IM and some of the opengl dependencies are no longer required.
Prerequisites
* Normal development stuff, i.e. build-essential on Debian distros
* wget - You can download manually using URLs listed by pretend
* unzip (Info-ZIP compatible)
* For GUI, the CD/IUP prerequisites. On Debian based systems, something like:
g++ libfreetype6-dev libgtk-3-dev libx11-dev libxpm-dev libxmu-dev libxft-dev
On non windows platforms, chdkptp also requires libusb-dev and defaults to using libreadline-dev
* On Windows, MSYS or MYS2 is assumed
* On Mac, python is required