From 6acc54191fb8ef5e1ad526bf420e0aedd4f153c5 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 2 May 2010 19:16:38 +0000 Subject: [PATCH] * fixes OpenGL on Haiku, resolves #16385, by Olivier Coursiere git-svn-id: trunk@15207 - --- packages/opengl/Makefile | 34 +++++++++++++++++++++++++++++++--- packages/opengl/Makefile.fpc | 1 + packages/opengl/src/gl.pp | 4 ++++ packages/opengl/src/glu.pp | 4 ++++ packages/opengl/src/glut.pp | 4 ++++ 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/packages/opengl/Makefile b/packages/opengl/Makefile index def60be587..b259f61d51 100644 --- a/packages/opengl/Makefile +++ b/packages/opengl/Makefile @@ -1,8 +1,8 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/12/10] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/05/02] # default: all -MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux +MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux BSDs = freebsd netbsd openbsd darwin UNIXs = linux $(BSDs) solaris qnx haiku LIMIT83fs = go32v2 os2 emx watcom @@ -285,7 +285,7 @@ ifeq ($(FULL_TARGET),i386-beos) override TARGET_UNITS+=gl glu glut endif ifeq ($(FULL_TARGET),i386-haiku) -override TARGET_UNITS+=gl glu glut +override TARGET_UNITS+=gl glu glut glext endif ifeq ($(FULL_TARGET),i386-netbsd) override TARGET_UNITS+=gl glu glut glx glext @@ -326,6 +326,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) override TARGET_UNITS+=gl glu glut endif +ifeq ($(FULL_TARGET),i386-nativent) +override TARGET_UNITS+=gl glu glut +endif ifeq ($(FULL_TARGET),m68k-linux) override TARGET_UNITS+=gl glu glut glx glext endif @@ -506,6 +509,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) override TARGET_EXAMPLEDIRS+=examples endif +ifeq ($(FULL_TARGET),i386-nativent) +override TARGET_EXAMPLEDIRS+=examples +endif ifeq ($(FULL_TARGET),m68k-linux) override TARGET_EXAMPLEDIRS+=examples endif @@ -687,6 +693,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) override COMPILER_INCLUDEDIR+=src endif +ifeq ($(FULL_TARGET),i386-nativent) +override COMPILER_INCLUDEDIR+=src +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_INCLUDEDIR+=src endif @@ -867,6 +876,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) override COMPILER_SOURCEDIR+=src tests examples endif +ifeq ($(FULL_TARGET),i386-nativent) +override COMPILER_SOURCEDIR+=src tests examples +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_SOURCEDIR+=src tests examples endif @@ -1360,6 +1372,10 @@ ifeq ($(OS_TARGET),symbian) SHAREDLIBEXT=.dll SHORTSUFFIX=symbian endif +ifeq ($(OS_TARGET),NativeNT) +SHAREDLIBEXT=.dll +SHORTSUFFIX=nativent +endif else ifeq ($(OS_TARGET),go32v1) PPUEXT=.pp1 @@ -1850,6 +1866,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) REQUIRE_PACKAGES_RTL=1 endif +ifeq ($(FULL_TARGET),i386-nativent) +REQUIRE_PACKAGES_RTL=1 +endif ifeq ($(FULL_TARGET),m68k-linux) REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_X11=1 @@ -2464,6 +2483,9 @@ fpc_zipdistinstall: ifdef EXEFILES override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES)) endif +ifdef CLEAN_PROGRAMS +override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS))) +endif ifdef CLEAN_UNITS override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS)) endif @@ -2510,6 +2532,9 @@ endif ifdef CLEANRSTFILES -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES)) endif +endif +ifdef CLEAN_FILES + -$(DEL) $(CLEAN_FILES) endif -$(DELTREE) units -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT) @@ -2693,6 +2718,9 @@ endif ifeq ($(FULL_TARGET),i386-symbian) TARGET_EXAMPLEDIRS_EXAMPLES=1 endif +ifeq ($(FULL_TARGET),i386-nativent) +TARGET_EXAMPLEDIRS_EXAMPLES=1 +endif ifeq ($(FULL_TARGET),m68k-linux) TARGET_EXAMPLEDIRS_EXAMPLES=1 endif diff --git a/packages/opengl/Makefile.fpc b/packages/opengl/Makefile.fpc index e1b6c53c44..e23a461e0d 100644 --- a/packages/opengl/Makefile.fpc +++ b/packages/opengl/Makefile.fpc @@ -16,6 +16,7 @@ packages_darwin=x11 [target] units=gl glu glut units_win32=glext +units_haiku=glext units_linux=glx glext units_freebsd=glx glext units_netbsd=glx glext diff --git a/packages/opengl/src/gl.pp b/packages/opengl/src/gl.pp index edcc998b2d..2cded51638 100644 --- a/packages/opengl/src/gl.pp +++ b/packages/opengl/src/gl.pp @@ -2334,7 +2334,11 @@ initialization {$IFDEF MorphOS} InitTinyGLLibrary; {$ELSE} + {$ifdef haiku} + LoadOpenGL('libGL.so'); + {$else} LoadOpenGL('libGL.so.1'); + {$endif} {$ENDIF} {$endif} {$ENDIF} diff --git a/packages/opengl/src/glu.pp b/packages/opengl/src/glu.pp index 8d51dd1a12..542d97d431 100644 --- a/packages/opengl/src/glu.pp +++ b/packages/opengl/src/glu.pp @@ -570,10 +570,14 @@ initialization {$ifdef darwin} LoadGLu('/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib'); {$else} + {$IFDEF haiku} + LoadGLu('libGLU.so'); + {$ELSE} {$ifndef MorphOS} LoadGLu('libGLU.so.1'); {$endif} {$ENDIF} + {$ENDIF} {$endif} finalization diff --git a/packages/opengl/src/glut.pp b/packages/opengl/src/glut.pp index f4abb24967..db39ae5e57 100644 --- a/packages/opengl/src/glut.pp +++ b/packages/opengl/src/glut.pp @@ -2089,9 +2089,13 @@ initialization {$ifdef darwin} LoadGlut('/System/Library/Frameworks/GLUT.framework/GLUT'); {$else} + {$IFDEF haiku} + LoadGlut('libglut.so'); + {$ELSE} {$IFNDEF MORPHOS} LoadGlut('libglut.so.3'); {$ENDIF} + {$ENDIF} {$endif} {$ENDIF}