summaryrefslogtreecommitdiffstats
path: root/unix/configure
diff options
context:
space:
mode:
authorstwo <stwo>2013-01-31 11:49:40 (GMT)
committerstwo <stwo>2013-01-31 11:49:40 (GMT)
commitf87865465eb042e0a72a84cffe3f1a9f60da99e6 (patch)
tree2b7a02eff512dc58baeb018bcc88c60535091845 /unix/configure
parentb759e66206f54d4053c05aa250fd24e14809407e (diff)
downloadtk-f87865465eb042e0a72a84cffe3f1a9f60da99e6.zip
tk-f87865465eb042e0a72a84cffe3f1a9f60da99e6.tar.gz
tk-f87865465eb042e0a72a84cffe3f1a9f60da99e6.tar.bz2
Bug [3599928]: Use XkbKeycodeToKeysym if available.
Diffstat (limited to 'unix/configure')
-rwxr-xr-xunix/configure157
1 files changed, 157 insertions, 0 deletions
diff --git a/unix/configure b/unix/configure
index 6cfff2a..c99f25e 100755
--- a/unix/configure
+++ b/unix/configure
@@ -10840,6 +10840,163 @@ _ACEOF
fi
#--------------------------------------------------------------------
+# Check for XkbKeycodeToKeysym.
+#--------------------------------------------------------------------
+
+if test $tk_aqua = no; then
+ tk_oldCFlags=$CFLAGS
+ tk_oldLibs=$LIBS
+ CFLAGS="$CFLAGS $XINCLUDES"
+ LIBS="$LIBS $XLIBSW"
+ echo "$as_me:$LINENO: checking for X11/XKBlib.h" >&5
+echo $ECHO_N "checking for X11/XKBlib.h... $ECHO_C" >&6
+if test "${ac_cv_header_X11_XKBlib_h+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. */
+#include <X11/Xlib.h>
+
+#include <X11/XKBlib.h>
+_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
+ ac_cv_header_X11_XKBlib_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_X11_XKBlib_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_X11_XKBlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_X11_XKBlib_h" >&6
+if test $ac_cv_header_X11_XKBlib_h = yes; then
+
+ xkblib_header_found=yes
+
+else
+
+ xkblib_header_found=no
+
+fi
+
+
+ if test $xkblib_header_found = "yes" ; then
+ echo "$as_me:$LINENO: checking for XkbKeycodeToKeysym in -lX11" >&5
+echo $ECHO_N "checking for XkbKeycodeToKeysym in -lX11... $ECHO_C" >&6
+if test "${ac_cv_lib_X11_XkbKeycodeToKeysym+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lX11 $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char XkbKeycodeToKeysym ();
+int
+main ()
+{
+XkbKeycodeToKeysym ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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_exeext'
+ { (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
+ ac_cv_lib_X11_XkbKeycodeToKeysym=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_X11_XkbKeycodeToKeysym=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5
+echo "${ECHO_T}$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6
+if test $ac_cv_lib_X11_XkbKeycodeToKeysym = yes; then
+
+ xkbkeycodetokeysym_found=yes
+
+else
+
+ xkbkeycodetokeysym_found=no
+
+fi
+
+ else
+ xkbkeycodetokeysym_found=no
+ fi
+ if test $xkbkeycodetokeysym_found = "yes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XKBKEYCODETOKEYSYM 1
+_ACEOF
+
+ fi
+ CFLAGS=$tk_oldCFlags
+ LIBS=$tk_oldLibs
+fi
+
+#--------------------------------------------------------------------
# XXX Do this last.
# It might modify XLIBSW which could affect other tests.
#