]> git.saurik.com Git - wxWidgets.git/commitdiff
added checks for Xxf86vmode
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 14 Dec 2003 22:46:22 +0000 (22:46 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 14 Dec 2003 22:46:22 +0000 (22:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure
configure.in
setup.h.in
src/unix/displayx11.cpp

index 618ad120319d866a5fd62bb0b5bf1e44fc9af56f..e9f23759ae7101d4a4ddad5cb58d4ea9be2b44ad 100755 (executable)
--- a/configure
+++ b/configure
@@ -26576,6 +26576,96 @@ for ac_dir in $SEARCH_LIB /usr/lib;
             GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXinerama"
             echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
+
+            echo "$as_me:$LINENO: checking for Xxf86vm extension" >&5
+echo $ECHO_N "checking for Xxf86vm extension... $ECHO_C" >&6
+
+ac_find_libraries=
+for ac_dir in $SEARCH_LIB /usr/lib;
+  do
+    for ac_extension in a so sl dylib; do
+      if test -f "$ac_dir/libXxf86vm.$ac_extension"; then
+        ac_find_libraries=$ac_dir
+        break 2
+      fi
+    done
+  done
+
+            if test "$ac_find_libraries" != "" ; then
+                echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+for ac_header in X11/extensions/xf86vmode.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+                                      #if HAVE_X11_XLIB_H
+                                        #include <X11/Xlib.h>
+                                      #endif
+
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+                                  GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm"
+
+fi
+
+done
+
+            else
+                echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+            fi
+
         else
             echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
index 9ec459aca036da87e8d89fa37b5a1114cf4e9a84..b74b7d8d1e44c652dc0ff16f44f31138823dafe5 100644 (file)
@@ -2968,6 +2968,25 @@ if test "$wxUSE_DISPLAY" = "yes"; then
             fi
             GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXinerama"
             AC_MSG_RESULT([yes])
+
+            AC_MSG_CHECKING([for Xxf86vm extension])
+            WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xxf86vm)
+            if test "$ac_find_libraries" != "" ; then
+                AC_MSG_RESULT([yes])
+                AC_CHECK_HEADERS([X11/extensions/xf86vmode.h],
+                                 [
+                                  GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm"
+                                 ],
+                                 [], 
+                                 [
+                                      #if HAVE_X11_XLIB_H
+                                        #include <X11/Xlib.h>
+                                      #endif
+                                 ])
+            else
+                AC_MSG_RESULT([no])
+            fi
+        
         else
             AC_MSG_RESULT([no])
             AC_MSG_WARN("*** Xinerama not found; disabling wxDisplay")
index 2b70d2484bc395f1882c722af1744691f8b8dcda..c31e5687be175c90d9f10abf7cca582fc5282e5c 100644 (file)
 /* Define if you have the <X11/XKBlib.h> header file.  */
 #undef HAVE_X11_XKBLIB_H
 
+/* Define if you have the <X11/extensions/xf86vmode.h> header file.  */
+#undef HAVE_X11_EXTENSIONS_XF86VMODE_H
+
 /* Define if you have the fnmatch() function */
 #undef HAVE_FNMATCH
 
index c19c2c2f60d4aea265dd7b038e3c1718357386ea..081a954c0201898c7ee5309131ba4dd0fe6d9527 100644 (file)
@@ -39,7 +39,9 @@ extern "C" {
   #include <X11/Xlib.h>
   #include <X11/Xlibint.h>
   #include <X11/extensions/Xinerama.h>
+#ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
   #include <X11/extensions/xf86vmode.h>
+#endif
 }
 
 class wxDisplayUnixPriv
@@ -150,6 +152,9 @@ wxString wxDisplay::GetName() const
   return wxEmptyString;
 }
 
+
+#ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
+
 //
 //  See (http://www.xfree86.org/4.2.0/XF86VidModeDeleteModeLine.3.html) for more
 //  info about xf86 video mode extensions
@@ -275,5 +280,27 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode)
     */
 }
 
-#endif /* wxUSE_DISPLAY */
 
+#else // !HAVE_X11_EXTENSIONS_XF86VMODE_H
+
+wxArrayVideoModes wxDisplay::GetModes(const wxVideoMode& mode) const
+{
+    // Not implemented
+    return wxArrayVideoModes();
+}
+
+wxVideoMode wxDisplay::GetCurrentMode() const
+{
+    // Not implemented
+    return wxVideoMode();
+}
+
+bool wxDisplay::ChangeMode(const wxVideoMode& mode)
+{
+    // Not implemented
+    return false;
+}
+
+#endif // !HAVE_X11_EXTENSIONS_XF86VMODE_H
+
+#endif /* wxUSE_DISPLAY */