Merge all changes from trunk

This commit is contained in:
Oliver Tappe
2013-03-29 14:04:07 +00:00
parent 888e133171
commit 94cc6aaf85
1052 changed files with 65053 additions and 2541 deletions

File diff suppressed because it is too large Load Diff

23
sys-libs/glu/glu-9.0.bep Normal file
View File

@@ -0,0 +1,23 @@
DESCRIPTION="glu"
HOMEPAGE="http://freedesktop.org"
SRC_URI="ftp://freedesktop.org/pub/mesa/glu/glu-9.0.0.tar.gz"
CHECKSUM_MD5="bbc57d4fe3bd3fb095bdbef6fcb977c4"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd glu-9.0.0
./configure --prefix=`finddir B_SYSTEM_DIRECTORY` \
--datadir=`finddir B_COMMON_DATA_DIRECTORY`/ \
--includedir=`finddir B_SYSTEM_HEADERS_DIRECTORY`/os/opengl \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}
INSTALL {
cd glu-9.0.0
make install DESTDIR="${DESTDIR}"
}
LICENSE="MIT"
COPYRIGHT="Copyright (C) 1999-2012 Brian Paul and others. All Rights Reserved."

View File

@@ -0,0 +1,79 @@
#!/bin/bash
# Mesa-O-Matic
# Copyright 2011-2012, Alexander von Gluck IV
# Released under the terms of the MIT license
# 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 ""
if [[ $DEBUG -eq 1 ]]; then
echo "Debugging: enabled"
else
echo "Debugging: disabled"
fi
#######################################################################
# 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 <mesa version> <compiled mesa location>"
echo ""
exit 1
fi
MESA_VER="$1"
MESA_TOP="$2"
GCC_VER=`gcc -v 2>&1 | tail -1 | awk '{print $3}' | cut -d. -f1`
DATESTAMP=`date +"%Y-%m-%d"`
echo "Bundling gcc$GCC_VER build of Mesa $MESA_VER..."
cd $MESA_TOP
#######################################################################
# Create Mesa optional pacakge
ZIP_HEADERS=""
echo "Collecting Mesa headers..."
for i in $(find . -name "*.h")
do
ZIP_HEADERS="$ZIP_HEADERS $i"
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="/boot/home/mesa-${MESA_VER}-x86${MESADBG}-gcc${GCC_VER}-${DATESTAMP}.zip"
zip -r -9 $ZIP_FILENAME $ZIP_HEADERS ./lib.haiku/*
echo "Great Success! $ZIP_FILENAME created."

View File

@@ -0,0 +1,25 @@
###############################################################
# 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=""
CHECKSUM_MD5="6be2d343a0089bfd395ce02aaf8adb57"
MESSAGE="This port only builds with gcc2. Not for general use."
BUILD {
export DEBUG=0
cd Mesa-7.8.2
make
cd ..
sh $(haikuporter -t)/sys-libs/mesa/buildpackage.sh 7.8.2 ./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."

View File

@@ -0,0 +1,25 @@
###############################################################
# 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/9.0.1/MesaLib-9.0.1.tar.bz2"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="scons"
CHECKSUM_MD5="97d6554c05ea7449398afe3a0ede7018"
MESSAGE="This port only builds with gcc4. Not for general use."
BUILD {
export DEBUG=0
cd Mesa-9.0.1
scons debug=$DEBUG
cd ..
sh $(haikuporter -t)/sys-libs/mesa/buildpackage.sh 9.0.1 ./Mesa-9.0.1
echo "There should be a Mesa OptionalBuild package in your home if everything went well!"
}
LICENSE="MIT"
COPYRIGHT="Copyright (C) 1999-2012 Brian Paul All Rights Reserved."

View File

@@ -0,0 +1,28 @@
###############################################################
# 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/9.0.2/MesaLib-9.0.2.tar.bz2"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="scons, llvm >= 3.2"
CHECKSUM_MD5="dc45d1192203e418163e0017640e1cfc"
MESSAGE="This port only builds with gcc4. Not for general use."
BUILD {
export DEBUG=0
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
echo "This generates a Mesa3D build package for Haiku... not for general use"
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
cd Mesa-9.0.2
scons debug=$DEBUG
cd ..
sh $(haikuporter -t)/sys-libs/mesa/buildpackage.sh 9.0.2 ./Mesa-9.0.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."

View File

@@ -0,0 +1,25 @@
###############################################################
# 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/9.0/MesaLib-9.0.tar.bz2"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="scons"
CHECKSUM_MD5="60e557ce407be3732711da484ab3db6c"
MESSAGE="This port only builds with gcc4. Not for general use."
BUILD {
export DEBUG=0
cd Mesa-9.0
scons debug=$DEBUG
cd ..
sh $(haikuporter -t)/sys-libs/mesa/buildpackage.sh 9.0 ./Mesa-9.0
echo "There should be a Mesa OptionalBuild package in your home if everything went well!"
}
LICENSE="MIT"
COPYRIGHT="Copyright (C) 1999-2012 Brian Paul All Rights Reserved."

View File

@@ -0,0 +1,28 @@
###############################################################
# 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/9.1/MesaLib-9.1.tar.bz2"
REVISION="1"
STATUS_HAIKU="unstable"
DEPEND="scons, llvm >= 3.2"
CHECKSUM_MD5="d3891e02215422e120271d976ff1947e"
MESSAGE="This port only builds with gcc4. Not for general use."
BUILD {
export DEBUG=0
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
echo "This generates a Mesa3D build package for Haiku... not for general use"
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
cd Mesa-9.1
scons debug=$DEBUG
cd ..
sh $(haikuporter -t)/sys-libs/mesa/buildpackage.sh 9.1.0 ./Mesa-9.1
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."

View File

@@ -0,0 +1,28 @@
###############################################################
# 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/9.1.1/MesaLib-9.1.1.tar.bz2"
REVISION="1"
STATUS_HAIKU="unstable"
DEPEND="scons, llvm >= 3.2"
CHECKSUM_MD5="6ea2bdc3b7ecfb4257b39814b4182580"
MESSAGE="This port only builds with gcc4. Not for general use."
BUILD {
export DEBUG=1
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
echo "This generates a Mesa3D build package for Haiku... not for general use"
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
cd Mesa-9.1.1
scons debug=$DEBUG
cd ..
sh $(haikuporter -t)/sys-libs/mesa/buildpackage.sh 9.1.1 ./Mesa-9.1.1
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."

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

View File

@@ -0,0 +1,52 @@
diff -Naur Mesa-9.0.1/scons/gallium.py Mesa-9.0.1-haiku/scons/gallium.py
--- Mesa-9.0.1/scons/gallium.py 2012-11-09 12:16:31.041680896 -0600
+++ Mesa-9.0.1-haiku/scons/gallium.py 2012-12-19 16:03:56.564658176 -0600
@@ -361,8 +361,7 @@
ccflags += [
'-mstackrealign', # ensure stack is aligned
'-march=i586', # Haiku target is Pentium
- '-mtune=i686', # use i686 where we can
- '-mmmx' # use mmx math where we can
+ '-mtune=i686' # use i686 where we can
]
if env['machine'] == 'x86_64':
ccflags += ['-m64']
diff -Naur Mesa-9.0.1/scons/llvm.py Mesa-9.0.1-haiku/scons/llvm.py
--- Mesa-9.0.1/scons/llvm.py 2012-08-31 18:33:41.041680896 -0500
+++ Mesa-9.0.1-haiku/scons/llvm.py 2012-12-18 23:05:50.677642240 -0600
@@ -183,6 +183,9 @@
if llvm_version >= distutils.version.LooseVersion('3.1'):
components.append('mcjit')
+ if llvm_version >= distutils.version.LooseVersion('3.2'):
+ env.Append(CXXFLAGS = ('-fno-rtti',))
+
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
env.ParseConfig('llvm-config --ldflags')
except OSError:
diff -Naur Mesa-9.0.1/src/gallium/auxiliary/Makefile Mesa-9.0.1-haiku/src/gallium/auxiliary/Makefile
--- Mesa-9.0.1/src/gallium/auxiliary/Makefile 2012-08-31 18:33:41.050331648 -0500
+++ Mesa-9.0.1-haiku/src/gallium/auxiliary/Makefile 2012-12-18 23:06:31.179306496 -0600
@@ -15,6 +15,10 @@
$(GALLIVM_CPP_SOURCES)
endif
+# LLVM >= 3.2 requires -fno-rtti
+ifeq ($(shell expr `echo $(LLVM_VERSION) | sed -e 's/\([0-9]\)\.\([0-9]\)/\10\2/g'` \>= 302),1)
+CXXFLAGS += -fno-rtti
+endif
include ../Makefile.template
diff -Naur Mesa-9.0.1/src/mesa/SConscript Mesa-9.0.1-haiku/src/mesa/SConscript
--- Mesa-9.0.1/src/mesa/SConscript 2012-11-09 12:16:31.015728640 -0600
+++ Mesa-9.0.1-haiku/src/mesa/SConscript 2012-12-19 16:32:37.285736960 -0600
@@ -371,7 +371,7 @@
#
# Assembly sources
#
-if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
+if env['gcc'] and env['platform'] not in ('darwin', 'windows', 'haiku'):
if env['machine'] == 'x86':
env.Append(CPPDEFINES = [
'USE_X86_ASM',

View File

@@ -0,0 +1,25 @@
diff -Naur Mesa-9.0.2/scons/llvm.py Mesa-9.0.2-haiku/scons/llvm.py
--- Mesa-9.0.2/scons/llvm.py 2013-01-22 18:09:32.066322432 +0000
+++ Mesa-9.0.2-haiku/scons/llvm.py 2013-02-17 21:20:51.626262016 +0000
@@ -183,6 +183,9 @@
if llvm_version >= distutils.version.LooseVersion('3.1'):
components.append('mcjit')
+ if llvm_version >= distutils.version.LooseVersion('3.2'):
+ env.Append(CXXFLAGS = ('-fno-rtti',))
+
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
env.ParseConfig('llvm-config --ldflags')
except OSError:
diff -Naur Mesa-9.0.2/src/mesa/SConscript Mesa-9.0.2-haiku/src/mesa/SConscript
--- Mesa-9.0.2/src/mesa/SConscript 2013-01-22 18:09:32.040370176 +0000
+++ Mesa-9.0.2-haiku/src/mesa/SConscript 2013-02-17 21:20:22.510394368 +0000
@@ -371,7 +371,7 @@
#
# Assembly sources
#
-if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
+if env['gcc'] and env['platform'] not in ('darwin', 'windows', 'haiku'):
if env['machine'] == 'x86':
env.Append(CPPDEFINES = [
'USE_X86_ASM',

View File

@@ -0,0 +1,42 @@
diff -Naur Mesa-9.0/src/mesa/sources.mak Mesa-9.0-haiku/src/mesa/sources.mak
--- Mesa-9.0/src/mesa/sources.mak 2012-08-31 23:36:09.036700160 +0000
+++ Mesa-9.0-haiku/src/mesa/sources.mak 2012-10-09 13:17:15.991690752 +0000
@@ -281,7 +281,6 @@
$(SRCDIR)x86/x86_xform.c \
$(SRCDIR)x86/3dnow.c \
$(SRCDIR)x86/sse.c \
- $(SRCDIR)x86/rtasm/x86sse.c \
$(SRCDIR)sparc/sparc.c \
$(SRCDIR)x86-64/x86-64.c
diff -Naur Mesa-9.0/src/mesa/tnl/t_vertex_sse.c Mesa-9.0-haiku/src/mesa/tnl/t_vertex_sse.c
--- Mesa-9.0/src/mesa/tnl/t_vertex_sse.c 2012-08-31 23:33:41.058458112 +0000
+++ Mesa-9.0-haiku/src/mesa/tnl/t_vertex_sse.c 2012-10-09 13:20:34.234356736 +0000
@@ -36,7 +36,7 @@
#if defined(USE_SSE_ASM)
-#include "x86/rtasm/x86sse.h"
+#include "rtasm/rtasm_x86sse.h"
#include "x86/common_x86_asm.h"
@@ -356,7 +356,7 @@
struct x86_reg vp0 = x86_make_reg(file_XMM, 1);
struct x86_reg vp1 = x86_make_reg(file_XMM, 2);
struct x86_reg temp2 = x86_make_reg(file_XMM, 3);
- GLubyte *fixup, *label;
+ GLuint fixup, label;
/* Push a few regs?
*/
@@ -658,7 +658,8 @@
p.identity = x86_make_reg(file_XMM, 6);
p.chan0 = x86_make_reg(file_XMM, 7);
- if (!x86_init_func_size(&p.func, MAX_SSE_CODE_SIZE)) {
+ x86_init_func_size(&p.func, MAX_SSE_CODE_SIZE);
+ if (p.func.caps == 0) {
vtx->emit = NULL;
return;
}

View File

@@ -7,7 +7,7 @@ STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd ncurses-5.6
./configure --prefix=/boot/common
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}

