Alexandre Julliard : configure: Improve the check for the GLU library.

Alexandre Julliard julliard at winehq.org
Thu May 1 06:39:32 CDT 2008


Module: wine
Branch: master
Commit: ad79873527df8be77e0df812af51795320eca8da
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ad79873527df8be77e0df812af51795320eca8da

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu May  1 13:29:02 2008 +0200

configure: Improve the check for the GLU library.

---

 configure           |   61 +++++++++++++++++++++++++++++++++++++++-----------
 configure.ac        |   17 ++++++++------
 dlls/opengl32/wgl.c |    6 ++--
 include/config.h.in |    3 ++
 4 files changed, 63 insertions(+), 24 deletions(-)

diff --git a/configure b/configure
index 2f1f1ca..b732efd 100755
--- a/configure
+++ b/configure
@@ -1388,6 +1388,7 @@ Optional Packages:
   --without-esd           do not use the EsounD sound support
   --without-fontconfig    do not use fontconfig
   --without-gphoto        do not use gphoto (Digital Camera support)
+  --without-glu           do not use the GLU library
   --without-hal           do not use HAL (dynamic device support)
   --without-jack          do not use the Jack sound support
   --without-jpeg          do not use JPEG
@@ -1972,6 +1973,12 @@ if test "${with_gphoto+set}" = set; then
 fi
 
 
+# Check whether --with-glu was given.
+if test "${with_glu+set}" = set; then
+  withval=$with_glu; if test "x$withval" = "xno"; then ac_cv_header_GL_glu_h=no; fi
+fi
+
+
 # Check whether --with-hal was given.
 if test "${with_hal+set}" = set; then
   withval=$with_hal;
@@ -11089,15 +11096,16 @@ _ACEOF
 
 fi
 
-
-	        		{ echo "$as_me:$LINENO: checking for gluLookAt in -lGLU" >&5
-echo $ECHO_N "checking for gluLookAt in -lGLU... $ECHO_C" >&6; }
-if test "${ac_cv_lib_GLU_gluLookAt+set}" = set; then
+                 if test "$ac_cv_header_GL_glu_h" = "yes"
+                 then
+                    { echo "$as_me:$LINENO: checking for -lGLU" >&5
+echo $ECHO_N "checking for -lGLU... $ECHO_C" >&6; }
+if test "${ac_cv_lib_soname_GLU+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
+  ac_check_soname_save_LIBS=$LIBS
 LIBS="-lGLU $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11137,24 +11145,49 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_GLU_gluLookAt=yes
