| Billy Patton 2005-04-21, 5:59 pm |
| 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 bit.
Just like the Linux boxes I have to set LD_LIBRARY_PATH to be for the correct
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 \
echo ${GCCDIR}/lib64 ; \
else \
echo ${GCCDIR}/lib ; \
fi; \
elif [ `/bin/uname -s` = 'SunOS' ] ; then \
if [ `/bin/isainfo -b` = 64 ] ; then \
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)
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
|