View File

@@ -7,7 +7,7 @@ STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd ncurses-5.7
./configure --prefix=/boot/common --with-libtool
./configure --prefix=`finddir B_COMMON_DIRECTORY` --with-libtool
make
}

View File

@@ -0,0 +1,23 @@
DESCRIPTION="ncurses"
HOMEPAGE="http://www.gnu.org/software/ncurses/ncurses.html"
SRC_URI="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.8.tar.gz"
CHECKSUM_MD5="20ed3fa7599937f0ca268d9088837a64"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd ncurses-5.8
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--datadir=`finddir B_COMMON_DATA_DIRECTORY`/ \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man \
--with-libtool
make
}
INSTALL {
cd ncurses-5.8
./misc/shlib make install DESTDIR="${DESTDIR}"
}
LICENSE="MIT"
COPYRIGHT="1998-2011 Free Software Foundation, Inc."

View File

@@ -0,0 +1,24 @@
DESCRIPTION="ncurses"
HOMEPAGE="http://www.gnu.org/software/ncurses/ncurses.html"
SRC_URI="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz"
CHECKSUM_MD5="8cb9c412e5f2d96bc6f459aa8c6282a1"
REVISION="2"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd ncurses-5.9
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--datadir=`finddir B_COMMON_DATA_DIRECTORY` \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man \
--with-libtool \
--enable-termcap
make
}
INSTALL {
cd ncurses-5.9
./misc/shlib make install DESTDIR="${DESTDIR}"
}
LICENSE="MIT"
COPYRIGHT="1998-2011 Free Software Foundation, Inc."