+  case "$LIBEXT" in
+    dll) ;;
+    dylib) ac_cv_lib_soname_GLU=`otool -L conftest$ac_exeext | grep "libGLU\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libGLU\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+    *) ac_cv_lib_soname_GLU=`$ac_cv_path_LDD conftest$ac_exeext | grep "libGLU\\.$LIBEXT" | sed -e "s/^.*\(libGLU\.$LIBEXT[^	 ]*\).*$/\1/"';2,$d'` ;;
+  esac
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_GLU_gluLookAt=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  LIBS=$ac_check_soname_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluLookAt" >&5
-echo "${ECHO_T}$ac_cv_lib_GLU_gluLookAt" >&6; }
-if test $ac_cv_lib_GLU_gluLookAt = yes; then
-  OPENGL_LIBS="$OPENGL_LIBS -lGLU"
-			     GLU32FILES='$(GLU32FILES)'
+if test "x$ac_cv_lib_soname_GLU" = "x"; then
+  { echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6; }
 
+else
+  { echo "$as_me:$LINENO: result: $ac_cv_lib_soname_GLU" >&5
+echo "${ECHO_T}$ac_cv_lib_soname_GLU" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define SONAME_LIBGLU "$ac_cv_lib_soname_GLU"
+_ACEOF
+
+       OPENGL_LIBS="$OPENGL_LIBS -lGLU"
+                                                     GLU32FILES='$(GLU32FILES)'
+fi
+
+                 fi
+                 if test "x$ac_cv_lib_soname_GLU" = "x"; then
+  case "x$with_glu" in
+  x)   wine_notices="$wine_notices|libGLU development files not found, GLU won't be supported." ;;
+  xno) ;;
+  *)   { { echo "$as_me:$LINENO: error: libGLU development files not found, GLU won't be supported.
+This is an error since --with-glu was requested." >&5
+echo "$as_me: error: libGLU development files not found, GLU won't be supported.
+This is an error since --with-glu was requested." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
 fi
 
              else
diff --git a/configure.ac b/configure.ac
index e38f5e7..946fa94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,8 @@ AC_ARG_WITH(esd,       AS_HELP_STRING([--without-esd],[do not use the EsounD sou
 AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]),
             [if test "x$withval" = "xno"; then ac_cv_header_fontconfig_fontconfig_h=no; fi])
 AC_ARG_WITH(gphoto,    AS_HELP_STRING([--without-gphoto],[do not use gphoto (Digital Camera support)]))
+AC_ARG_WITH(glu,       AS_HELP_STRING([--without-glu],[do not use the GLU library]),
+            [if test "x$withval" = "xno"; then ac_cv_header_GL_glu_h=no; fi])
 AC_ARG_WITH(hal,       AS_HELP_STRING([--without-hal],[do not use HAL (dynamic device support)]))
 AC_ARG_WITH(jack,      AS_HELP_STRING([--without-jack],[do not use the Jack sound support]),
             [if test "x$withval" = "xno"; then ac_cv_header_jack_jack_h=no; fi])
@@ -742,13 +744,14 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c
 	                            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.
-		AC_CHECK_LIB(GLU,gluLookAt,
-			     [OPENGL_LIBS="$OPENGL_LIBS -lGLU"
-			     GLU32FILES='$(GLU32FILES)']
-			     ,,
-			     $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
+                 if test "$ac_cv_header_GL_glu_h" = "yes"
+                 then
+                    WINE_CHECK_SONAME(GLU,gluLookAt,[OPENGL_LIBS="$OPENGL_LIBS -lGLU"
+                                                     GLU32FILES='$(GLU32FILES)'],,
+                                      [$OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS])
+                 fi
+                 WINE_NOTICE_WITH(glu,[test "x$ac_cv_lib_soname_GLU" = "x"],
+                                 [libGLU development files not found, GLU won't be supported.])
              else
                  opengl_msg="Old Mesa headers detected. Consider upgrading your Mesa libraries."
 	     fi
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 6944f37..2e3d118 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -313,7 +313,7 @@ BOOL WINAPI wglSwapLayerBuffers(HDC hdc,
   return TRUE;
 }
 
-#ifdef HAVE_GL_GLU_H
+#ifdef SONAME_LIBGLU
 
 static void fixed_to_double(POINTFX fixed, UINT em_size, GLdouble vertex[3])
 {
@@ -503,7 +503,7 @@ error_in_list:
 
 }
 
-#else /* HAVE_GL_GLU_H */
+#else /* SONAME_LIBGLU */
 
 static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
                                       DWORD first,
@@ -519,7 +519,7 @@ static BOOL WINAPI wglUseFontOutlines_common(HDC hdc,
     return FALSE;
 }
 
-#endif /* HAVE_GL_GLU_H */
+#endif /* SONAME_LIBGLU */
 
 /***********************************************************************
  *		wglUseFontOutlinesA (OPENGL32.@)
diff --git a/include/config.h.in b/include/config.h.in
index e384f96..d956790 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -1035,6 +1035,9 @@
 /* Define to the soname of the libGL library. */
 #undef SONAME_LIBGL
 
+/* Define to the soname of the libGLU library. */
+#undef SONAME_LIBGLU
+
 /* Define to the soname of the libhal library. */
 #undef SONAME_LIBHAL
 




More information about the wine-cvs mailing list