automake
[Top][All Lists]
Advanced

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

Re: build and installation names


From: Ralf Wildenhues
Subject: Re: build and installation names
Date: Tue, 27 Jul 2010 22:07:49 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

Hello Wesley,

* Wesley Smith wrote on Sun, Jul 25, 2010 at 08:35:34PM CEST:
> I'm trying to setup a Makefile.am such that the lib and modules I
> build get installed in the following way:
> 
> /usr/local/lib/liblua5.1-mymodule.so.0.0.0
> /usr/local/lib/liblua5.1-mymodule.so.0
> /usr/local/lib/lua/5.1/mymodule.so
> 
> As a start, I tried to see if I could just build
> liblua5.1-mymodule.so.0.0.0.  Here's the Makefile.am:
> 
> AM_CPPFLAGS = -I/usr/include/lua5.1 -I/usr/include/cairo
> -I/usr/include/directfb -I/usr/include/freetype2

This hard-codes quite a bit of system-specific information.  What if
your user does not have root rights, the sysadmin didn't install lua,
cairo, directfb etc. and is kind of hard to deal with ;-) so the user
just goes ahead and installs all of that below $HOME/local.  Then you'd
want those paths to point to $HOME/local/include/lua5.1 etc, no?

I'd suggest you look at the packages in question and add macros to
configure to set these flags.  Most likely they will have pkg-config
files or even /usr/share/aclocal/*.m4 files that let you know how the
package was installed.  Likewise ...

> lib_LTLIBRARIES = liblua5.1-cairo.la
> liblua5_1_cairo_la_LIBADD = -llua5.1 -L/usr/lib -lcairo -L/usr/lib
> -ldirectfb -L/usr/lib -lfreetype -L/usr/lib
> liblua5_1_cairo_la_SOURCES = src/lcairo.c

for the link flags.

If OTOH cairo is built as part (or aggregate) of your package, and you
would like to link against the uninstalled libcairo, then you should
just list
  ../cairo/libcairo.la

as dependency, so that automake can also infer that there should be a
dependency on that file.

In any case you should never add something like -L/usr/lib to your list
of library search paths here.  /usr/lib is searched by default usually,
and if it isn't, then that's typically because /usr/lib32 or /usr/lib64
is the right place to search.

> But I end up with this error:
> 
> 
> /bin/bash ../../libtool --tag=CC   --mode=link gcc  -g -O2   -o
> liblua5.1-cairo.la -rpath /usr/local/lib lcairo.lo -llua5.1 -L/usr/lib
> -lcairo -L/usr/lib -ldirectfb -L/usr/lib -lfreetype -L/usr/lib
> -lgstapp-0.10 -lgstreamer-0.10 -lcairo -lapr-1 -llua5.1
> libtool: link: gcc -shared  .libs/lcairo.o   -Wl,-rpath
> -Wl,/home/wesleysmith/Documents/luaav3/modules/cairo/.libs -Wl,-rpath
> -Wl,/usr/local/lib/lua/5.1 -L/usr/lib -ldirectfb
> /usr/lib/libfreetype.so -lgstapp-0.10 /usr/lib/libgstreamer-0.10.so
> /home/wesleysmith/Documents/luaav3/modules/cairo/.libs/libcairo.so
> /usr/lib/libapr-1.so /usr/lib/liblua5.1.so    -pthread -Wl,-soname
> -Wl,liblua5.1-cairo.so.0 -o .libs/liblua5.1-cairo.so.0.0.0
> gcc: /home/wesleysmith/Documents/luaav3/modules/cairo/.libs/libcairo.so:
> No such file or directory
> make[1]: *** [liblua5.1-cairo.la] Error 1

If my above advice does not help you further, then please rerun this
link command manually, with --debug added as first argument after
../../libtool, catch the output with >log 2>&1, gzip log, and send it.
Then we can find out for sure what happened.  Thanks.

> I have a feeling it's because the name of the lib liblua5.1-cairo.la
> and how I refer to its target liblua5_1_cairo are messing things up.

No, that shouldn't have much to do with it.

> How do the characters '.' and '-' get translated into target names?
> When I put them in there, I get errors on autoreconf.

I'm not quite sure what you mean with this.  Can you give an example?
Or do you mean the translation from
  lib_LTLIBRARIES = libxy-.z.la
to
  libxy__z_la_SOURCES = ...

?  That is documented in 'info Automake Canonicalization'.

Cheers,
Ralf



reply via email to

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