From 505c8ccdb3c1c59eb14b019c4386d1a0b10224b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 14 Dec 2003 22:46:22 +0000 Subject: [PATCH] added checks for Xxf86vmode git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 90 +++++++++++++++++++++++++++++++++++++++++ configure.in | 19 +++++++++ setup.h.in | 3 ++ src/unix/displayx11.cpp | 29 ++++++++++++- 4 files changed, 140 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 618ad12031..e9f23759ae 100755 --- 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 + #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 diff --git a/configure.in b/configure.in index 9ec459aca0..b74b7d8d1e 100644 --- a/configure.in +++ b/configure.in @@ -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 + #endif + ]) + else + AC_MSG_RESULT([no]) + fi + else AC_MSG_RESULT([no]) AC_MSG_WARN("*** Xinerama not found; disabling wxDisplay") diff --git a/setup.h.in b/setup.h.in index 2b70d2484b..c31e5687be 100644 --- a/setup.h.in +++ b/setup.h.in @@ -1116,6 +1116,9 @@ /* Define if you have the header file. */ #undef HAVE_X11_XKBLIB_H +/* Define if you have the header file. */ +#undef HAVE_X11_EXTENSIONS_XF86VMODE_H + /* Define if you have the fnmatch() function */ #undef HAVE_FNMATCH diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index c19c2c2f60..081a954c02 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -39,7 +39,9 @@ extern "C" { #include #include #include +#ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H #include +#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 */ -- 2.45.2