Boost logo

Boost Users :

From: Markus Werle (numerical.simulation_at_[hidden])
Date: 2007-09-10 03:24:59


John Maddock <john <at> johnmaddock.co.uk> writes:

>
> [...] Having tested it locally with several gcc
> versions on Linux everything seemed fine... except it's not: the problem is
> that gcc has a configuration option that lets you change the name of the
> directory the headers go in, and several Linux distro's change it from the
> default, so instead of being the normal default of something like "4.2.0"
> it's g++-v4 or something else that we can't automatically deduce

If you try this inside a MACRO I think you are lost.
I'd propose a feature request for gcc to provide a predefined macro
(http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html)

As a workaround I'd use the runtime information from gcc itself
to preconfigure the system:
gcc -v yields the information about how gcc was configured,
e.g.:

Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure
--verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,pascal,java,objc --enable-nls
--without-included-gettext --enable-version-specific-runtime-libs --without-x
--enable-libgcj --disable-java-awt --with-system-zlib --enable-interpreter
--disable-libgcj-debug --enable-threads=posix --enable-java-gc=boehm
--disable-win32-registry --enable-sjlj-exceptions --enable-hash-synchronization
--enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)

So I think that parsing this line for --prefix, --with-gxx-include-dir,
--version-specific-runtime-libs etc.
should give you any deviation from default paths.
Together with the information about default paths for every
release version of gcc you have all you need - but only outside a
compilation run.

> Obviously I could add a user-config macro for this purpose, but it's all a
> real pain basically

Yeah. Not much help from here ...

Markus


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net