BenV's notes

configure/autoconf and paths

by on Aug.21, 2009, under Software

Of course you’re already thrilled by my slackbuild.pl script, but this one thing keeps popping up.
How do I get configure to get my system paths right without giving it a line that’s 2389472389 arguments long?
Simple, install a site config.
A what?!

It’s a tiny little shell script that takes the configure options and barfs out some prefixes and stuff based on the options presented to it.
So when I tell it prefix=/usr, it will decide that sysconfdir=/etc instead of sysconfdir=/usr/etc.

You can get my my version here:
[Download not found]

Now the important tidbit. In order for configure to automagically use this script, you wil need to set the environment variable CONFIG_SITE.
Personally I do this through a profile file. Download the config.site script, put it in /etc and put the profile file in /etc/profile.d. Logout/login, done.
Oh, here’s the profile file:
[Download not found]

Now if everything worked out allright, running configure should start with something like this:

benv@janeman:/usr/src/coolprogram-1.0$ ./configure
configure: loading site script /etc/config.site
prefix=/usr
sysconfdir=/etc
bindir=/usr/bin
sbindir=/usr/sbin
includedir=/usr/include
libdir=/usr/lib64
libexecdir=/usr/libexec
datadir=/usr/share
mandir=/usr/share/man
infodir=/usr/share/info
localstatedir=/var
sharedstatedir=/var/cache
lispdir=/usr/share/emacs/site-lisp

Wonderful isn’t it? 🙂




:, , ,

Leave a Reply

You must be logged in to post a comment.