From fb7f48a9eb354097fdf34a456d47bc6e4fe5f7db Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 13 Nov 2012 10:52:06 -0600 Subject: [PATCH] OpenGL Kit: Use GLU-9.0 for gcc2 and gcc4 * As of Mesa3D 9.0+, GLU is a seperate project * Our in-tree GLUT builds with GLU-9.0 without modification. * We ignore the GLU libraries that Mesa-7.8.2 and Mesa-8.1-devel provide and use the glu-9.0 ones * This is kind of a limbo state, but works for now. * Eventually we will be on Mesa 9.0 (which requires the external GLU) and Mesa 7.8.2 (which works with the newer external GLU) and will rip GLU out of the 7.8.2 OptionalBuildPackage. * I don't *think* we are using the Mesa GLU headers... we will know for sure when I pull'em out of the OptionalBuildPackages :D --- build/jam/OptionalBuildFeatures | 27 ++++++++++++++++++++++++++- src/kits/opengl/Jamfile | 5 +++++ src/libs/glut/Jamfile | 3 +++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index 31227844e45..ca0097acf98 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -180,6 +180,29 @@ if $(HAIKU_BUILD_FEATURE_CLUCENE) { } +# GLU (GL Utilities) +if $(TARGET_ARCH) = x86 { + if $(HAIKU_GCC_VERSION[1]) >= 4 { + HAIKU_GLU_FILE = glu-9.0-x86-gcc4-2012-11-13.zip ; + } else { + HAIKU_GLU_FILE = glu-9.0-x86-gcc2-2012-11-13.zip ; + } + + local zipFile = [ DownloadFile $(HAIKU_GLU_FILE) + : $(baseURL)/lib/$(HAIKU_GLU_FILE) ] ; + + HAIKU_GLU_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) + $(HAIKU_GLU_FILE:B) ] ; + HAIKU_GLU_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_GLU_DIR) + : develop/headers/os/opengl/GL : $(zipFile) : extracted-glu-headers ] ; + HAIKU_GLU_LIBS = [ ExtractArchive $(HAIKU_GLU_DIR) + : system/lib/libGLU.a : $(zipFile) : extracted-glu ] ; + HAIKU_GLU_HEADERS = [ FDirName $(HAIKU_GLU_DIR) develop headers os opengl ] ; +} else { + Echo "GLU not yet available on $(TARGET_ARCH)" ; +} + + # Mesa if $(TARGET_ARCH) = x86 { local glslObject ; @@ -205,7 +228,6 @@ if $(TARGET_ARCH) = x86 { HAIKU_MESA_LIBS = [ ExtractArchive $(HAIKU_MESA_DIR) : - lib.haiku/libglu.a $(galliumObjects) lib.haiku/libglapi.a $(glslObject) @@ -215,6 +237,9 @@ if $(TARGET_ARCH) = x86 { HAIKU_MESA_HEADERS = [ FDirName $(HAIKU_MESA_DIR) include ] ; + Depends $(HAIKU_MESA_HEADERS_DEPENDENCY) : $(HAIKU_GLU_HEADERS_DEPENDENCY) ; + Depends $(HAIKU_MESA_LIBS) : $(HAIKU_GLU_LIBS) ; + } else { Echo "Mesa 3D rendering support not available on $(TARGET_ARCH)" ; } diff --git a/src/kits/opengl/Jamfile b/src/kits/opengl/Jamfile index ca1347d7174..009ff9fe103 100644 --- a/src/kits/opengl/Jamfile +++ b/src/kits/opengl/Jamfile @@ -19,7 +19,9 @@ if $(TARGET_PLATFORM) != haiku { } +SubDirSysHdrs $(HAIKU_GLU_HEADERS) ; SubDirSysHdrs $(HAIKU_MESA_HEADERS) ; +Includes [ FGristFiles $(sources) ] : $(HAIKU_GLU_HEADERS_DEPENDENCY) ; Includes [ FGristFiles $(sources) ] : $(HAIKU_MESA_HEADERS_DEPENDENCY) ; UseHeaders [ FDirName $(HAIKU_MESA_DIR) include ] ; @@ -41,6 +43,9 @@ if $(HAIKU_GCC_VERSION[1]) < 3 { SharedLibrary libGL.so : $(sources) : + # GLU + $(HAIKU_GLU_LIBS) + # Glut glut.o diff --git a/src/libs/glut/Jamfile b/src/libs/glut/Jamfile index 62a275550eb..cb380e8fb17 100644 --- a/src/libs/glut/Jamfile +++ b/src/libs/glut/Jamfile @@ -55,6 +55,9 @@ if $(HAIKU_GCC_VERSION[1]) < 3 { } +# Ensure GLU dependency is met +Includes [ FGristFiles $(sourcesCc) $(sourcesCpp) ] + : $(HAIKU_GLU_HEADERS_DEPENDENCY) ; # Ensure Mesa dependency is met Includes [ FGristFiles $(sourcesCc) $(sourcesCpp) ] : $(HAIKU_MESA_HEADERS_DEPENDENCY) ;