[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: $(EXEEXT) in TESTS required?

From: Ralf Corsepius
Subject: Re: $(EXEEXT) in TESTS required?
Date: Tue, 24 Jan 2006 16:29:58 +0100

On Tue, 2006-01-24 at 13:15 +0100, Simon Josefsson wrote:
> Ralf Corsepius <address@hidden> writes:
> > On Mon, 2006-01-23 at 21:51 +0100, Bruno Haible wrote:
> >> [For the automake people: The problem is that a Makefile.am snippet like
> >> 
> >>      TESTS = test-lock
> >>      check_PROGRAMS = test-lock
> >>      test_LOCK_LDFLAGS = -lmyspeciallib
> >> 
> >> when cross-compiling to mingw on a Unix system with 'wine', will cause
> >> "make check" to build 'test-lock', rather than 'test-lock.exe', 
> > This would qualify as a bug, either in your compiler's set up or in the
> > package's configuration.
> >
> > I don't have a mingw cross toolchain, but other cross compilers (eg.
> > linux->cygwin) handle this situation correctly.
> Could you expand on this?

I'll try, cf. below.

> What happens is that automake produce rules to turn test-lock.c into
> test-lock.exe, but 'make check' will try to build 'test-lock', and
> there are no rules for that, so it fails.  Where is the bug in the
> compile chain?
Due to lack of a mingw toolchain, I can't tell you exactly what goes
wrong for you.

3 likely candidates:
* The cross gcc doesn't produce *.exe's (This would be a gcc bug).
* You are not correctly invoking configure.
* Makefile bug somewhere.

Given this Makefile.am:
check_PROGRAMS = mytest
mytest_SOURCES = mytest.c

And this configure.ac:
AC_INIT(cross01,0.20060124, address@hidden)
AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2])

Results into this:

$ ./configure --host=i686-pc-cygwin
configure: WARNING: If you wanted to set the --build type, don't use
    If a cross compiler is detected then cross compile mode will be
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for i686-pc-cygwin-strip... i686-pc-cygwin-strip
checking for i686-pc-cygwin-gcc... i686-pc-cygwin-gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i686-pc-cygwin-gcc accepts -g... yes
checking for i686-pc-cygwin-gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of i686-pc-cygwin-gcc... gcc3
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands

$ make

$ make check
make  mytest.exe
make[1]: Entering directory `/users/corsepiu/src/work/autotools/cross01'
if i686-pc-cygwin-gcc -DPACKAGE_NAME=\"cross01\" -DPACKAGE_TARNAME=
\"cross01\" -DPACKAGE_VERSION=\"0.20060124\" -DPACKAGE_STRING=\"cross01\
0.20060124\" -DPACKAGE_BUGREPORT=\"address@hidden" -DPACKAGE=
\"cross01\" -DVERSION=\"0.20060124\"  -I. -I.     -g -O2 -MT mytest.o
-MD -MP -MF ".deps/mytest.Tpo" -c -o mytest.o mytest.c; \
then mv -f ".deps/mytest.Tpo" ".deps/mytest.Po"; else rm -f
".deps/mytest.Tpo"; exit 1; fi
i686-pc-cygwin-gcc  -g -O2   -o mytest.exe  mytest.o

=> it just works.

I'd guess you might be mixing up on --build, --host, --target.
You want to configure with --host=i686-mingw or whatever the
canonicalization tripple for mingw is.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]