gcc and include dirs -> do we need a /etc/includes.conf?
Mike Stump
mstump@apple.com
Fri Feb 28 19:27:00 GMT 2003
On Thursday, February 27, 2003, at 11:19 PM, Gerold J. Wucherpfennig
wrote:
> I've installed many packages into /opt to
> get rid of "put everything into /usr/bin".
>
> Now my CFLAGS and CXXFLAGS lines are _really_ long,
> because I have to include the include dir of each /opt dir.
> ( -I/opt/package/include ...)
>
> Is there any chance to get a "includes.conf" file in /etc ?
> This should be a kind of ld.so.conf and list all include directories
> which gcc should include at compile time.
>
> Maybe a /etc/includes.conf can even let some distributors put some
> things
> out of /usr/bin... that would be _really_ good :-)
The way this is normally handled is to sym link all the
/opt/emacs-20.31/include/*
files into
/opt/include
This way, a single -I/opt/include will pick up all packages. Further,
you can
link all the
/opt/emacs-20.31/bin/*
files into
/opt/bin
and then just put /opt/bin into your PATH. Works pretty well. Some
software that
uses argv[0] to relocate the install dir, might need to be fixed to do
a readlink
and be more intelligent about it, but in the mean time, one can create
shell
scripts to exec real_path ${1+"$@"}.
Here is what you get when you do this:
cd lair bash[1] cd /usr/local/bin
lair bash[2] ls -lt
total 17563
lrwxrwxrwx 1 root root 23 Jan 9 15:44 bison ->
../bison-1.25/bin/bison
lrwxrwxrwx 1 root root 30 Jan 7 07:16 yydecode ->
../yydecode-0.2.9/bin/yydecode
lrwxrwxrwx 1 root root 23 Jan 5 15:52 yacc ->
../bison-1.875/bin/yacc
lrwxrwxrwx 1 root root 27 Dec 29 03:39 ffmpeg ->
../ffmpeg-281202/bin/ffmpeg
lrwxrwxrwx 1 root root 27 Dec 29 03:39 ffplay ->
../ffmpeg-281202/bin/ffplay
lrwxrwxrwx 1 root root 29 Dec 29 03:39 ffserver ->
../ffmpeg-281202/bin/ffserver
lair bash[4] cd ../include/
lair bash[5] ls -lt
total 39
lrwxrwxrwx 1 root root 31 Jan 14 2001 libdv ->
../libdv-20010114/include/libdv
lrwxrwxrwx 1 root root 41 Jan 14 2001 libraw1394 ->
../libraw1394-20010114/include/libraw1394
lrwxrwxrwx 1 root root 29 Jan 13 2001 zconf.h ->
../zlib-1.1.3/include/zconf.h
lrwxrwxrwx 1 root root 28 Jan 13 2001 zlib.h ->
../zlib-1.1.3/include/zlib.h
lrwxrwxrwx 1 root root 29 Jul 31 2000 gtk ->
../glibgtk+-1.2.8/include/gtk
Additioanlly, info/*, man/*/* lib/* should all also be linked. The the
MANPATH can
be short, the PATH can be short, the -I and -L lines can be short, you
can switch
packages on the fly anytime you want, and it just works, backwards or
forwards, you
can install as many packages as many times as you need, rm -rf will
deinstall nicely,
and best of all, if you need to, you can do things like
PATH=/opt/goodemacs-20.31/bin:$PATH to hand pick a non-default package,
or -I -L the
non-default package, if you need to.
Someday this will be obvious to all, until then, spread the word.
With this style of management, gcc doesn't really need a way to do this.
More information about the Gcc
mailing list