I have run into something that seems really strange to me.
Autoconf will subst @prefix@ and @exec_prefix@ into a
Makefile, but while ./configure is actually running they
are not set. Here is a minimal example.
% cat configure.in
AC_INIT(foo.c)
AC_PROG_CC
echo "prefix is \"$prefix\""
echo "exec_prefix is \"$exec_prefix\""
AC_OUTPUT([Makefile])
% cat Makefile.in
prefix = @prefix@
exec_prefix = @exec_prefix@
Running this produces the following results:
% ./configure
checking for gcc... gcc
...
prefix is "NONE"
exec_prefix is "NONE"
creating ./config.status
creating Makefile
% cat Makefile
prefix = /usr/local
exec_prefix = ${prefix}
Does anyone else find that rather odd? I would like to
be able to set vars that I am going to subst based on
${prefix} and ${exec_prefix}, but it seems that nasty
hacks like the following are required in my configure.in.
if test "${prefix}" = "NONE"; then
prefix=/usr/local
fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
thanks
Mo DeJong
Red Hat Inc