Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: makefile define delimma GOT IT
On Thu, 21 Apr 2005, Billy Patton wrote:

> I have a makefile.common that I share between several directories
> It has some define statements that determine several items
> 2 specifically are where the problem occurs.
>
> First on our network we have 32 and 64 bit linux boxes.
> Our solaris boxes are only 64.  But the default system library is for 32 b
it.
> Just like the Linux boxes I have to set LD_LIBRARY_PATH to be for the corr
ect
> lib
> On linux it's either lib or lib64
> On solris it's either lib or lib/sparc9v
>
> Here are my define statements:
> define  Bit_size
>   if   [ `/bin/uname -s`   = 'Linux'  ] ; then \
>     if  [ `/bin/uname -m`  = 'x86_64' ] ; then echo 64 ; \
>     else echo 32; \
>     fi; \
>   elif   [ `/bin/uname -s` = 'SunOS'    ] ; then \
>      if [ `/bin/isainfo -b` = 64 ] ; then echo 64; \
>      else echo 32; \
>      fi; \
>   fi
> endef
>
> define ld_path
>   if [ `/bin/uname -s` = 'Linux' ] ; then \
>     if [ `/bin/uname -m`  = 'x86_64' ] ; then \
Changed the above line to
if [ $(BIT) = ...
>       echo ${GCCDIR}/lib64 ; \
>     else \
>       echo ${GCCDIR}/lib ; \
>     fi; \
>   elif [ `/bin/uname -s` = 'SunOS' ] ; then \
>     if [ `/bin/isainfo -b` = 64 ] ; then \
Changed the above line to
if [ $(BIT) = ...

The make documentations that if a varaible is set with := it is done the fir
st
time then naught else.  If it is set with = then is is set then needed.
So thing don't have to be in order.

>       echo ${GCCDIR}/lib/sparcv9; \
>     else \
>       echo ${GCCDIR}/lib; \
>     fi; \
>   fi
> endef
>
> LD_LIBRARY_PATH :=  $(shell $(ld_path))

> LD_RUN_PATH     :=  $(shell $(ld_path))

> BIT             :=  $(shell $(Bit_size))

> OS              :=  $(shell $(Cpu_type))/$(BIT)
BIT             =  $(shell $(Bit_size))
LD_LIBRARY_PATH =  $(shell $(ld_path))
LD_RUN_PATH     =  $(shell $(ld_path))
>
>
> The problem comes with the solaris boxes
> I can compile my lib and the test code without a problem.
> I seperate as
> Linux/32/
> Linux/64/
> SunOS/32/
> SunOS/64/
>
> When I do my :
> make BIT=32 test
> on a solaris box everything gets compiled.D
> But the LD_LIBRARY_PATH has been set to a 64 bit system.
> What I need is for the define ld_path to use the BIT variable.
> Either having been set or passed in from the command line.
>
> Now the question is. when does the define get called/compiled?
> Can I put ${BIT} in the ld_path define?
>
> How to set LD_LIBRARY_PATH for 32 bit on 64 bit system.
>
>   ___  _ ____       ___       __  __
>  / _ )(_) / /_ __  / _ \___ _/ /_/ /____  ___
> / _  / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
> /____/_/_/_/\_, / /_/   \_,_/\__/\__/\___/_//_/
>           /___/ Texas Instruments ASIC Circuit Design Methodology Group
> Dallas, Texas, 214-480-4455,  b-patton@ti.com
>

___  _ ____       ___       __  __
/ _ )(_) / /_ __  / _ \___ _/ /_/ /____  ___
/ _  / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/   \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455,  b-patton@ti.com

Report this thread to moderator Post Follow-up to this message
Old Post
Billy Patton
04-22-05 01:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:25 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.