I am currently working on an Autotools-based build system running on RHEL7. The system version of Boost is quite old (1.53), however there is a newer one provided through EPEL (1.69). This newer version is needed for some of the libraries that were more recently added to Boost, such as Boost::Log.
Unfortunately, it does not work transparently with either of the standard Autotools Boost bootstrapping scripts, boost.m4 or ax_boost_*.m4, due to it installing in a slightly unusual location (/usr/include/boost169 and /usr/lib64/boost169). It can be made to work with ax_boost_*.m4 by setting --with-boost=[include dir]
and --with-boost-libdir=[lib dir]
; however, this is a build system for a large group and I'm not wanting everyone to have to manually set this every time, when it's always going to be the same across all of our builds.
So I am looking for two things. First, Is there a good way to optionally set the configure options inside configure.ac? It's pretty easy to check if the directories are there, and I could set --with-boost and --with-boost-libdir before calling AX_BOOST_BASE if the user hasn't already set them. This would let me make my own boost M4 file that checks if a newer version of Boost is installed to an EPEL location and if so, set those options and use it.
Second... is this even the right way to go about this, or is there a cleaner way to set up the entire process?
config.site
script. I have never used that, but your use case sounds very much like whatconfig.site
was invented for. – ndim