Mail Archives: djgpp-workers/2001/04/10/12:53:48
> > Note that the ac_executable_extensions is a hack to avoid depending on
> > smart 'test -f' handling (EMX's bash doesn't have it).
>
> Could you please tell more about this? I don't think I understood
> what's that list for, exactly.
Before, the typical way of locating executables in autoconf was (in
pseudo-script):
: looking for foo
for dir in $PATH; do
if test -f $dir/foo; then
echo yay! foo is in $dir/foo
break
fi
done
I sent in a patch which ac_executable_exts variable that holds the
executable extensions for the host system. A search then does:
: looking for foo
for dir in $PATH; do
if test -f $dir/foo; then
echo yay! foo is in $dir/foo
break
elif test -n "$ac_executable_exts"; then
for ext in $ac_executable_exts; do
if test -f $dir/foo$ext; then
echo yay! foo is in $dir/foo
break
fi
done
fi
done
This is definitely not optimal, but it worked just fine, even with
a bash that doesn't handle test -f specially.
This patch won't be in 2.50, though it will likely be in my DJGPP
package for 2.50.
autoconf 2.51 will have
a) a way to build such a list itself, instead of relying on
config.site to set it, and
b) a cleaner way of dealing with it (avoiding the duplicated
'if found' code).
One suggestion was to have a variable 'ac_executable_forms' instead,
which would default to '${base}'.
: looking for foo
for dir in $PATH; do
forms=`base=foo eval echo $ac_executable_forms`
for form in $forms; do
if test -f $dir/$form; then
echo yay! foo is in $dir/$form
break
fi
done
done
That way, 'foo' would be found on Unixy systems; with the var set to
'i386-pc-msdosdjgpp-${base} ${base}' cross-compiling is made easy; and
with '${base} ${base}.exe ${base}.com ${base}.sh ${base}.pl ${base}.bat'
we get proper operation on DOS.
Hope this explains everything Eli :-)
- Raw text -