mesa: fix build for NetBSD
authorPierre Allegraud <pallegra@gmail.com>
Thu, 6 Jan 2011 14:58:57 +0000 (07:58 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 6 Jan 2011 15:00:01 +0000 (08:00 -0700)
See http://bugs.freedesktop.org/show_bug.cgi?id=32859

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
bin/mklib
configure.ac
src/mesa/drivers/dri/mach64/mach64_context.h

index 2f9223ff3c1c94c6690baedc88e245b101acd03d..a511375e20e96ccb3e12732d06f24f43d81f6d41 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -307,7 +307,7 @@ fi
 #
 case $ARCH in
 
-    'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/*)
+    'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/* | 'NetBSD')
        # we assume gcc
 
        if [ "x$LINK" = "x" ] ; then
@@ -574,20 +574,6 @@ case $ARCH in
        fi
        ;;
 
-    'NetBSD')
-        if [ $STATIC = 1 ] ; then
-           LIBNAME="lib${LIBNAME}_pic.a"
-           echo "mklib: Making NetBSD PIC static library: " ${LIBNAME}
-           FINAL_LIBS=`make_ar_static_lib cq 1 ${LIBNAME} ${OBJECTS}`
-       else
-           LIBNAME="lib${LIBNAME}.so.${MAJOR}.${MINOR}"
-           echo "mklib: Making NetBSD PIC shared library: " ${LIBNAME}
-           rm -f ${LIBNAME}
-           ld -x -Bshareable -Bforcearchive -o ${LIBNAME} ${OBJECTS}
-           FINAL_LIBS=${LIBNAME}
-       fi
-       ;;
-
     'IRIX' | 'IRIX64')
         if [ $STATIC = 1 ] ; then
            LIBNAME="lib${LIBNAME}.a"
index bd06f8ecf72eee4c9ce80d590fcbcdf3217d4cda..bcf7cd38a612f855e38a352363ad6309b1815eb3 100644 (file)
@@ -377,14 +377,14 @@ if test "x$enable_asm" = xyes; then
     case "$host_cpu" in
     i?86)
         case "$host_os" in
-        linux* | *freebsd* | dragonfly*)
+        linux* | *freebsd* | dragonfly* | *netbsd*)
             test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
             ;;
         esac
         ;;
     x86_64)
         case "$host_os" in
-        linux* | *freebsd* | dragonfly*)
+        linux* | *freebsd* | dragonfly* | *netbsd*)
             test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
             ;;
         esac
@@ -542,7 +542,7 @@ linux*)
     i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
     esac
     ;;
-*freebsd* | dragonfly*)
+*freebsd* | dragonfly* | *netbsd*)
     case "$host_cpu" in
     i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
     esac
@@ -909,16 +909,13 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
             ;;
         esac
         ;;
-    freebsd* | dragonfly*)
+    freebsd* | dragonfly* | *netbsd*)
         DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
         DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
         DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
         if test "x$driglx_direct" = xyes; then
             DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
         fi
-        if test "x$GXX" = xyes; then
-            CXXFLAGS="$CXXFLAGS -ansi -pedantic"
-        fi
 
         if test "x$DRI_DIRS" = "xyes"; then
             DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
index 11e8f53b283e168a60b34ddcc5aa001f2f88e4c7..70bc0ae79de4215276f2493caeeb9de2b9a3667c 100644 (file)
@@ -295,11 +295,11 @@ extern GLboolean mach64UnbindContext( __DRIcontext *driContextPriv );
 #define LE32_OUT( x, y )       do { *(GLuint *)(x) = (y); } while (0)
 #define LE32_OUT_FLOAT( x, y ) do { *(GLfloat *)(x) = (y); } while (0)
 #else
-#ifndef __OpenBSD__
-#include <byteswap.h>
-#else
+#if defined(__OpenBSD__) || defined(__NetBSD__)
 #include <machine/endian.h>
 #define bswap_32 bswap32
+#else
+#include <byteswap.h>
 #endif
 
 #define LE32_IN( x )           bswap_32( *(GLuint *)(x) )