[Xquartz-dev] X11 vs freeglut 2.6.0-rc1

William Davis frstan at bellsouth.net
Sat Apr 25 23:53:12 PDT 2009


Jeremy, could this have something to do with my inability to build  
Mesa 7.4_1? see trac #19143
WSD
On Apr 26, 2009, at 1:47 AM, Jeremy Huddleston wrote:

> That is an "interesting" issue... I'm guessing that freeglut test  
> probably has something like:
>
> #ifdef __APPLE__
> #define PFNGLGENBUFFERSPROC ...
> ...
> #endif
>
> That's because Apple's OpenGL.framework doesn't use the same naming  
> convention for the OpenGL function pointer types as Mesa/Windows  
> does.  We exist in an awkward state bridging the two... in order to  
> be as compatible as possible at the source level, I decided to  
> support both conventions.
>
> It looks like the freeglut test tried to be too clever for its own  
> good...
>
> On 04/25/2009 08:22 PM, Jack Howarth wrote:
>>
>> On Sat, Apr 25, 2009 at 11:03:03PM -0400, Jack Howarth wrote:
>>
>>>    While attempting to build some test packaging for
>>> the new freeglut 2.6.0-rc1 release on Intel Darwin,
>>> I discovered that their build fails in the freeglut
>>> demo programs with the error...
>>>
>>> Making all in smooth_opengl3
>>> gcc -DHAVE_CONFIG_H -I. -I../../..   -I/sw/include -I../../../ 
>>> include -I/usr/X11R6/include -O3 -DTARGET_HOST_POSIX_X11 -c -o  
>>> smooth_opengl3-smooth_opengl3.o `test -f 'smooth_opengl3.c' ||  
>>> echo './'`smooth_opengl3.c
>>> smooth_opengl3.c:101: error: redefinition of typedef  
>>> 'PFNGLGENBUFFERSPROC'
>>> /usr/X11R6/include/GL/gl.h:1884: error: previous declaration of  
>>> 'PFNGLGENBUFFERSPROC' was here
>>> smooth_opengl3.c:104: error: redefinition of typedef  
>>> 'PFNGLBINDBUFFERPROC'
>>> /usr/X11R6/include/GL/gl.h:1882: error: previous declaration of  
>>> 'PFNGLBINDBUFFERPROC' was here
>>> smooth_opengl3.c:107: error: redefinition of typedef  
>>> 'PFNGLBUFFERDATAPROC'
>>> /usr/X11R6/include/GL/gl.h:1886: error: previous declaration of  
>>> 'PFNGLBUFFERDATAPROC' was here
>>> smooth_opengl3.c:110: error: redefinition of typedef  
>>> 'PFNGLCREATESHADERPROC'
>>> /usr/X11R6/include/GL/gl.h:1939: error: previous declaration of  
>>> 'PFNGLCREATESHADERPROC' was here
>>> smooth_opengl3.c:113: error: redefinition of typedef  
>>> 'PFNGLSHADERSOURCEPROC'
>>> /usr/X11R6/include/GL/gl.h:1940: error: previous declaration of  
>>> 'PFNGLSHADERSOURCEPROC' was here
>>> smooth_opengl3.c:116: error: redefinition of typedef  
>>> 'PFNGLCOMPILESHADERPROC'
>>> /usr/X11R6/include/GL/gl.h:1941: error: previous declaration of  
>>> 'PFNGLCOMPILESHADERPROC' was here
>>> smooth_opengl3.c:119: error: redefinition of typedef  
>>> 'PFNGLCREATEPROGRAMPROC'
>>> /usr/X11R6/include/GL/gl.h:1942: error: previous declaration of  
>>> 'PFNGLCREATEPROGRAMPROC' was here
>>> smooth_opengl3.c:122: error: redefinition of typedef  
>>> 'PFNGLATTACHSHADERPROC'
>>> /usr/X11R6/include/GL/gl.h:1943: error: previous declaration of  
>>> 'PFNGLATTACHSHADERPROC' was here
>>> smooth_opengl3.c:125: error: redefinition of typedef  
>>> 'PFNGLLINKPROGRAMPROC'
>>> /usr/X11R6/include/GL/gl.h:1944: error: previous declaration of  
>>> 'PFNGLLINKPROGRAMPROC' was here
>>> smooth_opengl3.c:128: error: redefinition of typedef  
>>> 'PFNGLUSEPROGRAMPROC'
>>> /usr/X11R6/include/GL/gl.h:1945: error: previous declaration of  
>>> 'PFNGLUSEPROGRAMPROC' was here
>>> smooth_opengl3.c:131: error: redefinition of typedef  
>>> 'PFNGLGETSHADERIVPROC'
>>> /usr/X11R6/include/GL/gl.h:1969: error: previous declaration of  
>>> 'PFNGLGETSHADERIVPROC' was here
>>> smooth_opengl3.c:134: error: redefinition of typedef  
>>> 'PFNGLGETSHADERINFOLOGPROC'
>>> /usr/X11R6/include/GL/gl.h:1972: error: previous declaration of  
>>> 'PFNGLGETSHADERINFOLOGPROC' was here
>>> smooth_opengl3.c:137: error: redefinition of typedef  
>>> 'PFNGLGETPROGRAMIVPROC'
>>> /usr/X11R6/include/GL/gl.h:1970: error: previous declaration of  
>>> 'PFNGLGETPROGRAMIVPROC' was here
>>> smooth_opengl3.c:140: error: redefinition of typedef  
>>> 'PFNGLGETPROGRAMINFOLOGPROC'
>>> /usr/X11R6/include/GL/gl.h:1973: error: previous declaration of  
>>> 'PFNGLGETPROGRAMINFOLOGPROC' was here
>>> smooth_opengl3.c:143: error: redefinition of typedef  
>>> 'PFNGLGETATTRIBLOCATIONPROC'
>>> /usr/X11R6/include/GL/gl.h:1981: error: previous declaration of  
>>> 'PFNGLGETATTRIBLOCATIONPROC' was here
>>> smooth_opengl3.c:146: error: redefinition of typedef  
>>> 'PFNGLVERTEXATTRIBPOINTERPROC'
>>> /usr/X11R6/include/GL/gl.h:1930: error: previous declaration of  
>>> 'PFNGLVERTEXATTRIBPOINTERPROC' was here
>>> smooth_opengl3.c:149: error: redefinition of typedef  
>>> 'PFNGLENABLEVERTEXATTRIBARRAYPROC'
>>> /usr/X11R6/include/GL/gl.h:1931: error: previous declaration of  
>>> 'PFNGLENABLEVERTEXATTRIBARRAYPROC' was here
>>> smooth_opengl3.c:152: error: redefinition of typedef  
>>> 'PFNGLGETUNIFORMLOCATIONPROC'
>>> /usr/X11R6/include/GL/gl.h:1974: error: previous declaration of  
>>> 'PFNGLGETUNIFORMLOCATIONPROC' was here
>>> smooth_opengl3.c:155: error: redefinition of typedef  
>>> 'PFNGLUNIFORMMATRIX4FVPROC'
>>> /usr/X11R6/include/GL/gl.h:1966: error: previous declaration of  
>>> 'PFNGLUNIFORMMATRIX4FVPROC' was here
>>> smooth_opengl3.c: In function 'main':
>>> smooth_opengl3.c:425: error: 'GLUT_FORWARD_COMPATIBLE' undeclared  
>>> (first use in this function)
>>> smooth_opengl3.c:425: error: (Each undeclared identifier is  
>>> reported only once
>>> smooth_opengl3.c:425: error: for each function it appears in.)
>>> smooth_opengl3.c:425: error: 'GLUT_DEBUG' undeclared (first use in  
>>> this function)
>>> make[4]: *** [smooth_opengl3-smooth_opengl3.o] Error 1
>>> make[3]: *** [all-recursive] Error 1
>>> make[2]: *** [all-recursive] Error 1
>>> make[1]: *** [all-recursive] Error 1
>>>
>>> This appears to be coming from the definitions that exist in our  
>>> gl.h. These definitions don't exist in the
>>> gl.h of Fedora 10 but are in glext.h instead. I noticed we have  
>>> the comment...
>>>
>>> /* The following macros exist to address conflicts between the  
>>> names given to
>>>  * function pointers by the MESA API and OpenGL.framework's API.
>>>  */
>>>
>>> We should probably make the freeglut developers aware of this  
>>> issue so we don't have to
>>> heavily patch the freeglut 2.6.0 release. Any particular comments  
>>> on this?
>>>                         Jack
>>>
>>
>> Disabling the problem demo, I am able to completely build the  
>> freeglut 2.6.0-rc1 under
>> fink unstable and it appears to run all the pre-existing binaries  
>> without issue as drop
>> in replacement for 2.4.0. I have no issues with pymol, molmol or  
>> ccpnmr built against
>> fink's freeglut. If anyone is interested, here is the freeglut.info  
>> file I used in
>> fink unstable...
>>
>> Package: freeglut
>> Version: 2.6.0
>> Revision: 0rc1
>> Maintainer: Jack Howarth <howarth at bromo.med.uc.edu>
>> Source: mirror:sourceforge:freeglut/%N-%v-rc1.tar.gz
>> Source-MD5: b1a8107f99b5d953e8418a5409462294
>> SourceDirectory: %n-%v
>> Depends: %N-shlibs (= %v-%r)
>> BuildDepends: fink (>= 0.24.12), x11-dev
>> Conflicts: glut, openglut
>> Replaces: glut, openglut
>> ConfigureParams: --disable-replace-glut --disable-warnings -- 
>> disable-dependency-tracking --x-includes=/usr/X11R6/include --x- 
>> libraries=/usr/X11R6/lib RANLIB='ranlib -c' --build=%m-apple- 
>> darwin`uname -r|cut -f1 -d.` --host=%m-apple-darwin`uname -r|cut - 
>> f1 -d.`
>> SetCFLAGS: -O3 -DTARGET_HOST_POSIX_X11
>> SetLDFLAGS: -Wl,-dylib_file,/System/Library/Frameworks/ 
>> OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/ 
>> Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
>> PatchScript: <<
>>   perl -pi -e 's/hardcode_direct=yes/hardcode_direct=no/g' configure
>>   perl -pi -e 's/ smooth_opengl3//g' ./progs/demos/Makefile.in
>> <<
>> DocFiles: AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
>> BuildDependsOnly: True
>> InstallScript: <<
>> make install DESTDIR=%d
>> ln -s libfreeglut.3.dylib %i/lib/libglut.dylib
>> ln -s libfreeglut.a %i/lib/libglut.a
>> ln -s libfreeglut.la %i/lib/libglut.la
>> ln -s freeglut.h %i/include/GL/glut.h
>> ln -s freeglut_ext.h %i/include/GL/glut_ext.h
>> ln -s freeglut_std.h %i/include/GL/glut_std.h
>> <<
>> SplitOff: <<
>>  Package: %N-shlibs
>>  Depends: libgl, x11
>>  Files: lib/libfreeglut.3.9.0.dylib lib/libfreeglut.3.dylib
>>  Shlibs: %p/lib/libfreeglut.3.dylib 13.0.0 %n (>= 2.6.0-Orc1)
>>  DocFiles: AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
>> <<
>> Description: Opengl utility toolkit
>> DescDetail: <<
>> Freeglut is a completely OpenSourced alternative to the OpenGL  
>> Utility
>> Toolkit (GLUT) library released under the X-Consortium license. The
>> original GLUT library seems to have been abandoned with the most  
>> recent
>> version (3.7) dating back to August 1998. Its license does not allow
>> anyone to distribute modified library code. Freeglut is actively
>> developed and doesn't suffer the license restrictions. The goal is
>> to gradually depreciate the current glut package out of fink  
>> replacing
>> it with freeglut.
>> <<
>> DescPackaging: <<
>> This package is NOT binary compatible with glut/glut-shlibs and can  
>> not
>> replace for them. Packages that wish to use freeglut as a replacement
>> for glut cannot have "BuildDepends: glut|freeglut" and "Depends:
>> glut-shlibs|freeglut-shlibs" in their info file, but need to pick one
>> self-consistently.
>>
>> This package builds the freeglut libraries named as freeglut rather  
>> than
>> glut to allow the co-existance with glut since the shared library  
>> versioning
>> is identical. I have adopted the use of symlinks for the libraries  
>> and
>> headers to allow freeglut to used as a drop in replace for glut  
>> without
>> requiring changes in the source code of programs which require glut.
>>
>> Patch fixes crash in flightgear (taken from RH's Fedora 7 package).
>> <<
>> License: OSI-Approved
>> Homepage: http://freeglut.sourceforge.net/
>>
>> _______________________________________________
>> Xquartz-dev mailing list
>> Xquartz-dev at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/xquartz-dev
>>
>
> _______________________________________________
> Xquartz-dev mailing list
> Xquartz-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/xquartz-dev



William Davis
frstanATbellsouthDOTnet
Mac OS X.5.6 Darwin 9.5.0
XQuartz 2.3.3_rc5 (xorg-server 1.4.2-apple41)
Mac Mini Intel Duo @ 1.86 GHz

Mundus vult decepi, ego non

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/xquartz-dev/attachments/20090426/5be44c6a/attachment-0001.html>


More information about the Xquartz-dev mailing list