Work around an Xcode 3.0 bug when detecting the libGL library.

Francois Gouget fgouget at codeweavers.com
Tue Dec 18 03:17:20 CST 2007


---

When using Xcode 3.0 we get an error when trying to link with libGL. 
This is a known Xcode 3.0 issue but I'm not sure if it will be fixed in 
future releases or how soon. The documented workaround is to add a 
-dylib_file option to the link command. For more details, see near the 
bottom of this page:

http://developer.apple.com/releasenotes/DeveloperTools/RN-Id/index.html

So I have cooked up a patch to Wine's configure script detect the 
condition and automatically work around it as documented. I don't know 
if this is suitable for inclusion or if a better workaround should be 
found (or maybe we should just suffer in silence until a newer Xcode 
fixes the issue).

Autoconf needs to be re-run after applying this patch.


 configure.ac |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 492d363..18769cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -651,14 +651,19 @@ Wine will be built without XComposite support. (winex11.drv)])
 			     [OPENGL_LIBS="-lGL"
                              OPENGLFILES='$(OPENGLFILES)'
                              AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])],
-                             [if test -f /usr/X11R6/lib/libGL.a
-                              then
-                                  WINE_WARNING([/usr/X11R6/lib/libGL.a is present on your system.
+                             [WINE_CHECK_SONAME(GL,glXCreateContext,
+				    [OPENGL_LIBS="-Xlinker -dylib_file -Xlinker /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -lGL"
+	                            OPENGLFILES='$(OPENGLFILES)'
+	                            AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])],
+				    [if test -f /usr/X11R6/lib/libGL.a
+	                            then
+        	                        WINE_WARNING([/usr/X11R6/lib/libGL.a is present on your system.
 This probably prevents linking to OpenGL. Try deleting the file and restarting configure.])
-                              else
-                                  WINE_WARNING([No OpenGL library found on this system.
+	                            else
+	                                WINE_WARNING([No OpenGL library found on this system.
 Wine will be built without OpenGL or Direct3D support.])
-                              fi],
+	                            fi],
+				    $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib)],
 			     $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
 
 	        dnl Check for GLU32 library.
-- 
1.5.3.4




More information about the wine-patches mailing list