automake
[Top][All Lists]
Advanced

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

Re: problem --enable-shared and --enable-static together


From: Andreas Otto
Subject: Re: problem --enable-shared and --enable-static together
Date: Sun, 6 Dec 2009 10:17:21 +0100
User-agent: KMail/1.10.3 (Linux/2.6.27.39-0.2-default; KDE/4.1.3; x86_64; ; )

Am Samstag 05 Dezember 2009 13:33:06 schrieb Ralf Wildenhues:
> Hello Andreas,
>
> besides answers already given:
>
> * Andreas Otto wrote on Fri, Dec 04, 2009 at 09:41:16AM CET:
> > as you see both *lo and *.o are created. the *.o are useless and just
> > extend the compiling time
> >
> > Q: what can I do to avoid build static libraries ...
>
> foo_LIBTOOLFLAGS = -tag=disable-static

Q: what is foo?

I try "tclmsgque_LIBTOOLFLAGS" -> no change
I look into the "Makefile" and get

...
tclmsgque_la-context_tcl.lo: context_tcl.c
        $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile 
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $
(CPPFLAGS) $(tclmsgque_la_CFLAGS) $(CFLAGS) -MT tclmsgque_la-context_tcl.lo -
MD -MP -MF $(DEPDIR)/tclmsgque_la-context_tcl.Tpo -c -o tclmsgq
ue_la-context_tcl.lo `test -f 'context_tcl.c' || echo 
'$(srcdir)/'`context_tcl.c
...
as you see only $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) are used ????
->I'm confused
the info page speek about
...
   If `LIBRARY_LIBTOOLFLAGS' is not defined, the global
`AM_LIBTOOLFLAGS' variable is used instead.
...

about LIBRARY_LIBTOOLFLAGS well even the "LIBRARY" prefix does not work
->I'm more confused

than I try AM_LIBTOOLFLAGS

and get the following error...

/bin/sh ../../libtool --tag=CC -tag=disable-static  --mode=compile ccache gcc 
-std=gnu99 -DHAVE_CONFIG_H -I. -I../..   -D_DEBUG  -I./../libmsgque -
I/home/dev1usr/ext/x86_64-suse-linux/thread/include -DUSE_TCL_STUBS  -
DMQ_IGNORE_EXTERN -g -O3 -Wall -Wcast-align -Wstrict-prototypes -
fvisibility=hidden -g -O2 -pthread -MT tclmsgque_la-context_tcl.lo -MD -MP -MF 
.deps/tclmsgque_la-context_tcl.Tpo -c -o tclmsgque_la-context_tcl.lo `test -f 
'context_tcl.c' || echo './'`context_tcl.c
libtool: unrecognized option `-tag=disable-static'
libtool: Try `libtool --help' for more information.
make: *** [tclmsgque_la-context_tcl.lo] Fehler 1

after a look inti the info page I change "-tag" to "--tag" ..

next try

now it works ...........

summary:

change:

        foo_LIBTOOLFLAGS = -tag=disable-static

into

        AM_LIBTOOLFLAGS = --tag=disable-static

than it is fine



>
> for a target 'foo'.
>
> > I use "../libmsgque/*.lo" for in-project libraray dependency to avoid to
> > link to my own shared libraray
>
> Sounds like you could profit from using convenience archives.
>
> > 2. executables should build without library dependency. This mean that
> > if configured with "--enable-static" the static object files should be
> > used and if configureed without the shared object files should be used.
>
> Link the program against the library with -static.
>
> Hope that helps.
>
> Cheers,
> Ralf



reply via email to

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