[haiku-commits] haiku: hrev43644 - 3rdparty/mesa

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 8 Jan 2012 06:59:21 +0100 (CET)

hrev43644 adds 1 changeset to branch 'master'
old head: 74983a5f69cef9ef4e0d316ec79123e7015b3256
new head: b63d0f0c4454c5435b6a481072fc615dabbf8b93

----------------------------------------------------------------------------

b63d0f0: add mesa-o-matic shell script
  
   * This bundles up a compiled upstream Mesa source directory
   * Used during the creation of the Mesa optional package

                          [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev43644
Commit:      b63d0f0c4454c5435b6a481072fc615dabbf8b93
URL:         http://cgit.haiku-os.org/haiku/commit/?id=b63d0f0
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Sun Jan  8 05:58:54 2012 UTC

----------------------------------------------------------------------------

1 files changed, 105 insertions(+), 0 deletions(-)
3rdparty/mesa/mesa-o-matic.sh |  105 +++++++++++++++++++++++++++++++++++++

----------------------------------------------------------------------------

diff --git a/3rdparty/mesa/mesa-o-matic.sh b/3rdparty/mesa/mesa-o-matic.sh
new file mode 100755
index 0000000..ae06c38
--- /dev/null
+++ b/3rdparty/mesa/mesa-o-matic.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+# Mesa-O-Matic
+# Copyright 2011, Alexander von Gluck IV
+
+# 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 common_x86_asm.h common_ppc_features.h extensions.h 
s_spantemp.h s_renderbuffer.h"
+
+# These are public header directories, all files grabbed
+MESA_PUBLIC_HEADERS="include/GL"
+
+# These libraries are 1:1 file find/grabs
+MESA_LIBRARIES="libmesa.a libglapi.a libGLU.a"
+
+#######################################################################
+# 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`
+
+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"
+
+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 $FOUND`
+       if [[ $GCC_VER -eq 2 ]]; then
+               setgcc gcc2
+       fi
+       HEADERS=$( echo "$HEADERS_RAW" | cut -d':' -f2 | sed 's/\\//g' | tr -d 
'\n' )
+       ZIP_HEADERS="$ZIP_HEADERS $HEADERS"
+done
+
+echo "Collecting required Mesa public headers..."
+#for i in $MESA_PUBLIC_HEADERS
+#do
+       HEADERS=$( find $MESA_PUBLIC_HEADERS -exec echo -n "{} " \; )
+       ZIP_HEADERS="$ZIP_HEADERS $HEADERS"
+#done
+
+ZIP_LIBRARIES=""
+echo "Collecting required Mesa libraries..."
+for i in $MESA_LIBRARIES
+do
+       FOUND=$(findInTree $i)
+       ZIP_LIBRARIES="$ZIP_LIBRARIES $FOUND"
+done
+
+echo "Creating Mesa OptionalPackage..."
+PLATFORM=$( uname -m )
+ZIP_FILENAME="../mesa-$MESA_VER-gcc$GCC_VER-x86.zip"
+zip -9 $ZIP_FILENAME $ZIP_HEADERS $ZIP_LIBRARIES
+
+echo "Great Success! $ZIP_FILENAME created."


Other related posts:

  • » [haiku-commits] haiku: hrev43644 - 3rdparty/mesa - kallisti5