help-make
[Top][All Lists]
Advanced

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

Re: unable to use $ORIGIN in rpath


From: m c
Subject: Re: unable to use $ORIGIN in rpath
Date: Wed, 15 Aug 2007 09:39:22 +0530

Thanks for reply.
 
tried using $$$ but that too didnt work.
 

TARGETNAME="libSampleSoD.so" MAKETARGET="g++   -o ././libSampleSoD.so -shared   -Wl,-Bsymbolic  -Wl,-rpath,'$RIGIN:$RIGIN/../lib:.:../lib'  ./obj/debug/sample.o    -ldl -lpthread -lgcc" \

g++   -o ././libSampleSoD.so -shared    -Wl,-Bsymbolic  -Wl,-rpath,':/../lib:.:../lib'  ./obj/debug/sample.o    -ldl -lpthread -lgcc

Mehul

On 8/15/07, Dave Korn <address@hidden> wrote:
On 14 August 2007 19:30, Dave Korn wrote:

> On 14 August 2007 18:59, m c wrote:
>
>> Hi,
>>
>> i am trying to set rpath to value '$ORIGIN:$ORIGIN/../lib:.:../lib' in a
>> makefile. but $ORIGIN is always getting replaced.
>>
>> g++  -D__unix -D_REENTRANT -D_PTHREADS -DSTRING_CONVERSION -D_GNU_SOURCE
>> -DSTL_STRING_LENGTH_ORIG -DSGI_STL -D__STL -DSYNC_IS_PUBLIC -DNATIVE_64BIT
>> -DNDEBUG -w -fPIC -pipe   -o obj/release/sample.o -c sample.cpp g++   -o
>> ././libSampleSo.so -shared     -Wl,-Bsymbolic
>> -Wl,-rpath,':/../lib:.:../lib'  ./obj/release/sample.o    -ldl -lpthread
>> -lgcc
>>
>> i tried all the tricks mentioned in
>> http://www.itee.uq.edu.au/~daniel/using_origin/ but nothing worked.
>>
>> i have attached a zip file which contains the source and the make files.
>>
>> please help.
>>
>> Thanks,
>> mrc
>
>
>
>   <Holds hands up against forehead with fingers outstretched in an
> i'm-a-stage-psychic kind of fashion, pulls face that indicates deep
> concentration>
>
>
>   You forgot to double up the dollar signs?
>
>
>   <goes off to actually take a look at your makefile and see if I guessed
> right>


Nope, I didn't guess right.

Hmm, your rpath stuff is defined in RPATHFLAG, which is immediately
evaluated because of the := operator, so that presumably strips off the first
$ sign straight away.  Then it gets assigned (deferred, this time) to
MAKETARGET, which gets passed down on the commandline to the submake, where it
gets used in the Make.mk rule, so it'll be expanded again there; since it's
already lost the first $ sign, it only has one, so its use in the
BUILDDIR/TARGETNAME rule will be expanded, and I think at that point it's
replaced with the contents of the make variable ORIGIN, which is empty, before
it even gets passed to the shell.

I think you need to add another $ sign.  Turn all the "$$ORIGIN" into
"$$$ORIGIN" and see if that helps.


   cheers,
     DaveK
--
Can't think of a witty .sigline today....



reply via email to

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