OSDN Git Service

Make the linux-dri-x86 builds work on x86-64 again. mklib now
authorIan Romanick <idr@us.ibm.com>
Mon, 8 Aug 2005 23:22:46 +0000 (23:22 +0000)
committerIan Romanick <idr@us.ibm.com>
Mon, 8 Aug 2005 23:22:46 +0000 (23:22 +0000)
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.

bin/mklib
progs/egl/Makefile

index 3b55d73..b825f62 100755 (executable)
--- 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}
index be97ac6..39741db 100644 (file)
@@ -25,35 +25,35 @@ default: $(PROGRAMS)
 
 
 demo1: demo1.o $(LIB_DIR)/libEGL.so
-       $(CC) demo1.o -L$(LIB_DIR) -lEGL -o $@
+       $(CC) $(CFLAGS) demo1.o -L$(LIB_DIR) -lEGL -o $@
 
 demo1.o: demo1.c $(HEADERS)
        $(CC) -c $(CFLAGS) -I$(TOP)/include demo1.c
 
 
 demo2: demo2.o $(LIB_DIR)/libEGL.so
-       $(CC) demo2.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
+       $(CC) $(CFLAGS) demo2.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
 
 demo2.o: demo2.c $(HEADERS)
        $(CC) -c $(CFLAGS) -I$(TOP)/include demo2.c
 
 
 demo3: demo3.o $(LIB_DIR)/libEGL.so
-       $(CC) demo3.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
+       $(CC) $(CFLAGS) demo3.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
 
 demo3.o: demo3.c $(HEADERS)
        $(CC) -c $(CFLAGS) -I$(TOP)/include demo3.c
 
 
 eglinfo: eglinfo.o $(LIB_DIR)/libEGL.so
-       $(CC) eglinfo.o -L$(LIB_DIR) -lEGL -o $@
+       $(CC) $(CFLAGS) eglinfo.o -L$(LIB_DIR) -lEGL -o $@
 
 eglinfo.o: eglinfo.c $(HEADERS)
        $(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c
 
 
 eglgears: eglgears.o $(LIB_DIR)/libEGL.so
-       $(CC) eglgears.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
+       $(CC) $(CFLAGS) eglgears.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
 
 eglgears.o: eglgears.c $(HEADERS)
        $(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c