View File

@@ -7,7 +7,7 @@ STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd readline-5.2
./configure --prefix=/boot/common
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}

View File

@@ -1,5 +1,5 @@
DESCRIPTION="readline"
HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
DESCRIPTION="readline"
HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
SRC_URI="ftp://ftp.gnu.org/gnu/readline/readline-6.0.tar.gz"
CHECKSUM_MD5="b7f65a48add447693be6e86f04a63019"
REVISION="1"
@@ -11,11 +11,7 @@ BUILD {
aclocal
autoconf
MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
if [ -n "$(setgcc | grep '2')" ]; then
LIBDIR=`finddir B_COMMON_LIB_DIRECTORY`
else
LIBDIR=`finddir B_COMMON_LIB_DIRECTORY`/gcc4
fi
LIBDIR=`finddir B_COMMON_LIB_DIRECTORY`
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--libdir=$LIBDIR \
--mandir=$MANDIR

View File

@@ -1,5 +1,5 @@
DESCRIPTION="readline"
HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
DESCRIPTION="readline"
HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
SRC_URI="ftp://ftp.gnu.org/gnu/readline/readline-6.1.tar.gz"
CHECKSUM_MD5="fc2f7e714fe792db1ce6ddc4c9fb4ef3"
REVISION="1"
@@ -10,15 +10,11 @@ BUILD {
libtoolize --force --copy --install
aclocal
autoconf
MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
if [ -n "$(setgcc | grep '2')" ]; then
LIBDIR=`finddir B_COMMON_LIB_DIRECTORY`
else
LIBDIR=`finddir B_COMMON_LIB_DIRECTORY`/gcc4
fi
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--libdir=$LIBDIR \
--mandir=$MANDIR
# --datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--infodir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/info \
--libdir=`finddir B_COMMON_LIB_DIRECTORY` \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}

View File

@@ -0,0 +1,27 @@
DESCRIPTION="readline"
HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
SRC_URI="ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz"
CHECKSUM_MD5="67948acb2ca081f23359d0256e9a271c"
REVISION="2"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd readline-6.2
libtoolize --force --copy --install
aclocal
autoconf
COMMON_DOCS=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--infodir=$COMMON_DOCS/info \
--mandir=$COMMON_DOCS/man
make
}
INSTALL {
cd readline-6.2
make install DESTDIR="${DESTDIR}"
}
LICENSE="GNU GPL v3"
COPYRIGHT="1989-2011 Free Software Foundation, Inc."

