From 10e9ddcf51fe63797ca5bac252e8d9cf77d80f96 Mon Sep 17 00:00:00 2001 From: Diego Nieto Cid Date: Sun, 3 Apr 2011 00:02:46 -0300 Subject: Depend on X11 for string to keysym mappings. * config.make.in (HAVE_X11,X11_CFLAGS,X11_LIBS,XKB_BASE): New variables. * configure.in: Check for x11 module. * console-client/Makefile (PC_KBD_SO_SRCS): Move XKB sources... * console-client/Makefile (XKB_SRCS): ... here. New variable. * console-client/Makefile (SRCS): Add $(XKB_SRCS). * console-client/Makefile (LCLHDRS): Add xkb/xkb.h. * console-client/Makefile (XKB_DATA_DIR): Removed variable. * console-client/Makefile (pc_kbd.so.$(hurd-version)): Use patsubst. Depend on XKB objects when HAVE_X11 = yes. * console-client/Makefile (install): Depend on XKB datafiles when HAVE_X11 = yes. * console-client/Makefile (pc-kbd-CFLAGS): Set variable when HAVE_X11 = yes * console-client/Makefile ($(XKB_DATA_DIR),$(XKB_DATA_DIR)/%): Replaced by... * console-client/Makefile[HAVE_X11=yes]($(XKB_BASE),$(XKB_BASE)/%): ... this targets. * console-client/Makefile[HAVE_X11=yes](pc_kbd-LDLIBS): New variable. * console-client/xkb/keysymdef.h: Removed file. * console-client/xkb/ks_tables.h: Likewise. * console-client/xkb/symname.c: Likewise. * console-client/xkb/xkb.c: Include . * console-client/xkb/compose.c: Likewise. * console-client/xkb/xkb.h: Remove XStringToKeysym prototype. Include . --- configure.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure.in b/configure.in index 1cf4daab..967e86c9 100644 --- a/configure.in +++ b/configure.in @@ -230,6 +230,21 @@ AC_MSG_RESULT($boot_store_types) # Check for ncursesw, which is needed for the console-curses client. hurd_LIB_NCURSESW +# Check for those Xorg modules needed for keyboard mappings. +PKG_CHECK_MODULES([X11], [x11 xproto], + [ have_x11=yes + pkg_failed=no + AC_MSG_CHECKING([for xkb base]) + _PKG_CONFIG([XKB_BASE], [variable=xkb_base], [xkeyboard-config]) + AS_IF([test $pkg_failed = no], + [XKB_BASE="$pkg_cv_XKB_BASE" + AC_MSG_RESULT([$XKB_BASE])], + [XKB_BASE="$datadir/X11/xkb" + AC_MSG_RESULT([(default) $XKB_BASE])]) + ], [have_x11=no]) +AC_SUBST([have_x11]) +AC_SUBST([XKB_BASE]) + if test -f ./$ac_unique_file; then # Configuring in source directory; don't create any Makefiles. makefiles= -- cgit v1.2.3 From d2af65efaaea156b7bf2b5c6f319f8ee92d991b8 Mon Sep 17 00:00:00 2001 From: Diego Nieto Cid Date: Mon, 11 Apr 2011 15:51:23 -0300 Subject: Disable XKB when either lex or yacc is missing. --- configure.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.in b/configure.in index 967e86c9..18216540 100644 --- a/configure.in +++ b/configure.in @@ -230,6 +230,12 @@ AC_MSG_RESULT($boot_store_types) # Check for ncursesw, which is needed for the console-curses client. hurd_LIB_NCURSESW +AC_PROG_LEX +AC_PROG_YACC +AS_IF([test "$LEX" = ":" -o "$YACC" = ":"], [ +have_x11=no +AC_MSG_WARN([lex or yacc is mising, XKB will be disabled.]) +],[ # Check for those Xorg modules needed for keyboard mappings. PKG_CHECK_MODULES([X11], [x11 xproto], [ have_x11=yes @@ -242,6 +248,7 @@ PKG_CHECK_MODULES([X11], [x11 xproto], [XKB_BASE="$datadir/X11/xkb" AC_MSG_RESULT([(default) $XKB_BASE])]) ], [have_x11=no]) +]) AC_SUBST([have_x11]) AC_SUBST([XKB_BASE]) -- cgit v1.2.3 From 555a202f0debbb1f9ac81bc449ba9084a6d847a2 Mon Sep 17 00:00:00 2001 From: Diego Nieto Cid Date: Sat, 16 Apr 2011 20:22:31 -0300 Subject: Find the absolute path to Specifying the header file relative to $(includeir) won't work because it is defined in terms of prefix variable which is redefined during installation to the destination directory. And the dependency check will fail during 'make install' because the header might not be in the destination tree. * config.make.in (X11_KEYSYMDEF_H, SED): New variables. * configure.in: Check for sed. Find X11/keysymdef.h absolute location using the preprocessor and save it in X11_KEYSYMDEF_H variable. * console-client/Makefile (kstoucs_map.c): Use X11_KEYSYMDEF_H to depend on the header file. --- configure.in | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/configure.in b/configure.in index 18216540..978de1e2 100644 --- a/configure.in +++ b/configure.in @@ -82,6 +82,7 @@ AC_SUBST(enable_static_progs) INSTALL="$SHELL $(readlink -f "$ac_install_sh")"\ -C || unset INSTALL] AC_PROG_INSTALL AC_PROG_AWK +AC_PROG_SED AC_PROG_CC # Require GCC. @@ -247,10 +248,28 @@ PKG_CHECK_MODULES([X11], [x11 xproto], AC_MSG_RESULT([$XKB_BASE])], [XKB_BASE="$datadir/X11/xkb" AC_MSG_RESULT([(default) $XKB_BASE])]) + + have_keysymdef_h=no + AC_CHECK_HEADER([X11/keysymdef.h], + [AC_MSG_CHECKING([for X11/keysymdef.h absolute location]) + AC_PREPROC_IFELSE([#include ], + [[X11_KEYSYMDEF_H=`$SED -n 's%^[^"]*"\([^"]*X11/keysymdef.h\)".*$%\1%p' conftest.i`] + # did the sed magic above work? + AS_IF([test -f "$X11_KEYSYMDEF_H"], + [have_keysymdef_h=yes], + [X11_KEYSYMDEF_H=not-found]) + ], + [X11_KEYSYMDEF_H=not-found]) + AC_MSG_RESULT([$X11_KEYSYMDEF_H]) + ]) + AS_IF([test $have_keysymdef_h = no], + [AC_MSG_WARN([X11/keysymdef.h was not found, XKB will be disabled.]) + have_x11=no]) ], [have_x11=no]) ]) AC_SUBST([have_x11]) AC_SUBST([XKB_BASE]) +AC_SUBST([X11_KEYSYMDEF_H]) if test -f ./$ac_unique_file; then # Configuring in source directory; don't create any Makefiles. -- cgit v1.2.3 From aa3c675d2be29968672fe076af4ed1e3c542f6dd Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 1 Jul 2012 21:33:00 +0000 Subject: Use path to x11 locales from x11.pc instead of our prefix * configure.in (X11_PREFIX): Define from x11.pc's prefix variable. * console-client/xkb/compose.c (get_compile_file_for_locale): Use X11_PREFIX "/share" instead of DATADIR. --- configure.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.in b/configure.in index 0891aecc..73598cfc 100644 --- a/configure.in +++ b/configure.in @@ -248,6 +248,13 @@ PKG_CHECK_MODULES([X11], [x11 xproto], AC_MSG_RESULT([$XKB_BASE])], [XKB_BASE="$datadir/X11/xkb" AC_MSG_RESULT([(default) $XKB_BASE])]) + AC_MSG_CHECKING([for X11 prefix]) + _PKG_CONFIG([X11_PREFIX], [variable=prefix], [x11]) + AS_IF([test $pkg_failed = no], + [X11_PREFIX="$pkg_cv_X11_PREFIX" + AC_MSG_RESULT([$X11_PREFIX])], + [X11_PREFIX="$prefix" + AC_MSG_RESULT([(default) $X11_PREFIX])]) have_keysymdef_h=no AC_CHECK_HEADER([X11/keysymdef.h], @@ -269,6 +276,7 @@ PKG_CHECK_MODULES([X11], [x11 xproto], ]) AC_SUBST([have_x11]) AC_SUBST([XKB_BASE]) +AC_DEFINE_UNQUOTED([X11_PREFIX], "$X11_PREFIX") AC_SUBST([X11_KEYSYMDEF_H]) # Check for Sun RPC headers and library. -- cgit v1.2.3