Hello libtoolers.
I am trying to build the SDL with a mingw cross compiler
(for native windows binaries under Linux). I am using
autoconf from the CVS and libtool release-1-3-5
from the CVS.
When I run configure, it correctly detects the cross compile
case, but it fails when invoking ltconfig.
% ~/project/SDL/configure --host=i386-mingw32msvc
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-mingw32msvc
...
checking for i386-mingw32msvc-gcc... i386-mingw32msvc-gcc
checking whether the C compiler works... yes
checking whether we are using GNU C... yes
checking whether i386-mingw32msvc-gcc accepts -g... yes
...
+ /bin/sh /home/mo/project/SDL/ltconfig --no-reexec
--cache-file=/dev/null --with-gcc --with-gnu-ld --enable-win32-dll
--no-verify --build=i686-pc-linux-gnu /home/mo/project/SDL/ltmain.sh
loading cache /dev/null within ltconfig
ltconfig: you must specify a host type if you use `--no-verify'
Try `ltconfig --help' for more information.
+ echo configure: error: libtool configure failed
configure: error: libtool configure failed
+ exit 1
I then found this block of code in the generated ltconfig script.
build=`$SHELL $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6
elif test -z "$host"; then
echo "$progname: you must specify a host type if you use
\`--no-verify'" 1>&2
echo "$help" 1>&2
exit 1
else
host_alias=$host
build_alias=$host_alias
build=$host
fi
That seems backwards, host should default to build. I thought
it would work if I passed --host to indicate the system
that is going to be cross compiled for. I then tried
hacking the configure script to see if I could get it working.
Note that --host=i386-mingw32msvc should get passed to ltconfig.
--- copy_configure Wed May 31 00:43:47 2000
+++ configure Wed May 31 00:43:39 2000
@@ -2343,7 +2343,7 @@
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh
$target \
+$libtool_flags --no-verify --build="$build" --host="$host"
$ac_aux_dir/ltmain.s
h $target \
|| { echo "configure: error: libtool configure failed" >&2; exit 1; }
# Reload cache, that may have been modified by ltconfig
When I tried to run this, I got the following error:
+ OBJDUMP=
+ /bin/sh /home/mo/project/SDL/ltconfig --no-reexec
--cache-file=/dev/null --with-gcc --with-gnu-ld --enable-win32-dll
--no-verify --build=i686-pc-linux-gnu --host=i386-pc-mingw32msvc
/home/mo/project/SDL/ltmain.sh
ltconfig: unrecognized option `--host=i386-pc-mingw32msvc'
Try `ltconfig --help' for more information.
+ echo configure: error: libtool configure failed
configure: error: libtool configure failed
+ exit 1
So it seems like ltconfig just does not understand the --host argument.
I then read this web page, which seems to indicate that libtool is
incorrectly using the --build argument and not the --host argument
to indicate a cross compile.
http://www.gnu.org/software/libtool/manual.html#Invoking%20ltconfig
The CVS version of autoconf was recently changed to fix some old
bugs related to cross compiling with the --host argument. It would
seem that libtool needs to be updated to account for these changes
in autoconf. I think libtool needs to be able to understand both
--build and --host (where host defaults to build if not given).
Has this problem already been fixed on the HEAD branch? I would
rather use a released version but I will switch to the HEAD
if the problem is already fixed there.
thanks much
Mo DeJong
Red Hat Inc