summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-08-08 23:22:46 +0000
committerIan Romanick <[email protected]>2005-08-08 23:22:46 +0000
commitaba4864a25fbf056b4c34dd20cc000b7e3221ad3 (patch)
treeb4c0639eb658f6b199fa9037eedb79097de5e5c6 /bin
parent7bf08c23fdfe3e8a1dbfc44cad9e7e427f6e2630 (diff)
Make the linux-dri-x86 builds work on x86-64 again. mklib now
determines the bits (either 32 or 64) for libraries without the lib prefix. progs/egl/Makefile passes CFLAGS on the link commands so that things like '-m32' get propagated.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mklib9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/mklib b/bin/mklib
index 3b55d732ed8..b825f62df34 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -192,6 +192,15 @@ case $ARCH in
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
#OPTS="-shared -Wl,-soname,${LIBNAME}" # soname???
OPTS="-shared"
+
+ # 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
+
rm -f ${LIBNAME}
# make lib
${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}