Skip to content

Commit

Permalink
OpenGL Kit: Use GLU-9.0 for gcc2 and gcc4
Browse files Browse the repository at this point in the history
 * 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
  • Loading branch information
kallisti5 committed Nov 13, 2012
1 parent 344b321 commit fb7f48a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
27 changes: 26 additions & 1 deletion build/jam/OptionalBuildFeatures
Expand Up @@ -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 ;
Expand All @@ -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)
Expand All @@ -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)" ;
}
Expand Down
5 changes: 5 additions & 0 deletions src/kits/opengl/Jamfile
Expand Up @@ -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 ] ;
Expand All @@ -41,6 +43,9 @@ if $(HAIKU_GCC_VERSION[1]) < 3 {


SharedLibrary libGL.so : $(sources) :
# GLU
$(HAIKU_GLU_LIBS)

# Glut
<opengl>glut.o

Expand Down
3 changes: 3 additions & 0 deletions src/libs/glut/Jamfile
Expand Up @@ -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) ;
Expand Down

0 comments on commit fb7f48a

Please sign in to comment.