Mesa: Add initial 7.8.2 bep

This commit is contained in:
Alexander von Gluck
2013-02-17 22:38:47 +00:00
parent 4ecd65e9c4
commit 9e028fac8d
3 changed files with 601 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
###############################################################
# THIS IS NOT FOR GENERAL USE!
# This builds a buildpackage for the Haiku build system to link
# the OpenGL kit!!
###############################################################
DESCRIPTION="Mesa3D is a multi-platform GL implementation"
HOMEPAGE="http://www.freedesktop.org/"
SRC_URI="ftp://freedesktop.org/pub/mesa/7.8.2/MesaLib-7.8.2.tar.bz2"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="scons"
CHECKSUM_MD5="60e557ce407be3732711da484ab3db6c"
MESSAGE="This port only builds with gcc2. Not for general use."
BUILD {
cd Mesa-7.8.2
scons
cd ..
sh $(haikuporter -t)/sys-libs/mesa/mesapkg-7.8.x.sh ./Mesa-7.8.2
echo "There should be a Mesa OptionalBuild package in your home if everything went well!"
}
LICENSE="MIT"
COPYRIGHT="1999-2012 Brian Paul All Rights Reserved."

107
sys-libs/mesa/mesapkg-7.8.x.sh Executable file
View File

@@ -0,0 +1,107 @@
#!/bin/bash
# This script creates an optional package containing the
# the headers and binary code needed by the opengl kit
# to link libGL.so
# This script is run against a *COMPILED* Mesa source tree
echo " Welcome to Mesa-O-Matic!"
echo "-=-=-=-=-=-=-=-=-=-=-=-=-="
echo ""
# These are the Mesa headers and libraries used by the opengl kit
# Headers are probed for dependencies, only specify ones referenced
# by the opengl kit.
MESA_PRIVATE_HEADERS="glheader.h glapi.h glapitable.h glapitemp.h glapi_priv.h context.h driverfuncs.h meta.h colormac.h buffers.h framebuffer.h renderbuffer.h state.h version.h swrast.h swrast_setup.h tnl.h t_context.h t_pipeline.h vbo.h extensions.h s_spantemp.h s_renderbuffer.h s_context.h formats.h cpuinfo.h"
DEBUG=0
#######################################################################
# END CONFIG DATA, Dragons below!
#######################################################################
if [[ $( uname ) != "Haiku" ]]; then
echo "*************************************"
echo " I need to be run on a Haiku system!!"
echo "*************************************"
exit 1
fi
if [[ -z $1 ]]; then
echo ""
echo "Usage: $0 <compiled mesa location>"
echo ""
exit 1
fi
MESA_TOP="$1"
GCC_VER=`gcc -v 2>&1 | tail -1 | awk '{print $3}' | cut -d. -f1`
MESA_VER=`cat $MESA_TOP/Makefile |grep VERSION\= | cut -d= -f2`
DATESTAMP=`date +"%Y-%m-%d"`
echo "Bundling gcc$GCC_VER build of Mesa $MESA_VER..."
cd $MESA_TOP
#######################################################################
# Create Mesa optional pacakge
findInTree() {
RESULT=`find . -name "$1"`
if [[ $? -ne 0 || -z $RESULT ]]; then
echo "$i"
exit 1
fi
echo $RESULT
}
# Directories to search for matching headers
MESA_INCLUDES="-I./include -I./src -I./src/mapi -I./src/mesa"
MESA_DEFINES="-DUSE_X86_ASM -DUSE_PPC_ASM -DUSE_SPARC_ASM"
MESA_DEFINES="$MESA_DEFINES -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DUSE_X86_64_ASM"
ZIP_HEADERS=""
echo "Collecting required Mesa private headers..."
for i in $MESA_PRIVATE_HEADERS
do
FOUND=$(findInTree $i)
if [[ $GCC_VER -eq 2 ]]; then
# gcc2 isn't very good at -MM
setgcc gcc4
fi
HEADERS_RAW=`gcc -MM $MESA_INCLUDES $MESA_DEFINES $FOUND`
if [[ $GCC_VER -eq 2 ]]; then
setgcc gcc2
fi
for y in $( echo "$HEADERS_RAW" | cut -d':' -f2 | sed 's/\\//g' | tr -d '\n' )
do
CLEAN_HEADER=$( echo "$y" | grep -v "include/GL/" )
ZIP_HEADERS="$ZIP_HEADERS $CLEAN_HEADER"
done
done
echo "Collecting required Mesa libraries..."
rm -rf lib.haiku
mkdir -p lib.haiku
for i in $( find . -name "*.a" )
do
cp $i lib.haiku/
done
if [[ $DEBUG -eq 0 ]]; then
echo "Stripping debug symbols from Mesa libraries..."
find lib.haiku -exec strip --strip-debug {} \; ;
MESADBG=""
else
MESADBG="dbg"
fi
echo "Creating Mesa OptionalPackage..."
PLATFORM=$( uname -m )
ZIP_FILENAME="../mesa-${MESA_VER}${MESADBG}-x86-gcc${GCC_VER}-${DATESTAMP}.zip"
zip -r -9 $ZIP_FILENAME $ZIP_HEADERS ./include/GL/* ./lib.haiku/*
echo "Great Success! $ZIP_FILENAME created."

View File

@@ -0,0 +1,470 @@
diff -Naur Mesa-7.8.2/bin/mklib Mesa-7.8.2-haiku/bin/mklib
--- Mesa-7.8.2/bin/mklib 2010-06-15 17:43:41.034865152 +0000
+++ Mesa-7.8.2-haiku/bin/mklib 2013-02-17 22:26:13.017301504 +0000
@@ -260,7 +260,7 @@
NEWOBJECTS=""
for OBJ in $OBJECTS ; do
case $OBJ in
- -Wl,*)
+ -Wl,*|-L*|-l*)
echo "mklib: warning: ignoring $OBJ for static library"
;;
*)
@@ -307,7 +307,7 @@
#
case $ARCH in
- 'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/*)
+ 'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/* | 'NetBSD')
# we assume gcc
if [ "x$LINK" = "x" ] ; then
@@ -494,13 +494,16 @@
OPTS="${OPTS} -Wl,-Mmapfile.scope"
fi
- # Check if objects are SPARC v9
+ # Check if objects are 64-bit
# file says: ELF 64-bit MSB relocatable SPARCV9 Version 1
set ${OBJECTS}
if [ ${LINK} = "cc" -o ${LINK} = "CC" ] ; then
- SPARCV9=`file $1 | grep SPARCV9`
- if [ "${SPARCV9}" ] ; then
- OPTS="${OPTS} -xarch=v9"
+ ABI64=`file $1 | grep "ELF 64-bit"`
+ if [ "${ABI64}" ] ; then
+ case `uname -p` in
+ sparc) OPTS="${OPTS} -xarch=v9" ;;
+ i386) OPTS="${OPTS} -xarch=amd64" ;;
+ esac
fi
fi
if [ "${ALTOPTS}" ] ; then
@@ -571,20 +574,6 @@
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"
@@ -778,9 +767,8 @@
OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
fi
- LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
- LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}"
- LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}"
+ LINKNAME="lib${LIBNAME}.${LIBSUFFIX}"
+ LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
# examine first object to determine ABI
set ${OBJECTS}
@@ -793,9 +781,6 @@
OPTS=${ALTOPTS}
fi
- # XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk
- # to OPTS here?
-
# determine linker
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
@@ -807,8 +792,7 @@
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME} ${LINKNAME}
- ln -s ${LIBNAME} ${LINKNAME2}
- FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}"
+ FINAL_LIBS="${LIBNAME} ${LINKNAME}"
fi
;;
@@ -818,22 +802,6 @@
FINAL_LIBS=`make_ar_static_lib -ru 0 ${LIBNAME} ${OBJECTS}`
;;
- 'BeOS')
- if [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a"
- echo "mklib: Making BeOS static library: " ${LIBNAME}
- FINAL_LIBS=`make_ar_static_lib -cru 0 ${LIBNAME} ${OBJECTS}`
- else
- LIBNAME="lib${LIBNAME}.so"
- echo "mklib: Making BeOS shared library: " ${LIBNAME}
- gcc -nostart -Xlinker "-soname=${LIBNAME}" -L/Be/develop/lib/x86 -lbe ${DEPS} ${OBJECTS} -o "${LIBNAME}"
- mimeset -f "${LIBNAME}"
- # XXX remove the Mesa3D stuff here since mklib isn't mesa-specific.
- setversion "${LIBNAME}" -app ${MAJOR} ${MINOR} ${PATCH} -short "Powered by Mesa3D!" -long "Powered by Mesa3D!"
- fi
- FINAL_LIBS=${LIBNAME}
- ;;
-
'QNX')
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making QNX library: " ${LIBNAME}
@@ -927,6 +895,16 @@
CYGWIN*)
# GCC-based environment
+
+ if [ "x$LINK" = "x" ] ; then
+ # -linker was not specified so set default link command now
+ if [ $CPLUSPLUS = 1 ] ; then
+ LINK=g++
+ else
+ LINK=gcc
+ fi
+ fi
+
if [ $NOPREFIX = 1 ] ; then
# No "lib" or ".so" part
echo "mklib: Making CYGWIN shared library: " ${LIBNAME}
@@ -935,7 +913,7 @@
OPTS=${ALTOPTS}
fi
rm -f ${LIBNAME}
- ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
+ ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} || exit $?
FINAL_LIBS=${LIBNAME}
else
CYGNAME="cyg${LIBNAME}" # prefix with "cyg"
@@ -943,7 +921,7 @@
if [ $STATIC = 1 ] ; then
LIBNAME=${LIBNAME}.a
- echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
+ echo "mklib: Making CYGWIN static library: " ${LIBNAME}
OPTS="-ru"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
@@ -961,13 +939,7 @@
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
- echo "mklib: Making" $ARCH "shared library: " ${CYGNAME}-${MAJOR}.dll
-
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="g++"
- else
- LINK="gcc"
- fi
+ echo "mklib: Making CYGWIN shared library: " ${CYGNAME}-${MAJOR}.dll
# rm any old libs
rm -f ${CYGNAME}-${MAJOR}.dll
@@ -976,12 +948,7 @@
rm -f ${LIBNAME}.a
# make lib
- ${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS}
- # make build fail if link failed
- es=$?
- if [ "$es" -ne "0" ]; then
- exit $es
- fi
+ ${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS} || exit $?
# make usual symlinks
ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a
# finish up
@@ -992,6 +959,43 @@
fi
;;
+ 'Haiku')
+ if [ $STATIC = 1 ] ; then
+ LIBNAME="lib${LIBNAME}.a"
+ if [ "x$LINK" = "x" ] ; then
+ # -linker was not specified so set default link command now
+ if [ $CPLUSPLUS = 1 ] ; then
+ LINK=g++
+ else
+ LINK=gcc
+ fi
+ fi
+
+ OPTS="-ru"
+ if [ "${ALTOPTS}" ] ; then
+ OPTS=${ALTOPTS}
+ fi
+
+ echo "mklib: Making static library for Haiku: " ${LIBNAME}
+
+ # expand .a into .o files
+ NEW_OBJECTS=`expand_archives ${LIBNAME}.obj $OBJECTS`
+
+ # make static lib
+ FINAL_LIBS=`make_ar_static_lib ${OPTS} 1 ${LIBNAME} ${NEW_OBJECTS}`
+
+ # remove temporary extracted .o files
+ rm -rf ${LIBNAME}.obj
+ else
+ LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
+ OPTS="-shared"
+
+ echo "mklib: Making shared library for Haiku: " ${LIBNAME}
+ ${LINK} ${OPTS} ${LDFLAGS} ${OBJECTS} ${DEPS} -o ${LIBNAME}
+ FINAL_LIBS="${LIBNAME}"
+ fi
+ ;;
+
'example')
# If you're adding support for a new architecture, you can
# start with this:
@@ -1021,4 +1025,9 @@
echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR}
test -d ${INSTALLDIR} || mkdir -p ${INSTALLDIR}
mv ${FINAL_LIBS} ${INSTALLDIR}/
+
+ if [ "x${FINAL_BINS}" != "x" ] ; then
+ echo "mklib: Installing" ${FINAL_BINS} "in" ${INSTALLDIR}
+ mv ${FINAL_BINS} ${INSTALLDIR}/
+ fi
fi
diff -Naur Mesa-7.8.2/configs/current Mesa-7.8.2-haiku/configs/current
--- Mesa-7.8.2/configs/current 1970-01-01 00:00:00.000000000 +0000
+++ Mesa-7.8.2-haiku/configs/current 2013-02-17 22:26:13.021495808 +0000
@@ -0,0 +1,63 @@
+# Configuration for Haiku
+# Written by Alexander von Gluck IV
+#
+# Based on the BeOS config
+# written by Philippe Houdoin
+
+include $(TOP)/configs/default
+
+CONFIG_NAME = haiku
+
+# Haiku settings
+
+DEFINES = \
+ -DBEOS_THREADS \
+ -DGNU_ASSEMBLER \
+ -DUSE_X86_ASM \
+ -DUSE_MMX_ASM \
+ -DUSE_3DNOW_ASM \
+ -DUSE_SSE_ASM
+
+MESA_ASM_SOURCES = $(X86_SOURCES)
+GLAPI_ASM_SOURCES = $(X86_API)
+
+CC = gcc
+CXX = g++
+LD = gcc
+
+CFLAGS = -Wall -Wno-multichar $(DEFINES)
+CXXFLAGS = $(CFLAGS)
+LDFLAGS +=
+
+# Work around aliasing bugs - developers should comment this out
+CFLAGS += -fno-strict-aliasing
+#CFLAGS += -std=c99
+CXXFLAGS += -fno-strict-aliasing
+
+# No makedepend on Haiku, this will solve it
+MKDEP = true
+
+# Debug defines
+ifdef DEBUG
+ CFLAGS += -g -O0
+ LDFLAGS += -g
+ DEFINES += -DDEBUG
+else
+ CFLAGS += -O3
+endif
+
+# GLU settings
+GLU_LIB_NAME = libglu.a
+GLU_LIB = glu
+
+# Directories
+SRC_DIRS = glsl mesa/x86 mapi/glapi mesa glu
+GLU_DIRS = sgi
+DRIVER_DIRS =
+PROGRAM_DIRS =
+
+# Library/program dependencies
+GL_LIB_DEPS =
+OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
+GLU_LIB_DEPS =
+APP_LIB_DEPS = -lbe -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLUT_LIB)
diff -Naur Mesa-7.8.2/configs/haiku Mesa-7.8.2-haiku/configs/haiku
--- Mesa-7.8.2/configs/haiku 1970-01-01 00:00:00.000000000 +0000
+++ Mesa-7.8.2-haiku/configs/haiku 2013-02-17 22:26:13.031195136 +0000
@@ -0,0 +1,63 @@
+# Configuration for Haiku
+# Written by Alexander von Gluck IV
+#
+# Based on the BeOS config
+# written by Philippe Houdoin
+
+include $(TOP)/configs/default
+
+CONFIG_NAME = haiku
+
+# Haiku settings
+
+DEFINES = \
+ -DBEOS_THREADS \
+ -DGNU_ASSEMBLER \
+ -DUSE_X86_ASM \
+ -DUSE_MMX_ASM \
+ -DUSE_3DNOW_ASM \
+ -DUSE_SSE_ASM
+
+MESA_ASM_SOURCES = $(X86_SOURCES)
+GLAPI_ASM_SOURCES = $(X86_API)
+
+CC = gcc
+CXX = g++
+LD = gcc
+
+CFLAGS = -Wall -Wno-multichar $(DEFINES)
+CXXFLAGS = $(CFLAGS)
+LDFLAGS +=
+
+# Work around aliasing bugs - developers should comment this out
+CFLAGS += -fno-strict-aliasing
+#CFLAGS += -std=c99
+CXXFLAGS += -fno-strict-aliasing
+
+# No makedepend on Haiku, this will solve it
+MKDEP = true
+
+# Debug defines
+ifdef DEBUG
+ CFLAGS += -g -O0
+ LDFLAGS += -g
+ DEFINES += -DDEBUG
+else
+ CFLAGS += -O3
+endif
+
+# GLU settings
+GLU_LIB_NAME = libglu.a
+GLU_LIB = glu
+
+# Directories
+SRC_DIRS = glsl mesa/x86 mapi/glapi mesa glu
+GLU_DIRS = sgi
+DRIVER_DIRS =
+PROGRAM_DIRS =
+
+# Library/program dependencies
+GL_LIB_DEPS =
+OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
+GLU_LIB_DEPS =
+APP_LIB_DEPS = -lbe -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLUT_LIB)
diff -Naur Mesa-7.8.2/include/GL/gl.h Mesa-7.8.2-haiku/include/GL/gl.h
--- Mesa-7.8.2/include/GL/gl.h 2010-04-27 21:41:21.060555264 +0000
+++ Mesa-7.8.2-haiku/include/GL/gl.h 2013-02-17 22:30:31.274989056 +0000
@@ -67,7 +67,8 @@
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
# define GLAPI extern
# define GLAPIENTRY __stdcall
-#elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+#elif (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303) && \
+ defined(__ELF__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define GLAPI __attribute__((visibility("default")))
# define GLAPIENTRY
#endif /* WIN32 && !CYGWIN */
diff -Naur Mesa-7.8.2/Makefile Mesa-7.8.2-haiku/Makefile
--- Mesa-7.8.2/Makefile 2010-06-16 21:22:57.033292288 +0000
+++ Mesa-7.8.2-haiku/Makefile 2013-02-17 22:26:13.034340864 +0000
@@ -84,6 +84,7 @@
freebsd-dri \
freebsd-dri-amd64 \
freebsd-dri-x86 \
+haiku \
hpux10 \
hpux10-gcc \
hpux10-static \
diff -Naur Mesa-7.8.2/src/gallium/auxiliary/draw/draw_private.h Mesa-7.8.2-haiku/src/gallium/auxiliary/draw/draw_private.h
--- Mesa-7.8.2/src/gallium/auxiliary/draw/draw_private.h 2010-06-15 17:43:42.046661632 +0000
+++ Mesa-7.8.2-haiku/src/gallium/auxiliary/draw/draw_private.h 2013-02-17 22:26:13.037486592 +0000
@@ -70,7 +70,7 @@
/* This will probably become float (*data)[4] soon:
*/
- float data[][4];
+ float (*data)[4];
};
/* NOTE: It should match vertex_id size above */
diff -Naur Mesa-7.8.2/src/gallium/auxiliary/os/os_thread.h Mesa-7.8.2-haiku/src/gallium/auxiliary/os/os_thread.h
--- Mesa-7.8.2/src/gallium/auxiliary/os/os_thread.h 2010-06-15 17:43:42.056623104 +0000
+++ Mesa-7.8.2-haiku/src/gallium/auxiliary/os/os_thread.h 2013-02-17 22:26:13.040370176 +0000
@@ -257,7 +257,7 @@
* pipe_barrier
*/
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
typedef pthread_barrier_t pipe_barrier;
diff -Naur Mesa-7.8.2/src/gallium/auxiliary/util/u_debug.h Mesa-7.8.2-haiku/src/gallium/auxiliary/util/u_debug.h
--- Mesa-7.8.2/src/gallium/auxiliary/util/u_debug.h 2010-06-15 17:43:42.000000000 +0000
+++ Mesa-7.8.2-haiku/src/gallium/auxiliary/util/u_debug.h 2013-02-17 22:26:13.046923776 +0000
@@ -91,8 +91,10 @@
(void) format; /* silence warning */
#endif
}
-
-#endif /* !PIPE_OS_HAIKU */
+#else /* is Haiku */
+/* Haiku provides debug_printf in libroot with OS.h */
+#include <OS.h>
+#endif
/*
* ... isn't portable so we need to pass arguments in parentheses.
diff -Naur Mesa-7.8.2/src/glu/sgi/Makefile Mesa-7.8.2-haiku/src/glu/sgi/Makefile
--- Mesa-7.8.2/src/glu/sgi/Makefile 2010-02-05 00:10:40.064487424 +0000
+++ Mesa-7.8.2-haiku/src/glu/sgi/Makefile 2013-02-17 22:26:13.049545216 +0000
@@ -135,13 +135,19 @@
-mkdir $(TOP)/$(LIB_DIR)
# Make the library:
-$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
+$(TOP)/$(LIB_DIR)/lib$(GLU_LIB).so: $(OBJECTS)
$(MKLIB) -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
-major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
-cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
-exports glu.exports -id $(INSTALL_LIB_DIR)/lib$(GLU_LIB).$(GLU_MAJOR).dylib \
$(GLU_LIB_DEPS) $(OBJECTS)
+$(TOP)/$(LIB_DIR)/lib$(GLU_LIB).a: $(OBJECTS)
+ $(MKLIB) -o $(GLU_LIB) -static -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
+ -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
+ -cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
+ -exports glu.exports -id $(INSTALL_LIB_DIR)/lib$(GLU_LIB).$(GLU_MAJOR).dylib \
+ $(GLU_LIB_DEPS) $(OBJECTS)
clean:
-rm -f *.o */*.o */*/*.o
diff -Naur Mesa-7.8.2/src/mesa/glapi/glapi.h Mesa-7.8.2-haiku/src/mesa/glapi/glapi.h
--- Mesa-7.8.2/src/mesa/glapi/glapi.h 2010-06-15 17:43:43.026476544 +0000
+++ Mesa-7.8.2-haiku/src/mesa/glapi/glapi.h 2013-02-17 22:26:13.052428800 +0000
@@ -62,7 +62,7 @@
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__) && __GNUC__ > 2
# define likely(x) __builtin_expect(!!(x), 1)
# define unlikely(x) __builtin_expect(!!(x), 0)
#else