View File

@@ -11,7 +11,7 @@ BUILD {
cp autoconf/config.guess config.guess
cd ..
sed -i -e '/^TERMCAP=/s:=.*:=:' configure || die
./configure --prefix=/boot/common
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}

View File

@@ -7,7 +7,7 @@ STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd zlib-1.2.3
./configure --prefix=/boot/common
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}
@@ -16,4 +16,4 @@ INSTALL {
make install
}
LICENSE="Zlib"
COPYRIGHT="Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler"
COPYRIGHT="1995-2005 Jean-loup Gailly and Mark Adler"

View File

@@ -7,6 +7,7 @@ STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd zlib-1.2.5
sed -i 's/share\/man/documentation\/man/' CMakeLists.txt
cmake .
make
}
@@ -16,4 +17,4 @@ INSTALL {
make install
}
LICENSE="Zlib"
COPYRIGHT="Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler"
COPYRIGHT="1995-2005 Jean-loup Gailly and Mark Adler"

View File

@@ -0,0 +1,21 @@
DESCRIPTION="zlib"
HOMEPAGE="http://www.zlib.net/"
SRC_URI="http://zlib.net/zlib-1.2.7.tar.gz"
CHECKSUM_MD5="60df6a37c56e7c1366cca812414f7b85"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd zlib-1.2.7
sed -i 's/share\/man/documentation\/man/' CMakeLists.txt
sed -i 's/share\/pkgconfig/lib\/pkgconfig/' CMakeLists.txt
cmake .
make
}
INSTALL {
cd zlib-1.2.7
make install
}
LICENSE="Zlib"
COPYRIGHT="1995-2005 Jean-loup Gailly and Mark Adler"

View File

@@ -0,0 +1,24 @@
DESCRIPTION="Zopfli Compression Algorithm is a zlib (gzip, deflate) compatible compressor."
HOMEPAGE="http://code.google.com/p/zopfli"
SRC_URI="git+https://code.google.com/p/zopfli/"
#CHECKSUM_MD5="abc123"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
MESSAGE="This port only builds with gcc4. Use 'setgcc gcc4' before building."
BUILD {
cd zopfli-999
sed -i 's/\-lm//' makefile
make
}
INSTALL {
cd zopfli-999
BINDIR=${DESTDIR}/`finddir B_COMMON_BIN_DIRECTORY`
mkdir -p ${BINDIR}
cp -r zopfli ${BINDIR}/zopfli
}
LICENSE="Apache v2"
COPYRIGHT="2011-2013 Google Inc."