Browse files

Possible fix for bad X11 tests on OSX 10.8

  • Loading branch information...
1 parent fd24cc0 commit 4142ee7e0027ce2217012cfdc1f13980910b1518 Edward Rosten committed Nov 27, 2013
Showing with 46 additions and 0 deletions.
  1. +29 −0 configure
  2. +17 −0 configure.in
View
29 configure
@@ -6675,11 +6675,40 @@ fi
if test "$host_vendor" == apple
then
+ save_LIBS="$LIBS"
+
LIBS="$LIBS -framework OpenGL /usr/X11R6/lib/libX11.dylib /usr/X11R6/lib/libGLU.dylib /usr/X11R6/lib/libGL.dylib"
# all of the following is already covered in the framework
# AC_CHECK_LIB(GL,glDrawPixels, [], [a=1])
# AC_CHECK_HEADERS(GL/glu.h, [], [a=1])
# AC_CHECK_LIB(GLU,gluGetString, [], [a=1])
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 using dubious methods..." >&5
+$as_echo_n "checking for X11 using dubious methods...... " >&6; }
+
+ a=0
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+ int main()
+ {
+ XOpenDisplay(NULL);
+ }
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; a=1
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ if test x$a == x1
+ then
+ LIBS="$save_LIBS"
+ fi
+
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
View
17 configure.in
@@ -567,11 +567,28 @@ CHECK_FOR_OPTION(videodisplay,[
if test "$host_vendor" == apple
then
+ save_LIBS="$LIBS"
+
APPEND(LIBS, [ -framework OpenGL /usr/X11R6/lib/libX11.dylib /usr/X11R6/lib/libGLU.dylib /usr/X11R6/lib/libGL.dylib])
# all of the following is already covered in the framework
# AC_CHECK_LIB(GL,glDrawPixels, [], [a=1])
# AC_CHECK_HEADERS(GL/glu.h, [], [a=1])
# AC_CHECK_LIB(GLU,gluGetString, [], [a=1])
+
+ AC_MSG_CHECKING([for X11 using dubious methods...])
+
+ a=0
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <X11/Xlib.h>
+ int main()
+ {
+ XOpenDisplay(NULL);
+ }])], [AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no); a=1])
+
+ if test x$a == x1
+ then
+ LIBS="$save_LIBS"
+ fi
+
else
AC_PATH_X

0 comments on commit 4142ee7

Please sign in to comment.