automake
[Top][All Lists]
Advanced

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

Re: testing with .so and other questions


From: Alexandre Duret-Lutz
Subject: Re: testing with .so and other questions
Date: Mon, 05 Aug 2002 10:20:18 +0200
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386-debian-linux-gnu)

>>> "Waldemar" == Waldemar Rosenbach <address@hidden> writes:

[...]

 Waldemar> test_LDADD = $(top_builddir)/.libs/libFiniteStateMachine.so
 Waldemar> libTestAction_la_LIBADD = 
$(top_builddir)/.libs/libFiniteStateMachine.so

Prefer

test_LDADD = ../libFiniteStateMachine.la
libTestAction_la_LIBADD = ../libFiniteStateMachine.la


.libs/ are Libtool's private data you should not have to use
(besides `.libs' is not always called `.libs' and `.so' is not
always `.so'.)

 Waldemar> ./test.fsm: $(top_srcdir)/test.fsm
 Waldemar> -rm -f ./test.fsm
 Waldemar> $(LN_S) $(top_srcdir)/test.fsm ./test.fsm
 Waldemar> test1.sh: test ./test.fsm libTestAction.la
 Waldemar> @echo creating test1.sh...
 Waldemar> @-rm -f test1.sh
 Waldemar> @echo "#!/bin/sh" > test1.sh
 Waldemar> @echo "export
 Waldemar> LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(top_builddir)/.libs:.libs" >>
 Waldemar> test1.sh
 Waldemar> @echo "./test" >> test1.sh
 Waldemar> @chmod +x test1.sh

Building this kind of wrapper is actually the job
of Libtool; you should be able to run `./test' directly if you
pass the `.la' file on the test_LDADD line.

(BTW, this syntax for export and the use of LD_LIBRARY_PATH are
not portable.)

 Waldemar> Now the questions:
 Waldemar> 1. if I use lib_LTLIBRARIES, then libTestAction.so is created, but
 Waldemar> also installed if I call make install, if I use check_LTLIBRARIES or
 Waldemar> noinst_LTLIBRARIES, then libTestAction.so is not created, but only
 Waldemar> libTestAction.la
 Waldemar> How to create libTestAction.so without installing it? 

When you use `lib_', Automake knows where the library will be
installed, so it can pass a `-rpath $(libdir)' flag to Libtool.
For `check_', `noinst_', or `EXTRA_' library Automake can't
guess what `-rpath' flag you want (plus it doesn't always make
sense).

The libtool manual states that shared libraries are built only
when `-rpath' is given.  So you'll have to setup that yourself.
Probably with something along the lines of

libTestAction_la_LDFLAGS = -rpath /dummy/path/so/libtool/builds/a/shared/lib

 Waldemar> And also to clean at 'make clean'?

Should be automatic.

 Waldemar> 2. ./test.fsm  should be just a copy (or link) of this file from the
 Waldemar> source directory in the actual directory and is read by the test
 Waldemar> programm. But it is not created. If I call 'make ./test.fsm' then I
 Waldemar> get: make: »../../test/test.fsm« is already actual.

Why do you need this link?  How about reading $srcdir/test.fsm directly?

 Waldemar> 3. test1.sh is a script, that is generated by the
 Waldemar> Makefile. But it is not deleted if I call 'make
 Waldemar> clean'. How to tell the automake to delete it at
 Waldemar> clean?

CLEANFILES = test1.sh
-- 
Alexandre Duret-Lutz




reply via email to

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