bug-libtool
[Top][All Lists]
Advanced

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

Re: LIBTOOL_DEPS wrong when AC_CANONICAL_BUILD not called before initial


From: Jakub Bogusz
Subject: Re: LIBTOOL_DEPS wrong when AC_CANONICAL_BUILD not called before initializing libtool
Date: Sat, 22 Mar 2008 13:31:19 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

On Sat, Mar 15, 2008 at 11:01:32PM +0100, Ralf Wildenhues wrote:
> Hello Jakub,
> 
> * Jakub Bogusz wrote on Sat, Mar 15, 2008 at 02:56:28PM CET:
> > Aaah, I put this shell conditional just to easily demonstrate the
> > difference and hit another (already known) issue instead of the one
> > I originally reported.
> > 
> > So here is simpler example:
> [...]
> 
> Thank you!  I've applied this patch to fix this issue, and put you in
> THANKS.
> 
> It would still be nice if we had a testcase for this in the testsuite.
> For that, grepping the value of $OBJDUMP isn't going to work seamlessly.
> Can you perchance also provide a small example that creates a library or
> program, and an import library, which exposes this issue?  It doesn't
> matter whether you use Automake for this, or just plain
>   ./libtool --mode=compile/--mode=link
> 
> calls just like in the new testsuite; however, the test should use
> libtool to create the import lib.

I finally used library which is a part of cross mingw32 SDK (which is
already needed to test this issue).

#v+
[configure.ac]
AC_INIT([libtool-test], [0])

AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

echo "NM: $NM"
echo "OBJDUMP: $OBJDUMP"
echo "LIBTOOL_DEPS: $LIBTOOL_DEPS"

[Makefile.in]
LIBTOOL=./libtool
address@hidden@
address@hidden@
address@hidden@

all: libtestlib.la

libtestlib.la: testlib.lo
        $(LIBTOOL) --mode=link $(CC) -shared -no-undefined -o $@ $< -rpath 
$(libdir) -lws2_32
        test -f .libs/libtestlib.dll.a && echo OK || { echo "ERROR: shared lib 
not built" ; exit 1;
}

%.lo: %.c
        $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<

[testlib.c]
int __declspec(dllexport) testfunc(void)
{
        return 1;
}
#v-


========

And for the second issue I reported in this thread (@LIBTOOL_DEPS@
substitution):

#v+
[configure.ac]
AC_INIT([libtool-test], [0])
LT_INIT
AC_SUBST([LIBTOOL_DEPS])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

[Makefile.in]
all: @LIBTOOL_DEPS@
#v-

When AC_CANONICAL_BUILD is not called before LT_INIT (or
AC_PROG_LIBTOOL, doesn't matter), @LIBTOOL_DEPS@ contains "/ltmain.sh"
(instead of "./ltmain.sh"), so "make" will fail (unless "/ltmain.sh"
really exists... but I suppose it won't happen anywhere).


-- 
Jakub Bogusz    http://qboosh.pl/




reply via email to

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