[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: shared libraries and automake
From: |
Eric Ray |
Subject: |
RE: shared libraries and automake |
Date: |
Mon, 1 Apr 2002 08:16:34 -0600 |
Okay, let me rephrase the question.
How can I generate a shared library without using libtool and then link
to it.
when defining the library like so
lib_LIBRARIES=libSomeLib.so
i get the following error when running automake
automake: Makefile.am: `libSomeLib.so' is not a standard library name
and then automake exits without generating Makefile.in
So, what I want to do is generate a .so library, not a .la and I then
want to link that .so to create an executable.
here's the entire Makefile.am
lib_LIBRARIES=libSomeLib.so
if DEBUG
COMP_OPTS = -g
else
COMP_OPTS = -03
endif
STD_COMP_OPT = -ansi -std=c99
CXXFLAGS = $(COMP_OPTS) $(STD_COMP_OPTS)
libSomeLib_so_SOURCES = LibFile1.cpp LibFile2.cpp
LDADD=libSomeLib.so
bin_PROGRAMS = main
main_SOURCES = main.cpp
main_LDADD = libSomeLib.so
main_DEPENDENCIES = libSomeLib.so
Thanks.
Eric
> -----Original Message-----
> From: Alexandre Duret-Lutz [mailto:address@hidden
> Sent: Monday, April 01, 2002 8:05 AM
> To: Eric Ray
> Cc: address@hidden
> Subject: Re: shared libraries and automake
>
>
> >>> "Eric" == Eric Ray <address@hidden> writes:
>
> Eric> is it possible to link to a non-libtool generated
> shared object in the
> Eric> Makefile.am?
>
> Eric> for example, instead of
>
> Eric> lib_LTLIBRARIES=libSomeLibrary.la
>
> Eric> is there another command to use a regular .so file?
>
> Eric> lib_LIBRARIES only appears to work with static
> libraries. I can find no
> Eric> documentation in the Automake manual that describes how to use
> Eric> non-libtool libraries.
>
> _LTLIBRARIES and _LIBRARIES are used to *produce* libraries.
>
> If all you want is to link with a .so file which already exists
> (or for which you have supplied your own building rules), you
> can use _LDADD:
>
> bin_PROGRAMS = foo
> foo_SOURCES = foo.c foo.h
> foo_LDADD = pathto/libyours.so
>
> Alternatively, you can play with the -L and -l linker flags
>
> bin_PROGRAMS = foo
> foo_SOURCES = foo.c foo.h
> foo_LDADD = -Lpathto -lyours
>
> but this second form won't handle dependencies (in case
> pathto/libyours.so is built in the same project) automatically.
>
> (All of this remains true for any kind of libraries, e.g. static
> libraries or libtool libraries.)
>
> HTH,
> --
> Alexandre Duret-Lutz
>
>