[Top][All Lists]

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

building without $(top_builddir) in LDADD (was Re: libtool libraries, d

From: Václav Zeman
Subject: building without $(top_builddir) in LDADD (was Re: libtool libraries, dependencies and parallel builds)
Date: Sat, 03 Nov 2012 00:16:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

On 11/02/2012 09:43 AM, Stefano Lattarini wrote:
> On 11/02/2012 09:18 AM, Václav Zeman wrote:
>> On 1 November 2012 17:42, Diego Elio Pettenò wrote:
>>> On 01/11/2012 09:18, Vincent Torri wrote:
>>>> lib_eo_libeo_la_LIBADD = $(top_builddir)/src/lib/eina/
>>> Don't use $(top_builddir) and it should work just fine.
>> Is there a rationale behind this? I am not saying it is wrong, I just
>> want to better understand how things work.
> My guess is that, albeit having a rule to build 'lib/eina/'
> -- rule generated by Automake from the
>   lib_LTLIBRARIES = lib/eina/ lib/eo/
> assignment -- make is not "smart enough" to recognize that, in
> this Makefile (where '$(top_builddir)' expands to '..'),
> '$(top_builddir)/src/lib/eina/' points in fact to
> 'lib/eina/'.
> So, when asked to build '$(top_builddir)/src/lib/eina/'
> as a dependency for 'lib/eo/' -- dependency derived from
> the
>   lib_eo_libeo_la_LIBADD = $(top_builddir)/src/lib/eina/
> assignment --  make doesn't know how to proceed, and bails out.
> So better to just remove the useless extra '$(top_builddir)/src'
> indirection.  Not only this fixes the error, but is also clearer
> to human readers IMNSHO.

I have tried to change my for a test executable by removing
the $(top_builddir). But I am getting errors in libtool invocation:

amber2::wilx:~/log4cplus-bzr/work-trunk/objdir/tests/appender_test> make
/bin/bash ../../libtool --tag=CXX   --mode=link g++  -save-temps
-fverbose-asm -march=native -g3 -ggdb -Wall -Wextra -pedantic
-Wstrict-aliasing -Wstrict-overflow -Woverloaded-virtual
-Wold-style-cast -Wc++0x-compat -Wc++11-compat -Wundef -Wshadow -Wformat
-Wsuggest-attribute=noreturn -Wno-variadic-macros
-fkeep-inline-functions -fstack-check -fstack-protector -ftrapv
-fvisibility=hidden -pthread   -o appender_test main.o
src/  -lrt
libtool: link: cannot find the library `src/' or
unhandled argument `src/'
make: *** [appender_test] Error 1

The resulting looks (almost, becuse I use include to factor
out common stuff for multiple tests) like this:

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include




noinst_PROGRAMS = appender_test

appender_test_SOURCES = main.cxx

appender_test_LDADD = src/

The VPATH bit is there because I have tried to fix the error using it.

How can I make this work as you have suggested without $(top_builddir)?


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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