-m32 and -m64 were missing from linker flags which caused linking errors with
dri river linking test. Adding correct flag to linker paramters fixes the
linking.

Signed-off-by: Pauli Nieminen <suok...@gmail.com>
---

Does this look correct way of passing the flags to the build system?

 configure.ac                           |   11 +++++++++--
 src/mesa/drivers/dri/Makefile.template |    2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index f2e87f4..17d61d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,9 +163,11 @@ if test "x$enable_32bit" = xyes; then
     if test "x$GCC" = xyes; then
         CFLAGS="$CFLAGS -m32"
         ARCH_FLAGS="$ARCH_FLAGS -m32"
+        LDFLAGS_ADD="$LDFLAGS_ADD -m32"
     fi
     if test "x$GXX" = xyes; then
         CXXFLAGS="$CXXFLAGS -m32"
+        LDFLAGS_ADD="$LDFLAGS_ADD -m32"
     fi
 fi
 AC_ARG_ENABLE([64-bit],
@@ -177,9 +179,11 @@ AC_ARG_ENABLE([64-bit],
 if test "x$enable_64bit" = xyes; then
     if test "x$GCC" = xyes; then
         CFLAGS="$CFLAGS -m64"
+        LDFLAGS="$LDFLAGS -m64"
     fi
     if test "x$GXX" = xyes; then
         CXXFLAGS="$CXXFLAGS -m64"
+        LDFLAGS="$LDFLAGS -m64"
     fi
 fi
 
@@ -1414,7 +1418,7 @@ dnl prepend CORE_DIRS to SRC_DIRS
 SRC_DIRS="$CORE_DIRS $SRC_DIRS"
 
 dnl Restore LDFLAGS and CPPFLAGS
-LDFLAGS="$_SAVE_LDFLAGS"
+LDFLAGS="$_SAVE_LDFLAGS $LDFLAGS_ADD"
 CPPFLAGS="$_SAVE_CPPFLAGS"
 
 dnl Substitute the config
@@ -1498,11 +1502,14 @@ dnl Compiler options
 cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
     $SED 's/^ *//;s/  */ /;s/ *$//'`
 cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
-    $SED 's/^ *//;s/  */ /;s/ *$//'`
+    $SED 's/^ *//;s/  */ /;s/ *$//'` 
+ldflags=`echo $LDFLAGS | \
+    $SED 's/^ *//;s/  */ /;s/ *$//'` 
 defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/  */ /;s/ *$//'`
 echo ""
 echo "        CFLAGS:          $cflags"
 echo "        CXXFLAGS:        $cxxflags"
+echo "        LDFLAGS:         $ldflags"
 echo "        Macros:          $defines"
 
 echo ""
diff --git a/src/mesa/drivers/dri/Makefile.template 
b/src/mesa/drivers/dri/Makefile.template
index f19cc03..a2592bf 100644
--- a/src/mesa/drivers/dri/Makefile.template
+++ b/src/mesa/drivers/dri/Makefile.template
@@ -54,7 +54,7 @@ $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) 
Makefile \
                $(TOP)/src/mesa/drivers/dri/Makefile.template 
$(TOP)/src/mesa/drivers/dri/common/dri_test.o
        $(MKLIB) -o $...@.tmp -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
                $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(DRI_LIB_DEPS)
-       $(CC) -o $...@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o 
$...@.tmp $(DRI_LIB_DEPS)
+       $(CC) -o $...@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o 
$...@.tmp $(LDFLAGS) $(DRI_LIB_DEPS)
        @rm -f $...@.test
        mv -f $...@.tmp $@
 
-- 
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to