summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-03-03 01:38:13 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-03-03 01:38:13 +0000
commit3e1961839ee570fe3b1257ceaf88d630635c0349 (patch)
treec3e45b0546c8a8411e1e7f651a702a0370f344f9
parentfff3b2f318a1d05228d0128f59fe556652c70dda (diff)
downloadexternal_mesa3d-3e1961839ee570fe3b1257ceaf88d630635c0349.zip
external_mesa3d-3e1961839ee570fe3b1257ceaf88d630635c0349.tar.gz
external_mesa3d-3e1961839ee570fe3b1257ceaf88d630635c0349.tar.bz2
if building 32-bit objects in 64-bit environment, use -m32 flag
-rwxr-xr-xbin/mklib9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/mklib b/bin/mklib
index 6affa66..1e2a164 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -173,6 +173,15 @@ case $ARCH in
OPTS="${OPTS} -Xlinker --version-script=exptmp"
# exptmp is removed below
fi
+
+ # Check if objects are 32-bit and we're running in 64-bit
+ # environment. If so, pass -m32 flag to linker.
+ set ${OBJECTS}
+ ABI32=`file $1 | grep 32-bit`
+ if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
+ OPTS="-m32 ${OPTS}"
+ fi
+
if [ x${PATCH} = "x" ] ; then
VERSION="${MAJOR}.${MINOR}"
else