diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/aclocal.m4 libxkbcommon-0.1.0~git20120510.409ec8a1/aclocal.m4 --- libxkbcommon-0.1.0~git20120501.3d672fcf/aclocal.m4 2012-05-01 18:29:09.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/aclocal.m4 2012-05-10 10:11:15.000000000 +0000 @@ -20,8612 +20,6 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -]) - -# serial 57 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl -dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -_LT_OUTPUT_LIBTOOL_INIT -]) - -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2011 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test $[#] != 0 -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -_LT_COPYING -_LT_LIBTOOL_TAGS - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_REPLACE_SHELLFNS - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Go], [_LT_LANG(GO)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -m4_ifndef([AC_PROG_GO], [ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_GO. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -m4_defun([AC_PROG_GO], -[AC_LANG_PUSH(Go)dnl -AC_ARG_VAR([GOC], [Go compiler command])dnl -AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl -_AC_ARG_VAR_LDFLAGS()dnl -AC_CHECK_TOOL(GOC, gccgo) -if test -z "$GOC"; then - if test -n "$ac_tool_prefix"; then - AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) - fi -fi -if test -z "$GOC"; then - AC_CHECK_PROG(GOC, gccgo, gccgo, false) -fi -])#m4_defun -])#m4_ifndef - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([AC_PROG_GO], - [LT_LANG(GO)], - [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi]) - - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" - ]) - - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES([TAG]) -# --------------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], - [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# Allow to override them for all tags through lt_cv_aix_libpath. -m4_defun([_LT_SYS_MODULE_PATH_AIX], -[m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi],[]) - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi -])# _LT_SYS_MODULE_PATH_AIX - - -# _LT_SHELL_INIT(ARG) -# ------------------- -m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -case "$ECHO" in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac - -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) - -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_WITH_SYSROOT -# ---------------- -AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([${with_sysroot}]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac - - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" -])# _LT_ENABLE_LOCK - - -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cru} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - -# _LT_CMD_OLD_ARCHIVE -# ------------------- -m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[[4-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[23]].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[[3-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program which can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program which can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[[]] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_LT_DECL([global_symbol_to_c_name_address_lib_prefix], - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], - [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([], [nm_file_list_spec], [1], - [Specify filename containing input files for $NM]) -]) # _LT_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ F* | *Sun*Fortran*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Intel*\ [[CF]]*Compiler*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - *Portland\ Group*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - case $host_os in - aix[[4-9]]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - _LT_TAGVAR(link_all_deplibs, $1)=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], - [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], - [lt_cv_irix_exported_symbol=yes], - [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report which library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC="$lt_save_CC" -])# _LT_LANG_C_CONFIG - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - LT_PATH_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - gnu*) - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -AC_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -AC_REQUIRE([_LT_DECL_SED]) -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF -package foo -func foo() { -} -_LT_EOF -]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[case $host_os in -interix[[3-9]]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${F77-"f77"} - CFLAGS=$FFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes - -AC_LANG_POP -])# _LT_LANG_F77_CONFIG - - -# _LT_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_GO_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Go compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GO_CONFIG], -[AC_REQUIRE([LT_PROG_GO])dnl -AC_LANG_SAVE - -# Source file extension for Go test sources. -ac_ext=go - -# Object file extension for compiled Go test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="package main; func main() { }" - -# Code to be used in simple link tests -lt_simple_link_test_code='package main; func main() { }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GOC-"gccgo"} -CFLAGS=$GOFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# Go did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GO_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -CFLAGS= -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_GO -# ---------- -AC_DEFUN([LT_PROG_GO], -[AC_CHECK_TOOL(GOC, gccgo,) -]) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) - - -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) - - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) - - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) - - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi - -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) - - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) - -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine which file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS - -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 7 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - ]) -])# _LT_SET_OPTIONS - - - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) - -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) - -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# @configure_input@ - -# serial 3337 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.4.2]) -m4_define([LT_PACKAGE_REVISION], [1.3337]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2' -macro_revision='1.3337' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) - -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 5 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) - # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # @@ -11685,3 +3079,8 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/autogen.sh libxkbcommon-0.1.0~git20120510.409ec8a1/autogen.sh --- libxkbcommon-0.1.0~git20120501.3d672fcf/autogen.sh 2012-05-01 18:28:54.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/autogen.sh 2012-05-10 10:10:26.000000000 +0000 @@ -6,7 +6,7 @@ ORIGDIR=`pwd` cd "$srcdir" -autoreconf -v --install || exit 1 +autoreconf --verbose --install --symlink --warnings=all || exit 1 cd "$ORIGDIR" || exit $? exec "$srcdir/configure" --enable-maintainer-mode "$@" diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/ChangeLog libxkbcommon-0.1.0~git20120510.409ec8a1/ChangeLog --- libxkbcommon-0.1.0~git20120501.3d672fcf/ChangeLog 2012-05-01 18:29:12.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/ChangeLog 2012-05-10 10:11:17.000000000 +0000 @@ -1,9 +1,1045 @@ -commit b27dc50618604fea88950275f36a2fd2f3d437bd +commit d7a3c5eeec1ec551d3223c67b14cb6e8aed546ee Author: Rico Tzschichholz -Date: Tue May 1 20:28:59 2012 +0200 +Date: Thu May 10 12:10:26 2012 +0200 Add debian tree from origin/debian-experimental +commit 409ec8a12ef54f3eea704a8234e4cd26928bf87e +Author: Ran Benita +Date: Wed Apr 11 02:02:45 2012 +0300 + + Merge src/alloc.c and src/malloc.c + + The two files do exactly the same sort of things, without any discernible + reason for splitting them. + + Signed-off-by: Ran Benita + + [daniels: Updated for xkb_desc -> xkb_keymap changes.] + +commit aff531fb4db5bb5ae266b55e1f81abb939e4d059 +Author: Ran Benita +Date: Wed Apr 11 02:28:57 2012 +0300 + + Remove unused stuff from xkbrules.h + + Signed-off-by: Ran Benita + +commit 62a75dc17994933caa1bba42ccf8d1c78f07a373 +Author: Ran Benita +Date: Tue Apr 10 23:08:49 2012 +0300 + + Remove unused stuff from XKBcommonint.h + + Signed-off-by: Ran Benita + +commit 12b3495ddfbd69b2b785f26c51dbe78876c9dc00 +Author: Ran Benita +Date: Wed Apr 11 01:55:50 2012 +0300 + + Remove unused 'which' and 'merge' arguments + + Signed-off-by: Ran Benita + + [daniels: Updated for xkb_desc -> xkb_keymap changes.] + +commit 793908a046d3e5f32f670b891c85d371b6198e83 +Author: Ran Benita +Date: Wed Apr 11 19:58:03 2012 +0300 + + Remove unused 'compiled' field in XkbFile + + Signed-off-by: Ran Benita + +commit 5fb494eca960f790c18623e28b9587d43ebeeae4 +Author: Ran Benita +Date: Wed Apr 11 14:13:24 2012 +0300 + + Remove unused debugging function + + Signed-off-by: Ran Benita + +commit afa34f3d2f94d93292a70c18ff8eba44f19fbfb6 +Author: Ran Benita +Date: Wed Apr 11 02:10:35 2012 +0300 + + Remove unused function XkbcNameMatchesPattern + + Because the function is recursive, the compiler didn't say anything, eh. + + Signed-off-by: Ran Benita + +commit 522be162b274897f9cb9d682312b150b27daa6ff +Author: Ran Benita +Date: Tue Apr 10 22:04:05 2012 +0300 + + Use LT_INIT instead of deprecated AC_PROG_LIBTOOL + + And add some warnings to the autoreconf step, for the developers to + see. + + Signed-off-by: Ran Benita + +commit a641a1859b862b1324983a5e2ef8666c29539f87 +Author: Ran Benita +Date: Fri Apr 6 03:38:55 2012 +0300 + + Use stdbool.h + + 'Cause defining your own True and False is so 1990's. + + Signed-off-by: Ran Benita + + [daniels: Fixed for xkb_desc -> xkb_keymap changes.] + +commit a39ed85f5600f5f8b15decb5d16931c91ed0a7a1 +Author: Ran Benita +Date: Thu Apr 5 11:24:39 2012 +0300 + + Fix formatting in xkbcomp headers + + Signed-off-by: Ran Benita + + [daniels: Fixed for xkb_desc -> xkb_keymap change.] + +commit 1f81c0e163553deced177225952c17378dcf7c44 +Author: Daniel Stone +Date: Thu Apr 26 16:02:49 2012 +0200 + + Dump include paths when we can't find rules + + Since the most common failure mode here is a failure to properly set the + XKB data path, dump the include path so people at least have a clue + where to look. + + Signed-off-by: Daniel Stone + +commit a1c08536a5b2a2a053d28bc45e603dde3a1cddd3 +Author: Alan Coopersmith +Date: Thu Apr 26 13:49:00 2012 +0200 + + Include strings.h in XKBcommonint.h for strcasecmp etc + + POSIX specifies that these functions require , but we were + only including . It did work, but still. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Daniel Stone + +commit 4b49e0a117efe652c97afdd585ab899e0a6b9189 +Author: Ran Benita +Date: Sat Mar 31 02:44:39 2012 +0300 + + Overhaul test suite + + Rewrite all of the current tests in the following ways: + - Instead of the current mix of C and shell, just use single-process + pure C file per test. All of the .sh files are removed, but everything + that was tested is ported. + - Instead of handling the test logs ourselves, use Automake's + "parallel-test" mechanism. This will create a single log file for each + test with it's stdout+stderr, and a top level "test-suite.log" file + for all the failed tests. + - The "parallel-tests" directive also makes the test run in parallel, + so "make check" runs faster. + - Also use the "color-tests" directive to have the "make check" output + colorized. Who doesn't like to see PASS in green? + - All of the test data files are moved into the test/data subdirectory. + That way we can just put the directory in EXTRA_DIST and forget about + it. + - The test/Makefile.am file is consolidated into the main Makefile.am, + for a completely non-recursive build. + + Right now the tests are completely independent and just use simple + assert()'s. More sophistication can be added as needed. + + It should also be noted that it's still possible to use shell, python, + etc. if a test wants more flexibility than C can provide, just do as + before. + + Signed-off-by: Ran Benita + + [daniels: Updated for xkb_keymap changes.] + +commit b1e49ff98058e5999cb503ec79ce7223485caac4 +Author: Ran Benita +Date: Fri Apr 6 04:33:43 2012 +0300 + + Reformat actionHandler dispatch table + + Signed-off-by: Ran Benita + +commit 1b9635dfb51f78783d6c11d10773b998236d4ce8 +Author: Ran Benita +Date: Sun Apr 8 02:08:37 2012 +0300 + + Add xkb_state_get_map() + + This is very useful because it avoids redundent pointers in structs + and/or parameter passing in the application. + + Signed-off-by: Ran Benita + +commit 8fbd44fde6c54e5f646e619e51a6e846e3c6f95b +Author: Ran Benita +Date: Fri Apr 6 03:12:50 2012 +0300 + + Implicitly include config.h in all files + + The definitions in config.h should be available in all files an + implementation detail; it can be included through the build system + instead of having each file pull it every time. + + This is especially helpful with AC_USE_SYSTEM_EXTENSIONS, as _GNU_SOURCE + and friends can have an effect by merely being defined, which can lead + to some confusion if its effective for only half the files. + + And we don't really support a build _without_ config.h; so, one less + thing to worry about. + + Signed-off-by: Ran Benita + +commit 5df53e494423cecff14d3773405b4d2d28130485 +Author: Ran Benita +Date: Thu Apr 5 10:52:47 2012 +0300 + + Remove xproto and kbproto from pkg-config file + + These are no longer needed for using the library, only building it. Most + users would still want xproto though, for the keysym definitions. + + Signed-off-by: Ran Benita + +commit 18e6a6a43e4e4711eedc149875c064f3582948a7 +Author: Ran Benita +Date: Thu Apr 5 10:47:43 2012 +0300 + + Remove Xfuncproto.h and XKB.h from xkbcommon/xkbcommon.h + + The kbproto header is already not needed here anymore. + + Move the _X_EXPORT's to the corresponding function definitions, and use + straight extern "C" clauses instead of _XFUNCPROTOBEGIN/END. + + It also makes more sense to have the EXPORT's in the source files, as it + provides some documentation to the reader, whereas in the header it's + obvious. + + Signed-off-by: Ran Benita + + [daniels: Updated for xkb_keymap changes.] + +commit 073a21076c44aecb5439ce3cf884b3c04079d14c +Author: Ran Benita +Date: Sun Apr 8 15:40:12 2012 +0300 + + Constify the syms_out argument to xkb_key_get_syms() + + The caller should not mess around with these as they come directly from + our internal structs. + + Signed-off-by: Ran Benita + +commit 467d7bb64eb8e77304fc6c91f612ec7b8036e475 +Author: Ran Benita +Date: Thu Apr 5 10:13:24 2012 +0300 + + Implement missing xkb_state_ref and add return value + + xkb_state_ref was missing. + + Also modify the _ref functions to return the object instead of being + void. This is a useful idiom: + + struct my_object my_object_new(struct xkb_state *state) + { + [...] + my_object->state = xkb_state_ref(state); + [...] + } + + Essentially "taking" a reference, such that you don't forget to + increment it and it's one line less (see example in our own code). + + A case could also be made for _unref to return the object or NULL, but + this is quite uncommon. + + Signed-off-by: Ran Benita + + [daniels: Updated for xkb_keymap changes.] + +commit b08629f92b20a470cfd11ad03fe4d9085a2612d2 +Author: Ran Benita +Date: Fri Apr 6 05:09:17 2012 +0300 + + Do not enable yacc trace facility unconditionally + + Define DEBUG and set yydebug if you want that. + + Signed-off-by: Ran Benita + +commit 913e0740cbfc64cb60927f7f11fb0220b568d3bf +Author: Ran Benita +Date: Sat Mar 31 01:18:55 2012 +0300 + + Constify a global table and function arguments + + Signed-off-by: Ran Benita + +commit d116aaef9fc2e8014685fee21bc42c0de227313e +Author: Ran Benita +Date: Fri Apr 6 05:02:35 2012 +0300 + + Remove unused struct definition + + Signed-off-by: Ran Benita + +commit 28011e71ad4e9ecd9cc309237feff69762b56579 +Author: Ran Benita +Date: Fri Apr 6 04:20:35 2012 +0300 + + Replace remaining use of Atom instead of xkb_atom_t + + Signed-off-by: Ran Benita + +commit e9537d50d0239c8444de74f85ff063e629242c67 +Author: Ran Benita +Date: Sun Apr 8 20:58:39 2012 +0300 + + Fix possible overflow in scanner + + Also reduce the size of scanBuf given that it's allocated on the stack, + and 1024 is enough. + + Signed-off-by: Ran Benita + +commit 8feba630fa7a4b720c42a9b5b4e4280b0e17a500 +Author: Ran Benita +Date: Sun Apr 8 18:46:58 2012 +0300 + + Fix KeyInfo's syms array size calculation + + When merging group info from two KeyInfo's, the new size of the keysym + array was off. Fix it to match how it is used a few lines below. + + There are also some peripheral fixes, and some comments (took me a + few minutes to get what's going on). + + Signed-off-by: Ran Benita + +commit 518debb3bc0db2cb8036144ddfc22b81cfbb6f83 +Author: Ran Benita +Date: Sun Apr 8 15:38:04 2012 +0300 + + Set xorg-macros CFLAGS correctly + + A previous commit messed up all warning flags. Oops. + + Signed-off-by: Ran Benita + +commit 2590b5a15d9f685dacce79d8d4bc23906008036b +Author: Ran Benita +Date: Sun Apr 8 15:37:36 2012 +0300 + + Fix compiler warnings + + (They were not reported, see next commit). + The reset function declaration didn't match its name in the definition; + the _defaults variant matches better with the rest. + + Signed-off-by: Ran Benita + + [daniels: Updated to current master.] + +commit d007cd0a1f3f4b9c927175771ff79aae6fe4ab8b +Author: Daniel Stone +Date: Tue Apr 3 17:08:57 2012 +0100 + + Unconstify xkb_rules_names + + Since we never return an xkb_rules_names and it's all user-provided + strings, seems a bit harsh to have it const. + + Signed-off-by: Daniel Stone + +commit ef88c7efabf98ea1fcee29e026f96b3f31b94521 +Author: Daniel Stone +Date: Tue Apr 3 15:14:16 2012 +0100 + + Rename xkb_desc to xkb_keymap + + struct xkb_desc was just a hangover from the old XkbDescRec, which isn't + a very descriptive name. + + Signed-off-by: Daniel Stone + +commit bc872252f35bbb688b02f5ba5c5991ace2e6ef76 +Author: Daniel Stone +Date: Tue Apr 3 14:29:57 2012 +0100 + + Use xorg CFLAGS and fix AC_USE_SYSTEM_EXTENSIONS + + autotools was warning that AC_USE_SYSTEM_EXTENSIONS was being called too + late, so move it earlier. Also shove BASE_CFLAGS into CFLAGS so we get + all the added warning flags from xorg. + + Signed-off-by: Daniel Stone + +commit 632d9f0336a3fb0721fbecc34b67e15d0ddbc69b +Author: Daniel Stone +Date: Tue Apr 3 14:26:04 2012 +0100 + + Eliminate remaining gcc warnings + + Various one-liners (mostly removing unused variables) to make the code + safe for the full set of warnings used by the xorg macros. + + On Debian-based systems, flex generates incorrect code resulting in two + warnings about yy_getcolumn and yy_setcolumn having no previous + declaration despite being non-static. Fedora carries a patch to fix + this, and a bug has been filed on Debian's flex to add the patch: + http://bugs.debian.org/667027 + + Aside from this, it's now safe for --enable-strict-compilation. + + Signed-off-by: Daniel Stone + +commit 495d87b06d19380e22ca100b7e48a7c8ef5dea39 +Author: Daniel Stone +Date: Tue Apr 3 13:57:44 2012 +0100 + + Don't parse nonsense Unicode/hex keycodes + + If a keysym was specified as "U1039andsomeextrastuffontheend", return + NoSymbol rather than 0x10001039; similarly, return NoSymbol for + "0xdeadbeefhitherehowsyourdaybeen" rather than 0xdeadbeef. + + Signed-off-by: Daniel Stone + +commit 151fb4fc6dfcecb1abef53bb02d51c6057998de9 +Author: Daniel Stone +Date: Tue Apr 3 13:47:08 2012 +0100 + + Remove unused device_spec + + Signed-off-by: Daniel Stone + +commit f249919ec66d0d9b9997e0b7d5cdbd491322cf9e +Author: Daniel Stone +Date: Tue Apr 3 13:44:21 2012 +0100 + + include resets group compatibility modifiers #43091 + + This change makes sure that include does not overwrite previous + compatibility modifier settings when the included files does not + explicitly specify them. + + Signed-off-by: Andreas Wettstein + Reviewed-by: Daniel Stone + + [Cross-picked from xkbcomp commit 14470719.] + +commit 0002b8524cccafc8096d80398c5d46c2785dc5d8 +Author: Daniel Stone +Date: Tue Apr 3 13:01:10 2012 +0100 + + Add cscope output to .gitignore + + Signed-off-by: Daniel Stone + +commit 69111405b0ca02d79238f05979f11cf5f0e02686 +Author: Daniel Stone +Date: Tue Apr 3 12:48:05 2012 +0100 + + Properly document xkb_key_get_syms + + Signed-off-by: Daniel Stone + +commit aeaa623d27b18339cab42aa52e4c10acb8ff87a8 +Author: Ran Benita +Date: Sat Mar 31 01:18:55 2012 +0300 + + Constify a global table + + Signed-off-by: Ran Benita + +commit c83043b3c125dbe769ab09f9111deca5e3b33931 +Author: Ran Benita +Date: Sat Mar 31 01:26:15 2012 +0300 + + Make temporary fix for stale xkb_atoms + + When xkb_free_keymap is called the atoms are all free'd, but action.c + keeps a global copy of interned "true" and "false", which remains stale. + + The correct fix is to remove the need for the ActionsInit function + entirely. + + Signed-off-by: Ran Benita + +commit 3c9493795b3b632298921e6399d67b15e052f655 +Author: Ran Benita +Date: Sat Mar 31 00:02:12 2012 +0300 + + Fix bugs to allow multiple keymaps in one process + + These were several initializations that were forgotten in the previous + memory leak fixes. + + Now several xkb_desc's can coexist (relatively) peacefully. + + Signed-off-by: Ran Benita + + [daniels: Only the atom.c is relevant with the new context API.] + +commit ffb610c943154afdcaad949e7b0db93fd9047b2b +Author: Ran Benita +Date: Sat Mar 31 02:26:24 2012 +0300 + + Remove useless check from xkb_intern_atom + + The "makeit" variable is always true. Remove it and de-indent. + (Also change the type of the "len" variable to size_t to avoid some + useless casting). + + Signed-off-by: Ran Benita + +commit 7a7ec9b14a11a986cd91a4faab6af7f4367a3a16 +Author: Ran Benita +Date: Sat Mar 31 02:30:33 2012 +0300 + + Avoid leak in CompileKeymap error path + + The NULL check is unneeded, and prevented the atoms from being free'd. + + Signed-off-by: Ran Benita + + [daniels: Updated for xkb_map_unref.] + +commit 5c5f7fcb7c35a46efd05e840e593871538242b78 +Author: Ran Benita +Date: Sun Apr 1 16:48:34 2012 +0300 + + makekeys: use correct format strings + + The new glibc (2.15) appear to cause trouble, particularly the sscanf + call, where makekeys will output empty hash tables. Using the appropriate + macros from inttypes.h makes it work again. + + Signed-off-by: Ran Benita + +commit 84ec6b61a76a753f72eecec825fd0736d5b0070c +Author: Ran Benita +Date: Sun Apr 1 16:51:48 2012 +0300 + + Add a NULL check before before strcmp'ing + + The names array can have NULL entries for some virtual modifier indexes. + + Signed-off-by: Ran Benita + +commit 9813778e732180407adb44766cc42fa4fe610f6a +Author: Ran Benita +Date: Sun Apr 1 16:57:31 2012 +0300 + + makekeys: free strings before exiting + + Just to make valgrind happy. + + Signed-off-by: Ran Benita + +commit 8f2c9597ba5617d28857bdd8ffeeea7167c72467 +Author: Ran Benita +Date: Sun Apr 1 17:56:17 2012 +0300 + + Use straight strtok_r instead of wrapper + + strtok_r is POSIX-2001 and should be fine. + + Signed-off-by: Ran Benita + +commit fb606b06a9aedd668f233ab7915b831625b46328 +Author: Ran Benita +Date: Sun Apr 1 17:07:56 2012 +0300 + + Avoid use of partly initialized VModInfo in error path + + Such as: + + Compiling path: ./test/data/bad.xkb mapName: + ==1300== Conditional jump or move depends on uninitialised value(s) + ==1300== at 0x4E46166: HandleVModDef (vmod.c:90) + ==1300== by 0x4E3FEC9: HandleKeyTypesFile (keytypes.c:1035) + ==1300== by 0x4E3FBE1: HandleIncludeKeyTypes.constprop.11 (keytypes.c:387) + ==1300== by 0x4E401DD: HandleKeyTypesFile (keytypes.c:1022) + ==1300== by 0x4E3FBE1: HandleIncludeKeyTypes.constprop.11 (keytypes.c:387) + ==1300== by 0x4E401DD: HandleKeyTypesFile (keytypes.c:1022) + ==1300== by 0x4E4026F: CompileKeyTypes (keytypes.c:1150) + ==1300== by 0x4E3DF9B: CompileKeymap (keymap.c:169) + ==1300== by 0x4E465E9: compile_keymap (xkbcomp.c:205) + ==1300== by 0x4E46BE4: xkb_compile_keymap_from_file (xkbcomp.c:290) + ==1300== by 0x400B37: test_file (filecomp.c:47) + ==1300== by 0x4008E3: main (filecomp.c:90) + ==1300== Uninitialised value was created by a stack allocation + ==1300== at 0x4E3FB3F: HandleIncludeKeyTypes.constprop.11 (keytypes.c:366) + + Signed-off-by: Ran Benita + +commit cc5588c65b504c8815e3fc56bec90b6d9ae3db24 +Author: Daniel Stone +Date: Thu Mar 29 17:39:11 2012 +0100 + + Fail gracefully on failure to find component include + + If we can't find the component of the include file we're looking for, + make sure we don't return success when we meant failure, segfault, or + spectacularly leak everything. + + Tested with incorrect component includes for keycodes, compat, symbols, + and types. + + Signed-off-by: Daniel Stone + Reported-by: David Herrmann + +commit 9b14e0c311ca5f0ab7017e058fc9a34b0e5e04b2 +Author: Daniel Stone +Date: Thu Mar 29 17:38:44 2012 +0100 + + Tests: Release context on failure to build keymap + + No practical effect since they exit(1) regardless, but it keeps valgrind + happy. + + Signed-off-by: Daniel Stone + +commit 93ce9c7d4f797f38e1799b68f5da77358da27a31 +Author: Daniel Stone +Date: Thu Mar 29 16:31:09 2012 +0100 + + Full support for multiple keysyms per level + + Which also involved moving the global symbol map to be per-key instead; + this should probably be split out into a separate commit. + + Signed-off-by: Daniel Stone + +commit 9cdc1990fa5cf1de7d36de2e659ad7548d4e6a72 +Author: Daniel Stone +Date: Thu Mar 29 01:57:06 2012 +0100 + + Parsing support for multiple keysyms per entry + + Instead of allowing only one keysym per level per group, do as the + external API indicates and allow multiples. The existing syntax is: + key { [ q, Q ] }; + where the new syntax is: + key { [ q, Q, { H, E, L, L, O }, + { Y, E, S, space, T, H, I, S, space, I, S, space, D, O, G } }; + + to make the key in the extreme top left of the keyboard do pretty + surprising things in levels 3 and 4. + + Signed-off-by: Daniel Stone + +commit 36b8771e1f21bf464d89cab7db8fd03002397ee3 +Author: Daniel Stone +Date: Thu Mar 29 01:49:55 2012 +0100 + + Don't leak strings in merge declarations + + Introduced by the reentrant scanner commit. + + Signed-off-by: Daniel Stone + +commit aa9f2bf98ddc4d38408596159512c46f0e331409 +Author: Daniel Stone +Date: Thu Mar 29 01:41:40 2012 +0100 + + Don't leak include_paths in context + + Signed-off-by: Daniel Stone + +commit 6628cf0bed4b323d07b430bfe84daacc11a547a6 +Author: Daniel Stone +Date: Wed Mar 28 19:50:45 2012 +0100 + + Remove unused rtrnValue declaration + + Signed-off-by: Daniel Stone + +commit bb6ca7682c933404d2fd27c58f4838d8b271f93f +Author: Ran Benita +Date: Tue Mar 27 22:41:22 2012 +0100 + + Make parser and scanner reentrant + + All global state is removed from the parser and scanner. + This makes use of the standard facilities in Bison and Flex for + reentrant/pure scanner/lexer and location tracking. + + Signed-off-by: Ran Benita + + [daniels: Updated to current sources.] + +commit 034ffce66437592856497e605cb0943d5dbaf82c +Author: Daniel Stone +Date: Tue Mar 27 17:22:35 2012 +0100 + + Use xkb_contexts in keymap compilation + + Primarily for the include path, but also for the logging in future. + + Signed-off-by: Daniel Stone + +commit 3e9dd7512c16dd752830d9fd56d9f4cba76ee7d3 +Author: Daniel Stone +Date: Tue Mar 27 16:59:01 2012 +0100 + + Add new context API + + Signed-off-by: Daniel Stone + +commit f0cb4ee2191b097cb44370a37259b39e54f23e00 +Author: Daniel Stone +Date: Tue Mar 27 16:15:06 2012 +0100 + + Update xkb_filter_group_lock_func for xkb_key_direction + + Signed-off-by: Daniel Stone + +commit 21f1bff4af64428b7767120be6621b75a374d21b +Author: Daniel Stone +Date: Tue Mar 27 15:51:28 2012 +0100 + + Fix distcheck with non-recursive Makefiles + + Signed-off-by: Daniel Stone + +commit bc8bbf50dc911ad3073af389f54b54200cee4a91 +Author: Daniel Stone +Date: Tue Mar 27 15:50:59 2012 +0100 + + Fix build for X11 modifier masks + + Exposed by include path changes, oops. + + Signed-off-by: Daniel Stone + +commit 3fa7fdd0895a38528a91ae00d24360c8a185b783 +Author: Ran Benita +Date: Fri Mar 23 17:50:37 2012 +0200 + + Handle group lock actions + + The spec is simple here, as this action has no effect on key releases. + + Signed-off-by: Ran Benita + +commit b5efe41f190cbb76eb1ca8ddf0c96990ddb83704 +Author: Ran Benita +Date: Sat Mar 24 04:48:31 2012 +0200 + + Make build non-recursive + + Unify all the different Makefile.am into a single short top level one + (the test/Makefile.am file is left intact though). + + This makes the build system simpler to look and should encourage + unifying more currently-disparate code. + + Some further motivation can be found in this page: + http://www.flameeyes.eu/autotools-mythbuster/automake/nonrecursive.html + + Signed-off-by: Ran Benita + +commit 602e87805bdb829dfc0867b1466e2b1dc729ab52 +Author: Ran Benita +Date: Sat Mar 24 13:27:48 2012 +0200 + + Define our own NoSymbol value and use it + + Since we have our own xkb_keysym_t type, it makes sense to have our own + NoSymbol value instead of the one from X11/X.h. + + Signed-off-by: Ran Benita + +commit d3908b631c531aa3721d91297badad1c85e3c4f1 +Author: Ran Benita +Date: Sat Mar 24 12:33:28 2012 +0200 + + Define our own None atom value + + Since we define our own xkb_atom_t type, it makes sense not to use the + X11/X.h None value. This way we can also remove a lot of X11 includes. + + Signed-off-by: Ran Benita + +commit 2165e16ed925616f2e3760ae9b41a8a076b22f5e +Author: Ran Benita +Date: Sat Mar 24 02:36:11 2012 +0200 + + Fix all -Wsign-compare warnings + + i.e comparison of signed and unsigned values. These are mostly + harmless but fixing them allows to compile cleanly with -Wextra. + + Signed-off-by: Ran Benita + +commit 813ddf255d076efe65c953ff5dc6521839ab052b +Author: Ran Benita +Date: Sat Mar 24 00:29:33 2012 +0200 + + Silence -Wcast-qual warnings + + There are some cases where we must free a string with a const qualifier. + Add a macro UNCONSTIFY to trick the compiler into silencing the warning + in the cases where we know what we're doing. + + Signed-off-by: Ran Benita + +commit f08ce9b71b08e8db846780b7187124da53ba1c3c +Author: Ran Benita +Date: Sat Mar 24 00:26:12 2012 +0200 + + Use strcasecmp consistently instead of uStrCaseCmp + + There's no use calling the same thing by a different name. + + Signed-off-by: Ran Benita + +commit 3104a8ef181622805f39eba608523eec51591944 +Author: Ran Benita +Date: Sat Mar 24 00:12:08 2012 +0200 + + Move utility macro from XKBcommonint.h to utils.h + + And merge all the similar ones into the same name. + The u* prefix is chosen over the _Xkb prefix because it has more uses + throughout the codebase. But It should now be simple to choose a nice + prefix and stay consistent. + + Signed-off-by: Ran Benita + [daniels: fixed for the case where we have strcasecmp] + +commit 2a5f641657033e0ed1d4d9e712296e1e76bcaf6d +Author: Ran Benita +Date: Fri Mar 23 23:56:44 2012 +0200 + + Remove some more useless stuff + + Some unused defines and geometry-removal leftovers (specifically the + file geom.c and the struct for the keyboard coordinates). + + Signed-off-by: Ran Benita + +commit 861b0c79c40786c5384adba208f353003b291849 +Author: Ran Benita +Date: Fri Mar 23 23:47:26 2012 +0200 + + Rewrite recalloc to the correct type + + The recalloc function should be expressed in terms of bytes to match its + name. However uTypedRecalloc retains its type so nothing is changed. + + Signed-off-by: Ran Benita + +commit 0480f427adcc745c139841a23c80d15a3d44f4db +Author: Ran Benita +Date: Fri Mar 23 23:28:24 2012 +0200 + + Remove useless stuff from utils + + Signed-off-by: Ran Benita + + [daniels: fixed conflicts from strcasecmp, added includes to make + filecomp build again] + +commit 2ac8610fad7236f2ffc3a8507cd846e88de85dc0 +Author: Daniel Stone +Date: Tue Mar 27 14:06:56 2012 +0100 + + Remove fallback strcasecmp/strncasecmp + + Sorry if your libc doesn't have this, but it's not my problem. + + Signed-off-by: Daniel Stone + Reported-by: Ran Benita + +commit 55b76a63892447b580cb83726fd1e174d377e91f +Author: Daniel Stone +Date: Tue Mar 27 14:05:14 2012 +0100 + + Add include/ to makekeys include path + + Signed-off-by: Daniel Stone + +commit d22b8dbbd0a7e0f8bf8cc56968ea3a78692bac21 +Author: Ran Benita +Date: Fri Mar 23 22:25:47 2012 +0200 + + Move utils.{c,h} to be used by the entire project + + This is a first step for making consistent use of utils.h also outside + of xkbcomp/ . + + Signed-off-by: Ran Benita + +commit 7cc17ec50768652be09358beb234b086aacc7b73 +Author: Ran Benita +Date: Fri Mar 23 23:39:12 2012 +0200 + + Fix a scanf type mismatch + + "%o" takes an unsigned int. + + Signed-off-by: Ran Benita + +commit f52671a4d1f55b339fc136961dfc645b1b7589f2 +Author: Ran Benita +Date: Sat Mar 24 12:31:55 2012 +0200 + + Remove a few remaining uses of the KeySym type + + Signed-off-by: Ran Benita + +commit 8b3e2b9b005e89c58fbb063f6e4ebd8beac7d5a8 +Author: Ran Benita +Date: Sat Mar 24 04:57:40 2012 +0200 + + Add xkb test file to EXTRA_DIST + + To appease make distcheck. + + Signed-off-by: Ran Benita + +commit 1b17708c8846463e207310a2c232bd20f7aadbbc +Author: Ran Benita +Date: Sat Mar 24 02:33:18 2012 +0200 + + Fix incorrect usage of && instead of & + + Signed-off-by: Ran Benita + +commit eeb0a2144842ea960f3d3e7a02f717805cb3f428 +Author: Ran Benita +Date: Fri Mar 23 17:55:08 2012 +0200 + + Update gitignore for 'state' test + + Signed-off-by: Ran Benita + +commit 6f7478d775af67446bc2deb4683397bfa1b60a8e +Author: Ran Benita +Date: Sat Mar 24 02:56:38 2012 +0200 + + Fix latin8 upper/lower case check + + GCC complained: + misc.c:235:13: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op] + misc.c:248:13: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op] + + Looking at keysymdef.h shows that the check is indeed wrong. This commit + updates the check to match the latin8 section of keysymdef exactly. + + Signed-off-by: Ran Benita + +commit 3b22373f1fb554eb0ada419382381146238ce2ec +Author: Ran Benita +Date: Fri Mar 23 17:48:35 2012 +0200 + + Properly free xkb_state's + + Signed-off-by: Ran Benita + +commit d9f934ca42d41e5db83fe2c6d8f839cb8a216c1b +Author: Ran Benita +Date: Fri Mar 23 16:52:23 2012 +0200 + + Mention xkb_state_new can return NULL + + in the header comments. + + Signed-off-by: Ran Benita + +commit 087327d9c505ff8b9b00d998754528a347152851 +Author: Guillem Jover +Date: Tue Mar 27 14:41:44 2012 +0200 + + Move doxygen comment before enum item + + Signed-off-by: Guillem Jover + +commit 389c2db1d778f4a7bbe94abfad1e6de4dbd45858 +Author: Daniel Stone +Date: Tue Mar 27 13:44:48 2012 +0100 + + Remove internal API from xkbcommon.h + + And move it to XKBcomminint.h. + + Signed-off-by: Daniel Stone + +commit 3dcd7ae02ccfd47b2a9a552daa225255803e66cf +Author: Daniel Stone +Date: Tue Mar 27 12:20:42 2012 +0100 + + Remove hardcoded legacy modifier masks + + Use the xkb_state_mod_* and xkb_map_mod_* API instead. + + Signed-off-by: Daniel Stone + +commit 729ac12f1c7ea6c5de548765b10738b261a43852 +Author: Daniel Stone +Date: Tue Mar 27 12:19:42 2012 +0100 + + Remove unused changes structs + + Signed-off-by: Daniel Stone + +commit f89b0a80ba65193979fdb5d98ece642055d06470 +Author: Daniel Stone +Date: Tue Mar 27 12:18:50 2012 +0100 + + Remove unused members of xkb_state + + Signed-off-by: Daniel Stone + +commit ede8473490a4fa327f168225042ea7ea4dd0d5e0 +Author: Daniel Stone +Date: Tue Mar 27 12:11:45 2012 +0100 + + Add enum xkb_key_direction instead of bool + + Use XKB_KEY_UP instead of 0 and XKB_KEY_DOWN instead of 1. + + Signed-off-by: Daniel Stone + Reported-by: Ran Benita + +commit 7f471a702ed4e1af63c39370ea55f3fea0500cfc +Author: Daniel Stone +Date: Tue Mar 27 12:07:57 2012 +0100 + + Add state serialisation API + + Signed-off-by: Daniel Stone + +commit 83b8b4b53324085fcc91f484535f1a43d0c0ccca +Author: Daniel Stone +Date: Tue Mar 27 12:07:40 2012 +0100 + + Cosmetic coding style fixups + + Signed-off-by: Daniel Stone + +commit d039622a659b40d014f146fcd2ff2353cd5b1bc7 +Author: Daniel Stone +Date: Thu Mar 22 17:39:12 2012 +0000 + + Rename keymap allocation API + + Signed-off-by: Daniel Stone + commit 3d672fcfea6b823db4793b9ad1c3aadc4b547a08 Author: Daniel Stone Date: Thu Mar 22 14:32:53 2012 +0000 diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/configure libxkbcommon-0.1.0~git20120510.409ec8a1/configure --- libxkbcommon-0.1.0~git20120501.3d672fcf/configure 2012-05-01 18:29:10.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/configure 2012-05-10 10:11:16.000000000 +0000 @@ -174,6 +174,7 @@ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' @@ -181,8 +182,7 @@ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -657,7 +657,6 @@ STRICT_CFLAGS CWARNFLAGS BASE_CFLAGS -CPP OTOOL64 OTOOL LIPO @@ -675,9 +674,19 @@ DUMPBIN LD FGREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL EGREP GREP -SED +CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -695,15 +704,6 @@ LDFLAGS CFLAGS CC -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LIBTOOL MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE @@ -772,11 +772,11 @@ ac_user_opts=' enable_option_checking enable_maintainer_mode +enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install -enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock @@ -1425,12 +1425,12 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --disable-selective-werror Turn off selective compiler errors. (default: @@ -1598,21 +1598,20 @@ } # ac_fn_c_try_compile -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" + if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 @@ -1620,97 +1619,112 @@ mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_try_link +} # ac_fn_c_try_cpp -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" + ac_header_compiler=yes else - eval "$3=no" + ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } -} # ac_fn_c_check_header_compile +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------------------------------------------------- ## +## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ## +## ---------------------------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_c_try_cpp +} # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- @@ -1754,6 +1768,83 @@ } # ac_fn_c_try_run +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -2755,220 +2846,55 @@ -# Initialize libtool -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - +# Get _GNU_SOURCE and friends +DEPDIR="${am__leading_dot}deps" +ac_config_commands="$ac_config_commands depfiles" +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" @@ -3902,86 +3828,143 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi else - ac_cv_path_SED=$SED + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + done + ac_cv_prog_CPP=$CPP +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 @@ -4114,611 +4097,354 @@ EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi +int +main () +{ - fi + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : +else + ac_cv_header_stdc=no +fi +rm -f conftest* +fi +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else - with_gnu_ld=no + ac_cv_header_stdc=no fi +rm -f conftest* -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + else - lt_cv_path_LD="$LD" # Let the user override the test with a path. + ac_cv_header_stdc=no fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld + if test "$MINIX" = yes; then +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h +$as_echo "#define _MINIX 1" >>confdefs.h + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} + ac_cv_safe_to_define___extensions__=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - test -n "$ac_ct_DUMPBIN" && break -done - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; +# Initialize libtool +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm +macro_version='2.4.2' +macro_revision='1.3337' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; 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, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else - i=0 - teststring="ABCD" + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac @@ -4728,211 +4454,277 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED fi -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -fi -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count fi - ;; + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" +test -z "$GREP" && GREP=grep -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + with_gnu_ld=no fi - +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + +LD="$lt_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 else - OBJDUMP="$ac_cv_prog_OBJDUMP" + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld @@ -4942,7 +4734,637 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; 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, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 @@ -5327,7 +5749,6 @@ - if test -n "$ac_tool_prefix"; then for ac_prog in ar do @@ -6475,201 +6896,17 @@ fi fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_LIPO" = x; then - LIPO=":" + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6677,22 +6914,22 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - LIPO=$ac_ct_LIPO + DSYMUTIL=$ac_ct_DSYMUTIL fi else - LIPO="$ac_cv_prog_LIPO" + DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : +if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6701,7 +6938,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6711,10 +6948,10 @@ fi fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6722,17 +6959,17 @@ fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6741,7 +6978,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL="otool" + ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6751,17 +6988,17 @@ fi fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6769,22 +7006,22 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OTOOL=$ac_ct_OTOOL + NMEDIT=$ac_ct_NMEDIT fi else - OTOOL="$ac_cv_prog_OTOOL" + NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : +if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6793,7 +7030,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6803,10 +7040,10 @@ fi fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6814,17 +7051,17 @@ fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6833,7 +7070,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL64="otool64" + ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6843,17 +7080,17 @@ fi fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" + if test "x$ac_ct_LIPO" = x; then + LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6861,442 +7098,359 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OTOOL64=$ac_ct_OTOOL64 + LIPO=$ac_ct_LIPO fi else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi + LIPO="$ac_cv_prog_LIPO" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } else - # Broken: fails on valid input. -continue + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi else - # Passes both tests. -ac_preproc_ok=: -break + OTOOL="$ac_cv_prog_OTOOL" fi -rm -f conftest.err conftest.i conftest.$ac_ext + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - done - ac_cv_prog_CPP=$CPP fi - CPP=$ac_cv_prog_CPP +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } else - # Broken: fails on valid input. -continue + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi else - # Passes both tests. -ac_preproc_ok=: -break + OTOOL64="$ac_cv_prog_OTOOL64" fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* -fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; + + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi + lt_cv_ld_exported_symbols_list=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM fi - -done - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac for ac_header in dlfcn.h do : @@ -7776,6 +7930,10 @@ $RM -r conftest* +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= @@ -17913,17 +18071,22 @@ fi # Checks for library functions. -for ac_func in strcasecmp +for ac_func in strcasecmp strncasecmp do : - ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" -if test "x$ac_cv_func_strcasecmp" = xyes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRCASECMP 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done +if test "x$ac_cv_func_strcasecmp" = xno || \ + test "x$ac_cv_func_strncasecmp" = xno; then + as_fn_error $? "C library does not support strcasecmp/strncasecmp" "$LINENO" 5 +fi # Build native compiler needed for makekeys @@ -17980,8 +18143,8 @@ fi fi -if test "x$GCC" = xyes ; then - CFLAGS="$CFLAGS -fvisibility=hidden" +if test "x$GCC" = xyes ; then + CFLAGS="$CFLAGS -fvisibility=hidden" fi # Obtain protocols headers include directives @@ -18111,7 +18274,7 @@ -ac_config_files="$ac_config_files Makefile xkbcommon.pc include/Makefile makekeys/Makefile src/Makefile src/xkbcomp/Makefile test/Makefile" +ac_config_files="$ac_config_files Makefile xkbcommon.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -19128,11 +19291,6 @@ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "xkbcommon.pc") CONFIG_FILES="$CONFIG_FILES xkbcommon.pc" ;; - "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; - "makekeys/Makefile") CONFIG_FILES="$CONFIG_FILES makekeys/Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "src/xkbcomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/xkbcomp/Makefile" ;; - "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/configure.ac libxkbcommon-0.1.0~git20120510.409ec8a1/configure.ac --- libxkbcommon-0.1.0~git20120501.3d672fcf/configure.ac 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/configure.ac 2012-05-10 10:10:26.000000000 +0000 @@ -29,11 +29,14 @@ AC_CONFIG_MACRO_DIR([m4]) # Initialize Automake -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects color-tests parallel-tests]) AM_MAINTAINER_MODE +# Get _GNU_SOURCE and friends +AC_USE_SYSTEM_EXTENSIONS + # Initialize libtool -AC_PROG_LIBTOOL +LT_INIT # Require xorg-macros minimum of 1.8 for AM_SILENT_RULES m4_ifndef([XORG_MACROS_VERSION], @@ -53,7 +56,11 @@ fi # Checks for library functions. -AC_CHECK_FUNCS([strcasecmp]) +AC_CHECK_FUNCS([strcasecmp strncasecmp]) +if test "x$ac_cv_func_strcasecmp" = xno || \ + test "x$ac_cv_func_strncasecmp" = xno; then + AC_MSG_ERROR([C library does not support strcasecmp/strncasecmp]) +fi # Build native compiler needed for makekeys AC_ARG_VAR([CC_FOR_BUILD], [Build native C compiler program]) @@ -65,8 +72,8 @@ fi fi -if test "x$GCC" = xyes ; then - CFLAGS="$CFLAGS -fvisibility=hidden" +if test "x$GCC" = xyes ; then + CFLAGS="$CFLAGS -fvisibility=hidden" fi # Obtain protocols headers include directives @@ -99,12 +106,5 @@ [XKBCONFIGROOT="$xkb_base"]) AC_SUBST([XKBCONFIGROOT]) -AC_CONFIG_FILES([ - Makefile - xkbcommon.pc - include/Makefile - makekeys/Makefile - src/Makefile - src/xkbcomp/Makefile - test/Makefile]) +AC_CONFIG_FILES([Makefile xkbcommon.pc]) AC_OUTPUT diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/debian/changelog libxkbcommon-0.1.0~git20120510.409ec8a1/debian/changelog --- libxkbcommon-0.1.0~git20120501.3d672fcf/debian/changelog 2012-05-10 10:24:37.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/debian/changelog 2012-05-10 10:24:37.000000000 +0000 @@ -1,12 +1,12 @@ -libxkbcommon (0.1.0~git20120501.3d672fcf-0ubuntu0ricotz~precise) precise; urgency=medium +libxkbcommon (0.1.0~git20120510.409ec8a1-0ubuntu0ricotz~precise) precise; urgency=medium - * Checkout from git 20120501 (master branch) up to commit - 3d672fcfea6b823db4793b9ad1c3aadc4b547a08 + * Checkout from git 20120510 (master branch) up to commit + 409ec8a12ef54f3eea704a8234e4cd26928bf87e * Only added debian/ tree from origin/debian-experimental * hook: Adjust install path for headers in libxkbcommon-dev * hook: Drop hard dependency generation - -- Rico Tzschichholz Tue, 01 May 2012 20:29:20 +0200 + -- Rico Tzschichholz Thu, 10 May 2012 12:11:19 +0200 libxkbcommon (0.1.0~1-1) experimental; urgency=low diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/.gitignore libxkbcommon-0.1.0~git20120510.409ec8a1/.gitignore --- libxkbcommon-0.1.0~git20120501.3d672fcf/.gitignore 2012-05-01 18:28:54.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/.gitignore 2012-05-10 10:10:26.000000000 +0000 @@ -76,3 +76,7 @@ # Edit the following section as needed # For example, !report.pc overrides *.pc. See 'man gitignore' # + +.dirstamp +cscope.out +test-suite.log diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/include/Makefile.am libxkbcommon-0.1.0~git20120510.409ec8a1/include/Makefile.am --- libxkbcommon-0.1.0~git20120501.3d672fcf/include/Makefile.am 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/include/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -nobase_include_HEADERS = xkbcommon/xkbcommon.h diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/include/xkbcommon/xkbcommon.h libxkbcommon-0.1.0~git20120510.409ec8a1/include/xkbcommon/xkbcommon.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/include/xkbcommon/xkbcommon.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/include/xkbcommon/xkbcommon.h 2012-05-10 10:10:26.000000000 +0000 @@ -51,18 +51,42 @@ ********************************************************/ +/* + * Copyright © 2009 Daniel Stone + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone + */ + #ifndef _XKBCOMMON_H_ #define _XKBCOMMON_H_ +#include #include -#include -#include -#include typedef uint32_t xkb_keycode_t; typedef uint32_t xkb_keysym_t; typedef uint32_t xkb_mod_index_t; +typedef uint32_t xkb_mod_mask_t; typedef uint32_t xkb_group_index_t; typedef uint32_t xkb_led_index_t; @@ -71,6 +95,8 @@ #define XKB_KEYCODE_INVALID (0xffffffff) #define XKB_LED_INVALID (0xffffffff) +#define XKB_KEYSYM_NO_SYMBOL 0 + #define XKB_KEYCODE_MAX (0xffffffff - 1) #define xkb_keycode_is_legal_ext(kc) (kc <= XKB_KEYCODE_MAX) #define xkb_keycode_is_legal_x11(kc) (kc <= XKB_KEYCODE_MAX) @@ -80,458 +106,52 @@ xkb_keycode_is_legal_ext(xkb->min_key_code) && \ xkb_keycode_is_legal_ext(xkb->max_key_code)) -/* Duplicate the modifier mask defines so libxkcommon can be used - * without X.h */ -#define XKB_COMMON_SHIFT_MASK (1 << 0) -#define XKB_COMMON_LOCK_MASK (1 << 1) -#define XKB_COMMON_CONTROL_MASK (1 << 2) -#define XKB_COMMON_MOD1_MASK (1 << 3) -#define XKB_COMMON_MOD2_MASK (1 << 4) -#define XKB_COMMON_MOD3_MASK (1 << 5) -#define XKB_COMMON_MOD4_MASK (1 << 6) -#define XKB_COMMON_MOD5_MASK (1 << 7) - - +/** + * Names to compile a keymap with, also known as RMLVO. These names together + * should be the primary identifier for a keymap. + */ struct xkb_rule_names { - const char * rules; - const char * model; - const char * layout; - const char * variant; - const char * options; -}; - -struct xkb_any_action { - uint8_t type; - uint8_t data[7]; -}; - -struct xkb_mod_action { - uint8_t type; - uint8_t flags; - uint8_t mask; - uint8_t real_mods; - uint16_t vmods; -}; - -struct xkb_group_action { - uint8_t type; - uint8_t flags; - int16_t group; -}; - -struct xkb_iso_action { - uint8_t type; - uint8_t flags; - uint8_t mask; - uint8_t real_mods; - uint8_t group; - uint8_t affect; - uint16_t vmods; -}; - -struct xkb_controls_action { - uint8_t type; - uint8_t flags; - uint32_t ctrls; -}; - -struct xkb_device_button_action { - uint8_t type; - uint8_t flags; - uint8_t count; - uint8_t button; - uint8_t device; -}; - -struct xkb_device_valuator_action { - uint8_t type; - uint8_t device; - uint8_t v1_what; - uint8_t v1_index; - uint8_t v1_value; - uint8_t v2_what; - uint8_t v2_index; - uint8_t v2_value; -}; - -struct xkb_pointer_default_action { - uint8_t type; - uint8_t flags; - uint8_t affect; - uint8_t value; -}; - -struct xkb_switch_screen_action { - uint8_t type; - uint8_t flags; - uint8_t screen; -}; - -struct xkb_redirect_key_action { - uint8_t type; - xkb_keycode_t new_key; - uint8_t mods_mask; - uint8_t mods; - uint16_t vmods_mask; - uint16_t vmods; -}; - -struct xkb_pointer_action { - uint8_t type; - uint8_t flags; - uint16_t x; - uint16_t y; -}; - -struct xkb_message_action { - uint8_t type; - uint8_t flags; - uint8_t message[6]; -}; - -struct xkb_pointer_button_action { - uint8_t type; - uint8_t flags; - uint8_t count; - uint8_t button; -}; - -union xkb_action { - struct xkb_any_action any; - struct xkb_mod_action mods; - struct xkb_group_action group; - struct xkb_iso_action iso; - struct xkb_controls_action ctrls; - struct xkb_device_button_action devbtn; - struct xkb_device_valuator_action devval; - struct xkb_pointer_default_action dflt; - struct xkb_switch_screen_action screen; - struct xkb_redirect_key_action redirect; /* XXX wholly unnecessary? */ - struct xkb_pointer_action ptr; /* XXX delete for DeviceValuator */ - struct xkb_pointer_button_action btn; /* XXX delete for DeviceBtn */ - struct xkb_message_action msg; /* XXX just delete */ - unsigned char type; -}; - -struct xkb_mods { - uint32_t mask; /* effective mods */ - uint32_t vmods; - uint8_t real_mods; -}; - -struct xkb_kt_map_entry { - int active; - uint16_t level; - struct xkb_mods mods; -}; - -struct xkb_key_type { - struct xkb_mods mods; - uint16_t num_levels; - unsigned char map_count; - struct xkb_kt_map_entry * map; - struct xkb_mods * preserve; - const char *name; - const char **level_names; -}; - -struct xkb_sym_interpret { - xkb_keysym_t sym; - unsigned char flags; - unsigned char match; - uint8_t mods; - uint32_t virtual_mod; - union xkb_action act; -}; - -struct xkb_compat_map { - struct xkb_sym_interpret * sym_interpret; - struct xkb_mods groups[XkbNumKbdGroups]; - unsigned short num_si; - unsigned short size_si; -}; - -struct xkb_sym_map { - unsigned char kt_index[XkbNumKbdGroups]; - unsigned char group_info; - unsigned char width; - unsigned short offset; -}; - -#define XkbNumGroups(g) ((g)&0x0f) -#define XkbOutOfRangeGroupInfo(g) ((g)&0xf0) -#define XkbOutOfRangeGroupAction(g) ((g)&0xc0) -#define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4) -#define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f)) -#define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f)) - -struct xkb_client_map { - unsigned char size_types; - unsigned char num_types; - struct xkb_key_type * types; - - uint32_t size_syms; - uint32_t num_syms; - xkb_keysym_t *syms; - struct xkb_sym_map * key_sym_map; - - unsigned char *modmap; -}; - -struct xkb_behavior { - unsigned char type; - unsigned char data; -}; - -struct xkb_server_map { - unsigned short num_acts; - unsigned short size_acts; - -#if defined(__cplusplus) || defined(c_plusplus) - /* explicit is a C++ reserved word */ - unsigned char * c_explicit; -#else - unsigned char * explicit; -#endif - - union xkb_action *acts; - struct xkb_behavior *behaviors; - unsigned short *key_acts; - unsigned char *explicits; - uint32_t vmods[XkbNumVirtualMods]; /* vmod -> mod mapping */ - uint32_t *vmodmap; /* key -> vmod mapping */ -}; - - -struct xkb_indicator_map { - unsigned char flags; - unsigned char which_groups; - unsigned char groups; - unsigned char which_mods; - struct xkb_mods mods; - unsigned int ctrls; -}; - -struct xkb_indicator { - unsigned long phys_indicators; - struct xkb_indicator_map maps[XkbNumIndicators]; -}; - -struct xkb_key_name { - char name[XkbKeyNameLength]; -}; - -struct xkb_key_alias { - char real[XkbKeyNameLength]; - char alias[XkbKeyNameLength]; -}; - -struct xkb_names { - const char *vmods[XkbNumVirtualMods]; - const char *indicators[XkbNumIndicators]; - const char *groups[XkbNumKbdGroups]; - struct xkb_key_name * keys; - struct xkb_key_alias * key_aliases; - - xkb_keycode_t num_keys; - xkb_keycode_t num_key_aliases; -}; - -struct xkb_controls { - unsigned char num_groups; - unsigned char groups_wrap; - struct xkb_mods internal; - struct xkb_mods ignore_lock; - unsigned int enabled_ctrls; - unsigned short repeat_delay; - unsigned short repeat_interval; - unsigned short slow_keys_delay; - unsigned short debounce_delay; - unsigned short ax_options; - unsigned short ax_timeout; - unsigned short axt_opts_mask; - unsigned short axt_opts_values; - unsigned int axt_ctrls_mask; - unsigned int axt_ctrls_values; - unsigned char *per_key_repeat; -}; - -/* Common keyboard description structure */ -struct xkb_desc { - unsigned int defined; - unsigned short flags; - unsigned short device_spec; - xkb_keycode_t min_key_code; - xkb_keycode_t max_key_code; - - struct xkb_controls * ctrls; - struct xkb_server_map * server; - struct xkb_client_map * map; - struct xkb_indicator * indicators; - struct xkb_names * names; - struct xkb_compat_map * compat; -}; - - -#define XkbKeyGroupInfo(d,k) ((d)->map->key_sym_map[k].group_info) -#define XkbKeyNumGroups(d,k) (XkbNumGroups((d)->map->key_sym_map[k].group_info)) -#define XkbKeyGroupWidth(d,k,g) (XkbKeyType(d,k,g)->num_levels) -#define XkbKeyGroupsWidth(d,k) ((d)->map->key_sym_map[k].width) -#define XkbKeyTypeIndex(d,k,g) ((d)->map->key_sym_map[k].kt_index[g&0x3]) -#define XkbKeyType(d,k,g) (&(d)->map->types[XkbKeyTypeIndex(d,k,g)]) -#define XkbKeyNumSyms(d,k) (XkbKeyGroupsWidth(d,k)*XkbKeyNumGroups(d,k)) -#define XkbKeySymsOffset(d,k) ((d)->map->key_sym_map[k].offset) -#define XkbKeySymsPtr(d,k) (&(d)->map->syms[XkbKeySymsOffset(d,k)]) -#define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n]) -#define XkbKeySymEntry(d,k,sl,g) \ - (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl)))) -#define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0) -#define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1) -#define XkbKeyActionsPtr(d,k) (&(d)->server->acts[(d)->server->key_acts[k]]) -#define XkbKeyAction(d,k,n) \ - (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL) -#define XkbKeyActionEntry(d,k,sl,g) \ - (XkbKeyHasActions(d,k)?\ - XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL) - -#define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&\ - ((k)<=(d)->max_key_code)) -#define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1) - -struct xkb_map_changes { - unsigned short changed; - xkb_keycode_t min_key_code; - xkb_keycode_t max_key_code; - unsigned char first_type; - unsigned char num_types; - xkb_keycode_t first_key_sym; - xkb_keycode_t num_key_syms; - xkb_keycode_t first_key_act; - xkb_keycode_t num_key_acts; - xkb_keycode_t first_key_behavior; - xkb_keycode_t num_key_behaviors; - xkb_keycode_t first_key_explicit; - xkb_keycode_t num_key_explicit; - xkb_keycode_t first_modmap_key; - xkb_keycode_t num_modmap_keys; - xkb_keycode_t first_vmodmap_key; - xkb_keycode_t num_vmodmap_keys; - unsigned short vmods; -}; - -struct xkb_controls_changes { - unsigned int changed_ctrls; - unsigned int enabled_ctrls_changes; - int num_groups_changed; -}; - -struct xkb_indicator_changes { - unsigned int state_changes; - unsigned int map_changes; -}; - -struct xkb_name_changes { - unsigned int changed; - unsigned char first_type; - unsigned char num_types; - unsigned char first_lvl; - unsigned char num_lvls; - xkb_keycode_t num_aliases; - xkb_keycode_t first_key; - xkb_keycode_t num_keys; - unsigned short changed_vmods; - unsigned long changed_indicators; - unsigned char changed_groups; -}; - -struct xkb_compat_changes { - unsigned char changed_groups; - unsigned short first_si; - unsigned short num_si; -}; - -struct xkb_changes { - unsigned short device_spec; - unsigned short state_changes; - struct xkb_map_changes map; - struct xkb_controls_changes ctrls; - struct xkb_indicator_changes indicators; - struct xkb_name_changes names; - struct xkb_compat_changes compat; + char *rules; + char *model; + char *layout; + char *variant; + char *options; }; +/** + * Legacy names for the components of an XKB keymap, also known as KcCGST. + * This is only used in deprecated entrypoints which might be removed or + * shuffled off to a support library. + */ struct xkb_component_names { - char * keymap; - char * keycodes; - char * types; - char * compat; - char * symbols; + char *keymap; + char *keycodes; + char *types; + char *compat; + char *symbols; }; -struct xkb_component_name { - unsigned short flags; - char * name; -}; - -struct xkb_state { - unsigned char group; /* base + latched + locked */ - /* FIXME: Why are base + latched short and not char?? */ - unsigned short base_group; /* physically ... down? */ - unsigned short latched_group; - unsigned char locked_group; - - unsigned char mods; /* base + latched + locked */ - unsigned char base_mods; /* physically down */ - unsigned char latched_mods; - unsigned char locked_mods; - - unsigned char compat_state; /* mods + group for core state */ - - /* grab mods = all depressed and latched mods, _not_ locked mods */ - unsigned char grab_mods; /* grab mods minus internal mods */ - unsigned char compat_grab_mods; /* grab mods + group for core state, - but not locked groups if - IgnoreGroupLocks set */ - - /* effective mods = all mods (depressed, latched, locked) */ - unsigned char lookup_mods; /* effective mods minus internal mods */ - unsigned char compat_lookup_mods; /* effective mods + group */ - - unsigned short ptr_buttons; /* core pointer buttons */ - - uint32_t leds; - - int refcnt; - void *filters; - int num_filters; - struct xkb_desc *xkb; -}; - -#define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group) -#define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group) - -#define XkbNumGroups(g) ((g)&0x0f) -#define XkbOutOfRangeGroupInfo(g) ((g)&0xf0) -#define XkbOutOfRangeGroupAction(g) ((g)&0xc0) -#define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4) -#define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f)) - -_XFUNCPROTOBEGIN - -_X_EXPORT extern struct xkb_desc * -xkb_compile_keymap_from_rules(const struct xkb_rule_names *rules); - -_X_EXPORT extern struct xkb_desc * -xkb_compile_keymap_from_components(const struct xkb_component_names * ktcsg); +/** + * Opaque context object; may only be created, accessed, manipulated and + * destroyed through the xkb_context_*() API. + */ +struct xkb_context; -_X_EXPORT extern struct xkb_desc * -xkb_compile_keymap_from_file(FILE *inputFile, const char *mapName); +/** + * Opaque keymap object; may only be created, accessed, manipulated and + * destroyed through the xkb_state_*() API. + */ +struct xkb_keymap; -_X_EXPORT extern struct xkb_desc * -xkb_compile_keymap_from_string(const char *string, const char *mapName); +/** + * Opaque state object; may only be created, accessed, manipulated and + * destroyed through the xkb_state_*() API. + */ +struct xkb_state; -_X_EXPORT extern void -xkb_free_keymap(struct xkb_desc *xkb); +#ifdef __cplusplus +extern "C" { +#endif /* * Canonicalises component names by prepending the relevant component from @@ -547,27 +167,163 @@ * If a component in names needs to be modified, the existing value will be * free()d, and a new one allocated with malloc(). */ -_X_EXPORT extern void -xkb_canonicalise_components(struct xkb_component_names * names, - const struct xkb_component_names * old); +void +xkb_canonicalise_components(struct xkb_component_names *names, + const struct xkb_component_names *old); /* * Converts a keysym to a string; will return unknown Unicode codepoints * as "Ua1b2", and other unknown keysyms as "0xabcd1234". */ -_X_EXPORT extern void +void xkb_keysym_to_string(xkb_keysym_t ks, char *buffer, size_t size); /* * See xkb_keysym_to_string comments: this function will accept any string * from that function. */ -_X_EXPORT extern xkb_keysym_t +xkb_keysym_t xkb_string_to_keysym(const char *s); -_X_EXPORT unsigned int -xkb_key_get_syms(struct xkb_state *state, xkb_keycode_t key, - xkb_keysym_t **syms_out); +/** + * @defgroup ctx XKB contexts + * Every keymap compilation request must have an XKB context associated with + * it. The context keeps around state such as the include path. + * + * @{ + */ + +/** + * Returns a new XKB context, or NULL on failure. If successful, the caller + * holds a reference on the context, and must free it when finished with + * xkb_context_unref(). + */ +struct xkb_context * +xkb_context_new(void); + +/** + * Appends a new entry to the include path used for keymap compilation. + * Returns 1 on success, or 0 if the include path could not be added or is + * inaccessible. + */ +int +xkb_context_include_path_append(struct xkb_context *context, const char *path); + +/** + * Appends the default include paths to the context's current include path. + * Returns 1 on success, or 0 if the primary include path could not be + * added. + */ +int +xkb_context_include_path_append_default(struct xkb_context *context); + +/** + * Removes all entries from the context's include path, and inserts the + * default paths. Returns 1 on success, or 0 if the primary include path + * could not be added. + */ +int +xkb_context_include_path_reset_defaults(struct xkb_context *context); + +/** + * Removes all entries from the context's include path. + */ +void +xkb_context_include_path_clear(struct xkb_context *context); + +/** + * Returns the number of include paths currently active in the context. + */ +unsigned int +xkb_context_num_include_paths(struct xkb_context *context); + +/** + * Returns the include path at the specified index within the context. + */ +const char * +xkb_context_include_path_get(struct xkb_context *context, unsigned int index); + +/** + * Takes a new reference on an XKB context. + */ +struct xkb_context * +xkb_context_ref(struct xkb_context *context); + +/** + * Releases a reference on an XKB context, and possibly frees it. + */ +void +xkb_context_unref(struct xkb_context *context); + +/** @} */ + +/** + * @defgroup map Keymap management + * These utility functions allow you to create and deallocate XKB keymaps. + * + * @{ + */ + +/** + * The primary keymap entry point: creates a new XKB keymap from a set of + * RMLVO (Rules + Model + Layout + Variant + Option) names. + * + * You should almost certainly be using this and nothing else to create + * keymaps. + */ +struct xkb_keymap * +xkb_map_new_from_names(struct xkb_context *context, + const struct xkb_rule_names *names); + +/** + * Deprecated entrypoint for legacy users who need to be able to compile + * XKB keymaps by KcCGST (Keycodes + Compat + Geometry + Symbols + Types) + * names. + * + * You should not use this unless you are the X server. This entrypoint + * may well disappear in future releases. Please, please, don't use it. + * + * Geometry will be ignored since xkbcommon does not support it in any way. + */ +struct xkb_keymap * +xkb_map_new_from_kccgst(struct xkb_context *context, + const struct xkb_component_names *kccgst); + +enum xkb_keymap_format { + /** The current/classic XKB text format, as generated by xkbcomp -xkb. */ + XKB_KEYMAP_FORMAT_TEXT_V1 = 1, +}; + +/** + * Creates an XKB keymap from a full text XKB keymap passed into the + * file descriptor. + */ +struct xkb_keymap * +xkb_map_new_from_fd(struct xkb_context *context, + int fd, enum xkb_keymap_format format); + +/** + * Creates an XKB keymap from a full text XKB keymap serialised into one + * enormous string. + */ +struct xkb_keymap * +xkb_map_new_from_string(struct xkb_context *context, + const char *string, + enum xkb_keymap_format format); + +/** + * Takes a new reference on a keymap. + */ +struct xkb_keymap * +xkb_map_ref(struct xkb_keymap *xkb); + +/** + * Releases a reference on a keymap. + */ +void +xkb_map_unref(struct xkb_keymap *xkb); + +/** @} */ /** * @defgroup components XKB state components @@ -580,62 +336,62 @@ /** * Returns the number of modifiers active in the keymap. */ -_X_EXPORT xkb_mod_index_t -xkb_map_num_mods(struct xkb_desc *xkb); +xkb_mod_index_t +xkb_map_num_mods(struct xkb_keymap *xkb); /** * Returns the name of the modifier specified by 'idx', or NULL if invalid. */ -_X_EXPORT const char * -xkb_map_mod_get_name(struct xkb_desc *xkb, xkb_mod_index_t idx); +const char * +xkb_map_mod_get_name(struct xkb_keymap *xkb, xkb_mod_index_t idx); /** * Returns the index of the modifier specified by 'name', or XKB_MOD_INVALID. */ -_X_EXPORT xkb_mod_index_t -xkb_map_mod_get_index(struct xkb_desc *xkb, const char *name); +xkb_mod_index_t +xkb_map_mod_get_index(struct xkb_keymap *xkb, const char *name); /** * Returns the number of groups active in the keymap. */ -_X_EXPORT xkb_group_index_t -xkb_map_num_groups(struct xkb_desc *xkb); +xkb_group_index_t +xkb_map_num_groups(struct xkb_keymap *xkb); /** * Returns the name of the group specified by 'idx', or NULL if invalid. */ -_X_EXPORT const char * -xkb_map_group_get_name(struct xkb_desc *xkb, xkb_group_index_t idx); +const char * +xkb_map_group_get_name(struct xkb_keymap *xkb, xkb_group_index_t idx); /** * Returns the index of the group specified by 'name', or XKB_GROUP_INVALID. */ -_X_EXPORT xkb_group_index_t -xkb_map_group_get_index(struct xkb_desc *xkb, const char *name); +xkb_group_index_t +xkb_map_group_get_index(struct xkb_keymap *xkb, const char *name); /** * Returns the number of groups active for the specified key. */ -_X_EXPORT xkb_group_index_t -xkb_key_num_groups(struct xkb_desc *xkb, xkb_keycode_t key); +xkb_group_index_t +xkb_key_num_groups(struct xkb_keymap *xkb, xkb_keycode_t key); /** * Returns the number of LEDs in the given map. */ -_X_EXPORT xkb_led_index_t -xkb_map_num_leds(struct xkb_desc *xkb); +xkb_led_index_t +xkb_map_num_leds(struct xkb_keymap *xkb); /** * Returns the name of the LED specified by 'idx', or NULL if invalid. */ -_X_EXPORT const char * -xkb_map_led_get_name(struct xkb_desc *xkb, xkb_led_index_t idx); +const char * +xkb_map_led_get_name(struct xkb_keymap *xkb, xkb_led_index_t idx); /** * Returns the index of the LED specified by 'name', or XKB_LED_INVALID. */ -_X_EXPORT xkb_led_index_t -xkb_map_led_get_index(struct xkb_desc *xkb, const char *name); +xkb_led_index_t +xkb_map_led_get_index(struct xkb_keymap *xkb, const char *name); /** @} */ @@ -648,29 +404,55 @@ */ /** - * Allocates a new XKB state object for use with the given keymap. + * Returns a new XKB state object for use with the given keymap, or NULL on + * failure. */ -_X_EXPORT struct xkb_state * -xkb_state_new(struct xkb_desc *xkb); +struct xkb_state * +xkb_state_new(struct xkb_keymap *xkb); /** - * Adds a reference to a state object, so it will not be freed until unref. + * Takes a new reference on a state object. */ -_X_EXPORT void +struct xkb_state * xkb_state_ref(struct xkb_state *state); /** * Unrefs and potentially deallocates a state object; the caller must not * use the state object after calling this. */ -_X_EXPORT void +void xkb_state_unref(struct xkb_state *state); /** + * Get the keymap from which the state object was created. + */ +struct xkb_keymap * +xkb_state_get_map(struct xkb_state *state); + +enum xkb_key_direction { + XKB_KEY_UP, + XKB_KEY_DOWN, +}; + +/** * Updates a state object to reflect the given key being pressed or released. */ -_X_EXPORT void -xkb_state_update_key(struct xkb_state *state, xkb_keycode_t key, int down); +void +xkb_state_update_key(struct xkb_state *state, xkb_keycode_t key, + enum xkb_key_direction direction); + +/** + * Gives the symbols obtained from pressing a particular key with the given + * state. *syms_out will be set to point to an array of keysyms, with the + * return value being the number of symbols in *syms_out. If the return + * value is 0, *syms_out will be set to NULL, as there are no symbols produced + * by this event. + * + * This should be called before xkb_state_update_key. + */ +unsigned int +xkb_key_get_syms(struct xkb_state *state, xkb_keycode_t key, + const xkb_keysym_t **syms_out); /** * Modifier and group types for state objects. This enum is bitmaskable, @@ -678,26 +460,72 @@ * locked modifiers. */ enum xkb_state_component { + /** A key holding this modifier or group is currently physically + * depressed; also known as 'base'. */ XKB_STATE_DEPRESSED = (1 << 0), - /**< A key holding this modifier or group is currently physically - * depressed; also known as 'base'. */ + /** Modifier or group is latched, i.e. will be unset after the next + * non-modifier key press. */ XKB_STATE_LATCHED = (1 << 1), - /**< Modifier or group is latched, i.e. will be unset after the next - * non-modifier key press. */ + /** Modifier or group is locked, i.e. will be unset after the key + * provoking the lock has been pressed again. */ XKB_STATE_LOCKED = (1 << 2), - /**< Modifier or group is locked, i.e. will be unset after the key - * provoking the lock has been pressed again. */ + /** Combinatination of depressed, latched, and locked. */ XKB_STATE_EFFECTIVE = (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED | XKB_STATE_LOCKED), - /**< Combinatination of depressed, latched, and locked. */ }; /** + * Updates a state object from a set of explicit masks. This entrypoint is + * really only for window systems and the like, where a master process + * holds an xkb_state, then serialises it over a wire protocol, and clients + * then use the serialisation to feed in to their own xkb_state. + * + * All parameters must always be passed, or the resulting state may be + * incoherent. + * + * The serialisation is lossy and will not survive round trips; it must only + * be used to feed slave state objects, and must not be used to update the + * master state. + * + * Please do not use this unless you fit the description above. + */ +void +xkb_state_update_mask(struct xkb_state *state, + xkb_mod_mask_t base_mods, + xkb_mod_mask_t latched_mods, + xkb_mod_mask_t locked_mods, + xkb_group_index_t base_group, + xkb_group_index_t latched_group, + xkb_group_index_t locked_group); + +/** + * The counterpart to xkb_state_update_mask, to be used on the server side + * of serialisation. Returns a xkb_mod_mask_t representing the given + * component(s) of the state. + * + * This function should not be used in regular clients; please use the + * xkb_state_mod_*_is_active or xkb_state_foreach_active_mod API instead. + * + * Can return NULL on failure. + */ +xkb_mod_mask_t +xkb_state_serialise_mods(struct xkb_state *state, + enum xkb_state_component component); + +/** + * The group equivalent of xkb_state_serialise_mods: please see its + * documentation. + */ +xkb_group_index_t +xkb_state_serialise_group(struct xkb_state *state, + enum xkb_state_component component); + +/** * Returns 1 if the modifier specified by 'name' is active in the manner * specified by 'type', 0 if it is unset, or -1 if the modifier does not * exist in the current map. */ -_X_EXPORT int +int xkb_state_mod_name_is_active(struct xkb_state *state, const char *name, enum xkb_state_component type); @@ -706,7 +534,7 @@ * specified by 'type', 0 if it is unset, or -1 if the modifier does not * exist in the current map. */ -_X_EXPORT int +int xkb_state_mod_index_is_active(struct xkb_state *state, xkb_mod_index_t idx, enum xkb_state_component type); @@ -715,7 +543,7 @@ * specified by 'type', 0 if it is unset, or -1 if the group does not * exist in the current map. */ -_X_EXPORT int +int xkb_state_group_name_is_active(struct xkb_state *state, const char *name, enum xkb_state_component type); @@ -724,7 +552,7 @@ * specified by 'type', 0 if it is unset, or -1 if the group does not * exist in the current map. */ -_X_EXPORT int +int xkb_state_group_index_is_active(struct xkb_state *state, xkb_group_index_t idx, enum xkb_state_component type); @@ -732,18 +560,20 @@ * Returns 1 if the LED specified by 'name' is active, 0 if it is unset, or * -1 if the LED does not exist in the current map. */ -_X_EXPORT int +int xkb_state_led_name_is_active(struct xkb_state *state, const char *name); /** * Returns 1 if the LED specified by 'idx' is active, 0 if it is unset, or * -1 if the LED does not exist in the current map. */ -_X_EXPORT int +int xkb_state_led_index_is_active(struct xkb_state *state, xkb_led_index_t idx); /** @} */ -_XFUNCPROTOEND +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* _XKBCOMMON_H_ */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/.lastcommit libxkbcommon-0.1.0~git20120510.409ec8a1/.lastcommit --- libxkbcommon-0.1.0~git20120501.3d672fcf/.lastcommit 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/.lastcommit 2012-05-10 10:10:26.000000000 +0000 @@ -1 +1 @@ -commit 3d672fcfea6b823db4793b9ad1c3aadc4b547a08 +commit 409ec8a12ef54f3eea704a8234e4cd26928bf87e diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/Makefile.am libxkbcommon-0.1.0~git20120510.409ec8a1/Makefile.am --- libxkbcommon-0.1.0~git20120501.3d672fcf/Makefile.am 2012-05-01 18:28:54.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/Makefile.am 2012-05-10 10:10:26.000000000 +0000 @@ -1,5 +1,4 @@ -# Order: makekeys before src -SUBDIRS = include makekeys src test +ACLOCAL_AMFLAGS = -I m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xkbcommon.pc @@ -15,3 +14,109 @@ $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL + +AM_CPPFLAGS = \ + -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/xkbcomp \ + -Isrc/xkbcomp/ \ + -include $(top_srcdir)/src/config.h + +AM_CFLAGS = \ + $(BASE_CFLAGS) \ + $(XMALLOC_ZERO_CFLAGS) + +AM_YFLAGS = -d + +xkbcommonincludedir = $(includedir)/xkbcommon +xkbcommoninclude_HEADERS = include/xkbcommon/xkbcommon.h + +lib_LTLIBRARIES = libxkbcommon.la +libxkbcommon_la_LDFLAGS = -no-undefined +libxkbcommon_la_SOURCES = \ + src/xkbcomp/action.c \ + src/xkbcomp/action.h \ + src/xkbcomp/alias.c \ + src/xkbcomp/alias.h \ + src/xkbcomp/compat.c \ + src/xkbcomp/expr.c \ + src/xkbcomp/expr.h \ + src/xkbcomp/indicators.c \ + src/xkbcomp/indicators.h \ + src/xkbcomp/keycodes.c \ + src/xkbcomp/keycodes.h \ + src/xkbcomp/keymap.c \ + src/xkbcomp/keytypes.c \ + src/xkbcomp/misc.c \ + src/xkbcomp/misc.h \ + src/xkbcomp/parseutils.c \ + src/xkbcomp/parseutils.h \ + src/xkbcomp/symbols.c \ + src/xkbcomp/vmod.c \ + src/xkbcomp/vmod.h \ + src/xkbcomp/xkbcomp.c \ + src/xkbcomp/xkbcomp.h \ + src/xkbcomp/xkbparse.y \ + src/xkbcomp/xkbpath.c \ + src/xkbcomp/xkbpath.h \ + src/xkbcomp/xkbscan.l \ + src/alloc.c \ + src/atom.c \ + src/context.c \ + src/keysym.c \ + src/map.c \ + src/maprules.c \ + src/misc.c \ + src/state.c \ + src/text.c \ + src/utils.c \ + src/utils.h \ + src/xkb.c \ + src/xkballoc.h \ + src/xkbmisc.h \ + src/xkbrules.h \ + src/XKBcommonint.h + +BUILT_SOURCES = \ + src/xkbcomp/xkbparse.c \ + src/xkbcomp/xkbparse.h \ + src/xkbcomp/xkbscan.c \ + src/ks_tables.h +CLEANFILES = $(BUILT_SOURCES) + +noinst_PROGRAMS = makekeys/makekeys +makekeys_makekeys_SOURCES = makekeys/makekeys.c +makekeys_makekeys_CC = $(CC_FOR_BUILD) +makekeys_makekeys_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_FOR_BUILD) +makekeys_makekeys_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) +makekeys_makekeys_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) + +src/ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/makekeys/makekeys$(EXEEXT) + $(top_builddir)/makekeys/makekeys $(KEYSYMDEFS) > $@ + +# Tests + +TESTS_ENVIRONMENT = + +TESTS = \ + test/xkey \ + test/filecomp \ + test/namescomp \ + test/rulescomp \ + test/canonicalise \ + test/state \ + test/context +TESTS_LDADD = libxkbcommon.la + +test_xkey_LDADD = $(TESTS_LDADD) +test_filecomp_LDADD = $(TESTS_LDADD) +test_namescomp_LDADD = $(TESTS_LDADD) +test_rulescomp_LDADD = $(TESTS_LDADD) +test_canonicalise_LDADD = $(TESTS_LDADD) +test_state_LDADD = $(TESTS_LDADD) +test_context_LDADD = $(TESTS_LDADD) + +check_PROGRAMS = $(TESTS) + +EXTRA_DIST = test/data diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/Makefile.in libxkbcommon-0.1.0~git20120510.409ec8a1/Makefile.in --- libxkbcommon-0.1.0~git20120501.3d672fcf/Makefile.in 2012-05-01 18:29:12.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/Makefile.in 2012-05-10 10:11:17.000000000 +0000 @@ -15,6 +15,9 @@ @SET_MAKE@ + + + VPATH = @srcdir@ am__make_dryrun = \ { \ @@ -51,13 +54,25 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +noinst_PROGRAMS = makekeys/makekeys$(EXEEXT) +TESTS = test/xkey$(EXEEXT) test/filecomp$(EXEEXT) \ + test/namescomp$(EXEEXT) test/rulescomp$(EXEEXT) \ + test/canonicalise$(EXEEXT) test/state$(EXEEXT) \ + test/context$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/xkbcommon.pc.in \ - $(top_srcdir)/configure COPYING ChangeLog INSTALL config.guess \ - config.sub depcomp install-sh ltmain.sh missing ylwrap + $(top_srcdir)/configure $(top_srcdir)/src/config.h.in \ + $(xkbcommoninclude_HEADERS) COPYING ChangeLog INSTALL \ + config.guess config.sub depcomp install-sh ltmain.sh missing \ + src/xkbcomp/xkbparse.c src/xkbcomp/xkbparse.h \ + src/xkbcomp/xkbscan.c ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -66,26 +81,6 @@ CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = xkbcommon.pc CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -113,16 +108,220 @@ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(xkbcommonincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libxkbcommon_la_LIBADD = +am__dirstamp = $(am__leading_dot)dirstamp +am_libxkbcommon_la_OBJECTS = src/xkbcomp/action.lo \ + src/xkbcomp/alias.lo src/xkbcomp/compat.lo src/xkbcomp/expr.lo \ + src/xkbcomp/indicators.lo src/xkbcomp/keycodes.lo \ + src/xkbcomp/keymap.lo src/xkbcomp/keytypes.lo \ + src/xkbcomp/misc.lo src/xkbcomp/parseutils.lo \ + src/xkbcomp/symbols.lo src/xkbcomp/vmod.lo \ + src/xkbcomp/xkbcomp.lo src/xkbcomp/xkbparse.lo \ + src/xkbcomp/xkbpath.lo src/xkbcomp/xkbscan.lo src/alloc.lo \ + src/atom.lo src/context.lo src/keysym.lo src/map.lo \ + src/maprules.lo src/misc.lo src/state.lo src/text.lo \ + src/utils.lo src/xkb.lo +libxkbcommon_la_OBJECTS = $(am_libxkbcommon_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +libxkbcommon_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libxkbcommon_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +am__EXEEXT_1 = test/xkey$(EXEEXT) test/filecomp$(EXEEXT) \ + test/namescomp$(EXEEXT) test/rulescomp$(EXEEXT) \ + test/canonicalise$(EXEEXT) test/state$(EXEEXT) \ + test/context$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +am_makekeys_makekeys_OBJECTS = \ + makekeys/makekeys_makekeys-makekeys.$(OBJEXT) +makekeys_makekeys_OBJECTS = $(am_makekeys_makekeys_OBJECTS) +makekeys_makekeys_LDADD = $(LDADD) +makekeys_makekeys_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(makekeys_makekeys_CFLAGS) $(CFLAGS) \ + $(makekeys_makekeys_LDFLAGS) $(LDFLAGS) -o $@ +test_canonicalise_SOURCES = test/canonicalise.c +test_canonicalise_OBJECTS = test/canonicalise.$(OBJEXT) +test_canonicalise_DEPENDENCIES = $(TESTS_LDADD) +test_context_SOURCES = test/context.c +test_context_OBJECTS = test/context.$(OBJEXT) +test_context_DEPENDENCIES = $(TESTS_LDADD) +test_filecomp_SOURCES = test/filecomp.c +test_filecomp_OBJECTS = test/filecomp.$(OBJEXT) +test_filecomp_DEPENDENCIES = $(TESTS_LDADD) +test_namescomp_SOURCES = test/namescomp.c +test_namescomp_OBJECTS = test/namescomp.$(OBJEXT) +test_namescomp_DEPENDENCIES = $(TESTS_LDADD) +test_rulescomp_SOURCES = test/rulescomp.c +test_rulescomp_OBJECTS = test/rulescomp.$(OBJEXT) +test_rulescomp_DEPENDENCIES = $(TESTS_LDADD) +test_state_SOURCES = test/state.c +test_state_OBJECTS = test/state.$(OBJEXT) +test_state_DEPENDENCIES = $(TESTS_LDADD) +test_xkey_SOURCES = test/xkey.c +test_xkey_OBJECTS = test/xkey.$(OBJEXT) +test_xkey_DEPENDENCIES = $(TESTS_LDADD) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || +LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) +LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) +AM_V_LEX = $(am__v_LEX_@AM_V@) +am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) +am__v_LEX_0 = @echo " LEX " $@; +YLWRAP = $(top_srcdir)/ylwrap +@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) +LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) +AM_V_YACC = $(am__v_YACC_@AM_V@) +am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) +am__v_YACC_0 = @echo " YACC " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libxkbcommon_la_SOURCES) $(makekeys_makekeys_SOURCES) \ + test/canonicalise.c test/context.c test/filecomp.c \ + test/namescomp.c test/rulescomp.c test/state.c test/xkey.c +DIST_SOURCES = $(libxkbcommon_la_SOURCES) $(makekeys_makekeys_SOURCES) \ + test/canonicalise.c test/context.c test/filecomp.c \ + test/namescomp.c test/rulescomp.c test/state.c test/xkey.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DATA = $(pkgconfig_DATA) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +HEADERS = $(xkbcommoninclude_HEADERS) ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +# If stdout is a non-dumb tty, use colors. If test -t is not supported, +# then this fails; a conservative approach. Of course do not redirect +# stdout here, just stderr. +am__tty_colors = \ +red=; grn=; lgn=; blu=; std=; \ +test "X$(AM_COLOR_TESTS)" != Xno \ +&& test "X$$TERM" != Xdumb \ +&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \ +&& { \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + std=''; \ +} +# Restructured Text title and section. +am__rst_title = sed 's/.*/ & /;h;s/./=/g;p;x;p;g;p;s/.*//' +am__rst_section = sed 'p;s/./=/g;p;g' +# Put stdin (possibly several lines separated by ". ") in a box. +# Prefix each line by 'col' and terminate each with 'std', for coloring. +# Multi line coloring is problematic with "less -R", so we really need +# to color each line individually. +am__text_box = $(AWK) '{ \ + n = split($$0, lines, "\\. "); max = 0; \ + for (i = 1; i <= n; ++i) \ + if (max < length(lines[i])) \ + max = length(lines[i]); \ + for (i = 0; i < max; ++i) \ + line = line "="; \ + print col line std; \ + for (i = 1; i <= n; ++i) \ + if (lines[i]) \ + print col lines[i] std; \ + print col line std; \ +}' +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log, and passes +# TESTS_ENVIRONMENT. Save and restore TERM around use of +# TESTS_ENVIRONMENT, in case that unsets it. +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +srcdir=$(srcdir); export srcdir; \ +rm -f $@-t; \ +am__trap='rm -f '\''$(abs_builddir)/$@-t'\''; (exit $$st); exit $$st'; \ +trap "st=129; $$am__trap" 1; trap "st=130; $$am__trap" 2; \ +trap "st=141; $$am__trap" 13; trap "st=143; $$am__trap" 15; \ +am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`; \ +test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM; \ +$(TESTS_ENVIRONMENT) +# To be appended to the command running the test. Handle the stdout +# and stderr redirection, and catch the exit status. +am__check_post = \ +>$@-t 2>&1; \ +estatus=$$?; \ +if test -n '$(DISABLE_HARD_ERRORS)' \ + && test $$estatus -eq 99; then \ + estatus=1; \ +fi; \ +TERM=$$__SAVED_TERM; export TERM; \ +$(am__tty_colors); \ +xfailed=PASS; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + xfailed=XFAIL;; \ +esac; \ +case $$estatus.$$xfailed in \ + 0.XFAIL) col=$$red; res=XPASS;; \ + 0.*) col=$$grn; res=PASS ;; \ + 77.*) col=$$blu; res=SKIP ;; \ + 99.*) col=$$red; res=FAIL ;; \ + *.XFAIL) col=$$lgn; res=XFAIL;; \ + *.*) col=$$red; res=FAIL ;; \ +esac; \ +echo "$${col}$$res$${std}: $$f"; \ +echo "$$res: $$f (exit: $$estatus)" | \ + $(am__rst_section) >$@; \ +cat $@-t >>$@; \ +rm -f $@-t +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck check-html recheck-html +TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -132,31 +331,6 @@ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print @@ -314,15 +488,100 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ - -# Order: makekeys before src -SUBDIRS = include makekeys src test +ACLOCAL_AMFLAGS = -I m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xkbcommon.pc MAINTAINERCLEANFILES = ChangeLog INSTALL -all: all-recursive +AM_CPPFLAGS = \ + -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/xkbcomp \ + -Isrc/xkbcomp/ \ + -include $(top_srcdir)/src/config.h + +AM_CFLAGS = \ + $(BASE_CFLAGS) \ + $(XMALLOC_ZERO_CFLAGS) + +AM_YFLAGS = -d +xkbcommonincludedir = $(includedir)/xkbcommon +xkbcommoninclude_HEADERS = include/xkbcommon/xkbcommon.h +lib_LTLIBRARIES = libxkbcommon.la +libxkbcommon_la_LDFLAGS = -no-undefined +libxkbcommon_la_SOURCES = \ + src/xkbcomp/action.c \ + src/xkbcomp/action.h \ + src/xkbcomp/alias.c \ + src/xkbcomp/alias.h \ + src/xkbcomp/compat.c \ + src/xkbcomp/expr.c \ + src/xkbcomp/expr.h \ + src/xkbcomp/indicators.c \ + src/xkbcomp/indicators.h \ + src/xkbcomp/keycodes.c \ + src/xkbcomp/keycodes.h \ + src/xkbcomp/keymap.c \ + src/xkbcomp/keytypes.c \ + src/xkbcomp/misc.c \ + src/xkbcomp/misc.h \ + src/xkbcomp/parseutils.c \ + src/xkbcomp/parseutils.h \ + src/xkbcomp/symbols.c \ + src/xkbcomp/vmod.c \ + src/xkbcomp/vmod.h \ + src/xkbcomp/xkbcomp.c \ + src/xkbcomp/xkbcomp.h \ + src/xkbcomp/xkbparse.y \ + src/xkbcomp/xkbpath.c \ + src/xkbcomp/xkbpath.h \ + src/xkbcomp/xkbscan.l \ + src/alloc.c \ + src/atom.c \ + src/context.c \ + src/keysym.c \ + src/map.c \ + src/maprules.c \ + src/misc.c \ + src/state.c \ + src/text.c \ + src/utils.c \ + src/utils.h \ + src/xkb.c \ + src/xkballoc.h \ + src/xkbmisc.h \ + src/xkbrules.h \ + src/XKBcommonint.h + +BUILT_SOURCES = \ + src/xkbcomp/xkbparse.c \ + src/xkbcomp/xkbparse.h \ + src/xkbcomp/xkbscan.c \ + src/ks_tables.h + +CLEANFILES = $(BUILT_SOURCES) +makekeys_makekeys_SOURCES = makekeys/makekeys.c +makekeys_makekeys_CC = $(CC_FOR_BUILD) +makekeys_makekeys_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_FOR_BUILD) +makekeys_makekeys_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) +makekeys_makekeys_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) + +# Tests +TESTS_ENVIRONMENT = +TESTS_LDADD = libxkbcommon.la +test_xkey_LDADD = $(TESTS_LDADD) +test_filecomp_LDADD = $(TESTS_LDADD) +test_namescomp_LDADD = $(TESTS_LDADD) +test_rulescomp_LDADD = $(TESTS_LDADD) +test_canonicalise_LDADD = $(TESTS_LDADD) +test_state_LDADD = $(TESTS_LDADD) +test_context_LDADD = $(TESTS_LDADD) +EXTRA_DIST = test/data +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: +.SUFFIXES: .c .html .l .lo .log .o .obj .test .test$(EXEEXT) .y am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @@ -357,14 +616,343 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): + +src/config.h: src/stamp-h1 + @if test ! -f $@; then rm -f src/stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) src/stamp-h1; else :; fi + +src/stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status + @rm -f src/stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status src/config.h +$(top_srcdir)/src/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f src/stamp-h1 + touch $@ + +distclean-hdr: + -rm -f src/config.h src/stamp-h1 xkbcommon.pc: $(top_builddir)/config.status $(srcdir)/xkbcommon.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +src/xkbcomp/$(am__dirstamp): + @$(MKDIR_P) src/xkbcomp + @: > src/xkbcomp/$(am__dirstamp) +src/xkbcomp/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/xkbcomp/$(DEPDIR) + @: > src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/action.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/alias.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/compat.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/expr.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/indicators.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/keycodes.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/keymap.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/keytypes.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/misc.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/parseutils.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/symbols.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/vmod.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/xkbcomp.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/xkbparse.h: src/xkbcomp/xkbparse.c + @if test ! -f $@; then rm -f src/xkbcomp/xkbparse.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) src/xkbcomp/xkbparse.c; else :; fi +src/xkbcomp/xkbparse.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/xkbpath.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/xkbcomp/xkbscan.lo: src/xkbcomp/$(am__dirstamp) \ + src/xkbcomp/$(DEPDIR)/$(am__dirstamp) +src/$(am__dirstamp): + @$(MKDIR_P) src + @: > src/$(am__dirstamp) +src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/$(DEPDIR) + @: > src/$(DEPDIR)/$(am__dirstamp) +src/alloc.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/atom.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/context.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/keysym.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/map.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/maprules.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/misc.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/state.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/text.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/utils.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/xkb.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +libxkbcommon.la: $(libxkbcommon_la_OBJECTS) $(libxkbcommon_la_DEPENDENCIES) $(EXTRA_libxkbcommon_la_DEPENDENCIES) + $(AM_V_CCLD)$(libxkbcommon_la_LINK) -rpath $(libdir) $(libxkbcommon_la_OBJECTS) $(libxkbcommon_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +makekeys/$(am__dirstamp): + @$(MKDIR_P) makekeys + @: > makekeys/$(am__dirstamp) +makekeys/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) makekeys/$(DEPDIR) + @: > makekeys/$(DEPDIR)/$(am__dirstamp) +makekeys/makekeys_makekeys-makekeys.$(OBJEXT): \ + makekeys/$(am__dirstamp) makekeys/$(DEPDIR)/$(am__dirstamp) +makekeys/makekeys$(EXEEXT): $(makekeys_makekeys_OBJECTS) $(makekeys_makekeys_DEPENDENCIES) $(EXTRA_makekeys_makekeys_DEPENDENCIES) makekeys/$(am__dirstamp) + @rm -f makekeys/makekeys$(EXEEXT) + $(AM_V_CCLD)$(makekeys_makekeys_LINK) $(makekeys_makekeys_OBJECTS) $(makekeys_makekeys_LDADD) $(LIBS) +test/$(am__dirstamp): + @$(MKDIR_P) test + @: > test/$(am__dirstamp) +test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) test/$(DEPDIR) + @: > test/$(DEPDIR)/$(am__dirstamp) +test/canonicalise.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/canonicalise$(EXEEXT): $(test_canonicalise_OBJECTS) $(test_canonicalise_DEPENDENCIES) $(EXTRA_test_canonicalise_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/canonicalise$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_canonicalise_OBJECTS) $(test_canonicalise_LDADD) $(LIBS) +test/context.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/context$(EXEEXT): $(test_context_OBJECTS) $(test_context_DEPENDENCIES) $(EXTRA_test_context_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/context$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_context_OBJECTS) $(test_context_LDADD) $(LIBS) +test/filecomp.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/filecomp$(EXEEXT): $(test_filecomp_OBJECTS) $(test_filecomp_DEPENDENCIES) $(EXTRA_test_filecomp_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/filecomp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_filecomp_OBJECTS) $(test_filecomp_LDADD) $(LIBS) +test/namescomp.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/namescomp$(EXEEXT): $(test_namescomp_OBJECTS) $(test_namescomp_DEPENDENCIES) $(EXTRA_test_namescomp_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/namescomp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_namescomp_OBJECTS) $(test_namescomp_LDADD) $(LIBS) +test/rulescomp.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/rulescomp$(EXEEXT): $(test_rulescomp_OBJECTS) $(test_rulescomp_DEPENDENCIES) $(EXTRA_test_rulescomp_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/rulescomp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_rulescomp_OBJECTS) $(test_rulescomp_LDADD) $(LIBS) +test/state.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/state$(EXEEXT): $(test_state_OBJECTS) $(test_state_DEPENDENCIES) $(EXTRA_test_state_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/state$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_state_OBJECTS) $(test_state_LDADD) $(LIBS) +test/xkey.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/xkey$(EXEEXT): $(test_xkey_OBJECTS) $(test_xkey_DEPENDENCIES) $(EXTRA_test_xkey_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/xkey$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_xkey_OBJECTS) $(test_xkey_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f makekeys/makekeys_makekeys-makekeys.$(OBJEXT) + -rm -f src/alloc.$(OBJEXT) + -rm -f src/alloc.lo + -rm -f src/atom.$(OBJEXT) + -rm -f src/atom.lo + -rm -f src/context.$(OBJEXT) + -rm -f src/context.lo + -rm -f src/keysym.$(OBJEXT) + -rm -f src/keysym.lo + -rm -f src/map.$(OBJEXT) + -rm -f src/map.lo + -rm -f src/maprules.$(OBJEXT) + -rm -f src/maprules.lo + -rm -f src/misc.$(OBJEXT) + -rm -f src/misc.lo + -rm -f src/state.$(OBJEXT) + -rm -f src/state.lo + -rm -f src/text.$(OBJEXT) + -rm -f src/text.lo + -rm -f src/utils.$(OBJEXT) + -rm -f src/utils.lo + -rm -f src/xkb.$(OBJEXT) + -rm -f src/xkb.lo + -rm -f src/xkbcomp/action.$(OBJEXT) + -rm -f src/xkbcomp/action.lo + -rm -f src/xkbcomp/alias.$(OBJEXT) + -rm -f src/xkbcomp/alias.lo + -rm -f src/xkbcomp/compat.$(OBJEXT) + -rm -f src/xkbcomp/compat.lo + -rm -f src/xkbcomp/expr.$(OBJEXT) + -rm -f src/xkbcomp/expr.lo + -rm -f src/xkbcomp/indicators.$(OBJEXT) + -rm -f src/xkbcomp/indicators.lo + -rm -f src/xkbcomp/keycodes.$(OBJEXT) + -rm -f src/xkbcomp/keycodes.lo + -rm -f src/xkbcomp/keymap.$(OBJEXT) + -rm -f src/xkbcomp/keymap.lo + -rm -f src/xkbcomp/keytypes.$(OBJEXT) + -rm -f src/xkbcomp/keytypes.lo + -rm -f src/xkbcomp/misc.$(OBJEXT) + -rm -f src/xkbcomp/misc.lo + -rm -f src/xkbcomp/parseutils.$(OBJEXT) + -rm -f src/xkbcomp/parseutils.lo + -rm -f src/xkbcomp/symbols.$(OBJEXT) + -rm -f src/xkbcomp/symbols.lo + -rm -f src/xkbcomp/vmod.$(OBJEXT) + -rm -f src/xkbcomp/vmod.lo + -rm -f src/xkbcomp/xkbcomp.$(OBJEXT) + -rm -f src/xkbcomp/xkbcomp.lo + -rm -f src/xkbcomp/xkbparse.$(OBJEXT) + -rm -f src/xkbcomp/xkbparse.lo + -rm -f src/xkbcomp/xkbpath.$(OBJEXT) + -rm -f src/xkbcomp/xkbpath.lo + -rm -f src/xkbcomp/xkbscan.$(OBJEXT) + -rm -f src/xkbcomp/xkbscan.lo + -rm -f test/canonicalise.$(OBJEXT) + -rm -f test/context.$(OBJEXT) + -rm -f test/filecomp.$(OBJEXT) + -rm -f test/namescomp.$(OBJEXT) + -rm -f test/rulescomp.$(OBJEXT) + -rm -f test/state.$(OBJEXT) + -rm -f test/xkey.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@makekeys/$(DEPDIR)/makekeys_makekeys-makekeys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/alloc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/atom.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/context.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/keysym.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/map.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/maprules.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/misc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/state.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/text.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/xkb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/action.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/alias.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/compat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/expr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/indicators.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/keycodes.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/keymap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/keytypes.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/misc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/parseutils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/symbols.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/vmod.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/xkbcomp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/xkbparse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/xkbpath.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/xkbcomp/$(DEPDIR)/xkbscan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/canonicalise.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/context.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/filecomp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/namescomp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/rulescomp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/state.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/xkey.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +makekeys/makekeys_makekeys-makekeys.o: makekeys/makekeys.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(makekeys_makekeys_CPPFLAGS) $(CPPFLAGS) $(makekeys_makekeys_CFLAGS) $(CFLAGS) -MT makekeys/makekeys_makekeys-makekeys.o -MD -MP -MF makekeys/$(DEPDIR)/makekeys_makekeys-makekeys.Tpo -c -o makekeys/makekeys_makekeys-makekeys.o `test -f 'makekeys/makekeys.c' || echo '$(srcdir)/'`makekeys/makekeys.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) makekeys/$(DEPDIR)/makekeys_makekeys-makekeys.Tpo makekeys/$(DEPDIR)/makekeys_makekeys-makekeys.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='makekeys/makekeys.c' object='makekeys/makekeys_makekeys-makekeys.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(makekeys_makekeys_CPPFLAGS) $(CPPFLAGS) $(makekeys_makekeys_CFLAGS) $(CFLAGS) -c -o makekeys/makekeys_makekeys-makekeys.o `test -f 'makekeys/makekeys.c' || echo '$(srcdir)/'`makekeys/makekeys.c + +makekeys/makekeys_makekeys-makekeys.obj: makekeys/makekeys.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(makekeys_makekeys_CPPFLAGS) $(CPPFLAGS) $(makekeys_makekeys_CFLAGS) $(CFLAGS) -MT makekeys/makekeys_makekeys-makekeys.obj -MD -MP -MF makekeys/$(DEPDIR)/makekeys_makekeys-makekeys.Tpo -c -o makekeys/makekeys_makekeys-makekeys.obj `if test -f 'makekeys/makekeys.c'; then $(CYGPATH_W) 'makekeys/makekeys.c'; else $(CYGPATH_W) '$(srcdir)/makekeys/makekeys.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) makekeys/$(DEPDIR)/makekeys_makekeys-makekeys.Tpo makekeys/$(DEPDIR)/makekeys_makekeys-makekeys.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='makekeys/makekeys.c' object='makekeys/makekeys_makekeys-makekeys.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(makekeys_makekeys_CPPFLAGS) $(CPPFLAGS) $(makekeys_makekeys_CFLAGS) $(CFLAGS) -c -o makekeys/makekeys_makekeys-makekeys.obj `if test -f 'makekeys/makekeys.c'; then $(CYGPATH_W) 'makekeys/makekeys.c'; else $(CYGPATH_W) '$(srcdir)/makekeys/makekeys.c'; fi` + +.l.c: + $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) + +.y.c: + $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + -rm -rf makekeys/.libs makekeys/_libs + -rm -rf src/.libs src/_libs + -rm -rf src/xkbcomp/.libs src/xkbcomp/_libs + -rm -rf test/.libs test/_libs distclean-libtool: -rm -f libtool config.lt @@ -389,77 +977,28 @@ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ +install-xkbcommonincludeHEADERS: $(xkbcommoninclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(xkbcommoninclude_HEADERS)'; test -n "$(xkbcommonincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(xkbcommonincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(xkbcommonincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xkbcommonincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(xkbcommonincludedir)" || exit $$?; \ done +uninstall-xkbcommonincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(xkbcommoninclude_HEADERS)'; test -n "$(xkbcommonincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(xkbcommonincludedir)'; $(am__uninstall_files_from_dir) + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -470,23 +1009,10 @@ mkid -fID $$unique tags: TAGS -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -505,7 +1031,7 @@ fi; \ fi ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -525,6 +1051,151 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__sh_e_setup); \ + list='$(TEST_LOGS)'; \ + results=`for f in $$list; do \ + test -r $$f && read line < $$f && echo "$$line" \ + || echo FAIL; \ + done`; \ + all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[ ]*//'`; \ + fail=`echo "$$results" | grep -c '^FAIL'`; \ + pass=`echo "$$results" | grep -c '^PASS'`; \ + skip=`echo "$$results" | grep -c '^SKIP'`; \ + xfail=`echo "$$results" | grep -c '^XFAIL'`; \ + xpass=`echo "$$results" | grep -c '^XPASS'`; \ + failures=`expr $$fail + $$xpass`; \ + all=`expr $$all - $$skip`; \ + if test "$$all" -eq 1; then tests=test; All=; \ + else tests=tests; All="All "; fi; \ + case fail=$$fail:xpass=$$xpass:xfail=$$xfail in \ + fail=0:xpass=0:xfail=0) \ + msg="$$All$$all $$tests passed. "; \ + exit=true;; \ + fail=0:xpass=0:xfail=*) \ + msg="$$All$$all $$tests behaved as expected"; \ + if test "$$xfail" -eq 1; then xfailures=failure; \ + else xfailures=failures; fi; \ + msg="$$msg ($$xfail expected $$xfailures). "; \ + exit=true;; \ + fail=*:xpass=0:xfail=*) \ + msg="$$fail of $$all $$tests failed. "; \ + exit=false;; \ + fail=*:xpass=*:xfail=*) \ + msg="$$failures of $$all $$tests did not behave as expected"; \ + if test "$$xpass" -eq 1; then xpasses=pass; \ + else xpasses=passes; fi; \ + msg="$$msg ($$xpass unexpected $$xpasses). "; \ + exit=false;; \ + *) \ + echo >&2 "incorrect case"; exit 4;; \ + esac; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + msg="$$msg($$skip test was not run). "; \ + else \ + msg="$$msg($$skip tests were not run). "; \ + fi; \ + fi; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + echo "$$msg"; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for f in $$list; do \ + test -r $$f && read line < $$f || line=; \ + case $$line in \ + PASS:*|XFAIL:*);; \ + *) echo; cat $$f;; \ + esac; \ + done; \ + } >$(TEST_SUITE_LOG).tmp; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if test "$$failures" -ne 0; then \ + msg="$${msg}See $(subdir)/$(TEST_SUITE_LOG). "; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + msg="$${msg}Please report to $(PACKAGE_BUGREPORT). "; \ + fi; \ + fi; \ + test x"$$VERBOSE" = x || $$exit || cat $(TEST_SUITE_LOG); \ + $(am__tty_colors); \ + if $$exit; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + fi; \ + echo "$$msg" | $(am__text_box) "col=$$col" "std=$$std"; \ + $$exit || exit 1 + +check-TESTS recheck: + @if test $@ != recheck; then \ + list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list; \ + fi + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @list='' list2='$(TEST_LOGS)'; for f in $$list2; do \ + test .log = $$f && continue; \ + if test $@ = recheck; then \ + test -f $$f || continue; \ + if test -r $$f && read line < $$f; then \ + case $$line in FAIL*|XPASS*) : ;; *) continue;; esac; \ + fi; \ + fi; \ + if test -z "$$list"; then list=$$f; else list="$$list $$f"; fi; \ + done; \ + if test $@ = recheck && test -n "$$list"; then \ + $(am__make_dryrun) || rm -f $$list || exit 1; \ + fi; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list" +recheck: $(check_PROGRAMS) + +am--mostlyclean-test-html: + list='$(TEST_LOGS:.log=.html)'; test -z "$$list" || rm -f $$list + rm -f $(TEST_SUITE_HTML) + +.log.html: + @list='$(RST2HTML) $$RST2HTML rst2html rst2html.py'; \ + for r2h in $$list; do \ + if ($$r2h --version) >/dev/null 2>&1; then \ + R2H=$$r2h; \ + fi; \ + done; \ + if test -z "$$R2H"; then \ + echo >&2 "cannot find rst2html, cannot create $@"; \ + exit 2; \ + fi; \ + $$R2H $< >$@.tmp + @mv $@.tmp $@ + +# Be sure to run check first, and then to convert the result. +# Beware of concurrent executions. Run "check" not "check-TESTS", as +# check-SCRIPTS and other dependencies are rebuilt by the former only. +# And expect check to fail. +check-html recheck-html: + @target=`echo $@ | sed 's/-html$$//'`; \ + rv=0; $(MAKE) $(AM_MAKEFLAGS) $$target || rv=$$?; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML) TEST_LOGS= || exit 4; \ + exit $$rv +test/xkey.log: test/xkey$(EXEEXT) + @p='test/xkey$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +test/filecomp.log: test/filecomp$(EXEEXT) + @p='test/filecomp$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +test/namescomp.log: test/namescomp$(EXEEXT) + @p='test/namescomp$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +test/rulescomp.log: test/rulescomp$(EXEEXT) + @p='test/rulescomp$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +test/canonicalise.log: test/canonicalise$(EXEEXT) + @p='test/canonicalise$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +test/state.log: test/state$(EXEEXT) + @p='test/state$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +test/context.log: test/context$(EXEEXT) + @p='test/context$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +.test.log: + @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post) + distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @@ -557,31 +1228,6 @@ || exit 1; \ fi; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook @@ -716,22 +1362,25 @@ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-recursive -all-am: Makefile $(DATA) -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(xkbcommonincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-recursive +installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ @@ -743,106 +1392,131 @@ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS_TMP)" || rm -f $(TEST_LOGS_TMP) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f makekeys/$(DEPDIR)/$(am__dirstamp) + -rm -f makekeys/$(am__dirstamp) + -rm -f src/$(DEPDIR)/$(am__dirstamp) + -rm -f src/$(am__dirstamp) + -rm -f src/xkbcomp/$(DEPDIR)/$(am__dirstamp) + -rm -f src/xkbcomp/$(am__dirstamp) + -rm -f test/$(DEPDIR)/$(am__dirstamp) + -rm -f test/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -rm -f src/xkbcomp/xkbparse.c + -rm -f src/xkbcomp/xkbparse.h + -rm -f src/xkbcomp/xkbscan.c + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-recursive +clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstPROGRAMS mostlyclean-am -distclean: distclean-recursive +distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf makekeys/$(DEPDIR) src/$(DEPDIR) src/xkbcomp/$(DEPDIR) test/$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags -dvi: dvi-recursive +dvi: dvi-am dvi-am: -html: html-recursive +html: html-am html-am: -info: info-recursive +info: info-am info-am: -install-data-am: install-pkgconfigDATA +install-data-am: install-pkgconfigDATA install-xkbcommonincludeHEADERS -install-dvi: install-dvi-recursive +install-dvi: install-dvi-am install-dvi-am: -install-exec-am: +install-exec-am: install-libLTLIBRARIES -install-html: install-html-recursive +install-html: install-html-am install-html-am: -install-info: install-info-recursive +install-info: install-info-am install-info-am: install-man: -install-pdf: install-pdf-recursive +install-pdf: install-pdf-am install-pdf-am: -install-ps: install-ps-recursive +install-ps: install-ps-am install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-recursive +maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf makekeys/$(DEPDIR) src/$(DEPDIR) src/xkbcomp/$(DEPDIR) test/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-recursive +mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: am--mostlyclean-test-html mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool -pdf: pdf-recursive +pdf: pdf-am pdf-am: -ps: ps-recursive +ps: ps-am ps-am: -uninstall-am: uninstall-pkgconfigDATA +uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ + uninstall-xkbcommonincludeHEADERS -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: all check check-am check-html install install-am install-strip \ + recheck-html -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-hook dist-lzip dist-lzma dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ +.PHONY: CTAGS GTAGS all all-am am--mostlyclean-test-html am--refresh \ + check check-TESTS check-am check-html clean \ + clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstPROGRAMS ctags dist dist-all \ + dist-bzip2 dist-gzip dist-hook dist-lzip dist-lzma dist-shar \ + dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkgconfigDATA install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-pkgconfigDATA + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + install-xkbcommonincludeHEADERS installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am recheck recheck-html \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-pkgconfigDATA uninstall-xkbcommonincludeHEADERS .PHONY: ChangeLog INSTALL @@ -855,6 +1529,9 @@ dist-hook: ChangeLog INSTALL +src/ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/makekeys/makekeys$(EXEEXT) + $(top_builddir)/makekeys/makekeys $(KEYSYMDEFS) > $@ + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/makekeys/Makefile.am libxkbcommon-0.1.0~git20120510.409ec8a1/makekeys/Makefile.am --- libxkbcommon-0.1.0~git20120501.3d672fcf/makekeys/Makefile.am 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/makekeys/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) - -# need to use build-native compiler -CC = $(CC_FOR_BUILD) -CPPFLAGS = $(CPPFLAGS_FOR_BUILD) -CFLAGS = $(CFLAGS_FOR_BUILD) -LDFLAGS = $(LDFLAGS_FOR_BUILD) -noinst_PROGRAMS = makekeys diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/makekeys/makekeys.c libxkbcommon-0.1.0~git20120510.409ec8a1/makekeys/makekeys.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/makekeys/makekeys.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/makekeys/makekeys.c 2012-05-10 10:10:26.000000000 +0000 @@ -26,14 +26,18 @@ */ -/* Constructs hash tables for XStringToKeysym and XKeysymToString. */ +/* + * Constructs hash tables for xkb_keysym_to_string and + * xkb_string_from_keysym. + */ + +#include "xkbcommon/xkbcommon.h" -#include -#include #include #include #include #include +#include typedef uint32_t Signature; @@ -41,7 +45,7 @@ static struct info { char *name; - KeySym val; + xkb_keysym_t val; } info[KTNUM]; #define MIN_REHASH 15 @@ -50,11 +54,11 @@ static char tab[KTNUM]; static unsigned short offsets[KTNUM]; static unsigned short indexes[KTNUM]; -static KeySym values[KTNUM]; +static xkb_keysym_t values[KTNUM]; static int ksnum = 0; static int -parse_line(const char *buf, char *key, KeySym *val, char *prefix) +parse_line(const char *buf, char *key, xkb_keysym_t *val, char *prefix) { int i; char alias[128]; @@ -62,7 +66,7 @@ /* See if we can catch a straight XK_foo 0x1234-style definition first; * the trickery around tmp is to account for prefices. */ - i = sscanf(buf, "#define %127s 0x%lx", key, val); + i = sscanf(buf, "#define %127s 0x%"SCNx32, key, val); if (i == 2 && (tmp = strstr(key, "XK_"))) { memcpy(prefix, key, tmp - key); prefix[tmp - key] = '\0'; @@ -109,7 +113,7 @@ int best_max_rehash; int best_z = 0; int num_found; - KeySym val; + xkb_keysym_t val; char key[128], prefix[128]; char buf[1024]; @@ -127,7 +131,7 @@ if (val == XK_VoidSymbol) val = 0; if (val > 0x1fffffff) { - fprintf(stderr, "ignoring illegal keysym (%s, %lx)\n", key, + fprintf(stderr, "ignoring illegal keysym (%s, %"PRIx32")\n", key, val); continue; } @@ -150,9 +154,9 @@ fclose(fptr); } - /* Special case NoSymbol. */ + /* Special case XKB_KEYSYM_NO_SYMBOL. */ info[ksnum].name = strdup("NoSymbol"); - info[ksnum].val = 0L; + info[ksnum].val = XKB_KEYSYM_NO_SYMBOL; ksnum++; printf("/* This file is generated from keysymdef.h. */\n"); @@ -219,10 +223,10 @@ offsets[j] = k; indexes[i] = k; val = info[i].val; - printf("0x%.2"PRIx32", 0x%.2"PRIx32", 0x%.2lx, 0x%.2lx, 0x%.2lx, 0x%.2lx, ", - (sig >> 8) & 0xff, sig & 0xff, - (val >> 24) & 0xff, (val >> 16) & 0xff, - (val >> 8) & 0xff, val & 0xff); + printf("0x%.2"PRIx32", 0x%.2"PRIx32", 0x%.2"PRIx32", " + "0x%.2"PRIx32", 0x%.2"PRIx32", 0x%.2"PRIx32", ", + (sig >> 8) & 0xff, sig & 0xff, (val >> 24) & 0xff, + (val >> 16) & 0xff, (val >> 8) & 0xff, val & 0xff); for (name = info[i].name, k += 7; (c = *name++); k++) printf("'%c',", c); printf((i == (ksnum-1)) ? "0\n" : "0,\n"); @@ -317,5 +321,8 @@ printf("};\n"); printf("\n#endif /* KS_TABLES_H */\n"); + for (i = 0; i < ksnum; i++) + free(info[i].name); + exit(0); } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/alloc.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/alloc.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/alloc.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/alloc.c 2012-05-10 10:10:26.000000000 +0000 @@ -23,16 +23,354 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "utils.h" #include "xkballoc.h" #include "xkbcommon/xkbcommon.h" #include "XKBcommonint.h" -#include int -XkbcAllocCompatMap(struct xkb_desc * xkb, unsigned which, unsigned nSI) +XkbcAllocClientMap(struct xkb_keymap * xkb, unsigned which, unsigned nTotalTypes) +{ + struct xkb_client_map * map; + + if (!xkb || ((nTotalTypes > 0) && (nTotalTypes < XkbNumRequiredTypes))) + return BadValue; + + if ((which & XkbKeySymsMask) && !xkb_keymap_keycode_range_is_legal(xkb)) { +#ifdef DEBUG + fprintf(stderr, "bad keycode (%d,%d) in XkbAllocClientMap\n", + xkb->min_key_code, xkb->max_key_code); +#endif + return BadValue; + } + + if (!xkb->map) { + map = uTypedCalloc(1, struct xkb_client_map); + if (!map) + return BadAlloc; + xkb->map = map; + } + else + map = xkb->map; + + if ((which & XkbKeyTypesMask) && (nTotalTypes > 0)) { + if (!map->types) { + map->types = uTypedCalloc(nTotalTypes, struct xkb_key_type); + if (!map->types) + return BadAlloc; + + map->num_types = 0; + map->size_types = nTotalTypes; + } + else if (map->size_types < nTotalTypes) { + struct xkb_key_type *prev_types = map->types; + + map->types = uTypedRealloc(map->types, nTotalTypes, + struct xkb_key_type); + if (!map->types) { + free(prev_types); + map->num_types = map->size_types = 0; + return BadAlloc; + } + + map->size_types = nTotalTypes; + memset(&map->types[map->num_types], 0, + (map->size_types - map->num_types) * sizeof(struct xkb_key_type)); + } + } + + if (which & XkbKeySymsMask) { + if (!map->key_sym_map) { + map->key_sym_map = uTypedCalloc(xkb->max_key_code + 1, + struct xkb_sym_map); + if (!map->key_sym_map) + return BadAlloc; + } + } + + if (which & XkbModifierMapMask) { + if (!map->modmap) { + map->modmap = uTypedCalloc(xkb->max_key_code + 1, unsigned char); + if (!map->modmap) + return BadAlloc; + } + } + + return Success; +} + +int +XkbcAllocServerMap(struct xkb_keymap * xkb, unsigned which, unsigned nNewActions) +{ + unsigned i; + struct xkb_server_map * map; + + if (!xkb) + return BadMatch; + + if (!xkb->server) { + map = uTypedCalloc(1, struct xkb_server_map); + if (!map) + return BadAlloc; + + for (i = 0; i < XkbNumVirtualMods; i++) + map->vmods[i] = XkbNoModifierMask; + + xkb->server = map; + } + else + map = xkb->server; + + if (!which) + return Success; + + if (!xkb_keymap_keycode_range_is_legal(xkb)) + return BadMatch; + + if (!map->explicit) { + i = xkb->max_key_code + 1; + map->explicit = uTypedCalloc(i, unsigned char); + if (!map->explicit) + return BadAlloc; + } + + if (nNewActions < 1) + nNewActions = 1; + + if (!map->acts) { + map->acts = uTypedCalloc(nNewActions + 1, union xkb_action); + if (!map->acts) + return BadAlloc; + map->num_acts = 1; + map->size_acts = nNewActions + 1; + } + else if ((map->size_acts - map->num_acts) < (int)nNewActions) { + unsigned need; + union xkb_action *prev_acts = map->acts; + + need = map->num_acts + nNewActions; + map->acts = uTypedRealloc(map->acts, need, union xkb_action); + if (!map->acts) { + free(prev_acts); + map->num_acts = map->size_acts = 0; + return BadAlloc; + } + + map->size_acts = need; + memset(&map->acts[map->num_acts], 0, + (map->size_acts - map->num_acts) * sizeof(union xkb_action)); + } + + if (!map->key_acts) { + i = xkb->max_key_code + 1; + map->key_acts = uTypedCalloc(i, unsigned short); + if (!map->key_acts) + return BadAlloc; + } + + if (!map->behaviors) { + i = xkb->max_key_code + 1; + map->behaviors = uTypedCalloc(i, struct xkb_behavior); + if (!map->behaviors) + return BadAlloc; + } + + if (!map->vmodmap) { + i = xkb->max_key_code + 1; + map->vmodmap = uTypedCalloc(i, uint32_t); + if (!map->vmodmap) + return BadAlloc; + } + + return Success; +} + +int +XkbcCopyKeyType(struct xkb_key_type * from, struct xkb_key_type * into) +{ + int i; + + if (!from || !into) + return BadMatch; + + free(into->map); + into->map = NULL; + free(into->preserve); + into->preserve= NULL; + for (i = 0; i < into->num_levels; i++) + free(UNCONSTIFY(into->level_names[i])); + free(into->level_names); + into->level_names = NULL; + + *into = *from; + + if (from->map && (into->map_count > 0)) { + into->map = uTypedCalloc(into->map_count, struct xkb_kt_map_entry); + if (!into->map) + return BadAlloc; + memcpy(into->map, from->map, + into->map_count * sizeof(struct xkb_kt_map_entry)); + } + + if (from->preserve && (into->map_count > 0)) { + into->preserve = uTypedCalloc(into->map_count, struct xkb_mods); + if (!into->preserve) + return BadAlloc; + memcpy(into->preserve, from->preserve, + into->map_count * sizeof(struct xkb_mods)); + } + + if (from->level_names && (into->num_levels > 0)) { + into->level_names = uTypedCalloc(into->num_levels, const char *); + if (!into->level_names) + return BadAlloc; + for (i = 0; i < into->num_levels; i++) + into->level_names[i] = strdup(from->level_names[i]); + } + + return Success; +} + +bool +XkbcResizeKeySyms(struct xkb_keymap * xkb, xkb_keycode_t key, + unsigned int needed) +{ + if (xkb->map->key_sym_map[key].size_syms >= needed) + return true; + + xkb->map->key_sym_map[key].syms = + uTypedRecalloc(xkb->map->key_sym_map[key].syms, + xkb->map->key_sym_map[key].size_syms, + needed, + xkb_keysym_t); + if (!xkb->map->key_sym_map[key].syms) { + xkb->map->key_sym_map[key].size_syms = 0; + return false; + } + xkb->map->key_sym_map[key].size_syms = needed; + + return true; +} + +union xkb_action * +XkbcResizeKeyActions(struct xkb_keymap * xkb, xkb_keycode_t key, uint32_t needed) +{ + xkb_keycode_t i, nActs; + union xkb_action *newActs; + + if (needed == 0) { + xkb->server->key_acts[key] = 0; + return NULL; + } + + if (XkbKeyHasActions(xkb, key) && + (XkbKeyGroupsWidth(xkb, key) >= needed)) + return XkbKeyActionsPtr(xkb, key); + + if (xkb->server->size_acts - xkb->server->num_acts >= (int)needed) { + xkb->server->key_acts[key] = xkb->server->num_acts; + xkb->server->num_acts += needed; + + return &xkb->server->acts[xkb->server->key_acts[key]]; + } + + xkb->server->size_acts = xkb->server->num_acts + needed + 8; + newActs = uTypedCalloc(xkb->server->size_acts, union xkb_action); + if (!newActs) + return NULL; + newActs[0].type = XkbSA_NoAction; + nActs = 1; + + for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { + xkb_keycode_t nKeyActs, nCopy; + + if ((xkb->server->key_acts[i] == 0) && (i != key)) + continue; + + nCopy = nKeyActs = XkbKeyNumActions(xkb, i); + if (i == key) { + nKeyActs= needed; + if (needed < nCopy) + nCopy = needed; + } + + if (nCopy > 0) + memcpy(&newActs[nActs], XkbKeyActionsPtr(xkb, i), + nCopy * sizeof(union xkb_action)); + if (nCopy < nKeyActs) + memset(&newActs[nActs + nCopy], 0, + (nKeyActs - nCopy) * sizeof(union xkb_action)); + + xkb->server->key_acts[i] = nActs; + nActs += nKeyActs; + } + + free(xkb->server->acts); + xkb->server->acts = newActs; + xkb->server->num_acts = nActs; + + return &xkb->server->acts[xkb->server->key_acts[key]]; +} + +void +XkbcFreeClientMap(struct xkb_keymap * xkb) +{ + struct xkb_client_map * map; + struct xkb_key_type * type; + xkb_keycode_t key; + int i; + + if (!xkb || !xkb->map) + return; + + map = xkb->map; + + for (i = 0, type = map->types; i < map->num_types && type; i++, type++) { + int j; + free(type->map); + free(type->preserve); + for (j = 0; j < type->num_levels; j++) + free(UNCONSTIFY(type->level_names[j])); + free(type->level_names); + free(UNCONSTIFY(type->name)); + } + free(map->types); + + if (map->key_sym_map) { + for (key = xkb->min_key_code; key < xkb->max_key_code; key++) { + free(map->key_sym_map[key].sym_index); + free(map->key_sym_map[key].num_syms); + free(map->key_sym_map[key].syms); + } + } + free(map->key_sym_map); + + free(map->modmap); + free(xkb->map); + xkb->map = NULL; +} + +void +XkbcFreeServerMap(struct xkb_keymap * xkb) +{ + struct xkb_server_map * map; + + if (!xkb || !xkb->server) + return; + + map = xkb->server; + + free(map->explicit); + free(map->key_acts); + free(map->acts); + free(map->behaviors); + free(map->vmodmap); + free(xkb->server); + xkb->server = NULL; +} + +int +XkbcAllocCompatMap(struct xkb_keymap *xkb, unsigned nSI) { struct xkb_compat_map * compat; struct xkb_sym_interpret *prev_interpret; @@ -50,27 +388,24 @@ compat->num_si = 0; prev_interpret = compat->sym_interpret; - compat->sym_interpret = _XkbTypedRealloc(compat->sym_interpret, - nSI, struct xkb_sym_interpret); + compat->sym_interpret = uTypedRecalloc(compat->sym_interpret, + compat->num_si, nSI, + struct xkb_sym_interpret); if (!compat->sym_interpret) { free(prev_interpret); compat->size_si = compat->num_si = 0; return BadAlloc; } - if (compat->num_si != 0) - _XkbClearElems(compat->sym_interpret, compat->num_si, - compat->size_si - 1, struct xkb_sym_interpret); - return Success; } - compat = _XkbTypedCalloc(1, struct xkb_compat_map); + compat = uTypedCalloc(1, struct xkb_compat_map); if (!compat) return BadAlloc; if (nSI > 0) { - compat->sym_interpret = _XkbTypedCalloc(nSI, struct xkb_sym_interpret); + compat->sym_interpret = uTypedCalloc(nSI, struct xkb_sym_interpret); if (!compat->sym_interpret) { free(compat); return BadAlloc; @@ -86,7 +421,7 @@ static void -XkbcFreeCompatMap(struct xkb_desc * xkb) +XkbcFreeCompatMap(struct xkb_keymap * xkb) { struct xkb_compat_map * compat; @@ -101,7 +436,7 @@ } int -XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalAliases) +XkbcAllocNames(struct xkb_keymap * xkb, unsigned which, unsigned nTotalAliases) { struct xkb_names * names; @@ -109,7 +444,7 @@ return BadMatch; if (!xkb->names) { - xkb->names = _XkbTypedCalloc(1, struct xkb_names); + xkb->names = uTypedCalloc(1, struct xkb_names); if (!xkb->names) return BadAlloc; } @@ -122,7 +457,7 @@ type = xkb->map->types; for (i = 0; i < xkb->map->num_types; i++, type++) { if (!type->level_names) { - type->level_names = _XkbTypedCalloc(type->num_levels, const char *); + type->level_names = uTypedCalloc(type->num_levels, const char *); if (!type->level_names) return BadAlloc; } @@ -133,25 +468,23 @@ if (!xkb_keymap_keycode_range_is_legal(xkb)) return BadMatch; - names->keys = _XkbTypedCalloc(xkb->max_key_code + 1, struct xkb_key_name); + names->keys = uTypedCalloc(xkb->max_key_code + 1, struct xkb_key_name); if (!names->keys) return BadAlloc; } if ((which & XkbKeyAliasesMask) && (nTotalAliases > 0)) { if (!names->key_aliases) - names->key_aliases = _XkbTypedCalloc(nTotalAliases, + names->key_aliases = uTypedCalloc(nTotalAliases, struct xkb_key_alias); else if (nTotalAliases > names->num_key_aliases) { struct xkb_key_alias *prev_aliases = names->key_aliases; - names->key_aliases = _XkbTypedRealloc(names->key_aliases, - nTotalAliases, - struct xkb_key_alias); - if (names->key_aliases) - _XkbClearElems(names->key_aliases, names->num_key_aliases, - nTotalAliases - 1, struct xkb_key_alias); - else + names->key_aliases = uTypedRecalloc(names->key_aliases, + names->num_key_aliases, + nTotalAliases, + struct xkb_key_alias); + if (!names->key_aliases) free(prev_aliases); } @@ -167,7 +500,7 @@ } static void -XkbcFreeNames(struct xkb_desc * xkb) +XkbcFreeNames(struct xkb_keymap * xkb) { struct xkb_names * names; struct xkb_client_map * map; @@ -185,18 +518,18 @@ for (i = 0; i < map->num_types; i++, type++) { int j; for (j = 0; j < type->num_levels; j++) - free((char *) type->level_names[i]); + free(UNCONSTIFY(type->level_names[i])); free(type->level_names); type->level_names = NULL; } } for (i = 0; i < XkbNumVirtualMods; i++) - free((char *) names->vmods[i]); + free(UNCONSTIFY(names->vmods[i])); for (i = 0; i < XkbNumIndicators; i++) - free((char *) names->indicators[i]); + free(UNCONSTIFY(names->indicators[i])); for (i = 0; i < XkbNumKbdGroups; i++) - free((char *) names->groups[i]); + free(UNCONSTIFY(names->groups[i])); free(names->keys); free(names->key_aliases); @@ -205,29 +538,27 @@ } int -XkbcAllocControls(struct xkb_desc * xkb, unsigned which) +XkbcAllocControls(struct xkb_keymap * xkb) { if (!xkb) return BadMatch; if (!xkb->ctrls) { - xkb->ctrls = _XkbTypedCalloc(1, struct xkb_controls); + xkb->ctrls = uTypedCalloc(1, struct xkb_controls); if (!xkb->ctrls) return BadAlloc; } - if (!xkb->ctrls->per_key_repeat) { - xkb->ctrls->per_key_repeat = _XkbTypedCalloc(xkb->max_key_code << 3, - unsigned char); - if (!xkb->ctrls->per_key_repeat) - return BadAlloc; - } + xkb->ctrls->per_key_repeat = uTypedCalloc(xkb->max_key_code << 3, + unsigned char); + if (!xkb->ctrls->per_key_repeat) + return BadAlloc; return Success; } static void -XkbcFreeControls(struct xkb_desc * xkb) +XkbcFreeControls(struct xkb_keymap * xkb) { if (xkb && xkb->ctrls) { free(xkb->ctrls->per_key_repeat); @@ -237,13 +568,13 @@ } int -XkbcAllocIndicatorMaps(struct xkb_desc * xkb) +XkbcAllocIndicatorMaps(struct xkb_keymap * xkb) { if (!xkb) return BadMatch; if (!xkb->indicators) { - xkb->indicators = _XkbTypedCalloc(1, struct xkb_indicator); + xkb->indicators = uTypedCalloc(1, struct xkb_indicator); if (!xkb->indicators) return BadAlloc; } @@ -252,7 +583,7 @@ } static void -XkbcFreeIndicatorMaps(struct xkb_desc * xkb) +XkbcFreeIndicatorMaps(struct xkb_keymap * xkb) { if (xkb) { free(xkb->indicators); @@ -260,19 +591,23 @@ } } -struct xkb_desc * -XkbcAllocKeyboard(void) +struct xkb_keymap * +XkbcAllocKeyboard(struct xkb_context *context) { - struct xkb_desc *xkb; + struct xkb_keymap *xkb; + + xkb = uTypedCalloc(1, struct xkb_keymap); + if (!xkb) + return NULL; + + xkb->refcnt = 1; + xkb->context = xkb_context_ref(context); - xkb = _XkbTypedCalloc(1, struct xkb_desc); - if (xkb) - xkb->device_spec = XkbUseCoreKbd; return xkb; } void -XkbcFreeKeyboard(struct xkb_desc * xkb) +XkbcFreeKeyboard(struct xkb_keymap * xkb) { if (!xkb) return; @@ -283,5 +618,6 @@ XkbcFreeIndicatorMaps(xkb); XkbcFreeNames(xkb); XkbcFreeControls(xkb); + xkb_context_unref(xkb->context); free(xkb); } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/atom.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/atom.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/atom.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/atom.c 2012-05-10 10:10:26.000000000 +0000 @@ -70,9 +70,6 @@ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif #include "xkbmisc.h" #include "xkbcommon/xkbcommon.h" #include "XKBcommonint.h" @@ -88,17 +85,17 @@ #define BAD_RESOURCE 0xe0000000 -static xkb_atom_t lastAtom = None; -static NodePtr atomRoot = NULL; +static xkb_atom_t lastAtom = XKB_ATOM_NONE; +static NodePtr atomRoot; static unsigned long tableLength; -static NodePtr *nodeTable = NULL; +static NodePtr *nodeTable; const char * XkbcAtomText(xkb_atom_t atom) { NodePtr node; - if ((atom == None) || (atom > lastAtom)) + if ((atom == XKB_ATOM_NONE) || (atom > lastAtom)) return NULL; if (!(node = nodeTable[atom])) return NULL; @@ -116,14 +113,14 @@ xkb_intern_atom(const char *string) { NodePtr *np; + NodePtr nd; unsigned i; int comp; unsigned int fp = 0; - unsigned len; - int makeit = True; + size_t len; if (!string) - return None; + return XKB_ATOM_NONE; len = strlen(string); np = &atomRoot; @@ -139,7 +136,7 @@ np = &((*np)->right); else { /* now start testing the strings */ - comp = strncmp(string, (*np)->string, (int)len); + comp = strncmp(string, (*np)->string, len); if ((comp < 0) || ((comp == 0) && (len < strlen((*np)->string)))) np = &((*np)->left); else if (comp > 0) @@ -149,53 +146,47 @@ } } - if (makeit) { - NodePtr nd; - - nd = malloc(sizeof(NodeRec)); - if (!nd) - return BAD_RESOURCE; + nd = malloc(sizeof(NodeRec)); + if (!nd) + return BAD_RESOURCE; + + nd->string = malloc(len + 1); + if (!nd->string) { + free(nd); + return BAD_RESOURCE; + } + strncpy(nd->string, string, len); + nd->string[len] = 0; - nd->string = malloc(len + 1); - if (!nd->string) { + if ((lastAtom + 1) >= tableLength) { + NodePtr *table; + int newLength; + + if (tableLength == 0) + newLength = InitialTableSize; + else + newLength = tableLength * 2; + + table = realloc(nodeTable, newLength * sizeof(NodePtr)); + if (!table) { + if (nd->string != string) + free(nd->string); free(nd); return BAD_RESOURCE; } - strncpy(nd->string, string, (int)len); - nd->string[len] = 0; - - if ((lastAtom + 1) >= tableLength) { - NodePtr *table; - int newLength; - - if (tableLength == 0) - newLength = InitialTableSize; - else - newLength = tableLength * 2; - - table = realloc(nodeTable, newLength * sizeof(NodePtr)); - if (!table) { - if (nd->string != string) - free(nd->string); - free(nd); - return BAD_RESOURCE; - } - tableLength = newLength; - table[None] = NULL; + tableLength = newLength; + table[XKB_ATOM_NONE] = NULL; - nodeTable = table; - } + nodeTable = table; + } - *np = nd; - nd->left = nd->right = NULL; - nd->fingerPrint = fp; - nd->a = (++lastAtom); - *(nodeTable + lastAtom) = nd; + *np = nd; + nd->left = nd->right = NULL; + nd->fingerPrint = fp; + nd->a = (++lastAtom); + *(nodeTable + lastAtom) = nd; - return nd->a; - } - else - return None; + return nd->a; } static void @@ -218,5 +209,6 @@ atomRoot = NULL; free(nodeTable); nodeTable = NULL; - lastAtom = None; + lastAtom = XKB_ATOM_NONE; + tableLength = 0; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/config.h.in libxkbcommon-0.1.0~git20120510.409ec8a1/src/config.h.in --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/config.h.in 2012-05-01 18:29:11.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/config.h.in 2012-05-10 10:11:17.000000000 +0000 @@ -24,6 +24,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H @@ -70,9 +73,41 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/context.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/context.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/context.c 1970-01-01 00:00:00.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/context.c 2012-05-10 10:10:26.000000000 +0000 @@ -0,0 +1,197 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone + */ + +#include +#include +#include +#include + +#include "xkbcommon/xkbcommon.h" +#include "XKBcommonint.h" +#include "utils.h" + +struct xkb_context { + int refcnt; + char **include_paths; + int num_include_paths; + int size_include_paths; +}; + +/** + * Append one directory to the context's include path. + */ +_X_EXPORT int +xkb_context_include_path_append(struct xkb_context *context, const char *path) +{ + struct stat stat_buf; + int err; + + if (context->size_include_paths <= context->num_include_paths) { + int new_size; + char **new_paths; + new_size = context->size_include_paths + 2; + new_paths = uTypedRecalloc(context->include_paths, + context->size_include_paths, + new_size, + typeof(new_paths)); + if (!new_paths) + return 0; + context->include_paths = new_paths; + context->size_include_paths = new_size; + } + + err = stat(path, &stat_buf); + if (err != 0) + return 0; + if (!S_ISDIR(stat_buf.st_mode)) + return 0; + if (eaccess(path, R_OK | X_OK) != 0) + return 0; + + context->include_paths[context->num_include_paths] = strdup(path); + if (!context->include_paths[context->num_include_paths]) + return 0; + context->num_include_paths++; + + return 1; +} + +/** + * Append the default include directories to the context. + */ +_X_EXPORT int +xkb_context_include_path_append_default(struct xkb_context *context) +{ + const char *home = getenv("HOME"); + char *user_path; + int err; + + (void) xkb_context_include_path_append(context, DFLT_XKB_CONFIG_ROOT); + + home = getenv("HOME"); + if (!home) + return 1; + err = asprintf(&user_path, "%s/.xkb", home); + if (err <= 0) + return 1; + (void) xkb_context_include_path_append(context, user_path); + free(user_path); + + return 1; +} + +/** + * Remove all entries in the context's include path. + */ +_X_EXPORT void +xkb_context_include_path_clear(struct xkb_context *context) +{ + int i; + + for (i = 0; i < context->num_include_paths; i++) { + free(context->include_paths[i]); + context->include_paths[i] = NULL; + } + free(context->include_paths); + context->include_paths = NULL; + context->num_include_paths = 0; +} + +/** + * xkb_context_include_path_clear() + xkb_context_include_path_append_default() + */ +_X_EXPORT int +xkb_context_include_path_reset_defaults(struct xkb_context *context) +{ + xkb_context_include_path_clear(context); + return xkb_context_include_path_append_default(context); +} + +/** + * Returns the number of entries in the context's include path. + */ +_X_EXPORT unsigned int +xkb_context_num_include_paths(struct xkb_context *context) +{ + return context->num_include_paths; +} + +/** + * Returns the given entry in the context's include path, or NULL if an + * invalid index is passed. + */ +_X_EXPORT const char * +xkb_context_include_path_get(struct xkb_context *context, unsigned int idx) +{ + if (idx >= xkb_context_num_include_paths(context)) + return NULL; + + return context->include_paths[idx]; +} + +/** + * Take a new reference on the context. + */ +_X_EXPORT struct xkb_context * +xkb_context_ref(struct xkb_context *context) +{ + context->refcnt++; + return context; +} + +/** + * Drop an existing reference on the context, and free it if the refcnt is + * now 0. + */ +_X_EXPORT void +xkb_context_unref(struct xkb_context *context) +{ + if (--context->refcnt > 0) + return; + + xkb_context_include_path_clear(context); + free(context); +} + +/** + * Create a new context. + */ +_X_EXPORT struct xkb_context * +xkb_context_new(void) +{ + struct xkb_context *context = calloc(1, sizeof(*context)); + + if (!context) + return NULL; + + context->refcnt = 1; + + if (!xkb_context_include_path_append_default(context)) { + xkb_context_unref(context); + return NULL; + } + + return context; +} diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/geom.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/geom.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/geom.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/geom.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -/************************************************************ -Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright -notice appear in all copies and that both that copyright -notice and this permission notice appear in supporting -documentation, and that the name of Silicon Graphics not be -used in advertising or publicity pertaining to distribution -of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability -of this software for any purpose. It is provided "as is" -without any express or implied warranty. - -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include "xkbgeom.h" -#include "xkbcommon/xkbcommon.h" -#include "XKBcommonint.h" - -static void -_XkbCheckBounds(struct xkb_bounds * bounds, int x, int y) -{ - if (x < bounds->x1) - bounds->x1 = x; - if (x > bounds->x2) - bounds->x2 = x; - if (y < bounds->y1) - bounds->y1 = y; - if (y > bounds->y2) - bounds->y2 = y; -} - -Bool -XkbcComputeShapeBounds(struct xkb_shape * shape) -{ - int o, p; - struct xkb_outline * outline; - struct xkb_point * pt; - - if ((!shape) || (shape->num_outlines < 1)) - return False; - - shape->bounds.x1 = shape->bounds.y1 = SHRT_MAX; - shape->bounds.x2 = shape->bounds.y2 = SHRT_MIN; - - for (outline = shape->outlines, o = 0; o < shape->num_outlines; - o++, outline++) - { - for (pt = outline->points, p = 0; p < outline->num_points; p++, pt++) - _XkbCheckBounds(&shape->bounds, pt->x, pt->y); - if (outline->num_points < 2) - _XkbCheckBounds(&shape->bounds, 0, 0); - } - return True; -} - -static Bool -XkbcComputeRowBounds(struct xkb_geometry * geom, struct xkb_section * section, struct xkb_row * row) -{ - int k, pos; - struct xkb_key * key; - struct xkb_bounds *bounds, *sbounds; - - if (!geom || !section || !row) - return False; - - bounds = &row->bounds; - memset(bounds, 0, sizeof(struct xkb_bounds)); - - for (key = row->keys, pos = k = 0; k < row->num_keys; k++, key++) { - sbounds = &XkbKeyShape(geom, key)->bounds; - _XkbCheckBounds(bounds, pos, 0); - - if (!row->vertical) { - if (key->gap != 0) { - pos += key->gap; - _XkbCheckBounds(bounds, pos, 0); - } - _XkbCheckBounds(bounds, pos + sbounds->x1, sbounds->y1); - _XkbCheckBounds(bounds, pos + sbounds->x2, sbounds->y2); - pos += sbounds->x2; - } - else { - if (key->gap != 0) { - pos += key->gap; - _XkbCheckBounds(bounds, 0, pos); - } - _XkbCheckBounds(bounds,pos + sbounds->x1, sbounds->y1); - _XkbCheckBounds(bounds,pos + sbounds->x2, sbounds->y2); - pos += sbounds->y2; - } - } - - return True; -} - -Bool -XkbcComputeSectionBounds(struct xkb_geometry * geom, struct xkb_section * section) -{ - int i; - struct xkb_shape * shape; - struct xkb_row * row; - union xkb_doodad * doodad; - struct xkb_bounds * bounds, *rbounds = NULL; - - if (!geom || !section) - return False; - - bounds = §ion->bounds; - memset(bounds, 0, sizeof(struct xkb_bounds)); - - for (i = 0, row = section->rows; i < section->num_rows; i++, row++) { - if (!XkbcComputeRowBounds(geom, section, row)) - return False; - rbounds = &row->bounds; - _XkbCheckBounds(bounds, row->left + rbounds->x1, - row->top + rbounds->y1); - _XkbCheckBounds(bounds, row->left + rbounds->x2, - row->top + rbounds->y2); - } - - for (i = 0, doodad = section->doodads; i < section->num_doodads; - i++, doodad++) - { - static struct xkb_bounds tbounds; - - switch (doodad->any.type) { - case XkbOutlineDoodad: - case XkbSolidDoodad: - shape = XkbShapeDoodadShape(geom, &doodad->shape); - rbounds = &shape->bounds; - break; - case XkbTextDoodad: - tbounds.x1 = doodad->text.left; - tbounds.y1 = doodad->text.top; - tbounds.x2 = tbounds.x1 + doodad->text.width; - tbounds.y2 = tbounds.y1 + doodad->text.height; - rbounds = &tbounds; - break; - case XkbIndicatorDoodad: - shape = XkbIndicatorDoodadShape(geom, &doodad->indicator); - rbounds = &shape->bounds; - break; - case XkbLogoDoodad: - shape = XkbLogoDoodadShape(geom, &doodad->logo); - rbounds = &shape->bounds; - break; - default: - tbounds.x1 = tbounds.x2 = doodad->any.left; - tbounds.y1 = tbounds.y2 = doodad->any.top; - rbounds = &tbounds; - break; - } - - _XkbCheckBounds(bounds, rbounds->x1, rbounds->y1); - _XkbCheckBounds(bounds, rbounds->x2, rbounds->y2); - } - - return True; -} diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/keysym.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/keysym.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/keysym.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/keysym.c 2012-05-10 10:10:26.000000000 +0000 @@ -25,19 +25,16 @@ authorization from the authors. */ -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include "xkbmisc.h" -#include "xkbcommon/xkbcommon.h" #include +#include #include +#include #include "ks_tables.h" +#include "xkbmisc.h" +#include "xkbcommon/xkbcommon.h" -void +_X_EXPORT void xkb_keysym_to_string(xkb_keysym_t ks, char *buffer, size_t size) { int i, n, h, idx; @@ -50,7 +47,7 @@ } /* Not listed in keysymdef.h for hysterical raisins. */ - if (ks == NoSymbol) { + if (ks == XKB_KEYSYM_NO_SYMBOL) { snprintf(buffer, size, "NoSymbol"); return; } @@ -91,12 +88,13 @@ snprintf(buffer, size, "0x%08x", ks); } -xkb_keysym_t +_X_EXPORT xkb_keysym_t xkb_string_to_keysym(const char *s) { int i, n, h, c, idx; uint32_t sig = 0; const char *p = s; + char *tmp; const unsigned char *entry; unsigned char sig1, sig2; xkb_keysym_t val; @@ -132,18 +130,24 @@ } if (*s == 'U') { - val = strtoul(&s[1], NULL, 16); + val = strtoul(&s[1], &tmp, 16); + if (tmp && *tmp != '\0') + return XKB_KEYSYM_NO_SYMBOL; if (val < 0x20 || (val > 0x7e && val < 0xa0)) - return NoSymbol; + return XKB_KEYSYM_NO_SYMBOL; if (val < 0x100) return val; if (val > 0x10ffff) - return NoSymbol; + return XKB_KEYSYM_NO_SYMBOL; return val | 0x01000000; } else if (s[0] == '0' && s[1] == 'x') { - return strtoul(&s[2], NULL, 16); + val = strtoul(&s[2], &tmp, 16); + if (tmp && *tmp != '\0') + return XKB_KEYSYM_NO_SYMBOL; + + return val; } /* Stupid inconsistency between the headers and XKeysymDB: the former has @@ -151,14 +155,14 @@ * As a last ditch effort, try without. */ if (strncmp(s, "XF86_", 5) == 0) { xkb_keysym_t ret; - char *tmp = strdup(s); + tmp = strdup(s); if (!tmp) - return NoSymbol; + return XKB_KEYSYM_NO_SYMBOL; memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1); ret = xkb_string_to_keysym(tmp); free(tmp); return ret; } - return NoSymbol; + return XKB_KEYSYM_NO_SYMBOL; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/Makefile.am libxkbcommon-0.1.0~git20120510.409ec8a1/src/Makefile.am --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/Makefile.am 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -SUBDIRS = xkbcomp - -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) $(XMALLOC_ZERO_CFLAGS) - -lib_LTLIBRARIES = libxkbcommon.la -libxkbcommon_la_LIBADD = xkbcomp/libxkbcomp.la -libxkbcommon_la_LDFLAGS = -no-undefined -libxkbcommon_la_SOURCES = \ - XKBcommonint.h \ - alloc.c \ - atom.c \ - keysym.c \ - malloc.c \ - map.c \ - maprules.c \ - misc.c \ - state.c \ - text.c \ - xkb.c \ - xkballoc.h \ - xkbmisc.h \ - xkbrules.h - -BUILT_SOURCES = ks_tables.h -CLEANFILES = $(BUILT_SOURCES) - -ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/makekeys/makekeys$(EXEEXT) - $(top_builddir)/makekeys/makekeys $(KEYSYMDEFS) > $@ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/malloc.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/malloc.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/malloc.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/malloc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,432 +0,0 @@ -/************************************************************ -Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright -notice appear in all copies and that both that copyright -notice and this permission notice appear in supporting -documentation, and that the name of Silicon Graphics not be -used in advertising or publicity pertaining to distribution -of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability -of this software for any purpose. It is provided "as is" -without any express or implied warranty. - -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -#include "xkballoc.h" -#include "xkbcommon/xkbcommon.h" -#include "XKBcommonint.h" - -int -XkbcAllocClientMap(struct xkb_desc * xkb, unsigned which, unsigned nTotalTypes) -{ - int i; - struct xkb_client_map * map; - - if (!xkb || ((nTotalTypes > 0) && (nTotalTypes < XkbNumRequiredTypes))) - return BadValue; - - if ((which & XkbKeySymsMask) && !xkb_keymap_keycode_range_is_legal(xkb)) { -#ifdef DEBUG - fprintf(stderr, "bad keycode (%d,%d) in XkbAllocClientMap\n", - xkb->min_key_code, xkb->max_key_code); -#endif - return BadValue; - } - - if (!xkb->map) { - map = _XkbTypedCalloc(1, struct xkb_client_map); - if (!map) - return BadAlloc; - xkb->map = map; - } - else - map = xkb->map; - - if ((which & XkbKeyTypesMask) && (nTotalTypes > 0)) { - if (!map->types) { - map->types = _XkbTypedCalloc(nTotalTypes, struct xkb_key_type); - if (!map->types) - return BadAlloc; - - map->num_types = 0; - map->size_types = nTotalTypes; - } - else if (map->size_types < nTotalTypes) { - struct xkb_key_type *prev_types = map->types; - - map->types = _XkbTypedRealloc(map->types, nTotalTypes, - struct xkb_key_type); - if (!map->types) { - free(prev_types); - map->num_types = map->size_types = 0; - return BadAlloc; - } - - map->size_types = nTotalTypes; - memset(&map->types[map->num_types], 0, - (map->size_types - map->num_types) * sizeof(struct xkb_key_type)); - } - } - - if (which & XkbKeySymsMask) { - int nKeys = XkbNumKeys(xkb); - - if (!map->syms) { - map->size_syms = (nKeys * 15) / 10; - map->syms = _XkbTypedCalloc(map->size_syms, xkb_keysym_t); - if (!map->syms) { - map->size_syms = 0; - return BadAlloc; - } - map->num_syms = 1; - map->syms[0] = NoSymbol; - } - - if (!map->key_sym_map) { - i = xkb->max_key_code + 1; - map->key_sym_map = _XkbTypedCalloc(i, struct xkb_sym_map); - if (!map->key_sym_map) - return BadAlloc; - } - } - - if (which & XkbModifierMapMask) { - if (!xkb_keymap_keycode_range_is_legal(xkb)) - return BadMatch; - - if (!map->modmap) { - i = xkb->max_key_code + 1; - map->modmap = _XkbTypedCalloc(i, unsigned char); - if (!map->modmap) - return BadAlloc; - } - } - - return Success; -} - -int -XkbcAllocServerMap(struct xkb_desc * xkb, unsigned which, unsigned nNewActions) -{ - int i; - struct xkb_server_map * map; - - if (!xkb) - return BadMatch; - - if (!xkb->server) { - map = _XkbTypedCalloc(1, struct xkb_server_map); - if (!map) - return BadAlloc; - - for (i = 0; i < XkbNumVirtualMods; i++) - map->vmods[i] = XkbNoModifierMask; - - xkb->server = map; - } - else - map = xkb->server; - - if (!which) - return Success; - - if (!xkb_keymap_keycode_range_is_legal(xkb)) - return BadMatch; - - if (which & XkbExplicitComponentsMask) { - if (!map->explicit) { - i = xkb->max_key_code + 1; - map->explicit = _XkbTypedCalloc(i, unsigned char); - if (!map->explicit) - return BadAlloc; - } - } - - if (which&XkbKeyActionsMask) { - if (nNewActions < 1) - nNewActions = 1; - - if (!map->acts) { - map->acts = _XkbTypedCalloc(nNewActions + 1, union xkb_action); - if (!map->acts) - return BadAlloc; - map->num_acts = 1; - map->size_acts = nNewActions + 1; - } - else if ((map->size_acts - map->num_acts) < nNewActions) { - unsigned need; - union xkb_action *prev_acts = map->acts; - - need = map->num_acts + nNewActions; - map->acts = _XkbTypedRealloc(map->acts, need, union xkb_action); - if (!map->acts) { - free(prev_acts); - map->num_acts = map->size_acts = 0; - return BadAlloc; - } - - map->size_acts = need; - memset(&map->acts[map->num_acts], 0, - (map->size_acts - map->num_acts) * sizeof(union xkb_action)); - } - - if (!map->key_acts) { - i = xkb->max_key_code + 1; - map->key_acts = _XkbTypedCalloc(i, unsigned short); - if (!map->key_acts) - return BadAlloc; - } - } - - if (which & XkbKeyBehaviorsMask) { - if (!map->behaviors) { - i = xkb->max_key_code + 1; - map->behaviors = _XkbTypedCalloc(i, struct xkb_behavior); - if (!map->behaviors) - return BadAlloc; - } - } - - if (which & XkbVirtualModMapMask) { - if (!map->vmodmap) { - i = xkb->max_key_code + 1; - map->vmodmap = _XkbTypedCalloc(i, uint32_t); - if (!map->vmodmap) - return BadAlloc; - } - } - - return Success; -} - -int -XkbcCopyKeyType(struct xkb_key_type * from, struct xkb_key_type * into) -{ - int i; - - if (!from || !into) - return BadMatch; - - free(into->map); - into->map = NULL; - free(into->preserve); - into->preserve= NULL; - for (i = 0; i < into->num_levels; i++) - free((char *) into->level_names[i]); - free(into->level_names); - into->level_names = NULL; - - *into = *from; - - if (from->map && (into->map_count > 0)) { - into->map = _XkbTypedCalloc(into->map_count, struct xkb_kt_map_entry); - if (!into->map) - return BadAlloc; - memcpy(into->map, from->map, - into->map_count * sizeof(struct xkb_kt_map_entry)); - } - - if (from->preserve && (into->map_count > 0)) { - into->preserve = _XkbTypedCalloc(into->map_count, struct xkb_mods); - if (!into->preserve) - return BadAlloc; - memcpy(into->preserve, from->preserve, - into->map_count * sizeof(struct xkb_mods)); - } - - if (from->level_names && (into->num_levels > 0)) { - into->level_names = _XkbTypedCalloc(into->num_levels, const char *); - if (!into->level_names) - return BadAlloc; - for (i = 0; i < into->num_levels; i++) - into->level_names[i] = strdup(from->level_names[i]); - } - - return Success; -} - -xkb_keysym_t * -XkbcResizeKeySyms(struct xkb_desc * xkb, xkb_keycode_t key, - unsigned int needed) -{ - uint32_t i, nSyms, nKeySyms; - uint32_t nOldSyms; - xkb_keysym_t *newSyms; - - if (needed == 0) { - xkb->map->key_sym_map[key].offset = 0; - return xkb->map->syms; - } - - nOldSyms = XkbKeyNumSyms(xkb, key); - if (nOldSyms >= needed) - return XkbKeySymsPtr(xkb, key); - - if (xkb->map->size_syms - xkb->map->num_syms >= needed) { - if (nOldSyms > 0) - memcpy(&xkb->map->syms[xkb->map->num_syms], - XkbKeySymsPtr(xkb, key), nOldSyms * sizeof(xkb_keysym_t)); - - if ((needed - nOldSyms) > 0) - memset(&xkb->map->syms[xkb->map->num_syms + XkbKeyNumSyms(xkb, key)], - 0, (needed - nOldSyms) * sizeof(xkb_keysym_t)); - - xkb->map->key_sym_map[key].offset = xkb->map->num_syms; - xkb->map->num_syms += needed; - - return &xkb->map->syms[xkb->map->key_sym_map[key].offset]; - } - - xkb->map->size_syms += (needed > 32 ? needed : 32); - newSyms = _XkbTypedCalloc(xkb->map->size_syms, xkb_keysym_t); - if (!newSyms) - return NULL; - - newSyms[0] = NoSymbol; - nSyms = 1; - for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { - int nCopy; - - nCopy = nKeySyms = XkbKeyNumSyms(xkb, i); - if ((nKeySyms == 0) && (i != key)) - continue; - - if (i == key) - nKeySyms = needed; - if (nCopy != 0) - memcpy(&newSyms[nSyms], XkbKeySymsPtr(xkb, i), - nCopy * sizeof(xkb_keysym_t)); - if (nKeySyms > nCopy) - memset(&newSyms[nSyms + nCopy], 0, - (nKeySyms - nCopy) * sizeof(xkb_keysym_t)); - - xkb->map->key_sym_map[i].offset = nSyms; - nSyms += nKeySyms; - } - - free(xkb->map->syms); - xkb->map->syms = newSyms; - xkb->map->num_syms = nSyms; - - return &xkb->map->syms[xkb->map->key_sym_map[key].offset]; -} - -union xkb_action * -XkbcResizeKeyActions(struct xkb_desc * xkb, xkb_keycode_t key, int needed) -{ - xkb_keycode_t i, nActs; - union xkb_action *newActs; - - if (needed == 0) { - xkb->server->key_acts[key] = 0; - return NULL; - } - - if (XkbKeyHasActions(xkb, key) && - (XkbKeyNumSyms(xkb, key) >= (unsigned)needed)) - return XkbKeyActionsPtr(xkb, key); - - if (xkb->server->size_acts - xkb->server->num_acts >= (unsigned)needed) { - xkb->server->key_acts[key] = xkb->server->num_acts; - xkb->server->num_acts += needed; - - return &xkb->server->acts[xkb->server->key_acts[key]]; - } - - xkb->server->size_acts = xkb->server->num_acts + needed + 8; - newActs = _XkbTypedCalloc(xkb->server->size_acts, union xkb_action); - if (!newActs) - return NULL; - newActs[0].type = XkbSA_NoAction; - nActs = 1; - - for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { - xkb_keycode_t nKeyActs, nCopy; - - if ((xkb->server->key_acts[i] == 0) && (i != key)) - continue; - - nCopy = nKeyActs = XkbKeyNumActions(xkb, i); - if (i == key) { - nKeyActs= needed; - if (needed < nCopy) - nCopy = needed; - } - - if (nCopy > 0) - memcpy(&newActs[nActs], XkbKeyActionsPtr(xkb, i), - nCopy * sizeof(union xkb_action)); - if (nCopy < nKeyActs) - memset(&newActs[nActs + nCopy], 0, - (nKeyActs - nCopy) * sizeof(union xkb_action)); - - xkb->server->key_acts[i] = nActs; - nActs += nKeyActs; - } - - free(xkb->server->acts); - xkb->server->acts = newActs; - xkb->server->num_acts = nActs; - - return &xkb->server->acts[xkb->server->key_acts[key]]; -} - -void -XkbcFreeClientMap(struct xkb_desc * xkb) -{ - int i; - struct xkb_client_map * map; - struct xkb_key_type * type; - - if (!xkb || !xkb->map) - return; - - map = xkb->map; - - for (i = 0, type = map->types; i < map->num_types && type; i++, type++) { - int j; - free(type->map); - free(type->preserve); - for (j = 0; j < type->num_levels; j++) - free((char *) type->level_names[j]); - free(type->level_names); - free((char *) type->name); - } - free(map->types); - free(map->key_sym_map); - free(map->syms); - free(map->modmap); - free(xkb->map); - xkb->map = NULL; -} - -void -XkbcFreeServerMap(struct xkb_desc * xkb) -{ - struct xkb_server_map * map; - - if (!xkb || !xkb->server) - return; - - map = xkb->server; - - free(map->explicit); - free(map->key_acts); - free(map->acts); - free(map->behaviors); - free(map->vmodmap); - free(xkb->server); - xkb->server = NULL; -} diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/map.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/map.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/map.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/map.c 2012-05-10 10:10:26.000000000 +0000 @@ -49,20 +49,16 @@ * * ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - +#include "utils.h" #include "xkbcommon/xkbcommon.h" #include "XKBcommonint.h" #include "xkballoc.h" -#include /** * Returns the total number of modifiers active in the keymap. */ -xkb_mod_index_t -xkb_map_num_mods(struct xkb_desc *xkb) +_X_EXPORT xkb_mod_index_t +xkb_map_num_mods(struct xkb_keymap *xkb) { xkb_mod_index_t i; @@ -78,8 +74,8 @@ /** * Return the name for a given modifier. */ -const char * -xkb_map_mod_get_name(struct xkb_desc *xkb, xkb_mod_index_t idx) +_X_EXPORT const char * +xkb_map_mod_get_name(struct xkb_keymap *xkb, xkb_mod_index_t idx) { if (idx >= xkb_map_num_mods(xkb)) return NULL; @@ -113,8 +109,8 @@ /** * Returns the index for a named modifier. */ -xkb_mod_index_t -xkb_map_mod_get_index(struct xkb_desc *xkb, const char *name) +_X_EXPORT xkb_mod_index_t +xkb_map_mod_get_index(struct xkb_keymap *xkb, const char *name) { xkb_mod_index_t i; @@ -146,8 +142,8 @@ /** * Return the total number of active groups in the keymap. */ -xkb_group_index_t -xkb_map_num_groups(struct xkb_desc *xkb) +_X_EXPORT xkb_group_index_t +xkb_map_num_groups(struct xkb_keymap *xkb) { xkb_group_index_t ret = 0; xkb_group_index_t i; @@ -162,8 +158,8 @@ /** * Returns the name for a given group. */ -const char * -xkb_map_group_get_name(struct xkb_desc *xkb, xkb_group_index_t idx) +_X_EXPORT const char * +xkb_map_group_get_name(struct xkb_keymap *xkb, xkb_group_index_t idx) { if (idx >= xkb_map_num_groups(xkb)) return NULL; @@ -174,8 +170,8 @@ /** * Returns the index for a named group. */ -xkb_group_index_t -xkb_map_group_get_index(struct xkb_desc *xkb, const char *name) +_X_EXPORT xkb_group_index_t +xkb_map_group_get_index(struct xkb_keymap *xkb, const char *name) { xkb_group_index_t num_groups = xkb_map_num_groups(xkb); xkb_group_index_t i; @@ -191,8 +187,8 @@ /** * Returns the number of groups active for a particular key. */ -xkb_group_index_t -xkb_key_num_groups(struct xkb_desc *xkb, xkb_keycode_t key) +_X_EXPORT xkb_group_index_t +xkb_key_num_groups(struct xkb_keymap *xkb, xkb_keycode_t key) { return XkbKeyNumGroups(xkb, key); } @@ -200,8 +196,8 @@ /** * Return the total number of active LEDs in the keymap. */ -xkb_led_index_t -xkb_map_num_leds(struct xkb_desc *xkb) +_X_EXPORT xkb_led_index_t +xkb_map_num_leds(struct xkb_keymap *xkb) { xkb_led_index_t ret = 0; xkb_led_index_t i; @@ -218,8 +214,8 @@ /** * Returns the name for a given group. */ -const char * -xkb_map_led_get_name(struct xkb_desc *xkb, xkb_led_index_t idx) +_X_EXPORT const char * +xkb_map_led_get_name(struct xkb_keymap *xkb, xkb_led_index_t idx) { if (idx >= xkb_map_num_leds(xkb)) return NULL; @@ -230,8 +226,8 @@ /** * Returns the index for a named group. */ -xkb_group_index_t -xkb_map_led_get_index(struct xkb_desc *xkb, const char *name) +_X_EXPORT xkb_group_index_t +xkb_map_led_get_index(struct xkb_keymap *xkb, const char *name) { xkb_led_index_t num_leds = xkb_map_num_leds(xkb); xkb_led_index_t i; @@ -247,7 +243,7 @@ /** * Returns the level to use for the given key and state, or -1 if invalid. */ -unsigned int +_X_EXPORT unsigned int xkb_key_get_level(struct xkb_state *state, xkb_keycode_t key, unsigned int group) { @@ -269,12 +265,12 @@ * Returns the group to use for the given key and state, taking * wrapping/clamping/etc into account. */ -unsigned int +_X_EXPORT unsigned int xkb_key_get_group(struct xkb_state *state, xkb_keycode_t key) { unsigned int info = XkbKeyGroupInfo(state->xkb, key); unsigned int num_groups = XkbKeyNumGroups(state->xkb, key); - int ret = state->group; + unsigned int ret = state->group; if (ret < XkbKeyNumGroups(state->xkb, key)) return ret; @@ -300,15 +296,23 @@ /** * As below, but takes an explicit group/level rather than state. */ -unsigned int -xkb_key_get_syms_by_level(struct xkb_desc *xkb, xkb_keycode_t key, unsigned int group, - unsigned int level, xkb_keysym_t **syms_out) +_X_EXPORT unsigned int +xkb_key_get_syms_by_level(struct xkb_keymap *xkb, xkb_keycode_t key, unsigned int group, + unsigned int level, const xkb_keysym_t **syms_out) { - *syms_out = &(XkbKeySymEntry(xkb, key, level, group)); - if (**syms_out == NoSymbol) + int num_syms; + + if (group >= XkbKeyNumGroups(xkb, key)) + goto err; + if (level >= XkbKeyGroupWidth(xkb, key, group)) + goto err; + + num_syms = XkbKeyNumSyms(xkb, key, group, level); + if (num_syms == 0) goto err; - return 1; + *syms_out = XkbKeySymEntry(xkb, key, group, level); + return num_syms; err: *syms_out = NULL; @@ -319,11 +323,11 @@ * Provides the symbols to use for the given key and state. Returns the * number of symbols pointed to in syms_out. */ -unsigned int +_X_EXPORT unsigned int xkb_key_get_syms(struct xkb_state *state, xkb_keycode_t key, - xkb_keysym_t **syms_out) + const xkb_keysym_t **syms_out) { - struct xkb_desc *xkb = state->xkb; + struct xkb_keymap *xkb = state->xkb; int group; int level; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/maprules.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/maprules.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/maprules.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/maprules.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,32 +24,15 @@ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "utils.h" #include "xkbrules.h" #include "xkbcommon/xkbcommon.h" #include "XKBcommonint.h" -#ifdef HAVE_DIX_CONFIG_H -#include -#elif defined(HAVE_CONFIG_H) -#include -#endif - #include #include #include -#define X_INCLUDE_STRING_H -#define XOS_USE_NO_LOCKING -#include - -#include -#include -#include -#include - #ifdef DEBUG #define PR_DEBUG(s) fprintf(stderr,s) #define PR_DEBUG1(s,a) fprintf(stderr,s,a) @@ -113,21 +96,21 @@ (int)((l)->line[(l)->num_line++]= (c)):\ InputLineAddChar(l,c)) -static Bool -GetInputLine(FILE *file,InputLine *line,Bool checkbang) +static bool +GetInputLine(FILE *file,InputLine *line,bool checkbang) { int ch; - Bool endOfFile,spacePending,slashPending,inComment; + bool endOfFile,spacePending,slashPending,inComment; - endOfFile= False; + endOfFile= false; while ((!endOfFile)&&(line->num_line==0)) { - spacePending= slashPending= inComment= False; + spacePending= slashPending= inComment= false; while (((ch=getc(file))!='\n')&&(ch!=EOF)) { if (ch=='\\') { if ((ch=getc(file))==EOF) break; if (ch=='\n') { - inComment= False; + inComment= false; ch= ' '; line->line_num++; } @@ -136,21 +119,21 @@ continue; if (ch=='/') { if (slashPending) { - inComment= True; - slashPending= False; + inComment= true; + slashPending= false; } else { - slashPending= True; + slashPending= true; } continue; } else if (slashPending) { if (spacePending) { ADD_CHAR(line,' '); - spacePending= False; + spacePending= false; } ADD_CHAR(line,'/'); - slashPending= False; + slashPending= false; } if (isspace(ch)) { while (isspace(ch)&&(ch!='\n')&&(ch!=EOF)) { @@ -159,13 +142,13 @@ if (ch==EOF) break; if ((ch!='\n')&&(line->num_line>0)) - spacePending= True; + spacePending= true; ungetc(ch,file); } else { if (spacePending) { ADD_CHAR(line,' '); - spacePending= False; + spacePending= false; } if (checkbang && ch=='!') { if (line->num_line!=0) { @@ -180,13 +163,13 @@ } } if (ch==EOF) - endOfFile= True; + endOfFile= true; /* else line->num_line++;*/ } if ((line->num_line==0)&&(endOfFile)) - return False; + return false; ADD_CHAR(line,'\0'); - return True; + return true; } /***====================================================================***/ @@ -268,10 +251,11 @@ char *tok, *str; unsigned present, l_ndx_present, v_ndx_present; int i; - int len, ndx; - _Xstrtokparams strtok_buf; + size_t len; + int ndx; + char *strtok_buf; #ifdef DEBUG - Bool found; + bool found; #endif @@ -280,9 +264,9 @@ len = remap->number; memset(remap, 0, sizeof(RemapSpec)); remap->number = len; - while ((tok=_XStrtok(str," ",strtok_buf))!=NULL) { + while ((tok = strtok_r(str, " ", &strtok_buf)) != NULL) { #ifdef DEBUG - found= False; + found= false; #endif str= NULL; if (strcmp(tok,"=")==0) @@ -305,7 +289,7 @@ ndx = 0; } #ifdef DEBUG - found= True; + found= true; #endif if (present&(1<number++; } -static Bool +static bool MatchOneOf(char *wanted,char *vals_defined) { char *str, *next; @@ -380,14 +364,14 @@ len= strlen(str); } if ((len==want_len)&&(strncmp(wanted,str,len)==0)) - return True; + return true; } - return False; + return false; } /***====================================================================***/ -static Bool +static bool CheckLine( InputLine * line, RemapSpec * remap, XkbRF_RulePtr rule, @@ -396,8 +380,8 @@ char *str, *tok; int nread, i; FileSpec tmp; - _Xstrtokparams strtok_buf; - Bool append = False; + char *strtok_buf; + bool append = false; if (line->line[0]=='!') { if (line->line[1] == '$' || @@ -405,16 +389,16 @@ char *gname = strchr(line->line, '$'); char *words = strchr(gname, ' '); if(!words) - return False; + return false; *words++ = '\0'; for (; *words; words++) { if (*words != '=' && *words != ' ') break; } if (*words == '\0') - return False; - group->name = _XkbDupString(gname); - group->words = _XkbDupString(words); + return false; + group->name = uDupString(gname); + group->words = uDupString(words); for (i = 1, words = group->words; *words; words++) { if ( *words == ' ') { *words++ = '\0'; @@ -422,21 +406,21 @@ } } group->number = i; - return True; + return true; } else { SetUpRemap(line,remap); - return False; + return false; } } if (remap->num_remap==0) { PR_DEBUG("Must have a mapping before first line of data\n"); PR_DEBUG("Illegal line of data ignored\n"); - return False; + return false; } memset(&tmp, 0, sizeof(FileSpec)); str= line->line; - for (nread= 0;(tok=_XStrtok(str," ",strtok_buf))!=NULL;nread++) { + for (nread = 0; (tok = strtok_r(str, " ", &strtok_buf)) != NULL; nread++) { str= NULL; if (strcmp(tok,"=")==0) { nread--; @@ -449,12 +433,12 @@ } tmp.name[remap->remap[nread].word]= tok; if (*tok == '+' || *tok == '|') - append = True; + append = true; } if (nreadnum_remap) { PR_DEBUG1("Too few words on a line: %s\n", line->line); PR_DEBUG("line ignored\n"); - return False; + return false; } rule->flags= 0; @@ -465,16 +449,16 @@ rule->flags|= XkbRF_Append; else rule->flags|= XkbRF_Normal; - rule->model= _XkbDupString(tmp.name[MODEL]); - rule->layout= _XkbDupString(tmp.name[LAYOUT]); - rule->variant= _XkbDupString(tmp.name[VARIANT]); - rule->option= _XkbDupString(tmp.name[OPTION]); - - rule->keycodes= _XkbDupString(tmp.name[KEYCODES]); - rule->symbols= _XkbDupString(tmp.name[SYMBOLS]); - rule->types= _XkbDupString(tmp.name[TYPES]); - rule->compat= _XkbDupString(tmp.name[COMPAT]); - rule->keymap= _XkbDupString(tmp.name[KEYMAP]); + rule->model= uDupString(tmp.name[MODEL]); + rule->layout= uDupString(tmp.name[LAYOUT]); + rule->variant= uDupString(tmp.name[VARIANT]); + rule->option= uDupString(tmp.name[OPTION]); + + rule->keycodes= uDupString(tmp.name[KEYCODES]); + rule->symbols= uDupString(tmp.name[SYMBOLS]); + rule->types= uDupString(tmp.name[TYPES]); + rule->compat= uDupString(tmp.name[COMPAT]); + rule->keymap= uDupString(tmp.name[KEYMAP]); rule->layout_num = rule->variant_num = 0; for (i = 0; i < nread; i++) { @@ -485,7 +469,7 @@ rule->variant_num = remap->remap[i].index; } } - return True; + return true; } static char * @@ -496,7 +480,7 @@ if ((!str1)||(!str2)) return str1; len= strlen(str1)+strlen(str2)+1; - str1= _XkbTypedRealloc(str1,len,char); + str1 = uTypedRealloc(str1, len, char); if (str1) strcat(str1,str2); return str1; @@ -513,12 +497,12 @@ *p1 = '\0'; } -static Bool +static bool MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) { memset(mdefs, 0, sizeof(XkbRF_MultiDefsRec)); mdefs->model = defs->model; - mdefs->options = _XkbDupString(defs->options); + mdefs->options = uDupString(defs->options); if (mdefs->options) squeeze_spaces(mdefs->options); if (defs->layout) { @@ -527,9 +511,9 @@ } else { char *p; int i; - p = _XkbDupString(defs->layout); + p = uDupString(defs->layout); if (p == NULL) - return False; + return false; squeeze_spaces(p); mdefs->layout[1] = p; for (i = 2; i <= XkbNumKbdGroups; i++) { @@ -551,9 +535,9 @@ } else { char *p; int i; - p = _XkbDupString(defs->variant); + p = uDupString(defs->variant); if (p == NULL) - return False; + return false; squeeze_spaces(p); mdefs->variant[1] = p; for (i = 2; i <= XkbNumKbdGroups; i++) { @@ -568,16 +552,15 @@ *p = '\0'; } } - return True; + return true; } static void FreeMultiDefs(XkbRF_MultiDefsPtr defs) { free(defs->options); - /* Avoid -Wcast-qual warnings. */ - free((void *)(uintptr_t)defs->layout[1]); - free((void *)(uintptr_t)defs->variant[1]); + free(UNCONSTIFY(defs->layout[1])); + free(UNCONSTIFY(defs->variant[1])); } static void @@ -588,7 +571,7 @@ *dst= _Concat(*dst, src); } else { if (*dst == NULL) - *dst= _XkbDupString(src); + *dst= uDupString(src); } } } @@ -606,7 +589,7 @@ Apply(rule->keymap, &names->keymap); } -static Bool +static bool CheckGroup( XkbRF_RulesPtr rules, const char * group_name, const char * name) @@ -621,13 +604,13 @@ } } if (i == rules->num_groups) - return False; + return false; for (i = 0, p = group->words; i < group->number; i++, p += strlen(p)+1) { if (! strcmp(p, name)) { - return True; + return true; } } - return False; + return false; } static int @@ -636,13 +619,13 @@ struct xkb_component_names * names, XkbRF_RulesPtr rules) { - Bool pending = False; + bool pending = false; if (rule->model != NULL) { if(mdefs->model == NULL) return 0; if (strcmp(rule->model, "*") == 0) { - pending = True; + pending = true; } else { if (rule->model[0] == '$') { if (!CheckGroup(rules, rule->model, mdefs->model)) @@ -665,7 +648,7 @@ *mdefs->layout[rule->layout_num] == '\0') return 0; if (strcmp(rule->layout, "*") == 0) { - pending = True; + pending = true; } else { if (rule->layout[0] == '$') { if (!CheckGroup(rules, rule->layout, @@ -682,7 +665,7 @@ *mdefs->variant[rule->variant_num] == '\0') return 0; if (strcmp(rule->variant, "*") == 0) { - pending = True; + pending = true; } else { if (rule->variant[0] == '$') { if (!CheckGroup(rules, rule->variant, @@ -732,7 +715,7 @@ XkbRF_CheckApplyRules( XkbRF_RulesPtr rules, XkbRF_MultiDefsPtr mdefs, struct xkb_component_names * names, - int flags) + unsigned int flags) { int i; XkbRF_RulePtr rule; @@ -756,7 +739,8 @@ XkbRF_SubstituteVars(char *name, XkbRF_MultiDefsPtr mdefs) { char *str, *outstr, *orig, *var; - int len, ndx; + size_t len; + int ndx; orig= name; str= strchr(name,'%'); @@ -847,7 +831,7 @@ /***====================================================================***/ -Bool +bool XkbcRF_GetComponents( XkbRF_RulesPtr rules, XkbRF_VarDefsPtr defs, struct xkb_component_names * names) @@ -887,11 +871,11 @@ if (rules->sz_rules<1) { rules->sz_rules= 16; rules->num_rules= 0; - rules->rules= _XkbTypedCalloc(rules->sz_rules,XkbRF_RuleRec); + rules->rules= uTypedCalloc(rules->sz_rules,XkbRF_RuleRec); } else if (rules->num_rules>=rules->sz_rules) { rules->sz_rules*= 2; - rules->rules= _XkbTypedRealloc(rules->rules,rules->sz_rules, + rules->rules= uTypedRealloc(rules->rules,rules->sz_rules, XkbRF_RuleRec); } if (!rules->rules) { @@ -911,12 +895,12 @@ if (rules->sz_groups<1) { rules->sz_groups= 16; rules->num_groups= 0; - rules->groups= _XkbTypedCalloc(rules->sz_groups,XkbRF_GroupRec); + rules->groups= uTypedCalloc(rules->sz_groups,XkbRF_GroupRec); } else if (rules->num_groups >= rules->sz_groups) { rules->sz_groups *= 2; - rules->groups= _XkbTypedRealloc(rules->groups,rules->sz_groups, - XkbRF_GroupRec); + rules->groups= uTypedRealloc(rules->groups,rules->sz_groups, + XkbRF_GroupRec); } if (!rules->groups) { rules->sz_groups= rules->num_groups= 0; @@ -927,7 +911,7 @@ return &rules->groups[rules->num_groups++]; } -Bool +bool XkbcRF_LoadRules(FILE *file, XkbRF_RulesPtr rules) { InputLine line; @@ -936,11 +920,11 @@ XkbRF_GroupRec tgroup,*group; if (!(rules && file)) - return False; + return false; memset(&remap, 0, sizeof(RemapSpec)); memset(&tgroup, 0, sizeof(XkbRF_GroupRec)); InitInputLine(&line); - while (GetInputLine(file,&line,True)) { + while (GetInputLine(file, &line, true)) { if (CheckLine(&line,&remap,&trule,&tgroup)) { if (tgroup.number) { if ((group= XkbcRF_AddGroup(rules))!=NULL) { @@ -957,7 +941,7 @@ line.num_line= 0; } FreeInputLine(&line); - return True; + return true; } static void diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/misc.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/misc.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/misc.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/misc.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,10 +24,6 @@ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "xkballoc.h" #include "xkbmisc.h" #include "xkbcommon/xkbcommon.h" @@ -36,12 +32,12 @@ #define mapSize(m) (sizeof(m) / sizeof(struct xkb_kt_map_entry)) static struct xkb_kt_map_entry map2Level[]= { - { True, ShiftMask, {1, ShiftMask, 0} } + { true, ShiftMask, {1, ShiftMask, 0} } }; static struct xkb_kt_map_entry mapAlpha[]= { - { True, ShiftMask, { 1, ShiftMask, 0 } }, - { True, LockMask, { 0, LockMask, 0 } } + { true, ShiftMask, { 1, ShiftMask, 0 } }, + { true, LockMask, { 0, LockMask, 0 } } }; static struct xkb_mods preAlpha[]= { @@ -51,8 +47,8 @@ #define NL_VMOD_MASK 0 static struct xkb_kt_map_entry mapKeypad[]= { - { True, ShiftMask, { 1, ShiftMask, 0 } }, - { False, 0, { 1, 0, NL_VMOD_MASK } } + { true, ShiftMask, { 1, ShiftMask, 0 } }, + { false, 0, { 1, 0, NL_VMOD_MASK } } }; static struct xkb_key_type canonicalTypes[XkbNumRequiredTypes] = { @@ -60,30 +56,30 @@ 1, /* num_levels */ 0, /* map_count */ NULL, NULL, - None, NULL + NULL, NULL }, { { ShiftMask, ShiftMask, 0 }, 2, /* num_levels */ mapSize(map2Level), /* map_count */ map2Level, NULL, - None, NULL + NULL, NULL }, { { ShiftMask|LockMask, ShiftMask|LockMask, 0 }, 2, /* num_levels */ mapSize(mapAlpha), /* map_count */ mapAlpha, preAlpha, - None, NULL + NULL, NULL }, { { ShiftMask, ShiftMask, NL_VMOD_MASK }, 2, /* num_levels */ mapSize(mapKeypad), /* map_count */ mapKeypad, NULL, - None, NULL + NULL, NULL } }; int -XkbcInitCanonicalKeyTypes(struct xkb_desc * xkb, unsigned which, int keypadVMod) +XkbcInitCanonicalKeyTypes(struct xkb_keymap * xkb, unsigned which, int keypadVMod) { struct xkb_client_map * map; struct xkb_key_type *from, *to; @@ -123,12 +119,12 @@ if ((keypadVMod >= 0) && (keypadVMod < XkbNumVirtualMods) && (rtrn == Success)) { type->mods.vmods = (1 << keypadVMod); - type->map[0].active = True; + type->map[0].active = true; type->map[0].mods.mask = ShiftMask; type->map[0].mods.real_mods = ShiftMask; type->map[0].mods.vmods = 0; type->map[0].level = 1; - type->map[1].active = False; + type->map[1].active = false; type->map[1].mods.mask = 0; type->map[1].mods.real_mods = 0; type->map[1].mods.vmods = (1 << keypadVMod); @@ -139,21 +135,21 @@ return Success; } -Bool -XkbcVirtualModsToReal(struct xkb_desc * xkb, unsigned virtual_mask, +bool +XkbcVirtualModsToReal(struct xkb_keymap * xkb, unsigned virtual_mask, unsigned *mask_rtrn) { int i, bit; unsigned mask; if (!xkb) - return False; + return false; if (virtual_mask == 0) { *mask_rtrn = 0; - return True; + return true; } if (!xkb->server) - return False; + return false; for (i = mask = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (virtual_mask & bit) @@ -161,14 +157,14 @@ } *mask_rtrn = mask; - return True; + return true; } /* * All latin-1 alphanumerics, plus parens, slash, minus, underscore and * wildcards. */ -static unsigned char componentSpecLegal[] = { +static const unsigned char componentSpecLegal[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x83, 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -230,22 +226,29 @@ rtrn |= _XkbKSLower; break; case 18: /* latin 8 */ - if ((ks == XK_Babovedot) || - (ks >= XK_Dabovedot && ks <= XK_Wacute) || - (ks >= XK_Ygrave && ks <= XK_Fabovedot) || + if ((ks == XK_Wcircumflex) || + (ks == XK_Ycircumflex) || + (ks == XK_Babovedot) || + (ks == XK_Dabovedot) || + (ks == XK_Fabovedot) || (ks == XK_Mabovedot) || (ks == XK_Pabovedot) || (ks == XK_Sabovedot) || + (ks == XK_Tabovedot) || (ks == XK_Wdiaeresis) || - (ks >= XK_Wcircumflex && ks <= XK_Ycircumflex)) + (ks == XK_Ygrave)) rtrn |= _XkbKSUpper; - if ((ks == XK_babovedot) || + if ((ks == XK_wcircumflex) || + (ks == XK_ycircumflex) || + (ks == XK_babovedot) || (ks == XK_dabovedot) || (ks == XK_fabovedot) || (ks == XK_mabovedot) || - (ks >= XK_wgrave && ks <= XK_wacute) || - (ks == XK_ygrave) || - (ks >= XK_wdiaeresis && ks <= XK_ycircumflex)) + (ks == XK_pabovedot) || + (ks == XK_sabovedot) || + (ks == XK_tabovedot) || + (ks == XK_wdiaeresis) || + (ks == XK_ygrave)) rtrn |= _XkbKSLower; break; case 19: /* latin 9 */ @@ -258,38 +261,3 @@ return rtrn; } - -#define UNMATCHABLE(c) ((c) == '(' || (c) == ')' || (c) == '/') - -Bool -XkbcNameMatchesPattern(char *name, char *ptrn) -{ - while (ptrn[0] != '\0') { - if (name[0] == '\0') { - if (ptrn[0] == '*') { - ptrn++; - continue; - } - return False; - } - - if (ptrn[0] == '?') { - if (UNMATCHABLE(name[0])) - return False; - } - else if (ptrn[0] == '*') { - if (!UNMATCHABLE(name[0]) && - XkbcNameMatchesPattern(name + 1, ptrn)) - return True; - return XkbcNameMatchesPattern(name, ptrn + 1); - } - else if (ptrn[0] != name[0]) - return False; - - name++; - ptrn++; - } - - /* if we get here, the pattern is exhausted (-:just like me:-) */ - return (name[0] == '\0'); -} diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/state.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/state.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/state.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/state.c 2012-05-10 10:10:26.000000000 +0000 @@ -58,21 +58,19 @@ * - messages (very unlikely) */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include "xkbcommon/xkbcommon.h" #include "XKBcommonint.h" +#include "xkbmisc.h" struct xkb_filter { struct xkb_state *state; union xkb_action action; xkb_keycode_t keycode; uint32_t priv; - int (*func)(struct xkb_filter *filter, xkb_keycode_t key, int down); + int (*func)(struct xkb_filter *filter, xkb_keycode_t key, + enum xkb_key_direction direction); int refcnt; struct xkb_filter *next; }; @@ -134,14 +132,14 @@ static int xkb_filter_group_set_func(struct xkb_filter *filter, xkb_keycode_t keycode, - int down) + enum xkb_key_direction direction) { if (keycode != filter->keycode) { filter->action.group.flags &= ~XkbSA_ClearLocks; return 1; } - if (down) { + if (direction == XKB_KEY_DOWN) { filter->refcnt++; return 0; } @@ -185,15 +183,54 @@ } static int +xkb_filter_group_lock_func(struct xkb_filter *filter, xkb_keycode_t keycode, + enum xkb_key_direction direction) +{ + if (keycode != filter->keycode) + return 1; + + if (direction == XKB_KEY_DOWN) { + filter->refcnt++; + return 0; + } + if (--filter->refcnt > 0) + return 0; + + filter->func = NULL; + return 1; +} + +static int +xkb_filter_group_lock_new(struct xkb_state *state, xkb_keycode_t keycode, + union xkb_action *action) +{ + struct xkb_filter *filter = xkb_filter_new(state); + + if (!filter) + return 0; + + filter->keycode = keycode; + filter->func = xkb_filter_group_lock_func; + filter->action = *action; + + if (action->group.flags & XkbSA_GroupAbsolute) + filter->state->locked_group = action->group.group; + else + filter->state->locked_group += action->group.group; + + return 1; +} + +static int xkb_filter_mod_set_func(struct xkb_filter *filter, xkb_keycode_t keycode, - int down) + enum xkb_key_direction direction) { if (keycode != filter->keycode) { filter->action.mods.flags &= ~XkbSA_ClearLocks; return 1; } - if (down) { + if (direction == XKB_KEY_DOWN) { filter->refcnt++; return 0; } @@ -229,12 +266,12 @@ static int xkb_filter_mod_lock_func(struct xkb_filter *filter, xkb_keycode_t keycode, - int down) + enum xkb_key_direction direction) { if (keycode != filter->keycode) return 1; - if (down) { + if (direction == XKB_KEY_DOWN) { filter->refcnt++; return 0; } @@ -272,11 +309,11 @@ static int xkb_filter_mod_latch_func(struct xkb_filter *filter, xkb_keycode_t keycode, - int down) + enum xkb_key_direction direction) { enum xkb_key_latch_state latch = filter->priv; - if (down && latch == LATCH_PENDING) { + if (direction == XKB_KEY_DOWN && latch == LATCH_PENDING) { /* If this is a new keypress and we're awaiting our single latched * keypress, then either break the latch if any random key is pressed, * or promote it to a lock or plain base set if it's the same @@ -309,7 +346,7 @@ return 1; } } - else if (!down && keycode == filter->keycode) { + else if (direction == XKB_KEY_UP && keycode == filter->keycode) { /* Our key got released. If we've set it to clear locks, and we * currently have the same modifiers locked, then release them and * don't actually latch. Else we've actually hit the latching @@ -335,7 +372,7 @@ /* XXX beep beep! */ } } - else if (down && latch == LATCH_KEY_DOWN) { + else if (direction == XKB_KEY_DOWN && latch == LATCH_KEY_DOWN) { /* Someone's pressed another key while we've still got the latching * key held down, so keep the base modifier state active (from * xkb_filter_mod_latch_new), but don't trip the latch, just clear @@ -373,7 +410,8 @@ * apply a new filter from the key action. */ static void -xkb_filter_apply_all(struct xkb_state *state, xkb_keycode_t key, int down) +xkb_filter_apply_all(struct xkb_state *state, xkb_keycode_t key, + enum xkb_key_direction direction) { struct xkb_filter *filters = state->filters; union xkb_action *act = NULL; @@ -385,10 +423,10 @@ for (i = 0; i < state->num_filters; i++) { if (!filters[i].func) continue; - send &= (*filters[i].func)(&filters[i], key, down); + send &= (*filters[i].func)(&filters[i], key, direction); } - if (!send || !down) + if (!send || direction == XKB_KEY_UP) return; act = xkb_key_get_action(state, key); @@ -409,19 +447,20 @@ case XkbSA_LatchGroup: send = xkb_filter_mod_latch_new(state, key, act); break; +#endif case XkbSA_LockGroup: send = xkb_filter_group_lock_new(state, key, act); break; -#endif } return; } -struct xkb_state * -xkb_state_new(struct xkb_desc *xkb) +_X_EXPORT struct xkb_state * +xkb_state_new(struct xkb_keymap *xkb) { struct xkb_state *ret; + if (!xkb) return NULL; @@ -430,20 +469,37 @@ return NULL; ret->refcnt = 1; - ret->xkb = xkb; + ret->xkb = xkb_map_ref(xkb); + return ret; } -void +_X_EXPORT struct xkb_state * +xkb_state_ref(struct xkb_state *state) +{ + state->refcnt++; + return state; +} + +_X_EXPORT void xkb_state_unref(struct xkb_state *state) { state->refcnt--; assert(state->refcnt >= 0); - if (state->refcnt == 0) + if (state->refcnt > 0) return; + + xkb_map_unref(state->xkb); + free(state->filters); free(state); } +_X_EXPORT struct xkb_keymap * +xkb_state_get_map(struct xkb_state *state) +{ + return state->xkb; +} + /** * Update the LED state to match the rest of the xkb_state. */ @@ -494,14 +550,12 @@ } /** - * Given a particular key event, updates the state structure to reflect the - * new modifiers. + * Calculates the derived state (effective mods/group and LEDs) from an + * up-to-date xkb_state. */ -void -xkb_state_update_key(struct xkb_state *state, xkb_keycode_t key, int down) +static void +xkb_state_update_derived(struct xkb_state *state) { - xkb_filter_apply_all(state, key, down); - state->mods = (state->base_mods | state->latched_mods | state->locked_mods); /* FIXME: Clamp/wrap locked_group */ state->group = state->locked_group + state->base_group + @@ -512,12 +566,109 @@ } /** + * Given a particular key event, updates the state structure to reflect the + * new modifiers. + */ +_X_EXPORT void +xkb_state_update_key(struct xkb_state *state, xkb_keycode_t key, + enum xkb_key_direction direction) +{ + xkb_filter_apply_all(state, key, direction); + xkb_state_update_derived(state); +} + +/** + * Updates the state from a set of explicit masks as gained from + * xkb_state_serialise_mods and xkb_state_serialise_groups. As noted in the + * documentation for these functions in xkbcommon.h, this round-trip is + * lossy, and should only be used to update a slave state mirroring the + * master, e.g. in a client/server window system. + */ +_X_EXPORT void +xkb_state_update_mask(struct xkb_state *state, + xkb_mod_mask_t base_mods, + xkb_mod_mask_t latched_mods, + xkb_mod_mask_t locked_mods, + xkb_group_index_t base_group, + xkb_group_index_t latched_group, + xkb_group_index_t locked_group) +{ + xkb_mod_mask_t mod; + + state->base_mods = 0; + state->latched_mods = 0; + state->locked_mods = 0; + for (mod = 0; mod < xkb_map_num_mods(state->xkb); mod++) { + xkb_mod_mask_t idx = (1 << mod); + if (base_mods & idx) + state->base_mods |= idx; + if (latched_mods & idx) + state->latched_mods |= idx; + if (locked_mods & idx) + state->locked_mods |= idx; + } + + state->base_group = base_group; + state->latched_group = latched_group; + state->locked_group = locked_group; + + xkb_state_update_derived(state); +} + +/** + * Serialises the requested modifier state into an xkb_mod_mask_t, with all + * the same disclaimers as in xkb_state_update_mask. + */ +_X_EXPORT xkb_mod_mask_t +xkb_state_serialise_mods(struct xkb_state *state, + enum xkb_state_component type) +{ + xkb_mod_mask_t ret = 0; + + if (type == XKB_STATE_EFFECTIVE) + return state->mods; + + if (type & XKB_STATE_DEPRESSED) + ret |= state->base_mods; + if (type & XKB_STATE_LATCHED) + ret |= state->latched_mods; + if (type & XKB_STATE_LOCKED) + ret |= state->locked_mods; + + return ret; +} + +/** + * Serialises the requested group state, with all the same disclaimers as + * in xkb_state_update_mask. + */ +_X_EXPORT xkb_group_index_t +xkb_state_serialise_group(struct xkb_state *state, + enum xkb_state_component type) +{ + xkb_group_index_t ret = 0; + + if (type == XKB_STATE_EFFECTIVE) + return state->group; + + if (type & XKB_STATE_DEPRESSED) + ret += state->base_group; + if (type & XKB_STATE_LATCHED) + ret += state->latched_group; + if (type & XKB_STATE_LOCKED) + ret += state->locked_group; + + return ret; +} + +/** * Returns 1 if the given modifier is active with the specified type(s), 0 if * not, or -1 if the modifier is invalid. */ -int xkb_state_mod_index_is_active(struct xkb_state *state, - xkb_mod_index_t idx, - enum xkb_state_component type) +_X_EXPORT int +xkb_state_mod_index_is_active(struct xkb_state *state, + xkb_mod_index_t idx, + enum xkb_state_component type) { int ret = 0; @@ -538,8 +689,9 @@ * Returns 1 if the given modifier is active with the specified type(s), 0 if * not, or -1 if the modifier is invalid. */ -int xkb_state_mod_name_is_active(struct xkb_state *state, const char *name, - enum xkb_state_component type) +_X_EXPORT int +xkb_state_mod_name_is_active(struct xkb_state *state, const char *name, + enum xkb_state_component type) { xkb_mod_index_t idx = xkb_map_mod_get_index(state->xkb, name); @@ -553,9 +705,10 @@ * Returns 1 if the given group is active with the specified type(s), 0 if * not, or -1 if the group is invalid. */ -int xkb_state_group_index_is_active(struct xkb_state *state, - xkb_group_index_t idx, - enum xkb_state_component type) +_X_EXPORT int +xkb_state_group_index_is_active(struct xkb_state *state, + xkb_group_index_t idx, + enum xkb_state_component type) { int ret = 0; @@ -576,8 +729,9 @@ * Returns 1 if the given modifier is active with the specified type(s), 0 if * not, or -1 if the modifier is invalid. */ -int xkb_state_group_name_is_active(struct xkb_state *state, const char *name, - enum xkb_state_component type) +_X_EXPORT int +xkb_state_group_name_is_active(struct xkb_state *state, const char *name, + enum xkb_state_component type) { xkb_group_index_t idx = xkb_map_group_get_index(state->xkb, name); @@ -590,7 +744,8 @@ /** * Returns 1 if the given LED is active, 0 if not, or -1 if the LED is invalid. */ -int xkb_state_led_index_is_active(struct xkb_state *state, xkb_led_index_t idx) +_X_EXPORT int +xkb_state_led_index_is_active(struct xkb_state *state, xkb_led_index_t idx) { if (idx >= xkb_map_num_leds(state->xkb)) return -1; @@ -601,7 +756,8 @@ /** * Returns 1 if the given LED is active, 0 if not, or -1 if the LED is invalid. */ -int xkb_state_led_name_is_active(struct xkb_state *state, const char *name) +_X_EXPORT int +xkb_state_led_name_is_active(struct xkb_state *state, const char *name) { xkb_led_index_t idx = xkb_map_led_get_index(state->xkb, name); diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/text.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/text.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/text.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/text.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,9 +24,6 @@ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif #include "xkbmisc.h" #include "xkbcommon/xkbcommon.h" #include "XKBcommonint.h" @@ -36,7 +33,7 @@ #define BUFFER_SIZE 1024 static char textBuffer[BUFFER_SIZE]; -static int tbNext = 0; +static unsigned int tbNext = 0; static char * tbGetBuffer(unsigned int size) @@ -56,7 +53,7 @@ } static const char * -XkbcVModIndexText(struct xkb_desc * xkb, unsigned ndx) +XkbcVModIndexText(struct xkb_keymap * xkb, unsigned ndx) { int len; char *rtrn; @@ -84,7 +81,7 @@ } const char * -XkbcVModMaskText(struct xkb_desc * xkb, unsigned modMask, unsigned mask) +XkbcVModMaskText(struct xkb_keymap * xkb, unsigned modMask, unsigned mask) { int i, bit, len, rem; const char *mm = NULL; @@ -95,7 +92,7 @@ return "none"; if (modMask != 0) - mm = XkbcModMaskText(modMask, False); + mm = XkbcModMaskText(modMask, false); str = buf; buf[0]= '\0'; @@ -161,7 +158,7 @@ } const char * -XkbcModMaskText(unsigned mask, Bool cFormat) +XkbcModMaskText(unsigned mask, bool cFormat) { int i, rem, bit; char *str, *buf; @@ -209,12 +206,8 @@ return "CompatMap"; case XkmSymbolsIndex: return "Symbols"; - case XkmIndicatorsIndex: - return "Indicators"; case XkmKeyNamesIndex: return "KeyNames"; - case XkmVirtualModsIndex: - return "VirtualMods"; default: return "unknown"; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/utils.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/utils.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/utils.c 1970-01-01 00:00:00.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/utils.c 2012-05-10 10:10:26.000000000 +0000 @@ -0,0 +1,198 @@ + + /*\ + * + * COPYRIGHT 1990 + * DIGITAL EQUIPMENT CORPORATION + * MAYNARD, MASSACHUSETTS + * ALL RIGHTS RESERVED. + * + * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND + * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. + * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE + * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED + * WARRANTY. + * + * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT + * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN + * ADDITION TO THAT SET FORTH ABOVE. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Digital Equipment Corporation not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + \*/ + +#include "utils.h" +#include "XKBcommonint.h" + +#include +#include +#include +#include + +void * +recalloc(void *ptr, size_t old_size, size_t new_size) +{ + char *rtrn; + + if (ptr == NULL) + return calloc(1, new_size); + + rtrn = realloc(ptr, new_size); + if (rtrn && new_size > old_size) + memset(&rtrn[old_size], 0, new_size - old_size); + + return rtrn; +} + +static FILE *errorFile = NULL; +static int outCount = 0; +static char *preMsg = NULL; +static char *prefix = NULL; + +bool +uSetErrorFile(char *name) +{ + if ((errorFile != NULL) && (errorFile != stderr)) + { + fprintf(errorFile, "switching to %s\n", name ? name : "stderr"); + fclose(errorFile); + } + if (name != NULL) + errorFile = fopen(name, "w"); + else + errorFile = stderr; + if (errorFile == NULL) + { + errorFile = stderr; + return false; + } + return true; +} + +void +uInformation(const char *s, ...) +{ + va_list args; + + if (!errorFile) + errorFile = stderr; + + va_start(args, s); + vfprintf(errorFile, s, args); + va_end(args); + fflush(errorFile); +} + +/***====================================================================***/ + +void +uAction(const char *s, ...) +{ + va_list args; + + if (!errorFile) + errorFile = stderr; + + if (prefix != NULL) + fprintf(errorFile, "%s", prefix); + fprintf(errorFile, " "); + va_start(args, s); + vfprintf(errorFile, s, args); + va_end(args); + fflush(errorFile); +} + +/***====================================================================***/ + +void +uWarning(const char *s, ...) +{ + va_list args; + + if (!errorFile) + errorFile = stderr; + + if ((outCount == 0) && (preMsg != NULL)) + fprintf(errorFile, "%s\n", preMsg); + if (prefix != NULL) + fprintf(errorFile, "%s", prefix); + fprintf(errorFile, "Warning: "); + va_start(args, s); + vfprintf(errorFile, s, args); + va_end(args); + fflush(errorFile); + outCount++; +} + +/***====================================================================***/ + +void +uError(const char *s, ...) +{ + va_list args; + + if (!errorFile) + errorFile = stderr; + + if ((outCount == 0) && (preMsg != NULL)) + fprintf(errorFile, "%s\n", preMsg); + if (prefix != NULL) + fprintf(errorFile, "%s", prefix); + fprintf(errorFile, "Error: "); + va_start(args, s); + vfprintf(errorFile, s, args); + va_end(args); + fflush(errorFile); + outCount++; +} + +/***====================================================================***/ + +void +uFatalError(const char *s, ...) +{ + va_list args; + + if (!errorFile) + errorFile = stderr; + + if ((outCount == 0) && (preMsg != NULL)) + fprintf(errorFile, "%s\n", preMsg); + if (prefix != NULL) + fprintf(errorFile, "%s", prefix); + fprintf(errorFile, "Fatal Error: "); + va_start(args, s); + vfprintf(errorFile, s, args); + va_end(args); + fprintf(errorFile, " Exiting\n"); + fflush(errorFile); + outCount++; + exit(1); + /* NOTREACHED */ +} + +/***====================================================================***/ + +void +uInternalError(const char *s, ...) +{ + va_list args; + + if (!errorFile) + errorFile = stderr; + + if ((outCount == 0) && (preMsg != NULL)) + fprintf(errorFile, "%s\n", preMsg); + if (prefix != NULL) + fprintf(errorFile, "%s", prefix); + fprintf(errorFile, "Internal error: "); + va_start(args, s); + vfprintf(errorFile, s, args); + va_end(args); + fflush(errorFile); + outCount++; +} diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/utils.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/utils.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/utils.h 1970-01-01 00:00:00.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/utils.h 2012-05-10 10:10:26.000000000 +0000 @@ -0,0 +1,92 @@ +#ifndef UTILS_H +#define UTILS_H 1 + + /*\ + * + * COPYRIGHT 1990 + * DIGITAL EQUIPMENT CORPORATION + * MAYNARD, MASSACHUSETTS + * ALL RIGHTS RESERVED. + * + * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND + * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. + * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE + * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED + * WARRANTY. + * + * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT + * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN + * ADDITION TO THAT SET FORTH ABOVE. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Digital Equipment Corporation not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + \*/ + +/***====================================================================***/ + +#include +#include + +#include + +extern void * +recalloc(void *ptr, size_t old_size, size_t new_size); + +/* + * We sometimes malloc strings and then expose them as const char*'s. This + * macro is used when we free these strings in order to avoid -Wcast-qual + * errors. + */ +#define UNCONSTIFY(const_ptr) ((void *)(uintptr_t)(const_ptr)) + +#define uTypedAlloc(t) malloc(sizeof(t)) +#define uTypedCalloc(n, t) calloc((n), sizeof(t)) +#define uTypedRealloc(pO, n, t) realloc((pO), (n) * sizeof(t)) +#define uTypedRecalloc(pO, o, n, t) recalloc((pO), (o) * sizeof(t), (n) * sizeof(t)) + +#define uDupString(s) ((s) ? strdup(s) : NULL) +#define uStringText(s) ((s) == NULL ? "" : (s)) +#define uStrCasePrefix(s1, s2) (strncasecmp((s1), (s2), strlen(s1)) == 0) + +/***====================================================================***/ + +extern bool +uSetErrorFile(char *name); + +#define INFO uInformation + +extern _X_ATTRIBUTE_PRINTF(1, 2) void +uInformation(const char *s, ...); + +#define ACTION uAction + +extern _X_ATTRIBUTE_PRINTF(1, 2) void +uAction(const char *s, ...); + +#define WARN uWarning + +extern _X_ATTRIBUTE_PRINTF(1, 2) void +uWarning(const char *s, ...); + +#define ERROR uError + +extern _X_ATTRIBUTE_PRINTF(1, 2) void +uError(const char *s, ...); + +#define FATAL uFatalError + +extern _X_ATTRIBUTE_PRINTF(1, 2) _X_NORETURN void +uFatalError(const char *s, ...); + +/* WSGO stands for "Weird Stuff Going On" (wtf???) */ +#define WSGO uInternalError + +extern _X_ATTRIBUTE_PRINTF(1, 2) void +uInternalError(const char *s, ...); + +#endif /* UTILS_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkballoc.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkballoc.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkballoc.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkballoc.h 2012-05-10 10:10:26.000000000 +0000 @@ -28,53 +28,51 @@ #define _XKBALLOC_H_ #include -#include #include "xkbcommon/xkbcommon.h" +#include "XKBcommonint.h" extern int -XkbcAllocCompatMap(struct xkb_desc * xkb, unsigned which, unsigned nSI); +XkbcAllocCompatMap(struct xkb_keymap *xkb, unsigned nSI); extern int -XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalAliases); +XkbcAllocNames(struct xkb_keymap * xkb, unsigned which, unsigned nTotalAliases); extern int -XkbcAllocControls(struct xkb_desc * xkb, unsigned which); +XkbcAllocControls(struct xkb_keymap *xkb); extern int -XkbcAllocIndicatorMaps(struct xkb_desc * xkb); +XkbcAllocIndicatorMaps(struct xkb_keymap * xkb); -extern struct xkb_desc * -XkbcAllocKeyboard(void); +extern struct xkb_keymap * +XkbcAllocKeyboard(struct xkb_context *context); extern void -XkbcFreeKeyboard(struct xkb_desc * xkb); - -/***====================================================================***/ +XkbcFreeKeyboard(struct xkb_keymap * xkb); extern int -XkbcAllocClientMap(struct xkb_desc * xkb, unsigned which, unsigned nTotalTypes); +XkbcAllocClientMap(struct xkb_keymap * xkb, unsigned which, unsigned nTotalTypes); extern int -XkbcAllocServerMap(struct xkb_desc * xkb, unsigned which, unsigned nNewActions); +XkbcAllocServerMap(struct xkb_keymap * xkb, unsigned which, unsigned nNewActions); extern int XkbcCopyKeyType(struct xkb_key_type * from, struct xkb_key_type *into); -extern xkb_keysym_t * -XkbcResizeKeySyms(struct xkb_desc * xkb, xkb_keycode_t key, uint32_t needed); +extern bool +XkbcResizeKeySyms(struct xkb_keymap * xkb, xkb_keycode_t key, uint32_t needed); extern union xkb_action * -XkbcResizeKeyActions(struct xkb_desc * xkb, xkb_keycode_t key, int needed); +XkbcResizeKeyActions(struct xkb_keymap * xkb, xkb_keycode_t key, uint32_t needed); extern void -XkbcFreeClientMap(struct xkb_desc * xkb); +XkbcFreeClientMap(struct xkb_keymap * xkb); extern void -XkbcFreeServerMap(struct xkb_desc * xkb); +XkbcFreeServerMap(struct xkb_keymap * xkb); extern unsigned int -xkb_key_get_syms_by_level(struct xkb_desc *xkb, xkb_keycode_t key, +xkb_key_get_syms_by_level(struct xkb_keymap *xkb, xkb_keycode_t key, unsigned int group, unsigned int level, - xkb_keysym_t **syms_out); + const xkb_keysym_t **syms_out); #endif /* _XKBALLOC_H_ */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkb.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkb.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkb.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkb.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,9 +24,8 @@ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include + #include "xkbmisc.h" #include "xkbcommon/xkbcommon.h" #include "XKBcommonint.h" @@ -81,7 +80,7 @@ return name; } -void +_X_EXPORT void xkb_canonicalise_components(struct xkb_component_names * names, const struct xkb_component_names * old) { @@ -95,8 +94,8 @@ old ? old->types : NULL); } -Bool -XkbcComputeEffectiveMap(struct xkb_desc * xkb, struct xkb_key_type * type, +bool +XkbcComputeEffectiveMap(struct xkb_keymap * xkb, struct xkb_key_type * type, unsigned char *map_rtrn) { int i; @@ -104,11 +103,11 @@ struct xkb_kt_map_entry * entry = NULL; if (!xkb || !type || !xkb->server) - return False; + return false; if (type->mods.vmods != 0) { if (!XkbcVirtualModsToReal(xkb, type->mods.vmods, &tmp)) - return False; + return false; type->mods.mask = tmp | type->mods.real_mods; entry = type->map; @@ -116,13 +115,13 @@ tmp = 0; if (entry->mods.vmods != 0) { if (!XkbcVirtualModsToReal(xkb, entry->mods.vmods, &tmp)) - return False; + return false; if (tmp == 0) { - entry->active = False; + entry->active = false; continue; } } - entry->active = True; + entry->active = true; entry->mods.mask = (entry->mods.real_mods | tmp) & type->mods.mask; } } @@ -136,5 +135,5 @@ map_rtrn[type->map[i].mods.mask] = type->map[i].level; } - return True; + return true; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/XKBcommonint.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/XKBcommonint.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/XKBcommonint.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/XKBcommonint.h 2012-05-10 10:10:26.000000000 +0000 @@ -1,4 +1,5 @@ /* +Copyright 1985, 1987, 1990, 1998 The Open Group Copyright 2008 Dan Nicholson Permission is hereby granted, free of charge, to any person obtaining a @@ -24,72 +25,410 @@ authorization from the authors. */ +/************************************************************ +Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + +Permission to use, copy, modify, and distribute this +software and its documentation for any purpose and without +fee is hereby granted, provided that the above copyright +notice appear in all copies and that both that copyright +notice and this permission notice appear in supporting +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH +THE USE OR PERFORMANCE OF THIS SOFTWARE. + +********************************************************/ + +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone + */ + #ifndef _XKBCOMMONINT_H_ #define _XKBCOMMONINT_H_ +#include #include #include +#include +#include -#ifndef True -#define True 1 -#define False 0 -#endif - -#define _XkbTypedAlloc(t) ((t *)malloc(sizeof(t))) -#define _XkbTypedCalloc(n,t) ((t *)calloc((n),sizeof(t))) -#define _XkbTypedRealloc(o,n,t) \ - ((o)?(t *)realloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t)) -#define _XkbClearElems(a,f,l,t) memset(&(a)[f], 0, ((l) - (f) + 1) * sizeof(t)) - -#define _XkbDupString(s) ((s) ? strdup(s) : NULL) -#define _XkbStrCaseCmp strcasecmp +#include "xkbcommon/xkbcommon.h" /* From XKM.h */ -#define XkmFileVersion 15 - -#define XkmIllegalFile -1 #define XkmSemanticsFile 20 #define XkmLayoutFile 21 #define XkmKeymapFile 22 -#define XkmGeometryFile 23 #define XkmRulesFile 24 #define XkmTypesIndex 0 #define XkmCompatMapIndex 1 #define XkmSymbolsIndex 2 -#define XkmIndicatorsIndex 3 #define XkmKeyNamesIndex 4 #define XkmGeometryIndex 5 -#define XkmVirtualModsIndex 6 -#define XkmLastIndex XkmVirtualModsIndex #define XkmTypesMask (1<<0) #define XkmCompatMapMask (1<<1) #define XkmSymbolsMask (1<<2) -#define XkmIndicatorsMask (1<<3) #define XkmKeyNamesMask (1<<4) #define XkmGeometryMask (1<<5) -#define XkmVirtualModsMask (1<<6) -#define XkmLegalIndexMask (0x7f) -#define XkmAllIndicesMask (0x7f) #define XkmSemanticsRequired (XkmCompatMapMask) -#define XkmSemanticsOptional (XkmTypesMask|XkmVirtualModsMask|XkmIndicatorsMask|XkmGeometryMask) +#define XkmSemanticsOptional (XkmTypesMask|XkmGeometryMask) #define XkmSemanticsLegal (XkmSemanticsRequired|XkmSemanticsOptional) #define XkmLayoutRequired (XkmKeyNamesMask|XkmSymbolsMask|XkmTypesMask) -#define XkmLayoutOptional (XkmVirtualModsMask|XkmGeometryMask) +#define XkmLayoutOptional (XkmGeometryMask) #define XkmLayoutLegal (XkmLayoutRequired|XkmLayoutOptional) #define XkmKeymapRequired (XkmSemanticsRequired|XkmLayoutRequired) #define XkmKeymapOptional ((XkmSemanticsOptional|XkmLayoutOptional)&(~XkmKeymapRequired)) #define XkmKeymapLegal (XkmKeymapRequired|XkmKeymapOptional) -#define XkmLegalSection(m) (((m)&(~XkmKeymapLegal))==0) -#define XkmSingleSection(m) (XkmLegalSection(m)&&(((m)&(~(m)+1))==(m))) - extern unsigned int xkb_key_get_group(struct xkb_state *state, xkb_keycode_t key); extern unsigned int xkb_key_get_level(struct xkb_state *state, xkb_keycode_t key, unsigned int group); +struct xkb_any_action { + uint8_t type; + uint8_t data[7]; +}; + +struct xkb_mod_action { + uint8_t type; + uint8_t flags; + uint8_t mask; + uint8_t real_mods; + uint16_t vmods; +}; + +struct xkb_group_action { + uint8_t type; + uint8_t flags; + int16_t group; +}; + +struct xkb_iso_action { + uint8_t type; + uint8_t flags; + uint8_t mask; + uint8_t real_mods; + uint8_t group; + uint8_t affect; + uint16_t vmods; +}; + +struct xkb_controls_action { + uint8_t type; + uint8_t flags; + uint32_t ctrls; +}; + +struct xkb_device_button_action { + uint8_t type; + uint8_t flags; + uint8_t count; + uint8_t button; + uint8_t device; +}; + +struct xkb_device_valuator_action { + uint8_t type; + uint8_t device; + uint8_t v1_what; + uint8_t v1_index; + uint8_t v1_value; + uint8_t v2_what; + uint8_t v2_index; + uint8_t v2_value; +}; + +struct xkb_pointer_default_action { + uint8_t type; + uint8_t flags; + uint8_t affect; + uint8_t value; +}; + +struct xkb_switch_screen_action { + uint8_t type; + uint8_t flags; + uint8_t screen; +}; + +struct xkb_redirect_key_action { + uint8_t type; + xkb_keycode_t new_key; + uint8_t mods_mask; + uint8_t mods; + uint16_t vmods_mask; + uint16_t vmods; +}; + +struct xkb_pointer_action { + uint8_t type; + uint8_t flags; + uint16_t x; + uint16_t y; +}; + +struct xkb_message_action { + uint8_t type; + uint8_t flags; + uint8_t message[6]; +}; + +struct xkb_pointer_button_action { + uint8_t type; + uint8_t flags; + uint8_t count; + uint8_t button; +}; + +union xkb_action { + struct xkb_any_action any; + struct xkb_mod_action mods; + struct xkb_group_action group; + struct xkb_iso_action iso; + struct xkb_controls_action ctrls; + struct xkb_device_button_action devbtn; + struct xkb_device_valuator_action devval; + struct xkb_pointer_default_action dflt; + struct xkb_switch_screen_action screen; + struct xkb_redirect_key_action redirect; /* XXX wholly unnecessary? */ + struct xkb_pointer_action ptr; /* XXX delete for DeviceValuator */ + struct xkb_pointer_button_action btn; /* XXX delete for DeviceBtn */ + struct xkb_message_action msg; /* XXX just delete */ + unsigned char type; +}; + +struct xkb_mods { + uint32_t mask; /* effective mods */ + uint32_t vmods; + uint8_t real_mods; +}; + +struct xkb_kt_map_entry { + int active; + uint16_t level; + struct xkb_mods mods; +}; + +struct xkb_key_type { + struct xkb_mods mods; + uint16_t num_levels; + unsigned char map_count; + struct xkb_kt_map_entry * map; + struct xkb_mods * preserve; + const char *name; + const char **level_names; +}; + +struct xkb_sym_interpret { + xkb_keysym_t sym; + unsigned char flags; + unsigned char match; + uint8_t mods; + uint32_t virtual_mod; + union xkb_action act; +}; + +struct xkb_compat_map { + struct xkb_sym_interpret * sym_interpret; + struct xkb_mods groups[XkbNumKbdGroups]; + unsigned short num_si; + unsigned short size_si; +}; + +struct xkb_sym_map { + unsigned char kt_index[XkbNumKbdGroups]; + unsigned char group_info; + unsigned char width; + int *sym_index; /* per level/group index into 'syms' */ + unsigned int *num_syms; /* per level/group */ + xkb_keysym_t *syms; + unsigned int size_syms; /* size of 'syms' */ +}; + +struct xkb_client_map { + unsigned char size_types; + unsigned char num_types; + struct xkb_key_type * types; + struct xkb_sym_map * key_sym_map; + unsigned char *modmap; +}; + +struct xkb_behavior { + unsigned char type; + unsigned char data; +}; + +struct xkb_server_map { + unsigned short num_acts; + unsigned short size_acts; + + unsigned char * explicit; + + union xkb_action *acts; + struct xkb_behavior *behaviors; + unsigned short *key_acts; + uint32_t vmods[XkbNumVirtualMods]; /* vmod -> mod mapping */ + uint32_t *vmodmap; /* key -> vmod mapping */ +}; + + +struct xkb_indicator_map { + unsigned char flags; + unsigned char which_groups; + unsigned char groups; + unsigned char which_mods; + struct xkb_mods mods; + unsigned int ctrls; +}; + +struct xkb_indicator { + struct xkb_indicator_map maps[XkbNumIndicators]; +}; + +struct xkb_key_name { + char name[XkbKeyNameLength]; +}; + +struct xkb_key_alias { + char real[XkbKeyNameLength]; + char alias[XkbKeyNameLength]; +}; + +struct xkb_names { + const char *vmods[XkbNumVirtualMods]; + const char *indicators[XkbNumIndicators]; + const char *groups[XkbNumKbdGroups]; + struct xkb_key_name * keys; + struct xkb_key_alias * key_aliases; + + xkb_keycode_t num_keys; + xkb_keycode_t num_key_aliases; +}; + +struct xkb_controls { + unsigned char num_groups; + unsigned char groups_wrap; + struct xkb_mods internal; + struct xkb_mods ignore_lock; + unsigned int enabled_ctrls; + unsigned short repeat_delay; + unsigned short repeat_interval; + unsigned short slow_keys_delay; + unsigned short debounce_delay; + unsigned short ax_options; + unsigned short ax_timeout; + unsigned short axt_opts_mask; + unsigned short axt_opts_values; + unsigned int axt_ctrls_mask; + unsigned int axt_ctrls_values; + unsigned char *per_key_repeat; +}; + +/* Common keyboard description structure */ +struct xkb_keymap { + struct xkb_context *context; + + unsigned int refcnt; + unsigned short flags; + xkb_keycode_t min_key_code; + xkb_keycode_t max_key_code; + + struct xkb_controls * ctrls; + struct xkb_server_map * server; + struct xkb_client_map * map; + struct xkb_indicator * indicators; + struct xkb_names * names; + struct xkb_compat_map * compat; +}; + +#define XkbNumGroups(g) ((g)&0x0f) +#define XkbOutOfRangeGroupInfo(g) ((g)&0xf0) +#define XkbOutOfRangeGroupAction(g) ((g)&0xc0) +#define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4) +#define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f)) +#define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f)) + +#define XkbKeyGroupInfo(d,k) ((d)->map->key_sym_map[k].group_info) +#define XkbKeyNumGroups(d,k) (XkbNumGroups((d)->map->key_sym_map[k].group_info)) +#define XkbKeyGroupWidth(d,k,g) (XkbKeyType(d,k,g)->num_levels) +#define XkbKeyGroupsWidth(d,k) ((d)->map->key_sym_map[k].width) +#define XkbKeyTypeIndex(d,k,g) ((d)->map->key_sym_map[k].kt_index[g&0x3]) +#define XkbKeyType(d,k,g) (&(d)->map->types[XkbKeyTypeIndex(d,k,g)]) +#define XkbKeyNumSyms(d,k,g,sl) \ + ((d)->map->key_sym_map[k].num_syms[(g*XkbKeyGroupsWidth(d,k))+sl]) +#define XkbKeySym(d,k,n) (&(d)->map->key_sym_map[k].syms[n]) +#define XkbKeySymOffset(d,k,g,sl) \ + ((d)->map->key_sym_map[k].sym_index[(g*XkbKeyGroupsWidth(d,k))+sl]) +#define XkbKeySymEntry(d,k,g,sl) \ + (XkbKeySym(d,k,XkbKeySymOffset(d,k,g,sl))) +#define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0) +#define XkbKeyNumActions(d,k) \ + (XkbKeyHasActions(d,k)?(XkbKeyGroupsWidth(d,k)*XkbKeyNumGroups(d,k)):1) +#define XkbKeyActionsPtr(d,k) (&(d)->server->acts[(d)->server->key_acts[k]]) +#define XkbKeyAction(d,k,n) \ + (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL) +#define XkbKeyActionEntry(d,k,sl,g) \ + (XkbKeyHasActions(d,k)?\ + XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL) + +#define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&\ + ((k)<=(d)->max_key_code)) +#define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1) + +struct xkb_state { + xkb_group_index_t base_group; /**< depressed */ + xkb_group_index_t latched_group; + xkb_group_index_t locked_group; + xkb_group_index_t group; /**< effective */ + + xkb_mod_mask_t base_mods; /**< depressed */ + xkb_mod_mask_t latched_mods; + xkb_mod_mask_t locked_mods; + xkb_mod_mask_t mods; /**< effective */ + + uint32_t leds; + + int refcnt; + void *filters; + int num_filters; + struct xkb_keymap *xkb; +}; + #endif /* _XKBCOMMONINT_H_ */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/action.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/action.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/action.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/action.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,6 +24,8 @@ ********************************************************/ +#include + #include "xkbcomp.h" #include "xkbmisc.h" #include "expr.h" @@ -34,7 +36,7 @@ #include "action.h" #include "misc.h" -static Bool actionsInitialized; +static bool actionsInitialized; static ExprDef constTrue; static ExprDef constFalse; @@ -122,23 +124,23 @@ { NULL, 0 } }; -static Bool +static bool stringToValue(const LookupEntry tab[], const char *string, unsigned *value_rtrn) { const LookupEntry *entry; if (!string) - return False; + return false; for (entry = tab; entry->name != NULL; entry++) { - if (uStrCaseCmp(entry->name, string) == 0) { + if (strcasecmp(entry->name, string) == 0) { *value_rtrn = entry->result; - return True; + return true; } } - return False; + return false; } static const char * @@ -153,13 +155,13 @@ return "unknown"; } -static Bool +static bool stringToAction(const char *str, unsigned *type_rtrn) { return stringToValue(actionStrings, str, type_rtrn); } -static Bool +static bool stringToField(const char *str, unsigned *field_rtrn) { return stringToValue(fieldStrings, str, field_rtrn); @@ -173,51 +175,51 @@ /***====================================================================***/ -static Bool +static bool ReportMismatch(unsigned action, unsigned field, const char *type) { ERROR("Value of %s field must be of type %s\n", fieldText(field), type); ACTION("Action %s definition ignored\n", XkbcActionTypeText(action)); - return False; + return false; } -static Bool +static bool ReportIllegal(unsigned action, unsigned field) { ERROR("Field %s is not defined for an action of type %s\n", fieldText(field), XkbcActionTypeText(action)); ACTION("Action definition ignored\n"); - return False; + return false; } -static Bool +static bool ReportActionNotArray(unsigned action, unsigned field) { ERROR("The %s field in the %s action is not an array\n", fieldText(field), XkbcActionTypeText(action)); ACTION("Action definition ignored\n"); - return False; + return false; } -static Bool +static bool ReportNotFound(unsigned action, unsigned field, const char *what, const char *bad) { ERROR("%s named %s not found\n", what, bad); ACTION("Ignoring the %s field of an %s action\n", fieldText(field), XkbcActionTypeText(action)); - return False; + return false; } -static Bool -HandleNoAction(struct xkb_desc * xkb, +static bool +HandleNoAction(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { return ReportIllegal(action->type, field); } -static Bool +static bool CheckLatchLockFlags(unsigned action, unsigned field, ExprDef * value, unsigned *flags_inout) { @@ -229,18 +231,18 @@ else if (field == F_LatchToLock) tmp = XkbSA_LatchToLock; else - return False; /* WSGO! */ + return false; /* WSGO! */ if (!ExprResolveBoolean(value, &result)) return ReportMismatch(action, field, "boolean"); if (result.uval) *flags_inout |= tmp; else *flags_inout &= ~tmp; - return True; + return true; } -static Bool -CheckModifierField(struct xkb_desc * xkb, +static bool +CheckModifierField(struct xkb_keymap * xkb, unsigned action, ExprDef * value, unsigned *flags_inout, unsigned *mods_rtrn) @@ -251,24 +253,24 @@ { const char *valStr; valStr = XkbcAtomText(value->value.str); - if (valStr && ((uStrCaseCmp(valStr, "usemodmapmods") == 0) || - (uStrCaseCmp(valStr, "modmapmods") == 0))) + if (valStr && ((strcasecmp(valStr, "usemodmapmods") == 0) || + (strcasecmp(valStr, "modmapmods") == 0))) { *mods_rtrn = 0; *flags_inout |= XkbSA_UseModMapMods; - return True; + return true; } } if (!ExprResolveVModMask(value, &rtrn, xkb)) return ReportMismatch(action, F_Modifiers, "modifier mask"); *mods_rtrn = rtrn.uval; *flags_inout &= ~XkbSA_UseModMapMods; - return True; + return true; } -static Bool -HandleSetLatchMods(struct xkb_desc * xkb, +static bool +HandleSetLatchMods(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -295,9 +297,9 @@ if (CheckLatchLockFlags(action->type, field, value, &rtrn)) { act->flags = rtrn; - return True; + return true; } - return False; + return false; case F_Modifiers: t1 = act->flags; if (CheckModifierField(xkb, action->type, value, &t1, &t2)) @@ -305,15 +307,15 @@ act->flags = t1; act->real_mods = act->mask = (t2 & 0xff); act->vmods = (t2 >> 8) & 0xffff; - return True; + return true; } - return False; + return false; } return ReportIllegal(action->type, field); } -static Bool -HandleLockMods(struct xkb_desc * xkb, +static bool +HandleLockMods(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -332,14 +334,14 @@ act->flags = t1; act->real_mods = act->mask = (t2 & 0xff); act->vmods = (t2 >> 8) & 0xffff; - return True; + return true; } - return False; + return false; } return ReportIllegal(action->type, field); } -static Bool +static bool CheckGroupField(unsigned action, ExprDef * value, unsigned *flags_inout, int *grp_rtrn) { @@ -365,11 +367,11 @@ *grp_rtrn = rtrn.ival; else *grp_rtrn = rtrn.ival - 1; - return True; + return true; } -static Bool -HandleSetLatchGroup(struct xkb_desc * xkb, +static bool +HandleSetLatchGroup(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -397,24 +399,24 @@ if (CheckLatchLockFlags(action->type, field, value, &rtrn)) { act->flags = rtrn; - return True; + return true; } - return False; + return false; case F_Group: t1 = act->flags; if (CheckGroupField(action->type, value, &t1, &t2)) { act->flags = t1; act->group = t2; - return True; + return true; } - return False; + return false; } return ReportIllegal(action->type, field); } -static Bool -HandleLockGroup(struct xkb_desc * xkb, +static bool +HandleLockGroup(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -432,21 +434,21 @@ { act->flags = t1; act->group = t2; - return True; + return true; } - return False; + return false; } return ReportIllegal(action->type, field); } -static Bool -HandleMovePtr(struct xkb_desc * xkb, +static bool +HandleMovePtr(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { ExprResult rtrn; struct xkb_pointer_action *act; - Bool absolute; + bool absolute; act = (struct xkb_pointer_action *) action; if ((array_ndx != NULL) && ((field == F_X) || (field == F_Y))) @@ -455,9 +457,9 @@ if ((field == F_X) || (field == F_Y)) { if ((value->op == OpNegate) || (value->op == OpUnaryPlus)) - absolute = False; + absolute = false; else - absolute = True; + absolute = true; if (!ExprResolveInteger(value, &rtrn)) return ReportMismatch(action->type, field, "integer"); if (field == F_X) @@ -472,7 +474,7 @@ act->flags |= XkbSA_MoveAbsoluteY; act->y = rtrn.ival; } - return True; + return true; } else if (field == F_Accel) { @@ -494,8 +496,8 @@ {NULL, 0} }; -static Bool -HandlePtrBtn(struct xkb_desc * xkb, +static bool +HandlePtrBtn(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -514,10 +516,10 @@ { ERROR("Button must specify default or be in the range 1..5\n"); ACTION("Illegal button value %d ignored\n", rtrn.ival); - return False; + return false; } act->button = rtrn.ival; - return True; + return true; } else if ((action->type == XkbSA_LockPtrBtn) && (field == F_Affect)) { @@ -527,7 +529,7 @@ return ReportMismatch(action->type, field, "lock or unlock"); act->flags &= ~(XkbSA_LockNoLock | XkbSA_LockNoUnlock); act->flags |= rtrn.ival; - return True; + return true; } else if (field == F_Count) { @@ -539,10 +541,10 @@ { ERROR("The count field must have a value in the range 0..255\n"); ACTION("Illegal count %d ignored\n", rtrn.ival); - return False; + return false; } act->count = rtrn.ival; - return True; + return true; } return ReportIllegal(action->type, field); } @@ -554,8 +556,8 @@ {NULL, 0} }; -static Bool -HandleSetPtrDflt(struct xkb_desc * xkb, +static bool +HandleSetPtrDflt(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -570,7 +572,7 @@ if (!ExprResolveEnum(value, &rtrn, ptrDflts)) return ReportMismatch(action->type, field, "pointer component"); act->affect = rtrn.uval; - return True; + return true; } else if ((field == F_Button) || (field == F_Value)) { @@ -595,19 +597,19 @@ { ERROR("New default button value must be in the range 1..5\n"); ACTION("Illegal default button value %d ignored\n", rtrn.ival); - return False; + return false; } if (rtrn.ival == 0) { ERROR("Cannot set default pointer button to \"default\"\n"); ACTION("Illegal default button setting ignored\n"); - return False; + return false; } if (value->op == OpNegate) act->value = -rtrn.ival; else act->value = rtrn.ival; - return True; + return true; } return ReportIllegal(action->type, field); } @@ -626,8 +628,8 @@ {NULL, 0}, }; -static Bool -HandleISOLock(struct xkb_desc * xkb, +static bool +HandleISOLock(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -648,9 +650,9 @@ act->flags = flags & (~XkbSA_ISODfltIsGroup); act->real_mods = mods & 0xff; act->vmods = (mods >> 8) & 0xff; - return True; + return true; } - return False; + return false; case F_Group: if (array_ndx != NULL) return ReportActionNotArray(action->type, field); @@ -659,22 +661,22 @@ { act->flags = flags | XkbSA_ISODfltIsGroup; act->group = group; - return True; + return true; } - return False; + return false; case F_Affect: if (array_ndx != NULL) return ReportActionNotArray(action->type, field); if (!ExprResolveMask(value, &rtrn, isoNames)) return ReportMismatch(action->type, field, "keyboard component"); act->affect = (~rtrn.uval) & XkbSA_ISOAffectMask; - return True; + return true; } return ReportIllegal(action->type, field); } -static Bool -HandleSwitchScreen(struct xkb_desc * xkb, +static bool +HandleSwitchScreen(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -704,13 +706,13 @@ { ERROR("Screen index must be in the range 1..255\n"); ACTION("Illegal screen value %d ignored\n", rtrn.ival); - return False; + return false; } if (value->op == OpNegate) act->screen = -rtrn.ival; else act->screen = rtrn.ival; - return True; + return true; } else if (field == F_Same) { @@ -722,7 +724,7 @@ act->flags &= ~XkbSA_SwitchApplication; else act->flags |= XkbSA_SwitchApplication; - return True; + return true; } return ReportIllegal(action->type, field); } @@ -748,8 +750,8 @@ {NULL, 0} }; -static Bool -HandleSetLockControls(struct xkb_desc * xkb, +static bool +HandleSetLockControls(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -764,7 +766,7 @@ if (!ExprResolveMask(value, &rtrn, ctrlNames)) return ReportMismatch(action->type, field, "controls mask"); act->ctrls = rtrn.uval; - return True; + return true; } return ReportIllegal(action->type, field); } @@ -779,8 +781,8 @@ {NULL, 0} }; -static Bool -HandleActionMessage(struct xkb_desc * xkb, +static bool +HandleActionMessage(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -798,7 +800,7 @@ act->flags &= ~(XkbSA_MessageOnPress | XkbSA_MessageOnRelease); act->flags = rtrn.uval & (XkbSA_MessageOnPress | XkbSA_MessageOnRelease); - return True; + return true; case F_GenKeyEvent: if (array_ndx != NULL) return ReportActionNotArray(action->type, field); @@ -808,7 +810,7 @@ act->flags |= XkbSA_MessageGenKeyEvent; else act->flags &= ~XkbSA_MessageGenKeyEvent; - return True; + return true; case F_Data: if (array_ndx == NULL) { @@ -824,7 +826,7 @@ } strncpy((char *) act->message, rtrn.str, 6); } - return True; + return true; } else { @@ -833,14 +835,14 @@ { ERROR("Array subscript must be integer\n"); ACTION("Illegal subscript ignored\n"); - return False; + return false; } ndx = rtrn.uval; if (ndx > 5) { ERROR("An action message is at most 6 bytes long\n"); ACTION("Attempt to use data[%d] ignored\n", ndx); - return False; + return false; } if (!ExprResolveInteger(value, &rtrn)) return ReportMismatch(action->type, field, "integer"); @@ -848,17 +850,17 @@ { ERROR("Message data must be in the range 0..255\n"); ACTION("Illegal datum %d ignored\n", rtrn.ival); - return False; + return false; } act->message[ndx] = rtrn.uval; } - return True; + return true; } return ReportIllegal(action->type, field); } -static Bool -HandleRedirectKey(struct xkb_desc * xkb, +static bool +HandleRedirectKey(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -878,13 +880,13 @@ if (!ExprResolveKeyName(value, &rtrn)) return ReportMismatch(action->type, field, "key name"); tmp = KeyNameToLong(rtrn.keyName.name); - if (!FindNamedKey(xkb, tmp, &kc, True, CreateKeyNames(xkb), 0)) + if (!FindNamedKey(xkb, tmp, &kc, true, CreateKeyNames(xkb), 0)) { return ReportNotFound(action->type, field, "Key", XkbcKeyNameText(rtrn.keyName.name)); } act->new_key = kc; - return True; + return true; case F_ModsToClear: case F_Modifiers: t1 = 0; @@ -902,15 +904,15 @@ act->vmods |= t2; else act->vmods &= ~t2; - return True; + return true; } - return True; + return true; } return ReportIllegal(action->type, field); } -static Bool -HandleDeviceBtn(struct xkb_desc * xkb, +static bool +HandleDeviceBtn(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -929,10 +931,10 @@ { ERROR("Button must specify default or be in the range 1..255\n"); ACTION("Illegal button value %d ignored\n", rtrn.ival); - return False; + return false; } act->button = rtrn.ival; - return True; + return true; } else if ((action->type == XkbSA_LockDeviceBtn) && (field == F_Affect)) { @@ -942,7 +944,7 @@ return ReportMismatch(action->type, field, "lock or unlock"); act->flags &= ~(XkbSA_LockNoLock | XkbSA_LockNoUnlock); act->flags |= rtrn.ival; - return True; + return true; } else if (field == F_Count) { @@ -954,10 +956,10 @@ { ERROR("The count field must have a value in the range 0..255\n"); ACTION("Illegal count %d ignored\n", rtrn.ival); - return False; + return false; } act->count = rtrn.ival; - return True; + return true; } else if (field == F_Device) { @@ -970,16 +972,16 @@ { ERROR("Device must specify default or be in the range 1..255\n"); ACTION("Illegal device value %d ignored\n", rtrn.ival); - return False; + return false; } act->device = rtrn.ival; - return True; + return true; } return ReportIllegal(action->type, field); } -static Bool -HandleDeviceValuator(struct xkb_desc * xkb, +static bool +HandleDeviceValuator(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -990,11 +992,11 @@ act = (struct xkb_device_valuator_action *) action; /* XXX - Not yet implemented */ #endif - return False; + return false; } -static Bool -HandlePrivate(struct xkb_desc * xkb, +static bool +HandlePrivate(struct xkb_keymap * xkb, struct xkb_any_action * action, unsigned field, ExprDef * array_ndx, ExprDef * value) { @@ -1009,10 +1011,10 @@ { ERROR("Private action type must be in the range 0..255\n"); ACTION("Illegal type %d ignored\n", rtrn.ival); - return False; + return false; } action->type = rtrn.uval; - return True; + return true; case F_Data: if (array_ndx == NULL) { @@ -1025,12 +1027,12 @@ { WARN("A private action has 7 data bytes\n"); ACTION("Extra %d bytes ignored\n", len - 6); - return False; + return false; } strncpy((char *) action->data, rtrn.str, sizeof action->data); } free(rtrn.str); - return True; + return true; } else { @@ -1039,14 +1041,14 @@ { ERROR("Array subscript must be integer\n"); ACTION("Illegal subscript ignored\n"); - return False; + return false; } ndx = rtrn.uval; if (ndx >= sizeof action->data) { ERROR("The data for a private action is 18 bytes long\n"); ACTION("Attempt to use data[%d] ignored\n", ndx); - return False; + return false; } if (!ExprResolveInteger(value, &rtrn)) return ReportMismatch(action->type, field, "integer"); @@ -1054,45 +1056,42 @@ { ERROR("All data for a private action must be 0..255\n"); ACTION("Illegal datum %d ignored\n", rtrn.ival); - return False; + return false; } action->data[ndx] = rtrn.uval; - return True; + return true; } } return ReportIllegal(PrivateAction, field); } -typedef Bool(*actionHandler) (struct xkb_desc * /* xkb */ , - struct xkb_any_action * /* action */ , - unsigned /* field */ , - ExprDef * /* array_ndx */ , - ExprDef * /* value */ - ); +typedef bool (*actionHandler) (struct xkb_keymap *xkb, + struct xkb_any_action *action, unsigned field, + ExprDef *array_ndx, ExprDef *value); static const actionHandler handleAction[XkbSA_NumActions + 1] = { - HandleNoAction /* NoAction */ , - HandleSetLatchMods /* SetMods */ , - HandleSetLatchMods /* LatchMods */ , - HandleLockMods /* LockMods */ , - HandleSetLatchGroup /* SetGroup */ , - HandleSetLatchGroup /* LatchGroup */ , - HandleLockGroup /* LockGroup */ , - HandleMovePtr /* MovePtr */ , - HandlePtrBtn /* PtrBtn */ , - HandlePtrBtn /* LockPtrBtn */ , - HandleSetPtrDflt /* SetPtrDflt */ , - HandleISOLock /* ISOLock */ , - HandleNoAction /* Terminate */ , - HandleSwitchScreen /* SwitchScreen */ , - HandleSetLockControls /* SetControls */ , - HandleSetLockControls /* LockControls */ , - HandleActionMessage /* ActionMessage */ , - HandleRedirectKey /* RedirectKey */ , - HandleDeviceBtn /* DeviceBtn */ , - HandleDeviceBtn /* LockDeviceBtn */ , - HandleDeviceValuator /* DeviceValuatr */ , - HandlePrivate /* Private */ + [XkbSA_NoAction] = HandleNoAction, + [XkbSA_SetMods] = HandleSetLatchMods, + [XkbSA_LatchMods] = HandleSetLatchMods, + [XkbSA_LockMods] = HandleLockMods, + [XkbSA_SetGroup] = HandleSetLatchGroup, + [XkbSA_LatchGroup] = HandleSetLatchGroup, + [XkbSA_LockGroup] = HandleLockGroup, + [XkbSA_MovePtr] = HandleMovePtr, + [XkbSA_PtrBtn] = HandlePtrBtn, + [XkbSA_LockPtrBtn] = HandlePtrBtn, + [XkbSA_SetPtrDflt] = HandleSetPtrDflt, + [XkbSA_ISOLock] = HandleISOLock, + [XkbSA_Terminate] = HandleNoAction, + [XkbSA_SwitchScreen] = HandleSwitchScreen, + [XkbSA_SetControls] = HandleSetLockControls, + [XkbSA_LockControls] = HandleSetLockControls, + [XkbSA_ActionMessage] = HandleActionMessage, + [XkbSA_RedirectKey] = HandleRedirectKey, + [XkbSA_DeviceBtn] = HandleDeviceBtn, + [XkbSA_LockDeviceBtn] = HandleDeviceBtn, + [XkbSA_DeviceValuator] = HandleDeviceValuator, + [PrivateAction] = HandlePrivate, }; /***====================================================================***/ @@ -1117,8 +1116,8 @@ int HandleActionDef(ExprDef * def, - struct xkb_desc * xkb, - struct xkb_any_action * action, unsigned mergeMode, ActionInfo * info) + struct xkb_keymap * xkb, + struct xkb_any_action * action, ActionInfo * info) { ExprDef *arg; const char *str; @@ -1131,18 +1130,18 @@ { ERROR("Expected an action definition, found %s\n", exprOpText(def->op)); - return False; + return false; } str = XkbcAtomText(def->value.action.name); if (!str) { WSGO("Missing name in action definition!!\n"); - return False; + return false; } if (!stringToAction(str, &tmp)) { ERROR("Unknown action %s\n", str); - return False; + return false; } action->type = hndlrType = tmp; if (action->type != XkbSA_NoAction) @@ -1158,7 +1157,7 @@ info->array_ndx, info->value)) { - return False; + return false; } } info = info->next; @@ -1181,16 +1180,18 @@ if ((arg->op == OpNot) || (arg->op == OpInvert)) { field = arg->value.child; + constFalse.value.str = xkb_intern_atom("false"); value = &constFalse; } else { field = arg; + constTrue.value.str = xkb_intern_atom("true"); value = &constTrue; } } if (!ExprResolveLhs(field, &elemRtrn, &fieldRtrn, &arrayRtrn)) - return False; /* internal error -- already reported */ + return false; /* internal error -- already reported */ if (elemRtrn.str != NULL) { @@ -1199,30 +1200,30 @@ fieldRtrn.str); free(elemRtrn.str); free(fieldRtrn.str); - return False; + return false; } if (!stringToField(fieldRtrn.str, &fieldNdx)) { ERROR("Unknown field name %s\n", uStringText(fieldRtrn.str)); free(elemRtrn.str); free(fieldRtrn.str); - return False; + return false; } free(elemRtrn.str); free(fieldRtrn.str); if (!(*handleAction[hndlrType]) (xkb, action, fieldNdx, arrayRtrn, value)) { - return False; + return false; } } - return True; + return true; } /***====================================================================***/ int -SetActionField(struct xkb_desc * xkb, +SetActionField(struct xkb_keymap * xkb, char *elem, char *field, ExprDef * array_ndx, ExprDef * value, ActionInfo ** info_rtrn) @@ -1236,30 +1237,30 @@ if (new == NULL) { WSGO("Couldn't allocate space for action default\n"); - return False; + return false; } - if (uStrCaseCmp(elem, "action") == 0) + if (strcasecmp(elem, "action") == 0) new->action = XkbSA_NoAction; else { if (!stringToAction(elem, &new->action)) { free(new); - return False; + return false; } if (new->action == XkbSA_NoAction) { ERROR("\"%s\" is not a valid field in a NoAction action\n", field); free(new); - return False; + return false; } } if (!stringToField(field, &new->field)) { ERROR("\"%s\" is not a legal field name\n", field); free(new); - return False; + return false; } new->array_ndx = array_ndx; new->value = value; @@ -1271,7 +1272,7 @@ *info_rtrn = new; else old->next = new; - return True; + return true; } /***====================================================================***/ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/action.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/action.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/action.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/action.h 2012-05-10 10:10:26.000000000 +0000 @@ -64,20 +64,13 @@ struct _ActionInfo *next; } ActionInfo; -extern int HandleActionDef(ExprDef * /* def */ , - struct xkb_desc * /* xkb */ , - struct xkb_any_action * /* action */ , - unsigned /* mergeMode */ , - ActionInfo * /* info */ - ); +extern int +HandleActionDef(ExprDef *def, struct xkb_keymap *xkb, + struct xkb_any_action *action, ActionInfo *info); -extern int SetActionField(struct xkb_desc * /* xkb */ , - char * /* elem */ , - char * /* field */ , - ExprDef * /* index */ , - ExprDef * /* value */ , - ActionInfo ** /* info_rtrn */ - ); +extern int +SetActionField(struct xkb_keymap *xkb, char *elem, char *field, + ExprDef *index, ExprDef *value, ActionInfo **info_rtrn); extern const LookupEntry ctrlNames[]; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/alias.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/alias.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/alias.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/alias.c 2012-05-10 10:10:26.000000000 +0000 @@ -96,14 +96,14 @@ AliasInfo new; InitAliasInfo(&new, merge, file_id, def->alias, def->real); HandleCollision(info, &new); - return True; + return true; } } info = uTypedCalloc(1, AliasInfo); if (info == NULL) { WSGO("Allocation failure in HandleAliasDef\n"); - return False; + return false; } info->def.fileID = file_id; info->def.merge = merge; @@ -111,7 +111,7 @@ memcpy(info->alias, def->alias, XkbKeyNameLength); memcpy(info->real, def->real, XkbKeyNameLength); *info_in = (AliasInfo *) AddCommonInfo(&(*info_in)->def, &info->def); - return True; + return true; } void @@ -121,19 +121,19 @@ ClearCommonInfo(&(*info_in)->def); } -Bool +bool MergeAliases(AliasInfo ** into, AliasInfo ** merge, unsigned how_merge) { AliasInfo *tmp; KeyAliasDef def; if ((*merge) == NULL) - return True; + return true; if ((*into) == NULL) { *into = *merge; *merge = NULL; - return True; + return true; } memset(&def, 0, sizeof(KeyAliasDef)); for (tmp = *merge; tmp != NULL; tmp = (AliasInfo *) tmp->def.next) @@ -145,13 +145,13 @@ memcpy(def.alias, tmp->alias, XkbKeyNameLength); memcpy(def.real, tmp->real, XkbKeyNameLength); if (!HandleAliasDef(&def, def.merge, tmp->def.fileID, into)) - return False; + return false; } - return True; + return true; } int -ApplyAliases(struct xkb_desc * xkb, AliasInfo ** info_in) +ApplyAliases(struct xkb_keymap * xkb, AliasInfo ** info_in) { int i; struct xkb_key_alias *old, *a; @@ -160,7 +160,7 @@ int status; if (*info_in == NULL) - return True; + return true; nOld = (xkb->names ? xkb->names->num_key_aliases : 0); old = (xkb->names ? xkb->names->key_aliases : NULL); for (nNew = 0, info = *info_in; info != NULL; @@ -170,7 +170,7 @@ xkb_keycode_t kc; lname = KeyNameToLong(info->real); - if (!FindNamedKey(xkb, lname, &kc, False, CreateKeyNames(xkb), 0)) + if (!FindNamedKey(xkb, lname, &kc, false, CreateKeyNames(xkb), 0)) { if (warningLevel > 4) { @@ -182,7 +182,7 @@ continue; } lname = KeyNameToLong(info->alias); - if (FindNamedKey(xkb, lname, &kc, False, False, 0)) + if (FindNamedKey(xkb, lname, &kc, false, false, 0)) { if (warningLevel > 4) { @@ -216,7 +216,7 @@ { ClearCommonInfo(&(*info_in)->def); *info_in = NULL; - return True; + return true; } status = XkbcAllocNames(xkb, XkbKeyAliasesMask, nOld + nNew); if (xkb->names) @@ -224,7 +224,7 @@ if (status != Success) { WSGO("Allocation failure in ApplyAliases\n"); - return False; + return false; } a = xkb->names ? &xkb->names->key_aliases[nOld] : NULL; for (info = *info_in; info != NULL; info = (AliasInfo *) info->def.next) @@ -245,5 +245,5 @@ #endif ClearCommonInfo(&(*info_in)->def); *info_in = NULL; - return True; + return true; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/alias.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/alias.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/alias.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/alias.h 2012-05-10 10:10:26.000000000 +0000 @@ -34,22 +34,17 @@ char real[XkbKeyNameLength + 1]; } AliasInfo; -extern int HandleAliasDef(KeyAliasDef * /* def */ , - unsigned /* merge */ , - unsigned /* file_id */ , - AliasInfo ** /* info */ - ); +extern int +HandleAliasDef(KeyAliasDef *def, unsigned merge, unsigned file_id, + AliasInfo **info); -extern void ClearAliases(AliasInfo ** /* info */ - ); +extern void +ClearAliases(AliasInfo **info); -extern Bool MergeAliases(AliasInfo ** /* into */ , - AliasInfo ** /* merge */ , - unsigned /* how_merge */ - ); +extern bool +MergeAliases(AliasInfo **into, AliasInfo **merge, unsigned how_merge); -extern int ApplyAliases(struct xkb_desc * /* xkb */ , - AliasInfo ** /* info */ - ); +extern int +ApplyAliases(struct xkb_keymap *xkb, AliasInfo **info); #endif /* ALIAS_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/compat.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/compat.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/compat.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/compat.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,7 +24,6 @@ ********************************************************/ -#include #include "xkbcomp.h" #include "xkballoc.h" #include "xkbmisc.h" @@ -51,6 +50,7 @@ { unsigned char fileID; unsigned char merge; + bool defined; unsigned char real_mods; xkb_atom_t vmods; } GroupCompatInfo; @@ -68,7 +68,7 @@ LEDInfo *leds; VModInfo vmods; ActionInfo *act; - struct xkb_desc * xkb; + struct xkb_keymap * xkb; } CompatInfo; /***====================================================================***/ @@ -94,15 +94,15 @@ snprintf(buf, sizeof(buf), "%s+%s(%s)", XkbcKeysymText(si->interp.sym), XkbcSIMatchText(si->interp.match), - XkbcModMaskText(si->interp.mods, False)); + XkbcModMaskText(si->interp.mods, false)); } return buf; } static void -InitCompatInfo(CompatInfo * info, struct xkb_desc * xkb) +InitCompatInfo(CompatInfo * info, struct xkb_keymap * xkb) { - int i; + unsigned int i; info->xkb = xkb; info->name = NULL; @@ -130,9 +130,9 @@ } static void -ClearCompatInfo(CompatInfo * info, struct xkb_desc * xkb) +ClearCompatInfo(CompatInfo * info, struct xkb_keymap * xkb) { - int i; + unsigned int i; ActionInfo *next; free(info->name); @@ -193,7 +193,7 @@ return NULL; } -static Bool +static bool AddInterp(CompatInfo * info, SymInterpInfo * new) { unsigned collide; @@ -214,7 +214,7 @@ } *old = *new; old->defs.next = &next->defs; - return True; + return true; } if (UseNewField(_SI_VirtualMod, &old->defs, &new->defs, &collide)) { @@ -250,17 +250,17 @@ ACTION("Using %s definition for duplicate fields\n", (new->defs.merge != MergeAugment ? "last" : "first")); } - return True; + return true; } old = new; if ((new = NextInterp(info)) == NULL) - return False; + return false; *new = *old; new->defs.next = NULL; - return True; + return true; } -static Bool +static bool AddGroupCompat(CompatInfo * info, unsigned group, GroupCompatInfo * newGC) { GroupCompatInfo *gc; @@ -270,7 +270,7 @@ gc = &info->groupCompat[group]; if (((gc->real_mods == newGC->real_mods) && (gc->vmods == newGC->vmods))) { - return True; + return true; } if (((gc->fileID == newGC->fileID) && (warningLevel > 0)) || (warningLevel > 9)) @@ -279,14 +279,14 @@ ACTION("Using %s definition\n", (merge == MergeAugment ? "old" : "new")); } - if (merge != MergeAugment) + if (newGC->defined && (merge != MergeAugment || !gc->defined)) *gc = *newGC; - return True; + return true; } /***====================================================================***/ -static Bool +static bool ResolveStateAndPredicate(ExprDef * expr, unsigned *pred_rtrn, unsigned *mods_rtrn, CompatInfo * info) @@ -297,48 +297,48 @@ { *pred_rtrn = XkbSI_AnyOfOrNone; *mods_rtrn = ~0; - return True; + return true; } *pred_rtrn = XkbSI_Exactly; if (expr->op == ExprActionDecl) { const char *pred_txt = XkbcAtomText(expr->value.action.name); - if (uStrCaseCmp(pred_txt, "noneof") == 0) + if (strcasecmp(pred_txt, "noneof") == 0) *pred_rtrn = XkbSI_NoneOf; - else if (uStrCaseCmp(pred_txt, "anyofornone") == 0) + else if (strcasecmp(pred_txt, "anyofornone") == 0) *pred_rtrn = XkbSI_AnyOfOrNone; - else if (uStrCaseCmp(pred_txt, "anyof") == 0) + else if (strcasecmp(pred_txt, "anyof") == 0) *pred_rtrn = XkbSI_AnyOf; - else if (uStrCaseCmp(pred_txt, "allof") == 0) + else if (strcasecmp(pred_txt, "allof") == 0) *pred_rtrn = XkbSI_AllOf; - else if (uStrCaseCmp(pred_txt, "exactly") == 0) + else if (strcasecmp(pred_txt, "exactly") == 0) *pred_rtrn = XkbSI_Exactly; else { ERROR("Illegal modifier predicate \"%s\"\n", pred_txt); ACTION("Ignored\n"); - return False; + return false; } expr = expr->value.action.args; } else if (expr->op == ExprIdent) { const char *pred_txt = XkbcAtomText(expr->value.str); - if ((pred_txt) && (uStrCaseCmp(pred_txt, "any") == 0)) + if ((pred_txt) && (strcasecmp(pred_txt, "any") == 0)) { *pred_rtrn = XkbSI_AnyOf; *mods_rtrn = 0xff; - return True; + return true; } } if (ExprResolveModMask(expr, &result)) { *mods_rtrn = result.uval; - return True; + return true; } - return False; + return false; } /***====================================================================***/ @@ -388,29 +388,27 @@ } } -typedef void (*FileHandler) (XkbFile * /* rtrn */ , - struct xkb_desc * /* xkb */ , - unsigned /* merge */ , - CompatInfo * /* info */ - ); +typedef void (*FileHandler) (XkbFile *rtrn, struct xkb_keymap *xkb, + unsigned merge, CompatInfo *info); -static Bool +static bool HandleIncludeCompatMap(IncludeStmt * stmt, - struct xkb_desc * xkb, CompatInfo * info, FileHandler hndlr) + struct xkb_keymap * xkb, CompatInfo * info, FileHandler hndlr) { unsigned newMerge; XkbFile *rtrn; CompatInfo included; - Bool haveSelf; + bool haveSelf; - haveSelf = False; + haveSelf = false; if ((stmt->file == NULL) && (stmt->map == NULL)) { - haveSelf = True; + haveSelf = true; included = *info; memset(info, 0, sizeof(CompatInfo)); } - else if (ProcessIncludeFile(stmt, XkmCompatMapIndex, &rtrn, &newMerge)) + else if (ProcessIncludeFile(xkb->context, stmt, XkmCompatMapIndex, &rtrn, + &newMerge)) { InitCompatInfo(&included, xkb); included.fileID = rtrn->id; @@ -434,7 +432,7 @@ else { info->errorCount += 10; - return False; + return false; } if ((stmt->next != NULL) && (included.errorCount < 1)) { @@ -446,11 +444,12 @@ { if ((next->file == NULL) && (next->map == NULL)) { - haveSelf = True; + haveSelf = true; MergeIncludedCompatMaps(&included, info, next->merge); ClearCompatInfo(info, xkb); } - else if (ProcessIncludeFile(next, XkmCompatMapIndex, &rtrn, &op)) + else if (ProcessIncludeFile(xkb->context, next, XkmCompatMapIndex, + &rtrn, &op)) { InitCompatInfo(&next_incl, xkb); next_incl.fileID = rtrn->id; @@ -470,7 +469,7 @@ else { info->errorCount += 10; - return False; + return false; } } } @@ -494,24 +493,23 @@ static int SetInterpField(SymInterpInfo * si, - struct xkb_desc * xkb, + struct xkb_keymap * xkb, char *field, ExprDef * arrayNdx, ExprDef * value, CompatInfo * info) { int ok = 1; ExprResult tmp; - if (uStrCaseCmp(field, "action") == 0) + if (strcasecmp(field, "action") == 0) { if (arrayNdx != NULL) return ReportSINotArray(si, field, info); - ok = HandleActionDef(value, xkb, &si->interp.act.any, si->defs.merge, - info->act); + ok = HandleActionDef(value, xkb, &si->interp.act.any, info->act); if (ok) si->defs.defined |= _SI_Action; } - else if ((uStrCaseCmp(field, "virtualmodifier") == 0) || - (uStrCaseCmp(field, "virtualmod") == 0)) + else if ((strcasecmp(field, "virtualmodifier") == 0) || + (strcasecmp(field, "virtualmod") == 0)) { if (arrayNdx != NULL) return ReportSINotArray(si, field, info); @@ -524,7 +522,7 @@ else return ReportSIBadType(si, field, "virtual modifier", info); } - else if (uStrCaseCmp(field, "repeat") == 0) + else if (strcasecmp(field, "repeat") == 0) { if (arrayNdx != NULL) return ReportSINotArray(si, field, info); @@ -540,7 +538,7 @@ else return ReportSIBadType(si, field, "boolean", info); } - else if (uStrCaseCmp(field, "locking") == 0) + else if (strcasecmp(field, "locking") == 0) { if (arrayNdx != NULL) return ReportSINotArray(si, field, info); @@ -556,8 +554,8 @@ else return ReportSIBadType(si, field, "boolean", info); } - else if ((uStrCaseCmp(field, "usemodmap") == 0) || - (uStrCaseCmp(field, "usemodmapmods") == 0)) + else if ((strcasecmp(field, "usemodmap") == 0) || + (strcasecmp(field, "usemodmapmods") == 0)) { if (arrayNdx != NULL) return ReportSINotArray(si, field, info); @@ -581,7 +579,7 @@ } static int -HandleInterpVar(VarDef * stmt, struct xkb_desc * xkb, CompatInfo * info) +HandleInterpVar(VarDef * stmt, struct xkb_keymap * xkb, CompatInfo * info) { ExprResult elem, field; ExprDef *ndx; @@ -589,10 +587,10 @@ if (ExprResolveLhs(stmt->name, &elem, &field, &ndx) == 0) ret = 0; /* internal error, already reported */ - else if (elem.str && (uStrCaseCmp(elem.str, "interpret") == 0)) + else if (elem.str && (strcasecmp(elem.str, "interpret") == 0)) ret = SetInterpField(&info->dflt, xkb, field.str, ndx, stmt->value, info); - else if (elem.str && (uStrCaseCmp(elem.str, "indicator") == 0)) + else if (elem.str && (strcasecmp(elem.str, "indicator") == 0)) ret = SetIndicatorMapField(&info->ledDflt, xkb, field.str, ndx, stmt->value); else @@ -604,7 +602,7 @@ } static int -HandleInterpBody(VarDef * def, struct xkb_desc * xkb, SymInterpInfo * si, +HandleInterpBody(VarDef * def, struct xkb_keymap * xkb, SymInterpInfo * si, CompatInfo * info) { int ok = 1; @@ -629,7 +627,7 @@ } static int -HandleInterpDef(InterpDef * def, struct xkb_desc * xkb, unsigned merge, +HandleInterpDef(InterpDef * def, struct xkb_keymap * xkb, unsigned merge, CompatInfo * info) { unsigned pred, mods; @@ -639,7 +637,7 @@ { ERROR("Couldn't determine matching modifiers\n"); ACTION("Symbol interpretation ignored\n"); - return False; + return false; } if (def->merge != MergeDefault) merge = def->merge; @@ -650,27 +648,27 @@ { ERROR("Could not resolve keysym %s\n", def->sym); ACTION("Symbol interpretation ignored\n"); - return False; + return false; } si.interp.match = pred & XkbSI_OpMask; si.interp.mods = mods; if (!HandleInterpBody(def->def, xkb, &si, info)) { info->errorCount++; - return False; + return false; } if (!AddInterp(info, &si)) { info->errorCount++; - return False; + return false; } - return True; + return true; } static int HandleGroupCompatDef(GroupCompatDef * def, - struct xkb_desc * xkb, unsigned merge, CompatInfo * info) + struct xkb_keymap * xkb, unsigned merge, CompatInfo * info) { ExprResult val; GroupCompatInfo tmp; @@ -683,7 +681,7 @@ XkbNumKbdGroups + 1); ACTION("Compatibility map for illegal group %d ignored\n", def->group); - return False; + return false; } tmp.fileID = info->fileID; tmp.merge = merge; @@ -692,23 +690,24 @@ ERROR("Expected a modifier mask in group compatibility definition\n"); ACTION("Ignoring illegal compatibility map for group %d\n", def->group); - return False; + return false; } tmp.real_mods = val.uval & 0xff; tmp.vmods = (val.uval >> 8) & 0xffff; + tmp.defined = true; return AddGroupCompat(info, def->group - 1, &tmp); } static void HandleCompatMapFile(XkbFile * file, - struct xkb_desc * xkb, unsigned merge, CompatInfo * info) + struct xkb_keymap * xkb, unsigned merge, CompatInfo * info) { ParseCommon *stmt; if (merge == MergeDefault) merge = MergeAugment; free(info->name); - info->name = _XkbDupString(file->name); + info->name = uDupString(file->name); stmt = file->defs; while (stmt) { @@ -771,15 +770,15 @@ static void CopyInterps(CompatInfo * info, - struct xkb_compat_map * compat, Bool needSymbol, unsigned pred) + struct xkb_compat_map * compat, bool needSymbol, unsigned pred) { SymInterpInfo *si; for (si = info->interps; si; si = (SymInterpInfo *) si->defs.next) { if (((si->interp.match & XkbSI_OpMask) != pred) || - (needSymbol && (si->interp.sym == NoSymbol)) || - ((!needSymbol) && (si->interp.sym != NoSymbol))) + (needSymbol && (si->interp.sym == XKB_KEYSYM_NO_SYMBOL)) || + ((!needSymbol) && (si->interp.sym != XKB_KEYSYM_NO_SYMBOL))) continue; if (compat->num_si >= compat->size_si) { @@ -791,8 +790,8 @@ } } -Bool -CompileCompatMap(XkbFile *file, struct xkb_desc * xkb, unsigned merge, +bool +CompileCompatMap(XkbFile *file, struct xkb_keymap * xkb, unsigned merge, LEDInfoPtr *unboundLEDs) { int i; @@ -807,24 +806,23 @@ if (info.errorCount == 0) { int size; - if (XkbcAllocCompatMap(xkb, XkbAllCompatMask, info.nInterps) != - Success) + if (XkbcAllocCompatMap(xkb, info.nInterps) != Success) { WSGO("Couldn't allocate compatibility map\n"); - return False; + return false; } size = info.nInterps * sizeof(struct xkb_sym_interpret); if (size > 0) { - CopyInterps(&info, xkb->compat, True, XkbSI_Exactly); - CopyInterps(&info, xkb->compat, True, XkbSI_AllOf | XkbSI_NoneOf); - CopyInterps(&info, xkb->compat, True, XkbSI_AnyOf); - CopyInterps(&info, xkb->compat, True, XkbSI_AnyOfOrNone); - CopyInterps(&info, xkb->compat, False, XkbSI_Exactly); - CopyInterps(&info, xkb->compat, False, + CopyInterps(&info, xkb->compat, true, XkbSI_Exactly); + CopyInterps(&info, xkb->compat, true, XkbSI_AllOf | XkbSI_NoneOf); + CopyInterps(&info, xkb->compat, true, XkbSI_AnyOf); + CopyInterps(&info, xkb->compat, true, XkbSI_AnyOfOrNone); + CopyInterps(&info, xkb->compat, false, XkbSI_Exactly); + CopyInterps(&info, xkb->compat, false, XkbSI_AllOf | XkbSI_NoneOf); - CopyInterps(&info, xkb->compat, False, XkbSI_AnyOf); - CopyInterps(&info, xkb->compat, False, XkbSI_AnyOfOrNone); + CopyInterps(&info, xkb->compat, false, XkbSI_AnyOf); + CopyInterps(&info, xkb->compat, false, XkbSI_AnyOfOrNone); } for (i = 0, gcm = &info.groupCompat[0]; i < XkbNumKbdGroups; i++, gcm++) @@ -844,14 +842,14 @@ info.leds = NULL; } ClearCompatInfo(&info, xkb); - return True; + return true; } free(info.interps); - return False; + return false; } static uint32_t -VModsToReal(struct xkb_desc *xkb, uint32_t vmodmask) +VModsToReal(struct xkb_keymap *xkb, uint32_t vmodmask) { uint32_t ret = 0; int i; @@ -869,7 +867,7 @@ } static void -UpdateActionMods(struct xkb_desc *xkb, union xkb_action *act, uint32_t rmodmask) +UpdateActionMods(struct xkb_keymap *xkb, union xkb_action *act, uint32_t rmodmask) { switch (act->type) { case XkbSA_SetMods: @@ -894,13 +892,13 @@ /** * Find an interpretation which applies to this particular level, either by * finding an exact match for the symbol and modifier combination, or a - * generic NoSymbol match. + * generic XKB_KEYSYM_NO_SYMBOL match. */ static struct xkb_sym_interpret * -FindInterpForKey(struct xkb_desc *xkb, xkb_keycode_t key, uint32_t group, uint32_t level) +FindInterpForKey(struct xkb_keymap *xkb, xkb_keycode_t key, uint32_t group, uint32_t level) { struct xkb_sym_interpret *ret = NULL; - xkb_keysym_t *syms; + const xkb_keysym_t *syms; int num_syms; int i; @@ -911,10 +909,10 @@ for (i = 0; i < xkb->compat->num_si; i++) { struct xkb_sym_interpret *interp = &xkb->compat->sym_interpret[i]; uint32_t mods; - Bool found; + bool found; - if ((num_syms != 1 || interp->sym != syms[0]) && - interp->sym != NoSymbol) + if ((num_syms > 1 || interp->sym != syms[0]) && + interp->sym != XKB_KEYSYM_NO_SYMBOL) continue; if (level == 0 || !(interp->match & XkbSI_LevelOneOnly)) @@ -939,11 +937,11 @@ found = (interp->mods == mods); break; default: - found = False; + found = false; break; } - if (found && interp->sym != NoSymbol) + if (found && interp->sym != XKB_KEYSYM_NO_SYMBOL) return interp; else if (found && !ret) ret = interp; @@ -954,8 +952,8 @@ /** */ -static Bool -ApplyInterpsToKey(struct xkb_desc *xkb, xkb_keycode_t key) +static bool +ApplyInterpsToKey(struct xkb_keymap *xkb, xkb_keycode_t key) { #define INTERP_SIZE (8 * 4) struct xkb_sym_interpret *interps[INTERP_SIZE]; @@ -968,7 +966,7 @@ /* If we've been told not to bind interps to this key, then don't. */ if (xkb->server->explicit[key] & XkbExplicitInterpretMask) - return True; + return true; for (i = 0; i < INTERP_SIZE; i++) interps[i] = NULL; @@ -977,7 +975,7 @@ for (level = 0; level < XkbKeyGroupWidth(xkb, key, group); level++) { i = (group * width) + level; if (i >= INTERP_SIZE) /* XXX FIXME */ - return False; + return false; interps[i] = FindInterpForKey(xkb, key, group, level); if (interps[i]) num_acts++; @@ -988,9 +986,9 @@ num_acts = XkbKeyNumGroups(xkb, key) * width; acts = XkbcResizeKeyActions(xkb, key, num_acts); if (!num_acts) - return True; + return true; else if (!acts) - return False; + return false; for (group = 0; group < XkbKeyNumGroups(xkb, key); group++) { for (level = 0; level < XkbKeyGroupWidth(xkb, key, group); level++) { @@ -1024,7 +1022,7 @@ if (!(xkb->server->explicit[key] & XkbExplicitVModMapMask)) xkb->server->vmodmap[key] = vmodmask; - return True; + return true; #undef INTERP_SIZE } @@ -1034,8 +1032,8 @@ * your actions and types are a lot more useful when any of your modifiers * other than Shift actually do something ... */ -Bool -UpdateModifiersFromCompat(struct xkb_desc *xkb) +bool +UpdateModifiersFromCompat(struct xkb_keymap *xkb) { xkb_keycode_t key; int i; @@ -1044,7 +1042,7 @@ * which will also update the vmodmap. */ for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) if (!ApplyInterpsToKey(xkb, key)) - return False; + return false; /* Update xkb->server->vmods, the virtual -> real mod mapping. */ for (i = 0; i < XkbNumVirtualMods; i++) @@ -1099,5 +1097,5 @@ led->mask = led->real_mods | VModsToReal(xkb, led->vmods); } - return True; + return true; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/expr.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/expr.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/expr.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/expr.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,6 +24,8 @@ ********************************************************/ +#include + #include "xkbcomp.h" #include "xkbmisc.h" #include "expr.h" @@ -33,11 +35,8 @@ /***====================================================================***/ -typedef Bool(*IdentLookupFunc) (const void * /* priv */ , - xkb_atom_t /* field */ , - unsigned /* type */ , - ExprResult * /* val_rtrn */ - ); +typedef bool (*IdentLookupFunc) (const void *priv, xkb_atom_t field, + unsigned type, ExprResult *val_rtrn); /***====================================================================***/ @@ -146,43 +145,43 @@ elem_rtrn->str = NULL; field_rtrn->str = XkbcAtomGetString(expr->value.str); *index_rtrn = NULL; - return True; + return true; case ExprFieldRef: elem_rtrn->str = XkbcAtomGetString(expr->value.field.element); field_rtrn->str = XkbcAtomGetString(expr->value.field.field); *index_rtrn = NULL; - return True; + return true; case ExprArrayRef: elem_rtrn->str = XkbcAtomGetString(expr->value.array.element); field_rtrn->str = XkbcAtomGetString(expr->value.array.field); *index_rtrn = expr->value.array.entry; - return True; + return true; } WSGO("Unexpected operator %d in ResolveLhs\n", expr->op); - return False; + return false; } -static Bool +static bool SimpleLookup(const void * priv, xkb_atom_t field, unsigned type, ExprResult * val_rtrn) { const LookupEntry *entry; const char *str; - if ((priv == NULL) || (field == None) || (type != TypeInt)) + if ((priv == NULL) || (field == XKB_ATOM_NONE) || (type != TypeInt)) { - return False; + return false; } str = XkbcAtomText(field); for (entry = priv; (entry != NULL) && (entry->name != NULL); entry++) { - if (uStrCaseCmp(str, entry->name) == 0) + if (strcasecmp(str, entry->name) == 0) { val_rtrn->uval = entry->result; - return True; + return true; } } - return False; + return false; } static const LookupEntry modIndexNames[] = { @@ -198,33 +197,33 @@ {NULL, 0} }; -int +bool LookupModIndex(const void * priv, xkb_atom_t field, unsigned type, ExprResult * val_rtrn) { return SimpleLookup(modIndexNames, field, type, val_rtrn); } -int +bool LookupModMask(const void * priv, xkb_atom_t field, unsigned type, ExprResult * val_rtrn) { const char *str; - Bool ret = True; + bool ret = true; if (type != TypeInt) - return False; + return false; str = XkbcAtomText(field); if (str == NULL) - return False; - if (uStrCaseCmp(str, "all") == 0) + return false; + if (strcasecmp(str, "all") == 0) val_rtrn->uval = 0xff; - else if (uStrCaseCmp(str, "none") == 0) + else if (strcasecmp(str, "none") == 0) val_rtrn->uval = 0; else if (LookupModIndex(priv, field, type, val_rtrn)) val_rtrn->uval = (1 << val_rtrn->uval); else - ret = False; + ret = false; return ret; } @@ -243,37 +242,37 @@ ERROR ("Found constant of type %s where boolean was expected\n", exprTypeText(expr->type)); - return False; + return false; } val_rtrn->ival = expr->value.ival; - return True; + return true; case ExprIdent: bogus = XkbcAtomText(expr->value.str); if (bogus) { - if ((uStrCaseCmp(bogus, "true") == 0) || - (uStrCaseCmp(bogus, "yes") == 0) || - (uStrCaseCmp(bogus, "on") == 0)) + if ((strcasecmp(bogus, "true") == 0) || + (strcasecmp(bogus, "yes") == 0) || + (strcasecmp(bogus, "on") == 0)) { val_rtrn->uval = 1; - return True; + return true; } - else if ((uStrCaseCmp(bogus, "false") == 0) || - (uStrCaseCmp(bogus, "no") == 0) || - (uStrCaseCmp(bogus, "off") == 0)) + else if ((strcasecmp(bogus, "false") == 0) || + (strcasecmp(bogus, "no") == 0) || + (strcasecmp(bogus, "off") == 0)) { val_rtrn->uval = 0; - return True; + return true; } } ERROR("Identifier \"%s\" of type int is unknown\n", XkbcAtomText(expr->value.str)); - return False; + return false; case ExprFieldRef: ERROR("Default \"%s.%s\" of type boolean is unknown\n", XkbcAtomText(expr->value.field.element), XkbcAtomText(expr->value.field.field)); - return False; + return false; case OpInvert: case OpNot: ok = ExprResolveBoolean(expr, val_rtrn); @@ -307,7 +306,7 @@ WSGO("Unknown operator %d in ResolveBoolean\n", expr->op); break; } - return False; + return false; } int @@ -328,19 +327,19 @@ if ((str != NULL) && (strlen(str) == 1)) { val_rtrn->uval = str[0] * XkbGeomPtsPerMM; - return True; + return true; } } if (expr->type != TypeInt) { ERROR("Found constant of type %s, expected a number\n", exprTypeText(expr->type)); - return False; + return false; } val_rtrn->ival = expr->value.ival; if (expr->type == TypeInt) val_rtrn->ival *= XkbGeomPtsPerMM; - return True; + return true; case ExprIdent: ERROR("Numeric identifier \"%s\" unknown\n", XkbcAtomText(expr->value.str)); @@ -349,7 +348,7 @@ ERROR("Numeric default \"%s.%s\" unknown\n", XkbcAtomText(expr->value.field.element), XkbcAtomText(expr->value.field.field)); - return False; + return false; case OpAdd: case OpSubtract: case OpMultiply: @@ -374,15 +373,15 @@ val_rtrn->ival = leftRtrn.ival / rightRtrn.ival; break; } - return True; + return true; } - return False; + return false; case OpAssign: WSGO("Assignment operator not implemented yet\n"); break; case OpNot: ERROR("The ! operator cannot be applied to a number\n"); - return False; + return false; case OpInvert: case OpNegate: left = expr->value.child; @@ -392,9 +391,9 @@ val_rtrn->ival = -leftRtrn.ival; else val_rtrn->ival = ~leftRtrn.ival; - return True; + return true; } - return False; + return false; case OpUnaryPlus: left = expr->value.child; return ExprResolveFloat(left, val_rtrn); @@ -402,7 +401,7 @@ WSGO("Unknown operator %d in ResolveFloat\n", expr->op); break; } - return False; + return false; } int @@ -420,10 +419,10 @@ ERROR ("Found constant of type %s where an int was expected\n", exprTypeText(expr->type)); - return False; + return false; } val_rtrn->uval = expr->value.uval; - return True; + return true; case OpAdd: case OpSubtract: case OpMultiply: @@ -448,17 +447,17 @@ val_rtrn->uval = leftRtrn.uval / rightRtrn.uval; break; } - return True; + return true; } - return False; + return false; case OpNegate: left = expr->value.child; if (ExprResolveKeyCode(left, &leftRtrn)) { val_rtrn->uval = ~leftRtrn.uval; - return True; + return true; } - return False; + return false; case OpUnaryPlus: left = expr->value.child; return ExprResolveKeyCode(left, val_rtrn); @@ -466,7 +465,7 @@ WSGO("Unknown operator %d in ResolveKeyCode\n", expr->op); break; } - return False; + return false; } /** @@ -504,10 +503,10 @@ { case 0: val_rtrn->uval = 0; - return True; + return true; case 1: val_rtrn->uval = str[0]; - return True; + return true; default: break; } @@ -517,10 +516,10 @@ ERROR ("Found constant of type %s where an int was expected\n", exprTypeText(expr->type)); - return False; + return false; } val_rtrn->ival = expr->value.ival; - return True; + return true; case ExprIdent: if (lookup) { @@ -534,7 +533,7 @@ ERROR("Default \"%s.%s\" of type int is unknown\n", XkbcAtomText(expr->value.field.element), XkbcAtomText(expr->value.field.field)); - return False; + return false; case OpAdd: case OpSubtract: case OpMultiply: @@ -559,15 +558,15 @@ val_rtrn->ival = leftRtrn.ival / rightRtrn.ival; break; } - return True; + return true; } - return False; + return false; case OpAssign: WSGO("Assignment operator not implemented yet\n"); break; case OpNot: ERROR("The ! operator cannot be applied to an integer\n"); - return False; + return false; case OpInvert: case OpNegate: left = expr->value.child; @@ -577,9 +576,9 @@ val_rtrn->ival = -leftRtrn.ival; else val_rtrn->ival = ~leftRtrn.ival; - return True; + return true; } - return False; + return false; case OpUnaryPlus: left = expr->value.child; return ExprResolveIntegerLookup(left, val_rtrn, lookup, lookupPriv); @@ -587,7 +586,7 @@ WSGO("Unknown operator %d in ResolveInteger\n", expr->op); break; } - return False; + return false; } int @@ -615,16 +614,16 @@ }; ret = ExprResolveIntegerLookup(expr, val_rtrn, SimpleLookup, group_names); - if (ret == False) + if (ret == false) return ret; if (val_rtrn->uval == 0 || val_rtrn->uval > XkbNumKbdGroups) { ERROR("Group index %d is out of range (1..%d)\n", val_rtrn->uval, XkbNumKbdGroups); - return False; + return false; } - return True; + return true; } int @@ -645,16 +644,16 @@ }; ret = ExprResolveIntegerLookup(expr, val_rtrn, SimpleLookup, level_names); - if (ret == False) + if (ret == false) return ret; if (val_rtrn->ival < 1 || val_rtrn->ival > XkbMaxShiftLevel) { ERROR("Shift level %d is out of range (1..%d)\n", val_rtrn->ival, XkbMaxShiftLevel); - return False; + return false; } - return True; + return true; } int @@ -691,21 +690,21 @@ { ERROR("Found constant of type %s, expected a string\n", exprTypeText(expr->type)); - return False; + return false; } val_rtrn->str = XkbcAtomGetString(expr->value.str); if (val_rtrn->str == NULL) val_rtrn->str = strdup(""); - return True; + return true; case ExprIdent: ERROR("Identifier \"%s\" of type string not found\n", XkbcAtomText(expr->value.str)); - return False; + return false; case ExprFieldRef: ERROR("Default \"%s.%s\" of type string not found\n", XkbcAtomText(expr->value.field.element), XkbcAtomText(expr->value.field.field)); - return False; + return false; case OpAdd: left = expr->value.binary.left; right = expr->value.binary.right; @@ -721,12 +720,12 @@ free(leftRtrn.str); free(rightRtrn.str); val_rtrn->str = new; - return True; + return true; } free(leftRtrn.str); free(rightRtrn.str); } - return False; + return false; case OpSubtract: if (bogus == NULL) bogus = "Subtraction"; @@ -746,18 +745,18 @@ if (bogus == NULL) bogus = "Bitwise complement"; ERROR("%s of string values not permitted\n", bogus); - return False; + return false; case OpNot: ERROR("The ! operator cannot be applied to a string\n"); - return False; + return false; case OpUnaryPlus: ERROR("The + operator cannot be applied to a string\n"); - return False; + return false; default: WSGO("Unknown operator %d in ResolveString\n", expr->op); break; } - return False; + return false; } int @@ -773,19 +772,19 @@ { ERROR("Found constant of type %s, expected a key name\n", exprTypeText(expr->type)); - return False; + return false; } memcpy(val_rtrn->keyName.name, expr->value.keyName, XkbKeyNameLength); - return True; + return true; case ExprIdent: ERROR("Identifier \"%s\" of type string not found\n", XkbcAtomText(expr->value.str)); - return False; + return false; case ExprFieldRef: ERROR("Default \"%s.%s\" of type key name not found\n", XkbcAtomText(expr->value.field.element), XkbcAtomText(expr->value.field.field)); - return False; + return false; case OpAdd: if (bogus == NULL) bogus = "Addition"; @@ -808,18 +807,18 @@ if (bogus == NULL) bogus = "Bitwise complement"; ERROR("%s of key name values not permitted\n", bogus); - return False; + return false; case OpNot: ERROR("The ! operator cannot be applied to a key name\n"); - return False; + return false; case OpUnaryPlus: ERROR("The + operator cannot be applied to a key name\n"); - return False; + return false; default: WSGO("Unknown operator %d in ResolveKeyName\n", expr->op); break; } - return False; + return false; } /***====================================================================***/ @@ -831,7 +830,7 @@ { ERROR("Found a %s where an enumerated value was expected\n", exprOpText(expr->op)); - return False; + return false; } if (!SimpleLookup(values, expr->value.str, TypeInt, val_rtrn)) { @@ -848,9 +847,9 @@ nOut++; } INFO(")\n"); - return False; + return false; } - return True; + return true; } static int @@ -872,10 +871,10 @@ ERROR ("Found constant of type %s where a mask was expected\n", exprTypeText(expr->type)); - return False; + return false; } val_rtrn->ival = expr->value.ival; - return True; + return true; case ExprIdent: ok = (*lookup) (lookupPriv, expr->value.str, TypeInt, val_rtrn); if (!ok) @@ -886,7 +885,7 @@ ERROR("Default \"%s.%s\" of type int is unknown\n", XkbcAtomText(expr->value.field.element), XkbcAtomText(expr->value.field.field)); - return False; + return false; case ExprArrayRef: bogus = "array reference"; case ExprActionDecl: @@ -894,7 +893,7 @@ bogus = "function use"; ERROR("Unexpected %s in mask expression\n", bogus); ACTION("Expression ignored\n"); - return False; + return false; case OpAdd: case OpSubtract: case OpMultiply: @@ -917,11 +916,11 @@ ERROR("Cannot %s masks\n", expr->op == OpDivide ? "divide" : "multiply"); ACTION("Illegal operation ignored\n"); - return False; + return false; } - return True; + return true; } - return False; + return false; case OpAssign: WSGO("Assignment operator not implemented yet\n"); break; @@ -930,9 +929,9 @@ if (ExprResolveIntegerLookup(left, &leftRtrn, lookup, lookupPriv)) { val_rtrn->ival = ~leftRtrn.ival; - return True; + return true; } - return False; + return false; case OpUnaryPlus: case OpNegate: case OpNot: @@ -942,12 +941,12 @@ ERROR("The %s operator cannot be used with a mask\n", (expr->op == OpNegate ? "-" : "!")); } - return False; + return false; default: WSGO("Unknown operator %d in ResolveMask\n", expr->op); break; } - return False; + return false; } int @@ -968,7 +967,7 @@ int ExprResolveVModMask(ExprDef * expr, ExprResult * val_rtrn, - struct xkb_desc *xkb) + struct xkb_keymap *xkb) { return ExprResolveMaskLookup(expr, val_rtrn, LookupVModMask, xkb); } @@ -984,10 +983,12 @@ { const char *str; str = XkbcAtomText(expr->value.str); - if ((str != NULL) && ((sym = xkb_string_to_keysym(str)) != NoSymbol)) - { - val_rtrn->uval = sym; - return True; + if (str) { + sym = xkb_string_to_keysym(str); + if (sym != XKB_KEYSYM_NO_SYMBOL) { + val_rtrn->uval = sym; + return true; + } } } ok = ExprResolveInteger(expr, val_rtrn); diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/expr.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/expr.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/expr.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/expr.h 2012-05-10 10:10:26.000000000 +0000 @@ -27,6 +27,8 @@ #ifndef EXPR_H #define EXPR_H 1 +#include + typedef union _ExprResult { char *str; @@ -35,11 +37,9 @@ struct xkb_key_name keyName; } ExprResult; -extern int ExprResolveLhs(ExprDef * /* expr */ , - ExprResult * /* elem_rtrn */ , - ExprResult * /* field_rtrn */ , - ExprDef ** /* index_rtrn */ - ); +extern int +ExprResolveLhs(ExprDef *expr, ExprResult *elem_rtrn, ExprResult *field_rtrn, + ExprDef **index_rtrn); typedef struct _LookupEntry { @@ -48,84 +48,63 @@ } LookupEntry; -extern const char *exprOpText(unsigned /* type */ - ); +extern const char * +exprOpText(unsigned type); + +extern bool +LookupModMask(const void *priv, xkb_atom_t field, unsigned type, + ExprResult *val_rtrn); + +extern bool +LookupVModMask(const void *priv, xkb_atom_t field, unsigned type, + ExprResult *val_rtrn); + +extern bool +LookupModIndex(const void *priv, xkb_atom_t field, unsigned type, + ExprResult *val_rtrn); + +extern int +ExprResolveModMask(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveVModMask(ExprDef *expr, ExprResult *val_rtrn, + struct xkb_keymap *xkb); + +extern int +ExprResolveBoolean(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveKeyCode(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveInteger(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveLevel(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveGroup(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveButton(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveFloat(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveString(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveKeyName(ExprDef *expr, ExprResult *val_rtrn); + +extern int +ExprResolveEnum(ExprDef *expr, ExprResult *val_rtrn, + const LookupEntry *values); + +extern int +ExprResolveMask(ExprDef *expr, ExprResult *val_rtrn, + const LookupEntry *values); -extern int LookupModMask(const void * /* priv */ , - xkb_atom_t /* field */ , - unsigned /* type */ , - ExprResult * /* val_rtrn */ - ); - -extern int LookupVModMask(const void * /* priv */ , - xkb_atom_t /* field */ , - unsigned /* type */ , - ExprResult * /* val_rtrn */ - ); - -extern int LookupModIndex(const void * /* priv */ , - xkb_atom_t /* field */ , - unsigned /* type */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveModMask(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveVModMask(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ , - struct xkb_desc * /* xkb */ - ); - -extern int ExprResolveBoolean(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveKeyCode(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveInteger(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveLevel(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveGroup(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveButton(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveFloat(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveString(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveKeyName(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); - -extern int ExprResolveEnum(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ , - const LookupEntry * /* values */ - ); - -extern int ExprResolveMask(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ , - const LookupEntry * /* values */ - ); - -extern int ExprResolveKeySym(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ - ); +extern int ExprResolveKeySym(ExprDef *expr, ExprResult *val_rtrn); #endif /* EXPR_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/indicators.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/indicators.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/indicators.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/indicators.c 2012-05-10 10:10:26.000000000 +0000 @@ -32,6 +32,7 @@ #include "vmod.h" #include "indicators.h" #include "action.h" +#include "utils.h" /***====================================================================***/ @@ -197,15 +198,15 @@ int SetIndicatorMapField(LEDInfo * led, - struct xkb_desc * xkb, + struct xkb_keymap * xkb, char *field, ExprDef * arrayNdx, ExprDef * value) { ExprResult rtrn; - Bool ok; + bool ok; - ok = True; - if ((uStrCaseCmp(field, "modifiers") == 0) - || (uStrCaseCmp(field, "mods") == 0)) + ok = true; + if ((strcasecmp(field, "modifiers") == 0) || + (strcasecmp(field, "mods") == 0)) { if (arrayNdx != NULL) return ReportIndicatorNotArray(led, field); @@ -215,7 +216,7 @@ led->vmods = (rtrn.uval >> 8) & 0xff; led->defs.defined |= _LED_Mods; } - else if (uStrCaseCmp(field, "groups") == 0) + else if (strcasecmp(field, "groups") == 0) { if (arrayNdx != NULL) return ReportIndicatorNotArray(led, field); @@ -224,8 +225,8 @@ led->groups = rtrn.uval; led->defs.defined |= _LED_Groups; } - else if ((uStrCaseCmp(field, "controls") == 0) || - (uStrCaseCmp(field, "ctrls") == 0)) + else if ((strcasecmp(field, "controls") == 0) || + (strcasecmp(field, "ctrls") == 0)) { if (arrayNdx != NULL) return ReportIndicatorNotArray(led, field); @@ -235,7 +236,7 @@ led->ctrls = rtrn.uval; led->defs.defined |= _LED_Ctrls; } - else if (uStrCaseCmp(field, "allowexplicit") == 0) + else if (strcasecmp(field, "allowexplicit") == 0) { if (arrayNdx != NULL) return ReportIndicatorNotArray(led, field); @@ -247,8 +248,8 @@ led->flags |= XkbIM_NoExplicit; led->defs.defined |= _LED_Explicit; } - else if ((uStrCaseCmp(field, "whichmodstate") == 0) || - (uStrCaseCmp(field, "whichmodifierstate") == 0)) + else if ((strcasecmp(field, "whichmodstate") == 0) || + (strcasecmp(field, "whichmodifierstate") == 0)) { if (arrayNdx != NULL) return ReportIndicatorNotArray(led, field); @@ -259,7 +260,7 @@ } led->which_mods = rtrn.uval; } - else if (uStrCaseCmp(field, "whichgroupstate") == 0) + else if (strcasecmp(field, "whichgroupstate") == 0) { if (arrayNdx != NULL) return ReportIndicatorNotArray(led, field); @@ -270,12 +271,12 @@ } led->which_groups = rtrn.uval; } - else if ((uStrCaseCmp(field, "driveskbd") == 0) || - (uStrCaseCmp(field, "driveskeyboard") == 0) || - (uStrCaseCmp(field, "leddriveskbd") == 0) || - (uStrCaseCmp(field, "leddriveskeyboard") == 0) || - (uStrCaseCmp(field, "indicatordriveskbd") == 0) || - (uStrCaseCmp(field, "indicatordriveskeyboard") == 0)) + else if ((strcasecmp(field, "driveskbd") == 0) || + (strcasecmp(field, "driveskeyboard") == 0) || + (strcasecmp(field, "leddriveskbd") == 0) || + (strcasecmp(field, "leddriveskeyboard") == 0) || + (strcasecmp(field, "indicatordriveskbd") == 0) || + (strcasecmp(field, "indicatordriveskeyboard") == 0)) { if (arrayNdx != NULL) return ReportIndicatorNotArray(led, field); @@ -287,7 +288,7 @@ led->flags &= ~XkbIM_LEDDrivesKB; led->defs.defined |= _LED_DrivesKbd; } - else if (uStrCaseCmp(field, "index") == 0) + else if (strcasecmp(field, "index") == 0) { if (arrayNdx != NULL) return ReportIndicatorNotArray(led, field); @@ -300,7 +301,7 @@ rtrn.uval, XkbNumIndicators); ACTION("Index definition for %s indicator ignored\n", XkbcAtomText(led->name)); - return False; + return false; } led->indicator = rtrn.uval; led->defs.defined |= _LED_Index; @@ -310,19 +311,19 @@ ERROR("Unknown field %s in map for %s indicator\n", field, XkbcAtomText(led->name)); ACTION("Definition ignored\n"); - ok = False; + ok = false; } return ok; } LEDInfo * HandleIndicatorMapDef(IndicatorMapDef * def, - struct xkb_desc * xkb, + struct xkb_keymap * xkb, LEDInfo * dflt, LEDInfo * oldLEDs, unsigned merge) { LEDInfo led, *rtrn; VarDef *var; - Bool ok; + bool ok; if (def->merge != MergeDefault) merge = def->merge; @@ -331,14 +332,14 @@ led.defs.merge = merge; led.name = def->name; - ok = True; + ok = true; for (var = def->body; var != NULL; var = (VarDef *) var->common.next) { ExprResult elem, field; ExprDef *arrayNdx; if (!ExprResolveLhs(var->name, &elem, &field, &arrayNdx)) { - ok = False; + ok = false; continue; } if (elem.str != NULL) @@ -347,7 +348,7 @@ ("Cannot set defaults for \"%s\" element in indicator map\n", elem.str); ACTION("Assignment to %s.%s ignored\n", elem.str, field.str); - ok = False; + ok = false; } else { @@ -365,8 +366,8 @@ return NULL; } -Bool -CopyIndicatorMapDefs(struct xkb_desc * xkb, LEDInfo *leds, LEDInfo **unboundRtrn) +bool +CopyIndicatorMapDefs(struct xkb_keymap * xkb, LEDInfo *leds, LEDInfo **unboundRtrn) { LEDInfo *led, *next; LEDInfo *unbound, *last; @@ -380,7 +381,7 @@ { WSGO("Can't allocate indicator maps\n"); ACTION("Indicator map definitions may be lost\n"); - return False; + return false; } last = unbound = (unboundRtrn ? *unboundRtrn : NULL); while ((last != NULL) && (last->defs.next != NULL)) @@ -422,7 +423,7 @@ im->ctrls = led->ctrls; if (xkb->names != NULL) { - free((char *) xkb->names->indicators[led->indicator - 1]); + free(UNCONSTIFY(xkb->names->indicators[led->indicator - 1])); xkb->names->indicators[led->indicator-1] = XkbcAtomGetString(led->name); } free(led); @@ -432,11 +433,11 @@ { *unboundRtrn = unbound; } - return True; + return true; } -Bool -BindIndicators(struct xkb_desc * xkb, Bool force, LEDInfo *unbound, +bool +BindIndicators(struct xkb_keymap * xkb, bool force, LEDInfo *unbound, LEDInfo **unboundRtrn) { int i; @@ -472,7 +473,6 @@ { xkb->names->indicators[i] = XkbcAtomGetString(led->name); led->indicator = i + 1; - xkb->indicators->phys_indicators &= ~(1 << i); break; } } @@ -565,5 +565,5 @@ free(led); } } - return True; + return true; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/indicators.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/indicators.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/indicators.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/indicators.h 2012-05-10 10:10:26.000000000 +0000 @@ -51,33 +51,27 @@ unsigned int ctrls; } LEDInfo; -extern void ClearIndicatorMapInfo(LEDInfo * /* info */ - ); +extern void +ClearIndicatorMapInfo(LEDInfo *info); -extern LEDInfo *AddIndicatorMap(LEDInfo * /* oldLEDs */ , - LEDInfo * /* newLED */ - ); - -extern int SetIndicatorMapField(LEDInfo * /* led */ , - struct xkb_desc * /* xkb */ , - char * /* field */ , - ExprDef * /* arrayNdx */ , - ExprDef * /* value */ - ); - -extern LEDInfo *HandleIndicatorMapDef(IndicatorMapDef * /* stmt */ , - struct xkb_desc * /* xkb */ , - LEDInfo * /* dflt */ , - LEDInfo * /* oldLEDs */ , - unsigned /* mergeMode */ - ); +extern LEDInfo * +AddIndicatorMap(LEDInfo *oldLEDs, LEDInfo *newLED); -extern Bool -CopyIndicatorMapDefs(struct xkb_desc * xkb, LEDInfo *leds, LEDInfo **unboundRtrn); +extern int +SetIndicatorMapField(LEDInfo *led, struct xkb_keymap *xkb, char *field, + ExprDef *arrayNdx, ExprDef *value); -extern Bool -BindIndicators(struct xkb_desc * xkb, Bool force, LEDInfo *unbound, +extern LEDInfo * +HandleIndicatorMapDef(IndicatorMapDef *stmt, struct xkb_keymap *xkb, + LEDInfo *dflt, LEDInfo *oldLEDs, unsigned mergeMode); + +extern bool +CopyIndicatorMapDefs(struct xkb_keymap *xkb, LEDInfo *leds, + LEDInfo **unboundRtrn); + +extern bool +BindIndicators(struct xkb_keymap *xkb, bool force, LEDInfo *unbound, LEDInfo **unboundRtrn); #endif /* INDICATORS_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/keycodes.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/keycodes.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/keycodes.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/keycodes.c 2012-05-10 10:10:26.000000000 +0000 @@ -60,7 +60,7 @@ CommonInfo defs; int ndx; xkb_atom_t name; - Bool virtual; + bool virtual; } IndicatorNameInfo; typedef struct _KeyNamesInfo @@ -82,7 +82,7 @@ } KeyNamesInfo; static void HandleKeycodesFile(XkbFile * file, - struct xkb_desc * xkb, + struct xkb_keymap * xkb, unsigned merge, KeyNamesInfo * info); @@ -92,7 +92,7 @@ void *tmp; int i; - tmp = _XkbTypedRealloc(info->names, newMax + 1, unsigned long); + tmp = uTypedRealloc(info->names, newMax + 1, unsigned long); if (!tmp) { ERROR ("Couldn't reallocate for larger maximum keycode (%d)\n", @@ -104,7 +104,7 @@ for (i = info->arraySize + 1; i <= newMax; i++) info->names[i] = 0; - tmp = _XkbTypedRealloc(info->files, newMax + 1, unsigned); + tmp = uTypedRealloc(info->files, newMax + 1, unsigned); if (!tmp) { ERROR ("Couldn't reallocate for larger maximum keycode (%d)\n", @@ -116,7 +116,7 @@ for (i = info->arraySize + 1; i <= newMax; i++) info->files[i] = 0; - tmp = _XkbTypedRealloc(info->has_alt_forms, newMax + 1, unsigned char); + tmp = uTypedRealloc(info->has_alt_forms, newMax + 1, unsigned char); if (!tmp) { ERROR ("Couldn't reallocate for larger maximum keycode (%d)\n", @@ -141,8 +141,8 @@ ii->defs.fileID = info->fileID; ii->defs.next = NULL; ii->ndx = 0; - ii->name = None; - ii->virtual = False; + ii->name = XKB_ATOM_NONE; + ii->virtual = false; } static void @@ -198,11 +198,11 @@ return NULL; } -static Bool +static bool AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new) { IndicatorNameInfo *old; - Bool replace; + bool replace; replace = (new->defs.merge == MergeReplace) || (new->defs.merge == MergeOverride); @@ -227,7 +227,7 @@ { ACTION("Identical definitions ignored\n"); } - return True; + return true; } else { @@ -299,7 +299,7 @@ old->name = new->name; old->virtual = new->virtual; } - return True; + return true; } old = new; new = NextIndicatorName(info); @@ -307,12 +307,12 @@ { WSGO("Couldn't allocate name for indicator %d\n", old->ndx); ACTION("Ignored\n"); - return False; + return false; } new->name = old->name; new->ndx = old->ndx; new->virtual = old->virtual; - return True; + return true; } static void @@ -351,7 +351,7 @@ static int FindKeyByLong(KeyNamesInfo * info, unsigned long name) { - int i; + uint64_t i; for (i = info->computedMin; i <= info->computedMax; i++) { @@ -366,18 +366,18 @@ * keycode. If the same keys is referred to twice, print a warning. * Note that the key's name is stored as a long, the keycode is the index. */ -static Bool +static bool AddKeyName(KeyNamesInfo * info, xkb_keycode_t kc, - char *name, unsigned merge, unsigned fileID, Bool reportCollisions) + char *name, unsigned merge, unsigned fileID, bool reportCollisions) { - int old; + xkb_keycode_t old; unsigned long lval; if (kc > info->arraySize && !ResizeKeyNameArrays(info, kc)) { ERROR("Couldn't resize KeyNames arrays for keycode %d\n", kc); ACTION("Ignoring key %d\n", kc); - return False; + return false; } if (kc < info->computedMin) info->computedMin = kc; @@ -402,7 +402,7 @@ { if (info->has_alt_forms[kc] || (merge == MergeAltForm)) { - info->has_alt_forms[kc] = True; + info->has_alt_forms[kc] = true; } else if (reportCollisions) { @@ -410,7 +410,7 @@ ACTION("Later occurences of \"<%s> = %d\" ignored\n", buf, kc); } - return True; + return true; } if (merge == MergeAugment) { @@ -419,7 +419,7 @@ WARN("Multiple names for keycode %d\n", kc); ACTION("Using <%s>, ignoring <%s>\n", buf, name); } - return True; + return true; } else { @@ -439,7 +439,7 @@ { info->names[old] = 0; info->files[old] = 0; - info->has_alt_forms[old] = True; + info->has_alt_forms[old] = true; if (reportCollisions) { WARN("Key name <%s> assigned to multiple keys\n", name); @@ -455,17 +455,17 @@ ACTION ("Use 'alternate' keyword to assign the same name to multiple keys\n"); } - return True; + return true; } else { - info->has_alt_forms[old] = True; + info->has_alt_forms[old] = true; } } info->names[kc] = lval; info->files[kc] = fileID; info->has_alt_forms[kc] = (merge == MergeAltForm); - return True; + return true; } /***====================================================================***/ @@ -474,7 +474,7 @@ MergeIncludedKeycodes(KeyNamesInfo * into, KeyNamesInfo * from, unsigned merge) { - int i; + uint64_t i; char buf[5]; if (from->errorCount > 0) @@ -506,7 +506,7 @@ thisMerge = MergeAltForm; else thisMerge = merge; - if (!AddKeyName(into, i, buf, thisMerge, from->fileID, False)) + if (!AddKeyName(into, i, buf, thisMerge, from->fileID, false)) into->errorCount++; } if (from->leds) @@ -544,18 +544,20 @@ * @param xkb Unused for all but the xkb->flags. * @param info Struct to store the key info in. */ -static Bool -HandleIncludeKeycodes(IncludeStmt * stmt, struct xkb_desc * xkb, KeyNamesInfo * info) +static bool +HandleIncludeKeycodes(IncludeStmt * stmt, struct xkb_keymap * xkb, KeyNamesInfo * info) { unsigned newMerge; XkbFile *rtrn; - KeyNamesInfo included = {NULL}; - Bool haveSelf; + KeyNamesInfo included; + bool haveSelf; + + memset(&included, 0, sizeof(included)); - haveSelf = False; + haveSelf = false; if ((stmt->file == NULL) && (stmt->map == NULL)) { - haveSelf = True; + haveSelf = true; included = *info; memset(info, 0, sizeof(KeyNamesInfo)); } @@ -566,7 +568,8 @@ info->explicitMax = XKB_KEYCODE_MAX; return (info->errorCount == 0); } /* parse file, store returned info in the xkb struct */ - else if (ProcessIncludeFile(stmt, XkmKeyNamesIndex, &rtrn, &newMerge)) + else if (ProcessIncludeFile(xkb->context, stmt, XkmKeyNamesIndex, &rtrn, + &newMerge)) { InitKeyNamesInfo(&included); HandleKeycodesFile(rtrn, xkb, MergeOverride, &included); @@ -581,7 +584,7 @@ else { info->errorCount += 10; /* XXX: why 10?? */ - return False; + return false; } /* Do we have more than one include statement? */ if ((stmt->next != NULL) && (included.errorCount < 1)) @@ -594,11 +597,12 @@ { if ((next->file == NULL) && (next->map == NULL)) { - haveSelf = True; + haveSelf = true; MergeIncludedKeycodes(&included, info, next->merge); ClearKeyNamesInfo(info); } - else if (ProcessIncludeFile(next, XkmKeyNamesIndex, &rtrn, &op)) + else if (ProcessIncludeFile(xkb->context, next, XkmKeyNamesIndex, + &rtrn, &op)) { InitKeyNamesInfo(&next_incl); HandleKeycodesFile(rtrn, xkb, MergeOverride, &next_incl); @@ -610,7 +614,7 @@ { info->errorCount += 10; /* XXX: Why 10?? */ ClearKeyNamesInfo(&included); - return False; + return false; } } } @@ -648,7 +652,7 @@ merge = stmt->merge; } return AddKeyName(info, stmt->value, stmt->name, merge, info->fileID, - True); + true); } #define MIN_KEYCODE_DEF 0 @@ -676,9 +680,9 @@ ACTION("Default for field %s ignored\n", field.str); goto err_out; } - if (uStrCaseCmp(field.str, "minimum") == 0) + if (strcasecmp(field.str, "minimum") == 0) which = MIN_KEYCODE_DEF; - else if (uStrCaseCmp(field.str, "maximum") == 0) + else if (strcasecmp(field.str, "maximum") == 0) which = MAX_KEYCODE_DEF; else { @@ -755,8 +759,7 @@ } static int -HandleIndicatorNameDef(IndicatorNameDef * def, - unsigned merge, KeyNamesInfo * info) +HandleIndicatorNameDef(IndicatorNameDef *def, KeyNamesInfo *info) { IndicatorNameInfo ii; ExprResult tmp; @@ -766,7 +769,7 @@ info->errorCount++; ERROR("Name specified for illegal indicator index %d\n", def->ndx); ACTION("Ignored\n"); - return False; + return false; } InitIndicatorNameInfo(&ii, info); ii.ndx = def->ndx; @@ -781,8 +784,8 @@ free(tmp.str); ii.virtual = def->virtual; if (!AddIndicatorName(info, &ii)) - return False; - return True; + return false; + return true; } /** @@ -800,12 +803,12 @@ */ static void HandleKeycodesFile(XkbFile * file, - struct xkb_desc * xkb, unsigned merge, KeyNamesInfo * info) + struct xkb_keymap * xkb, unsigned merge, KeyNamesInfo * info) { ParseCommon *stmt; free(info->name); - info->name = _XkbDupString(file->name); + info->name = uDupString(file->name); stmt = file->defs; while (stmt) { @@ -829,8 +832,7 @@ info->errorCount++; break; case StmtIndicatorNameDef: /* e.g. indicator 1 = "Caps Lock"; */ - if (!HandleIndicatorNameDef((IndicatorNameDef *) stmt, - merge, info)) + if (!HandleIndicatorNameDef((IndicatorNameDef *) stmt, info)) { info->errorCount++; } @@ -869,10 +871,10 @@ * @param result The effective keycodes, as gathered from the file. * @param merge Merge strategy. * - * @return True on success, False otherwise. + * @return true on success, false otherwise. */ -Bool -CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge) +bool +CompileKeycodes(XkbFile *file, struct xkb_keymap * xkb, unsigned merge) { KeyNamesInfo info; /* contains all the info after parsing */ @@ -894,14 +896,14 @@ if (XkbcAllocNames(xkb, XkbKeyNamesMask | XkbIndicatorNamesMask, 0) == Success) { - int i; + uint64_t i; for (i = info.computedMin; i <= info.computedMax; i++) LongToKeyName(info.names[i], xkb->names->keys[i].name); } else { WSGO("Cannot create struct xkb_names in CompileKeycodes\n"); - return False; + return false; } if (info.leds) { @@ -914,24 +916,15 @@ for (ii = info.leds; ii != NULL; ii = (IndicatorNameInfo *) ii->defs.next) { - free((char *) xkb->names->indicators[ii->ndx - 1]); + free(UNCONSTIFY(xkb->names->indicators[ii->ndx - 1])); xkb->names->indicators[ii->ndx - 1] = XkbcAtomGetString(ii->name); - if (xkb->indicators != NULL) - { - unsigned bit; - bit = 1 << (ii->ndx - 1); - if (ii->virtual) - xkb->indicators->phys_indicators &= ~bit; - else - xkb->indicators->phys_indicators |= bit; - } } } if (info.aliases) ApplyAliases(xkb, &info.aliases); ClearKeyNamesInfo(&info); - return True; + return true; } ClearKeyNamesInfo(&info); - return False; + return false; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/keycodes.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/keycodes.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/keycodes.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/keycodes.h 2012-05-10 10:10:26.000000000 +0000 @@ -27,13 +27,16 @@ #ifndef KEYCODES_H #define KEYCODES_H 1 -#define KeyNameToLong(n) ((((unsigned long)n[0])<<24)|(((unsigned long)n[1])<<16)|(((unsigned long)n[2])<<8)|n[3]) +#define KeyNameToLong(n) ( \ + (((unsigned long)n[0]) << 24) | \ + (((unsigned long)n[1]) << 16) | \ + (((unsigned long)n[2]) << 8) | \ + (((unsigned long)n[3]) << 0)) -extern const char *longText(unsigned long /* val */ - ); +extern const +char *longText(unsigned long val); -extern void LongToKeyName(unsigned long /* val */ , - char * /* name_rtrn */ - ); +extern void +LongToKeyName(unsigned long val, char *name_rtrn); #endif /* KEYCODES_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/keymap.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/keymap.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/keymap.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/keymap.c 2012-05-10 10:10:26.000000000 +0000 @@ -38,16 +38,16 @@ * @param file A list of XkbFiles, each denoting one type (e.g. * XkmKeyNamesIdx, etc.) */ -struct xkb_desc * -CompileKeymap(XkbFile *file, unsigned merge) +struct xkb_keymap * +CompileKeymap(struct xkb_context *context, XkbFile *file) { unsigned have; - Bool ok; + bool ok; unsigned required, legal; unsigned mainType; const char *mainName; - LEDInfo *unbound = NULL; - struct xkb_desc *xkb = XkbcAllocKeyboard(); + LEDInfo *unbound = NULL, *next; + struct xkb_keymap *xkb = XkbcAllocKeyboard(context); struct { XkbFile *keycodes; XkbFile *types; @@ -72,14 +72,14 @@ legal = XkmKeymapLegal; break; case XkmKeymapFile: - required = XkmKeyNamesIndex | XkmTypesIndex | XkmSymbolsIndex | \ - XkmCompatMapIndex | XkmVirtualModsIndex; + required = XkmKeyNamesIndex | XkmTypesIndex | XkmSymbolsIndex | + XkmCompatMapIndex; legal = XkmKeymapLegal; break; default: ERROR("Cannot compile %s alone into an XKM file\n", XkbcConfigText(mainType)); - return False; + return false; } have = 0; ok = 1; @@ -116,11 +116,6 @@ break; case XkmGeometryIndex: continue; - case XkmVirtualModsIndex: - case XkmIndicatorsIndex: - WSGO("Found an isolated %s section\n", XkbcConfigText(file->type)); - ACTION("Ignored\n"); - continue; default: WSGO("Unknown file type %d\n", file->type); ACTION("Ignored\n"); @@ -159,34 +154,32 @@ } /* compile the sections we have in the file one-by-one, or fail. */ - if (sections.keycodes != NULL && + if (sections.keycodes == NULL || !CompileKeycodes(sections.keycodes, xkb, MergeOverride)) { ERROR("Failed to compile keycodes\n"); goto err; } - if (sections.types != NULL && + if (sections.types == NULL || !CompileKeyTypes(sections.types, xkb, MergeOverride)) { ERROR("Failed to compile key types\n"); goto err; } - if (sections.compat != NULL && + if (sections.compat == NULL || !CompileCompatMap(sections.compat, xkb, MergeOverride, &unbound)) { ERROR("Failed to compile compat map\n"); goto err; } - if (sections.symbols != NULL && + if (sections.symbols == NULL || !CompileSymbols(sections.symbols, xkb, MergeOverride)) { ERROR("Failed to compile symbols\n"); goto err; } - xkb->defined = have; - - ok = BindIndicators(xkb, True, unbound, NULL); + ok = BindIndicators(xkb, true, unbound, NULL); if (!ok) goto err; @@ -198,7 +191,11 @@ err: ACTION("Failed to compile keymap\n"); - if (xkb) - xkb_free_keymap(xkb); + xkb_map_unref(xkb); + while (unbound) { + next = (LEDInfo *) unbound->defs.next; + free(unbound); + unbound = next; + } return NULL; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/keytypes.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/keytypes.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/keytypes.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/keytypes.c 2012-05-10 10:10:26.000000000 +0000 @@ -56,13 +56,13 @@ int fileID; unsigned mask; unsigned vmask; - Bool groupInfo; - int numLevels; - int nEntries; - int szEntries; + bool groupInfo; + unsigned numLevels; + unsigned nEntries; + unsigned szEntries; struct xkb_kt_map_entry * entries; PreserveInfo *preserve; - int szNames; + unsigned szNames; xkb_atom_t *lvlNames; } KeyTypeInfo; @@ -72,7 +72,7 @@ int errorCount; int fileID; unsigned stdPresent; - int nTypes; + unsigned nTypes; KeyTypeInfo *types; KeyTypeInfo dflt; VModInfo vmods; @@ -106,7 +106,7 @@ /***====================================================================***/ static void -InitKeyTypesInfo(KeyTypesInfo * info, struct xkb_desc * xkb, KeyTypesInfo * from) +InitKeyTypesInfo(KeyTypesInfo * info, struct xkb_keymap * xkb, KeyTypesInfo * from) { tok_ONE_LEVEL = xkb_intern_atom("ONE_LEVEL"); tok_TWO_LEVEL = xkb_intern_atom("TWO_LEVEL"); @@ -121,10 +121,10 @@ info->dflt.defs.fileID = 0; info->dflt.defs.merge = MergeOverride; info->dflt.defs.next = NULL; - info->dflt.name = None; + info->dflt.name = XKB_ATOM_NONE; info->dflt.mask = 0; info->dflt.vmask = 0; - info->dflt.groupInfo = False; + info->dflt.groupInfo = false; info->dflt.numLevels = 1; info->dflt.nEntries = info->dflt.szEntries = 0; info->dflt.entries = NULL; @@ -237,16 +237,16 @@ return NULL; } -static Bool +static bool ReportTypeBadWidth(const char *type, int has, int needs) { ERROR("Key type \"%s\" has %d levels, must have %d\n", type, has, needs); ACTION("Illegal type definition ignored\n"); - return False; + return false; } -static Bool -AddKeyType(struct xkb_desc * xkb, KeyTypesInfo * info, KeyTypeInfo * new) +static bool +AddKeyType(struct xkb_keymap * xkb, KeyTypesInfo * info, KeyTypeInfo * new) { KeyTypeInfo *old; @@ -284,7 +284,7 @@ old = FindMatchingKeyType(info, new); if (old != NULL) { - Bool report; + bool report; if ((new->defs.merge == MergeReplace) || (new->defs.merge == MergeOverride)) { @@ -303,7 +303,7 @@ new->preserve = NULL; new->lvlNames = NULL; old->defs.next = &next->defs; - return True; + return true; } report = (old->defs.fileID == new->defs.fileID) && (warningLevel > 0); if (report) @@ -313,11 +313,11 @@ ACTION("Later definition ignored\n"); } FreeKeyTypeInfo(new); - return True; + return true; } old = NextKeyType(info); if (old == NULL) - return False; + return false; *old = *new; old->defs.next = NULL; new->nEntries = new->szEntries = 0; @@ -325,14 +325,14 @@ new->szNames = 0; new->lvlNames = NULL; new->preserve = NULL; - return True; + return true; } /***====================================================================***/ static void MergeIncludedKeyTypes(KeyTypesInfo * into, - KeyTypesInfo * from, unsigned merge, struct xkb_desc * xkb) + KeyTypesInfo * from, unsigned merge, struct xkb_keymap * xkb) { KeyTypeInfo *type; @@ -356,29 +356,27 @@ into->stdPresent |= from->stdPresent; } -typedef void (*FileHandler) (XkbFile * /* file */ , - struct xkb_desc * /* xkb */ , - unsigned /* merge */ , - KeyTypesInfo * /* included */ - ); +typedef void (*FileHandler) (XkbFile *file, struct xkb_keymap *xkb, + unsigned merge, KeyTypesInfo *included); -static Bool +static bool HandleIncludeKeyTypes(IncludeStmt * stmt, - struct xkb_desc * xkb, KeyTypesInfo * info, FileHandler hndlr) + struct xkb_keymap * xkb, KeyTypesInfo * info, FileHandler hndlr) { unsigned newMerge; XkbFile *rtrn; KeyTypesInfo included; - Bool haveSelf; + bool haveSelf; - haveSelf = False; + haveSelf = false; if ((stmt->file == NULL) && (stmt->map == NULL)) { - haveSelf = True; + haveSelf = true; included = *info; memset(info, 0, sizeof(KeyTypesInfo)); } - else if (ProcessIncludeFile(stmt, XkmTypesIndex, &rtrn, &newMerge)) + else if (ProcessIncludeFile(xkb->context, stmt, XkmTypesIndex, &rtrn, + &newMerge)) { InitKeyTypesInfo(&included, xkb, info); included.fileID = included.dflt.defs.fileID = rtrn->id; @@ -396,7 +394,7 @@ else { info->errorCount += 10; - return False; + return false; } if ((stmt->next != NULL) && (included.errorCount < 1)) { @@ -408,11 +406,12 @@ { if ((next->file == NULL) && (next->map == NULL)) { - haveSelf = True; + haveSelf = true; MergeIncludedKeyTypes(&included, info, next->merge, xkb); FreeKeyTypesInfo(info); } - else if (ProcessIncludeFile(next, XkmTypesIndex, &rtrn, &op)) + else if (ProcessIncludeFile(xkb->context, next, XkmTypesIndex, + &rtrn, &op)) { InitKeyTypesInfo(&next_incl, xkb, &included); next_incl.fileID = next_incl.dflt.defs.fileID = rtrn->id; @@ -426,7 +425,7 @@ { info->errorCount += 10; FreeKeyTypesInfo(&included); - return False; + return false; } } } @@ -445,7 +444,7 @@ static struct xkb_kt_map_entry * FindMatchingMapEntry(KeyTypeInfo * type, unsigned mask, unsigned vmask) { - int i; + unsigned int i; struct xkb_kt_map_entry * entry; for (i = 0, entry = type->entries; i < type->nEntries; i++, entry++) @@ -459,7 +458,7 @@ static void DeleteLevel1MapEntries(KeyTypeInfo * type) { - int i, n; + unsigned int i, n; for (i = 0; i < type->nEntries; i++) { @@ -509,9 +508,9 @@ return &type->entries[type->nEntries++]; } -static Bool -AddPreserve(struct xkb_desc * xkb, - KeyTypeInfo * type, PreserveInfo * new, Bool clobber, Bool report) +static bool +AddPreserve(struct xkb_keymap * xkb, + KeyTypeInfo * type, PreserveInfo * new, bool clobber, bool report) { PreserveInfo *old; @@ -533,7 +532,7 @@ PreserveIndexTxt(xkb, old), TypeTxt(type)); ACTION("Ignored\n"); } - return True; + return true; } if (report && (warningLevel > 0)) { @@ -557,20 +556,20 @@ old->preMods = new->preMods; old->preVMods = new->preVMods; } - return True; + return true; } old = uTypedAlloc(PreserveInfo); if (!old) { WSGO("Couldn't allocate preserve in %s\n", TypeTxt(type)); ACTION("Preserve[%s] lost\n", PreserveIndexTxt(xkb, new)); - return False; + return false; } *old = *new; old->matchingMapIndex = -1; type->preserve = (PreserveInfo *) AddCommonInfo(&type->preserve->defs, &old->defs); - return True; + return true; } /** @@ -579,12 +578,12 @@ * entry is created. * * @param clobber Overwrite existing entry. - * @param report True if a warning is to be printed on. + * @param report true if a warning is to be printed on. */ -static Bool -AddMapEntry(struct xkb_desc * xkb, +static bool +AddMapEntry(struct xkb_keymap * xkb, KeyTypeInfo * type, - struct xkb_kt_map_entry * new, Bool clobber, Bool report) + struct xkb_kt_map_entry * new, bool clobber, bool report) { struct xkb_kt_map_entry * old; @@ -613,30 +612,30 @@ WARN("Multiple occurences of map[%s]= %d in %s\n", MapEntryTxt(xkb, new), new->level + 1, TypeTxt(type)); ACTION("Ignored\n"); - return True; + return true; } if (clobber) old->level = new->level; - return True; + return true; } if ((old = NextMapEntry(type)) == NULL) - return False; /* allocation failure, already reported */ + return false; /* allocation failure, already reported */ if (new->level >= type->numLevels) type->numLevels = new->level + 1; if (new->mods.vmods == 0) - old->active = True; + old->active = true; else - old->active = False; + old->active = false; old->mods.mask = new->mods.real_mods; old->mods.real_mods = new->mods.real_mods; old->mods.vmods = new->mods.vmods; old->level = new->level; - return True; + return true; } -static Bool +static bool SetMapEntry(KeyTypeInfo * type, - struct xkb_desc * xkb, ExprDef * arrayNdx, ExprDef * value) + struct xkb_keymap * xkb, ExprDef * arrayNdx, ExprDef * value) { ExprResult rtrn; struct xkb_kt_map_entry entry; @@ -666,15 +665,15 @@ { ERROR("Level specifications in a key type must be integer\n"); ACTION("Ignoring malformed level specification\n"); - return False; + return false; } entry.level = rtrn.ival - 1; - return AddMapEntry(xkb, type, &entry, True, True); + return AddMapEntry(xkb, type, &entry, true, true); } -static Bool +static bool SetPreserve(KeyTypeInfo * type, - struct xkb_desc * xkb, ExprDef * arrayNdx, ExprDef * value) + struct xkb_keymap * xkb, ExprDef * arrayNdx, ExprDef * value) { ExprResult rtrn; PreserveInfo new; @@ -705,12 +704,12 @@ ERROR("Preserve value in a key type is not a modifier mask\n"); ACTION("Ignoring preserve[%s] in type %s\n", PreserveIndexTxt(xkb, &new), TypeTxt(type)); - return False; + return false; } new.preMods = rtrn.uval & 0xff; new.preVMods = (rtrn.uval >> 16) & 0xffff; if ((new.preMods & (~new.indexMods)) - || (new.preVMods && (~new.indexVMods))) + || (new.preVMods & (~new.indexVMods))) { if (warningLevel > 0) { @@ -725,14 +724,14 @@ INFO("%s\n", PreserveIndexTxt(xkb, &new)); } } - return AddPreserve(xkb, type, &new, True, True); + return AddPreserve(xkb, type, &new, true, true); } /***====================================================================***/ -static Bool +static bool AddLevelName(KeyTypeInfo * type, - unsigned level, xkb_atom_t name, Bool clobber, Bool report) + unsigned level, xkb_atom_t name, bool clobber) { if ((type->lvlNames == NULL) || (type->szNames <= level)) { @@ -744,7 +743,7 @@ TypeTxt(type)); ACTION("Level names lost\n"); type->szNames = 0; - return False; + return false; } type->szNames = level + 1; } @@ -756,9 +755,9 @@ level + 1, TypeTxt(type)); ACTION("Ignored\n"); } - return True; + return true; } - else if (type->lvlNames[level] != None) + else if (type->lvlNames[level] != XKB_ATOM_NONE) { if (warningLevel > 0) { @@ -773,15 +772,15 @@ ACTION("Using %s, ignoring %s\n", old, new); } if (!clobber) - return True; + return true; } if (level >= type->numLevels) type->numLevels = level + 1; type->lvlNames[level] = name; - return True; + return true; } -static Bool +static bool SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value) { ExprResult rtrn; @@ -798,11 +797,11 @@ ERROR("Non-string name for level %d in key type %s\n", level + 1, XkbcAtomText(type->name)); ACTION("Ignoring illegal level name definition\n"); - return False; + return false; } level_name = xkb_intern_atom(rtrn.str); free(rtrn.str); - return AddLevelName(type, level, level_name, True, True); + return AddLevelName(type, level, level_name, true); } /***====================================================================***/ @@ -812,15 +811,15 @@ * * @param field The field to parse (e.g. modifiers, map, level_name) */ -static Bool +static bool SetKeyTypeField(KeyTypeInfo * type, - struct xkb_desc * xkb, + struct xkb_keymap * xkb, char *field, ExprDef * arrayNdx, ExprDef * value, KeyTypesInfo * info) { ExprResult tmp; - if (uStrCaseCmp(field, "modifiers") == 0) + if (strcasecmp(field, "modifiers") == 0) { unsigned mods, vmods; if (arrayNdx != NULL) @@ -833,7 +832,7 @@ { ERROR("Key type mask field must be a modifier mask\n"); ACTION("Key type definition ignored\n"); - return False; + return false; } mods = tmp.uval & 0xff; /* core mods */ vmods = (tmp.uval >> 8) & 0xffff; /* xkb virtual mods */ @@ -843,43 +842,43 @@ XkbcAtomText(type->name)); ACTION("Using %s, ", TypeMaskTxt(type, xkb)); INFO("ignoring %s\n", XkbcVModMaskText(xkb, mods, vmods)); - return False; + return false; } type->mask = mods; type->vmask = vmods; type->defs.defined |= _KT_Mask; - return True; + return true; } - else if (uStrCaseCmp(field, "map") == 0) + else if (strcasecmp(field, "map") == 0) { type->defs.defined |= _KT_Map; return SetMapEntry(type, xkb, arrayNdx, value); } - else if (uStrCaseCmp(field, "preserve") == 0) + else if (strcasecmp(field, "preserve") == 0) { type->defs.defined |= _KT_Preserve; return SetPreserve(type, xkb, arrayNdx, value); } - else if ((uStrCaseCmp(field, "levelname") == 0) || - (uStrCaseCmp(field, "level_name") == 0)) + else if ((strcasecmp(field, "levelname") == 0) || + (strcasecmp(field, "level_name") == 0)) { type->defs.defined |= _KT_LevelNames; return SetLevelName(type, arrayNdx, value); } ERROR("Unknown field %s in key type %s\n", field, TypeTxt(type)); ACTION("Definition ignored\n"); - return False; + return false; } -static Bool -HandleKeyTypeVar(VarDef * stmt, struct xkb_desc * xkb, KeyTypesInfo * info) +static bool +HandleKeyTypeVar(VarDef * stmt, struct xkb_keymap * xkb, KeyTypesInfo * info) { ExprResult elem, field; ExprDef *arrayNdx; if (!ExprResolveLhs(stmt->name, &elem, &field, &arrayNdx)) - return False; /* internal error, already reported */ - if (elem.str && (uStrCaseCmp(elem.str, "type") == 0)) + return false; /* internal error, already reported */ + if (elem.str && (strcasecmp(elem.str, "type") == 0)) return SetKeyTypeField(&info->dflt, xkb, field.str, arrayNdx, stmt->value, info); if (elem.str != NULL) @@ -893,12 +892,12 @@ uStringText(field.str)); ACTION("Ignored\n"); } - return False; + return false; } static int HandleKeyTypeBody(VarDef * def, - struct xkb_desc * xkb, KeyTypeInfo * type, KeyTypesInfo * info) + struct xkb_keymap * xkb, KeyTypeInfo * type, KeyTypesInfo * info) { int ok = 1; ExprResult tmp, field; @@ -927,9 +926,9 @@ */ static int HandleKeyTypeDef(KeyTypeDef * def, - struct xkb_desc * xkb, unsigned merge, KeyTypesInfo * info) + struct xkb_keymap * xkb, unsigned merge, KeyTypesInfo * info) { - int i; + unsigned int i; KeyTypeInfo type; if (def->merge != MergeDefault) @@ -954,7 +953,7 @@ if (!HandleKeyTypeBody(def->body, xkb, &type, info)) { info->errorCount++; - return False; + return false; } /* now copy any appropriate map, preserve or level names from the */ @@ -966,7 +965,7 @@ if (((dflt->mods.real_mods & type.mask) == dflt->mods.real_mods) && ((dflt->mods.vmods & type.vmask) == dflt->mods.vmods)) { - AddMapEntry(xkb, &type, dflt, False, False); + AddMapEntry(xkb, &type, dflt, false, false); } } if (info->dflt.preserve) @@ -977,25 +976,25 @@ if (((dflt->indexMods & type.mask) == dflt->indexMods) && ((dflt->indexVMods & type.vmask) == dflt->indexVMods)) { - AddPreserve(xkb, &type, dflt, False, False); + AddPreserve(xkb, &type, dflt, false, false); } dflt = (PreserveInfo *) dflt->defs.next; } } for (i = 0; i < info->dflt.szNames; i++) { - if ((i < type.numLevels) && (info->dflt.lvlNames[i] != None)) + if ((i < type.numLevels) && (info->dflt.lvlNames[i] != XKB_ATOM_NONE)) { - AddLevelName(&type, i, info->dflt.lvlNames[i], False, False); + AddLevelName(&type, i, info->dflt.lvlNames[i], false); } } /* Now add the new keytype to the info struct */ if (!AddKeyType(xkb, info, &type)) { info->errorCount++; - return False; + return false; } - return True; + return true; } /** @@ -1007,12 +1006,12 @@ */ static void HandleKeyTypesFile(XkbFile * file, - struct xkb_desc * xkb, unsigned merge, KeyTypesInfo * info) + struct xkb_keymap * xkb, unsigned merge, KeyTypesInfo * info) { ParseCommon *stmt; free(info->name); - info->name = _XkbDupString(file->name); + info->name = uDupString(file->name); stmt = file->defs; while (stmt) { @@ -1067,10 +1066,10 @@ } } -static Bool -CopyDefToKeyType(struct xkb_desc * xkb, struct xkb_key_type * type, KeyTypeInfo * def) +static bool +CopyDefToKeyType(struct xkb_keymap * xkb, struct xkb_key_type * type, KeyTypeInfo * def) { - int i; + unsigned int i; PreserveInfo *pre; for (pre = def->preserve; pre != NULL; @@ -1081,13 +1080,13 @@ tmp.mods.real_mods = pre->indexMods; tmp.mods.vmods = pre->indexVMods; tmp.level = 0; - AddMapEntry(xkb, def, &tmp, False, False); + AddMapEntry(xkb, def, &tmp, false, false); match = FindMatchingMapEntry(def, pre->indexMods, pre->indexVMods); if (!match) { WSGO("Couldn't find matching entry for preserve\n"); ACTION("Aborting\n"); - return False; + return false; } pre->matchingMapIndex = match - def->entries; } @@ -1140,8 +1139,8 @@ return XkbcComputeEffectiveMap(xkb, type, NULL); } -Bool -CompileKeyTypes(XkbFile *file, struct xkb_desc * xkb, unsigned merge) +bool +CompileKeyTypes(XkbFile *file, struct xkb_keymap * xkb, unsigned merge) { KeyTypesInfo info; @@ -1151,7 +1150,7 @@ if (info.errorCount == 0) { - int i; + unsigned int i; KeyTypeInfo *def; struct xkb_key_type *type, *next; @@ -1168,7 +1167,7 @@ { FreeKeyTypesInfo(&info); WSGO("Couldn't allocate client map\n"); - return False; + return false; } xkb->map->num_types = i; if (XkbAllRequiredTypes & (~info.stdPresent)) @@ -1181,7 +1180,7 @@ { FreeKeyTypesInfo(&info); WSGO("Couldn't initialize canonical key types\n"); - return False; + return false; } if (missing & XkbOneLevelMask) xkb->map->types[XkbOneLevelIndex].name = @@ -1212,14 +1211,14 @@ DeleteLevel1MapEntries(def); if (!CopyDefToKeyType(xkb, type, def)) { FreeKeyTypesInfo(&info); - return False; + return false; } def = (KeyTypeInfo *) def->defs.next; } FreeKeyTypesInfo(&info); - return True; + return true; } FreeKeyTypesInfo(&info); - return False; + return false; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/Makefile.am libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/Makefile.am --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/Makefile.am 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) \ - -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' -AM_YFLAGS = -d - -noinst_LTLIBRARIES = libxkbcomp.la -libxkbcomp_la_SOURCES = \ - action.c \ - action.h \ - alias.c \ - alias.h \ - compat.c \ - expr.c \ - expr.h \ - indicators.c \ - indicators.h \ - keycodes.c \ - keycodes.h \ - keymap.c \ - keytypes.c \ - misc.c \ - misc.h \ - parseutils.c \ - parseutils.h \ - symbols.c \ - utils.c \ - utils.h \ - vmod.c \ - vmod.h \ - xkbcomp.c \ - xkbcomp.h \ - xkbparse.y \ - xkbpath.c \ - xkbpath.h \ - xkbscan.l - -BUILT_SOURCES = xkbparse.h diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/misc.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/misc.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/misc.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/misc.c 2012-05-10 10:10:26.000000000 +0000 @@ -30,7 +30,6 @@ #include "xkbpath.h" #include "keycodes.h" #include "misc.h" -#include #include "parseutils.h" /***====================================================================***/ @@ -40,45 +39,36 @@ * If the statement defines a specific map to use, this map is returned in * file_rtrn. Otherwise, the default map is returned. * + * @param context The context containing include paths * @param stmt The include statement, specifying the file name to look for. * @param file_type Type of file (XkmKeyNamesIdx, etc.) * @param file_rtrn Returns the key map to be used. * @param merge_rtrn Always returns stmt->merge. * - * @return True on success or False otherwise. + * @return true on success or false otherwise. */ -Bool -ProcessIncludeFile(IncludeStmt * stmt, +bool +ProcessIncludeFile(struct xkb_context *context, + IncludeStmt * stmt, unsigned file_type, XkbFile ** file_rtrn, unsigned *merge_rtrn) { FILE *file; XkbFile *rtrn, *mapToUse, *next; - char oldFile[1024] = {0}; - int oldLine = lineNum; - file = XkbFindFileInPath(stmt->file, file_type, &stmt->path); + file = XkbFindFileInPath(context, stmt->file, file_type, &stmt->path); if (file == NULL) { ERROR("Can't find file \"%s\" for %s include\n", stmt->file, XkbDirectoryForInclude(file_type)); - return False; + return false; } - if (scanFile) - strcpy(oldFile, scanFile); - else - memset(oldFile, 0, sizeof(oldFile)); - oldLine = lineNum; - setScanState(stmt->file, 1); - if (debugFlags & 2) - INFO("About to parse include file %s\n", stmt->file); /* parse the file */ - if ((XKBParseFile(file, &rtrn) == 0) || (rtrn == NULL)) + if ((XKBParseFile(file, stmt->file, &rtrn) == 0) || (rtrn == NULL)) { - setScanState(oldFile, oldLine); ERROR("Error interpreting include file \"%s\"\n", stmt->file); fclose(file); - return False; + return false; } fclose(file); @@ -89,7 +79,7 @@ { next = (XkbFile *)mapToUse->common.next; mapToUse->common.next = NULL; - if (uStringEqual(mapToUse->name, stmt->map) && + if (strcmp(mapToUse->name, stmt->map) == 0 && mapToUse->type == file_type) { FreeXKBFile(next); @@ -105,7 +95,7 @@ { ERROR("No %s named \"%s\" in the include file \"%s\"\n", XkbcConfigText(file_type), stmt->map, stmt->file); - return False; + return false; } } else if ((rtrn->common.next != NULL) && (warningLevel > 5)) @@ -114,20 +104,18 @@ stmt->file); ACTION("Using first defined map, \"%s\"\n", rtrn->name); } - setScanState(oldFile, oldLine); if (mapToUse->type != file_type) { ERROR("Include file wrong type (expected %s, got %s)\n", XkbcConfigText(file_type), XkbcConfigText(mapToUse->type)); ACTION("Include file \"%s\" ignored\n", stmt->file); - return False; + return false; } /* FIXME: we have to check recursive includes here (or somewhere) */ - mapToUse->compiled = True; *file_rtrn = mapToUse; *merge_rtrn = stmt->merge; - return True; + return true; } /***====================================================================***/ @@ -137,7 +125,7 @@ { ERROR("The %s %s field is not an array\n", type, field); ACTION("Ignoring illegal assignment in %s\n", name); - return False; + return false; } int @@ -145,7 +133,7 @@ { ERROR("Missing subscript for %s %s\n", type, field); ACTION("Ignoring illegal assignment in %s\n", name); - return False; + return false; } int @@ -154,7 +142,7 @@ { ERROR("The %s %s field must be a %s\n", type, field, wanted); ACTION("Ignoring illegal assignment in %s\n", name); - return False; + return false; } int @@ -162,18 +150,18 @@ { ERROR("Unknown %s field %s in %s\n", type, field, name); ACTION("Ignoring assignment to unknown field in %s\n", name); - return False; + return false; } /***====================================================================***/ -Bool +bool UseNewField(unsigned field, CommonInfo * oldDefs, CommonInfo * newDefs, unsigned *pCollide) { - Bool useNew; + bool useNew; - useNew = False; + useNew = false; if (oldDefs->defined & field) { if (newDefs->defined & field) @@ -184,11 +172,11 @@ *pCollide |= field; } if (newDefs->merge != MergeAugment) - useNew = True; + useNew = true; } } else if (newDefs->defined & field) - useNew = True; + useNew = true; return useNew; } @@ -228,31 +216,23 @@ /***====================================================================***/ -typedef struct _KeyNameDesc -{ - xkb_atom_t level1; - xkb_atom_t level2; - char name[5]; - Bool used; -} KeyNameDesc; - /** * Find the key with the given name and return its keycode in kc_rtrn. * * @param name The 4-letter name of the key as a long. * @param kc_rtrn Set to the keycode if the key was found, otherwise 0. - * @param use_aliases True if the key aliases should be searched too. - * @param create If True and the key is not found, it is added to the + * @param use_aliases true if the key aliases should be searched too. + * @param create If true and the key is not found, it is added to the * xkb->names at the first free keycode. * @param start_from Keycode to start searching from. * - * @return True if found, False otherwise. + * @return true if found, false otherwise. */ -Bool -FindNamedKey(struct xkb_desc * xkb, +bool +FindNamedKey(struct xkb_keymap * xkb, unsigned long name, xkb_keycode_t *kc_rtrn, - Bool use_aliases, Bool create, int start_from) + bool use_aliases, bool create, xkb_keycode_t start_from) { unsigned n; @@ -262,7 +242,7 @@ } else if (start_from > xkb->max_key_code) { - return False; + return false; } *kc_rtrn = 0; /* some callers rely on this */ @@ -275,14 +255,14 @@ if (tmp == name) { *kc_rtrn = n; - return True; + return true; } } if (use_aliases) { unsigned long new_name; if (FindKeyNameForAlias(xkb, name, &new_name)) - return FindNamedKey(xkb, new_name, kc_rtrn, False, create, 0); + return FindNamedKey(xkb, new_name, kc_rtrn, false, create, 0); } } if (create) @@ -297,7 +277,7 @@ ACTION("Key \"%s\" not automatically created\n", longText(name)); } - return False; + return false; } } /* Find first unused keycode and store our key here */ @@ -309,18 +289,18 @@ LongToKeyName(name, buf); memcpy(xkb->names->keys[n].name, buf, XkbKeyNameLength); *kc_rtrn = n; - return True; + return true; } } } - return False; + return false; } -Bool -FindKeyNameForAlias(struct xkb_desc * xkb, unsigned long lname, +bool +FindKeyNameForAlias(struct xkb_keymap * xkb, unsigned long lname, unsigned long *real_name) { - int i; + unsigned int i; char name[XkbKeyNameLength + 1]; if (xkb && xkb->names && xkb->names->key_aliases) @@ -334,9 +314,9 @@ if (strncmp(name, a->alias, XkbKeyNameLength) == 0) { *real_name = KeyNameToLong(a->real); - return True; + return true; } } } - return False; + return false; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/misc.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/misc.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/misc.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/misc.h 2012-05-10 10:10:26.000000000 +0000 @@ -35,57 +35,40 @@ struct _CommonInfo *next; } CommonInfo; -extern Bool UseNewField(unsigned /* field */ , - CommonInfo * /* oldDefs */ , - CommonInfo * /* newDefs */ , - unsigned * /* pCollide */ - ); - -extern char * ClearCommonInfo(CommonInfo * /* cmn */ - ); - -extern char * AddCommonInfo(CommonInfo * /* old */ , - CommonInfo * /* new */ - ); - -extern int ReportNotArray(const char * /* type */ , - const char * /* field */ , - const char * /* name */ - ); - -extern int ReportShouldBeArray(const char * /* type */ , - const char * /* field */ , - const char * /* name */ - ); - -extern int ReportBadType(const char * /* type */ , - const char * /* field */ , - const char * /* name */ , - const char * /* wanted */ - ); - -extern int ReportBadField(const char * /* type */ , - const char * /* field */ , - const char * /* name */ - ); - -extern Bool ProcessIncludeFile(IncludeStmt * /* stmt */ , - unsigned /* file_type */ , - XkbFile ** /* file_rtrn */ , - unsigned * /* merge_rtrn */ - ); - -extern Bool FindNamedKey(struct xkb_desc * /* xkb */ , - unsigned long /* name */ , - xkb_keycode_t * /* kc_rtrn */ , - Bool /* use_aliases */ , - Bool /* create */ , - int /* start_from */ - ); - -extern Bool FindKeyNameForAlias(struct xkb_desc * /* xkb */ , - unsigned long /* lname */ , - unsigned long * /* real_name */ - ); +extern bool +UseNewField(unsigned field, CommonInfo *oldDefs, CommonInfo *newDefs, + unsigned *pCollide); + +extern char * +ClearCommonInfo(CommonInfo *cmn); + +extern char * +AddCommonInfo(CommonInfo *old, CommonInfo *new); + +extern int +ReportNotArray(const char *type, const char *field, const char *name); + +extern int +ReportShouldBeArray(const char *type, const char *field, const char *name); + +extern int +ReportBadType(const char *type, const char *field, const char *name, + const char *wanted); + +extern int +ReportBadField(const char *type, const char *field, const char *name); + +extern bool +ProcessIncludeFile(struct xkb_context *context, + IncludeStmt *stmt, unsigned file_type, XkbFile **file_rtrn, + unsigned *merge_rtrn); + +extern bool +FindNamedKey(struct xkb_keymap *xkb, unsigned long name, xkb_keycode_t *kc_rtrn, + bool use_aliases, bool create, xkb_keycode_t start_from); + +extern bool +FindKeyNameForAlias(struct xkb_keymap *xkb, unsigned long lname, + unsigned long *real_name); #endif /* MISC_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/parseutils.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/parseutils.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/parseutils.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/parseutils.c 2012-05-10 10:10:26.000000000 +0000 @@ -28,10 +28,8 @@ #include "xkbmisc.h" #include "xkbpath.h" #include "xkbparse.h" -#include -#include -XkbFile *rtrnValue; +#include ParseCommon * AppendStmt(ParseCommon * to, ParseCommon * append) @@ -121,7 +119,7 @@ } KeycodeDef * -KeycodeCreate(char *name, unsigned long value) +KeycodeCreate(const char *name, unsigned long value) { KeycodeDef *def; @@ -143,7 +141,7 @@ } KeyAliasDef * -KeyAliasCreate(char *alias, char *real) +KeyAliasCreate(const char *alias, const char *real) { KeyAliasDef *def; @@ -261,7 +259,7 @@ } SymbolsDef * -SymbolsCreate(char *keyName, ExprDef * symbols) +SymbolsCreate(const char *keyName, ExprDef *symbols) { SymbolsDef *def; @@ -350,7 +348,7 @@ } IndicatorNameDef * -IndicatorNameCreate(int ndx, ExprDef * name, Bool virtual) +IndicatorNameCreate(int ndx, ExprDef * name, bool virtual) { IndicatorNameDef *def; @@ -391,66 +389,168 @@ return NULL; } +static bool +ResizeKeysymList(ExprDef *list, unsigned int extra) +{ + int i; + + if (list->value.list.nSyms + extra > list->value.list.szSyms) + { + list->value.list.szSyms *= 2; + list->value.list.szSyms += extra; + if (list->value.list.szSyms == 1) + list->value.list.szSyms = 4; + list->value.list.syms = uTypedRecalloc(list->value.list.syms, + list->value.list.nSyms, + list->value.list.szSyms, + char *); + if (list->value.list.syms == NULL) + { + FATAL("Couldn't resize list of symbols for append\n"); + return false; + } + } + if (list->value.list.nLevels >= list->value.list.szLevels) + { + list->value.list.szLevels *= 2; + if (list->value.list.szLevels == 0) + list->value.list.szLevels = 4; + list->value.list.symsMapIndex = + uTypedRecalloc(list->value.list.symsMapIndex, + list->value.list.nLevels, + list->value.list.szLevels, + int); + if (list->value.list.symsMapIndex == NULL) + { + FATAL("Couldn't resize keysym index map for append\n"); + return false; + } + list->value.list.symsNumEntries = + uTypedRecalloc(list->value.list.symsNumEntries, + list->value.list.nLevels, + list->value.list.szLevels, + unsigned int); + if (list->value.list.symsNumEntries == NULL) + { + FATAL("Couldn't resize num keysym entries for append\n"); + return false; + } + for (i = list->value.list.nLevels; i < list->value.list.szLevels; i++) + list->value.list.symsMapIndex[i] = -1; + } + + return true; +} + ExprDef * CreateKeysymList(char *sym) { ExprDef *def; def = ExprCreate(ExprKeysymList, TypeSymbols); - if (def) + if (!def) { - def->value.list.nSyms = 1; - def->value.list.szSyms = 4; - def->value.list.syms = uTypedCalloc(4, char *); - if (def->value.list.syms != NULL) - { - def->value.list.syms[0] = sym; - return def; - } + FATAL("Couldn't allocate expression for keysym list in parser\n"); + return NULL; } - FATAL("Couldn't allocate expression for keysym list in parser\n"); - return NULL; + + def->value.list.nSyms = 0; + def->value.list.szSyms = 0; + def->value.list.nLevels = 0; + def->value.list.szLevels = 0; + def->value.list.syms = NULL; + def->value.list.symsMapIndex = NULL; + def->value.list.symsNumEntries = NULL; + + if (!ResizeKeysymList(def, 1)) + { + FreeStmt(&def->common); + return NULL; + } + + def->value.list.syms[0] = sym; + def->value.list.symsMapIndex[0] = 0; + def->value.list.symsNumEntries[0] = 1; + def->value.list.nLevels = 1; + def->value.list.nSyms = 1; + + return def; } ExprDef * -AppendKeysymList(ExprDef * list, char *sym) +CreateMultiKeysymList(ExprDef *list) { - if (list->value.list.nSyms >= list->value.list.szSyms) + int i; + + for (i = 1; i < list->value.list.szLevels; i++) { - list->value.list.szSyms *= 2; - list->value.list.syms = uTypedRecalloc(list->value.list.syms, - list->value.list.nSyms, - list->value.list.szSyms, - char *); - if (list->value.list.syms == NULL) - { - FATAL("Couldn't resize list of symbols for append\n"); - return NULL; - } + list->value.list.symsMapIndex[i] = -1; + list->value.list.symsNumEntries[i] = 0; } + list->value.list.symsMapIndex[0] = 0; + list->value.list.symsNumEntries[0] = list->value.list.nLevels; + list->value.list.nLevels = 1; + + return list; +} + +ExprDef * +AppendKeysymList(ExprDef * list, char *sym) +{ + if (!ResizeKeysymList(list, 1)) + return NULL; + + list->value.list.symsMapIndex[list->value.list.nLevels] = + list->value.list.nSyms; + list->value.list.symsNumEntries[list->value.list.nLevels] = 1; list->value.list.syms[list->value.list.nSyms++] = sym; + list->value.list.nLevels++; + return list; +} + +ExprDef * +AppendMultiKeysymList(ExprDef * list, ExprDef * append) +{ + int i; + + if (!ResizeKeysymList(list, append->value.list.nSyms)) + return NULL; + + list->value.list.symsMapIndex[list->value.list.nLevels] = + list->value.list.nSyms; + list->value.list.symsNumEntries[list->value.list.nLevels] = + append->value.list.nSyms; + for (i = 0; i < append->value.list.nSyms; i++) { + list->value.list.syms[list->value.list.nSyms++] = + append->value.list.syms[i]; + append->value.list.syms[i] = NULL; + } + list->value.list.nLevels++; + + FreeStmt(&append->common); + return list; } int -LookupKeysym(char *str, xkb_keysym_t * sym_rtrn) +LookupKeysym(const char *str, xkb_keysym_t *sym_rtrn) { xkb_keysym_t sym; - if ((!str) || (uStrCaseCmp(str, "any") == 0) - || (uStrCaseCmp(str, "nosymbol") == 0)) + if ((!str) || (strcasecmp(str, "any") == 0) || + (strcasecmp(str, "nosymbol") == 0)) { - *sym_rtrn = NoSymbol; + *sym_rtrn = XKB_KEYSYM_NO_SYMBOL; return 1; } - else if ((uStrCaseCmp(str, "none") == 0) - || (uStrCaseCmp(str, "voidsymbol") == 0)) + else if ((strcasecmp(str, "none") == 0) || + (strcasecmp(str, "voidsymbol") == 0)) { *sym_rtrn = XK_VoidSymbol; return 1; } sym = xkb_string_to_keysym(str); - if (sym != NoSymbol) + if (sym != XKB_KEYSYM_NO_SYMBOL) { *sym_rtrn = sym; return 1; @@ -467,13 +567,13 @@ IncludeStmt *incl, *first; char *file, *map, *stmt, *tmp, *extra_data; char nextop; - Bool haveSelf; + bool haveSelf; - haveSelf = False; + haveSelf = false; incl = first = NULL; file = map = NULL; tmp = str; - stmt = _XkbDupString(str); + stmt = uDupString(str); while ((tmp) && (*tmp)) { if (XkbParseIncludeMap(&tmp, &file, &map, &nextop, &extra_data)) @@ -482,7 +582,7 @@ { if (haveSelf) goto BAIL; - haveSelf = True; + haveSelf = true; } if (first == NULL) first = incl = uTypedAlloc(IncludeStmt); @@ -533,26 +633,8 @@ return NULL; } -#ifdef DEBUG -void -PrintStmtAddrs(ParseCommon * stmt) -{ - fprintf(stderr, "0x%x", stmt); - if (stmt) - { - do - { - fprintf(stderr, "->0x%x", stmt->next); - stmt = stmt->next; - } - while (stmt); - } - fprintf(stderr, "\n"); -} -#endif - void -CheckDefaultMap(XkbFile * maps) +CheckDefaultMap(XkbFile * maps, const char *fileName) { XkbFile *dflt, *tmp; @@ -569,7 +651,7 @@ if (warningLevel > 2) { WARN("Multiple default components in %s\n", - (scanFile ? scanFile : "(unknown)")); + (fileName ? fileName : "(unknown)")); ACTION("Using %s, ignoring %s\n", (dflt->name ? dflt->name : "(first)"), (tmp->name ? tmp->name : "(subsequent)")); @@ -592,22 +674,21 @@ XkbcEnsureSafeMapName(name); memset(file, 0, sizeof(XkbFile)); file->type = type; - file->topName = _XkbDupString(name); + file->topName = uDupString(name); file->name = name; file->defs = defs; file->id = fileID++; - file->compiled = False; file->flags = flags; } return file; } unsigned -StmtSetMerge(ParseCommon * stmt, unsigned merge) +StmtSetMerge(ParseCommon * stmt, unsigned merge, YYLTYPE *loc, void *scanner) { if ((merge == MergeAltForm) && (stmt->stmtType != StmtKeycodeDef)) { - yyerror("illegal use of 'alternate' merge mode"); + yyerror(loc, scanner, "illegal use of 'alternate' merge mode"); merge = MergeDefault; } return merge; @@ -648,6 +729,8 @@ for (i = 0; i < expr->value.list.nSyms; i++) free(expr->value.list.syms[i]); free(expr->value.list.syms); + free(expr->value.list.symsMapIndex); + free(expr->value.list.symsNumEntries); break; default: break; @@ -755,7 +838,6 @@ case XkmSymbolsIndex: case XkmKeyNamesIndex: case XkmGeometryIndex: - case XkmGeometryFile: FreeStmt(file->defs); break; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/parseutils.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/parseutils.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/parseutils.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/parseutils.h 2012-05-10 10:10:26.000000000 +0000 @@ -28,133 +28,110 @@ #define XKBPARSE_H 1 #include "xkbcomp.h" +#include "xkbparse.h" -extern char scanBuf[1024]; -extern int scanInt; -extern unsigned long scanULong; -extern int lineNum; +struct parser_param { + void *scanner; + XkbFile *rtrn; +}; -extern XkbFile *rtrnValue; +struct scanner_extra { + char *scanFile; + char scanBuf[1024]; + char *s; +}; -extern ParseCommon *AppendStmt(ParseCommon * /* to */ , - ParseCommon * /* append */ - ); +extern ParseCommon * +AppendStmt(ParseCommon *to, ParseCommon *append); -extern ExprDef *ExprCreate(unsigned /* op */ , - unsigned /* type */ - ); +extern ExprDef * +ExprCreate(unsigned op, unsigned type); -extern ExprDef *ExprCreateUnary(unsigned /* op */ , - unsigned /* type */ , - ExprDef * /* child */ - ); +extern ExprDef * +ExprCreateUnary(unsigned op, unsigned type, ExprDef *child); -extern ExprDef *ExprCreateBinary(unsigned /* op */ , - ExprDef * /* left */ , - ExprDef * /* right */ - ); +extern ExprDef * +ExprCreateBinary(unsigned op, ExprDef *left, ExprDef *right); -extern KeycodeDef *KeycodeCreate(char * /* name */ , - unsigned long /* value */ - ); +extern KeycodeDef * +KeycodeCreate(const char *name, unsigned long value); -extern KeyAliasDef *KeyAliasCreate(char * /* alias */ , - char * /* real */ - ); +extern KeyAliasDef * +KeyAliasCreate(const char *alias, const char *real); -extern VModDef *VModCreate(xkb_atom_t /* name */ , - ExprDef * /* value */ - ); +extern VModDef * +VModCreate(xkb_atom_t name, ExprDef *value); -extern VarDef *VarCreate(ExprDef * /* name */ , - ExprDef * /* value */ - ); +extern VarDef * +VarCreate(ExprDef *name, ExprDef *value); -extern VarDef *BoolVarCreate(xkb_atom_t /* nameToken */ , - unsigned /* set */ - ); +extern VarDef * +BoolVarCreate(xkb_atom_t nameToken, unsigned set); -extern InterpDef *InterpCreate(char * /* sym */ , - ExprDef * /* match */ - ); +extern InterpDef * +InterpCreate(char *sym, ExprDef *match); -extern KeyTypeDef *KeyTypeCreate(xkb_atom_t /* name */ , - VarDef * /* body */ - ); +extern KeyTypeDef * +KeyTypeCreate(xkb_atom_t name, VarDef *body); -extern SymbolsDef *SymbolsCreate(char * /* keyName */ , - ExprDef * /* symbols */ - ); +extern SymbolsDef * +SymbolsCreate(const char *keyName, ExprDef *symbols); -extern GroupCompatDef *GroupCompatCreate(int /* group */ , - ExprDef * /* def */ - ); +extern GroupCompatDef * +GroupCompatCreate(int group, ExprDef *def); -extern ModMapDef *ModMapCreate(uint32_t /* modifier */ , - ExprDef * /* keys */ - ); +extern ModMapDef * +ModMapCreate(uint32_t modifier, ExprDef *keys); -extern IndicatorMapDef *IndicatorMapCreate(xkb_atom_t /* name */ , - VarDef * /* body */ - ); +extern IndicatorMapDef * +IndicatorMapCreate(xkb_atom_t name, VarDef *body); -extern IndicatorNameDef *IndicatorNameCreate(int /* ndx */ , - ExprDef * /* name */ , - Bool /* virtual */ - ); +extern IndicatorNameDef * +IndicatorNameCreate(int ndx, ExprDef *name, bool virtual); -extern ExprDef *ActionCreate(xkb_atom_t /* name */ , - ExprDef * /* args */ - ); +extern ExprDef * +ActionCreate(xkb_atom_t name, ExprDef *args); -extern ExprDef *CreateKeysymList(char * /* sym */ - ); +extern ExprDef * +CreateMultiKeysymList(ExprDef *list); -extern ExprDef *AppendKeysymList(ExprDef * /* list */ , - char * /* sym */ - ); +extern ExprDef * +CreateKeysymList(char *sym); -extern int LookupKeysym(char * /* str */ , - xkb_keysym_t * /* sym_rtrn */ - ); +extern ExprDef * +AppendMultiKeysymList(ExprDef *list, ExprDef *append); -extern IncludeStmt *IncludeCreate(char * /* str */ , - unsigned /* merge */ - ); +extern ExprDef * +AppendKeysymList(ExprDef *list, char *sym); -extern unsigned StmtSetMerge(ParseCommon * /* stmt */ , - unsigned /* merge */ - ); +extern int +LookupKeysym(const char *str, xkb_keysym_t *sym_rtrn); -#ifdef DEBUG -extern void PrintStmtAddrs(ParseCommon * /* stmt */ - ); -#endif +extern IncludeStmt * +IncludeCreate(char *str, unsigned merge); -extern int XKBParseFile(FILE * /* file */ , - XkbFile ** /* pRtrn */ - ); +extern unsigned +StmtSetMerge(ParseCommon *stmt, unsigned merge, YYLTYPE *loc, void *scanner); -extern int XKBParseString(const char *string, XkbFile ** pRtrn); +extern void +CheckDefaultMap(XkbFile *maps, const char *fileName); -extern void CheckDefaultMap(XkbFile * maps); +extern int +XKBParseFile(FILE *file, const char *fileName, XkbFile **pRtrn); -extern XkbFile *CreateXKBFile(int /* type */ , - char * /* name */ , - ParseCommon * /* defs */ , - unsigned /* flags */ - ); +extern int +XKBParseString(const char *string, const char *fileName, XkbFile **pRtrn); -extern void FreeXKBFile(XkbFile *file); +extern XkbFile * +CreateXKBFile(int type, char *name, ParseCommon *defs, unsigned flags); -extern void yyerror(const char * /* msg */ - ); +extern void +FreeXKBFile(XkbFile *file); -extern void setScanState(const char * /* file */ , - int /* line */ - ); +extern void +FreeStmt(ParseCommon *stmt); -extern void FreeStmt(ParseCommon * /* stmt */ - ); +extern void +yyerror(struct YYLTYPE *loc, void *scanner, const char *msg); #endif /* XKBPARSE_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/symbols.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/symbols.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/symbols.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/symbols.c 2012-05-10 10:10:26.000000000 +0000 @@ -63,8 +63,25 @@ unsigned char typesDefined; unsigned char symsDefined; unsigned char actsDefined; - short numLevels[XkbNumKbdGroups]; + unsigned int numLevels[XkbNumKbdGroups]; + + /* syms[group] -> Single array for all the keysyms in the group. */ xkb_keysym_t *syms[XkbNumKbdGroups]; + /* sizeSyms[group] -> The size of the syms[group] array. */ + int sizeSyms[XkbNumKbdGroups]; + /* + * symsMapIndex[group][level] -> The index from which the syms for + * the level begin in the syms[group] array. Remember each keycode + * can have multiple keysyms in each level (that is, each key press + * can result in multiple keysyms). + */ + int *symsMapIndex[XkbNumKbdGroups]; + /* + * symsMapNumEntries[group][level] -> How many syms are in + * syms[group][symsMapIndex[group][level]]. + */ + unsigned int *symsMapNumEntries[XkbNumKbdGroups]; + union xkb_action *acts[XkbNumKbdGroups]; xkb_atom_t types[XkbNumKbdGroups]; unsigned repeat; @@ -93,11 +110,14 @@ for (i = 0; i < XkbNumKbdGroups; i++) { info->numLevels[i] = 0; - info->types[i] = None; + info->types[i] = XKB_ATOM_NONE; info->syms[i] = NULL; + info->sizeSyms[i] = 0; + info->symsMapIndex[i] = NULL; + info->symsMapNumEntries[i] = NULL; info->acts[i] = NULL; } - info->dfltType = None; + info->dfltType = XKB_ATOM_NONE; info->behavior.type = XkbKB_Default; info->behavior.data = 0; info->vmodmap = 0; @@ -122,13 +142,18 @@ for (i = 0; i < XkbNumKbdGroups; i++) { info->numLevels[i] = 0; - info->types[i] = None; + info->types[i] = XKB_ATOM_NONE; free(info->syms[i]); info->syms[i] = NULL; + info->sizeSyms[i] = 0; + free(info->symsMapIndex[i]); + info->symsMapIndex[i] = NULL; + free(info->symsMapNumEntries[i]); + info->symsMapNumEntries[i] = NULL; free(info->acts[i]); info->acts[i] = NULL; } - info->dfltType = None; + info->dfltType = XKB_ATOM_NONE; info->behavior.type = XkbKB_Default; info->behavior.data = 0; info->vmodmap = 0; @@ -141,8 +166,8 @@ * If old is reset, new simply re-uses old's memory. Otherwise, the memory is * newly allocated and new points to the new memory areas. */ -static Bool -CopyKeyInfo(KeyInfo * old, KeyInfo * new, Bool clearOld) +static bool +CopyKeyInfo(KeyInfo * old, KeyInfo * new, bool clearOld) { int i; @@ -153,41 +178,80 @@ for (i = 0; i < XkbNumKbdGroups; i++) { old->numLevels[i] = 0; + old->symsMapIndex[i] = NULL; + old->symsMapNumEntries[i] = NULL; old->syms[i] = NULL; + old->sizeSyms[i] = 0; old->acts[i] = NULL; } } else { - int width; + unsigned int width; for (i = 0; i < XkbNumKbdGroups; i++) { width = new->numLevels[i]; if (old->syms[i] != NULL) { - new->syms[i] = uTypedCalloc(width, xkb_keysym_t); + new->syms[i] = uTypedCalloc(new->sizeSyms[i], xkb_keysym_t); if (!new->syms[i]) { new->syms[i] = NULL; + new->sizeSyms[i] = 0; + new->numLevels[i] = 0; + new->acts[i] = NULL; + return false; + } + memcpy(new->syms[i], old->syms[i], + new->sizeSyms[i] * sizeof(xkb_keysym_t)); + new->symsMapIndex[i] = uTypedCalloc(width, int); + if (!new->symsMapIndex[i]) + { + free(new->syms[i]); + new->syms[i] = NULL; + new->sizeSyms[i] = 0; new->numLevels[i] = 0; - return False; + new->acts[i] = NULL; + return false; } - memcpy(new->syms[i], old->syms[i], width * sizeof(xkb_keysym_t)); + memcpy(new->symsMapIndex[i], old->symsMapIndex[i], + width * sizeof(int)); + new->symsMapNumEntries[i] = uTypedCalloc(width, unsigned int); + if (!new->symsMapNumEntries[i]) + { + free(new->syms[i]); + new->syms[i] = NULL; + new->sizeSyms[i] = 0; + free(new->symsMapIndex[i]); + new->symsMapIndex[i] = NULL; + new->numLevels[i] = 0; + new->acts[i] = NULL; + return false; + } + memcpy(new->symsMapNumEntries[i], old->symsMapNumEntries[i], + width * sizeof(unsigned int)); } if (old->acts[i] != NULL) { new->acts[i] = uTypedCalloc(width, union xkb_action); if (!new->acts[i]) { - new->acts[i] = NULL; - return False; + free(new->syms[i]); + new->syms[i] = NULL; + new->sizeSyms[i] = 0; + free(new->symsMapIndex[i]); + new->symsMapIndex[i] = NULL; + free(new->symsMapNumEntries[i]); + new->symsMapNumEntries[i] = NULL; + new->numLevels[i] = 0; + return false; } memcpy(new->acts[i], old->acts[i], width * sizeof(union xkb_action)); } } } - return True; + return true; } /***====================================================================***/ @@ -195,7 +259,7 @@ typedef struct _ModMapEntry { CommonInfo defs; - Bool haveSymbol; + bool haveSymbol; int modifier; union { @@ -227,7 +291,7 @@ } SymbolsInfo; static void -InitSymbolsInfo(SymbolsInfo * info, struct xkb_desc * xkb) +InitSymbolsInfo(SymbolsInfo * info, struct xkb_keymap * xkb) { int i; @@ -242,7 +306,7 @@ info->keys = uTypedCalloc(SYMBOLS_INIT_SIZE, KeyInfo); info->modMap = NULL; for (i = 0; i < XkbNumKbdGroups; i++) - info->groupNames[i] = None; + info->groupNames[i] = XKB_ATOM_NONE; InitKeyInfo(&info->dflt); InitVModInfo(&info->vmods, xkb); info->action = NULL; @@ -252,7 +316,7 @@ static void FreeSymbolsInfo(SymbolsInfo * info) { - int i; + unsigned int i; free(info->name); if (info->keys) @@ -268,76 +332,104 @@ memset(info, 0, sizeof(SymbolsInfo)); } -static Bool -ResizeKeyGroup(KeyInfo * key, - unsigned group, unsigned atLeastSize, Bool forceActions) -{ - Bool tooSmall; - unsigned newWidth; - - tooSmall = (key->numLevels[group] < atLeastSize); - if (tooSmall) - newWidth = atLeastSize; - else - newWidth = key->numLevels[group]; +static bool +ResizeKeyGroup(KeyInfo * key, unsigned int group, unsigned int numLevels, + unsigned sizeSyms, bool forceActions) +{ + int i; - if ((key->syms[group] == NULL) || tooSmall) + if (key->syms[group] == NULL || key->sizeSyms[group] < sizeSyms) { key->syms[group] = uTypedRecalloc(key->syms[group], - key->numLevels[group], newWidth, + key->sizeSyms[group], + sizeSyms, xkb_keysym_t); - if (!key->syms[group]) - return False; - } - if (((forceActions) && (tooSmall || (key->acts[group] == NULL))) || - (tooSmall && (key->acts[group] != NULL))) + if (!key->syms[group]) { + key->sizeSyms[group] = 0; + return false; + } + key->sizeSyms[group] = sizeSyms; + } + if (!key->symsMapIndex[group] || key->numLevels[group] < numLevels) + { + key->symsMapIndex[group] = uTypedRealloc(key->symsMapIndex[group], + numLevels, + int); + if (!key->symsMapIndex[group]) + return false; + for (i = key->numLevels[group]; i < numLevels; i++) + key->symsMapIndex[group][i] = -1; + } + if (!key->symsMapNumEntries[group] || key->numLevels[group] < numLevels) + { + key->symsMapNumEntries[group] = + uTypedRecalloc(key->symsMapNumEntries[group], + key->numLevels[group], + numLevels, + unsigned int); + if (!key->symsMapNumEntries[group]) + return false; + } + if ((forceActions && + (key->numLevels[group] < numLevels || (key->acts[group] == NULL))) || + (key->numLevels[group] < numLevels && (key->acts[group] != NULL))) { key->acts[group] = uTypedRecalloc(key->acts[group], - key->numLevels[group], newWidth, + key->numLevels[group], + numLevels, union xkb_action); if (!key->acts[group]) - return False; + return false; } - key->numLevels[group] = newWidth; - return True; + if (key->numLevels[group] < numLevels) + key->numLevels[group] = numLevels; + return true; } -static Bool +static bool MergeKeyGroups(SymbolsInfo * info, KeyInfo * into, KeyInfo * from, unsigned group) { - xkb_keysym_t *resultSyms; + xkb_keysym_t *resultSyms = NULL; union xkb_action *resultActs; - int resultWidth; + unsigned int resultWidth; + unsigned int resultSize = 0; + int cur_idx = 0; int i; - Bool report, clobber; + bool report, clobber; clobber = (from->defs.merge != MergeAugment); report = (warningLevel > 9) || ((into->defs.fileID == from->defs.fileID) && (warningLevel > 0)); if (into->numLevels[group] >= from->numLevels[group]) { - resultSyms = into->syms[group]; resultActs = into->acts[group]; resultWidth = into->numLevels[group]; } else { - resultSyms = from->syms[group]; resultActs = from->acts[group]; resultWidth = from->numLevels[group]; - } - if (resultSyms == NULL) - { - resultSyms = uTypedCalloc(resultWidth, xkb_keysym_t); - if (!resultSyms) + into->symsMapIndex[group] = uTypedRealloc(into->symsMapIndex[group], + from->numLevels[group], + int); + into->symsMapNumEntries[group] = + uTypedRecalloc(into->symsMapNumEntries[group], + into->numLevels[group], + from->numLevels[group], + unsigned int); + if (!into->symsMapIndex[group] || !into->symsMapNumEntries[group]) { - WSGO("Could not allocate symbols for group merge\n"); + WSGO("Could not allocate level indices for key info merge\n"); ACTION("Group %d of key %s not merged\n", group, - longText(into->name)); - return False; + longText(into->name)); + + return false; } + for (i = into->numLevels[group]; i < from->numLevels[group]; i++) + into->symsMapIndex[group][i] = -1; } + if ((resultActs == NULL) && (into->acts[group] || from->acts[group])) { resultActs = uTypedCalloc(resultWidth, union xkb_action); @@ -346,51 +438,9 @@ WSGO("Could not allocate actions for group merge\n"); ACTION("Group %d of key %s not merged\n", group, longText(into->name)); - if (resultSyms != into->syms[group] && - resultSyms != from->syms[group]) - free(resultSyms); - return False; + return false; } - } - for (i = 0; i < resultWidth; i++) - { - xkb_keysym_t fromSym, toSym; - if (from->syms[group] && (i < from->numLevels[group])) - fromSym = from->syms[group][i]; - else - fromSym = NoSymbol; - if (into->syms[group] && (i < into->numLevels[group])) - toSym = into->syms[group][i]; - else - toSym = NoSymbol; - if ((fromSym == NoSymbol) || (fromSym == toSym)) - resultSyms[i] = toSym; - else if (toSym == NoSymbol) - resultSyms[i] = fromSym; - else - { - xkb_keysym_t use, ignore; - if (clobber) - { - use = fromSym; - ignore = toSym; - } - else - { - use = toSym; - ignore = fromSym; - } - if (report) - { - WARN - ("Multiple symbols for level %d/group %d on key %s\n", - i + 1, group + 1, longText(into->name)); - ACTION("Using %s, ignoring %s\n", - XkbcKeysymText(use), XkbcKeysymText(ignore)); - } - resultSyms[i] = use; - } - if (resultActs != NULL) + for (i = 0; i < resultWidth; i++) { union xkb_action *fromAct, *toAct; fromAct = (from->acts[group] ? &from->acts[group][i] : NULL); @@ -432,32 +482,117 @@ } } } - if (resultSyms != into->syms[group]) - free(into->syms[group]); - if (resultSyms != from->syms[group]) - free(from->syms[group]); + + for (i = 0; i < resultWidth; i++) + { + unsigned int fromSize = 0; + unsigned toSize = 0; + + if (from->symsMapNumEntries[group] && (i < from->numLevels[group])) + fromSize = from->symsMapNumEntries[group][i]; + if (into->symsMapNumEntries[group] && (i < into->numLevels[group])) + toSize = into->symsMapNumEntries[group][i]; + + if ((fromSize != 0 && toSize == 0) || clobber) + resultSize += fromSize; + else + resultSize += toSize; + } + + if (resultSize == 0) + goto out; + + resultSyms = uTypedCalloc(resultSize, xkb_keysym_t); + if (!resultSyms) + { + WSGO("Could not allocate symbols for group merge\n"); + ACTION("Group %d of key %s not merged\n", group, longText(into->name)); + return false; + } + + for (i = 0; i < resultWidth; i++) + { + enum { NONE, FROM, TO } use; + unsigned int fromSize = 0; + unsigned int toSize = 0; + + if (from->symsMapNumEntries[group] && (i < from->numLevels[group])) + fromSize = from->symsMapNumEntries[group][i]; + if (into->symsMapNumEntries[group] && (i < into->numLevels[group])) + toSize = into->symsMapNumEntries[group][i]; + + if (!fromSize && !toSize) + { + into->symsMapIndex[group][i] = -1; + into->symsMapNumEntries[group][i] = 0; + continue; + } + + if ((fromSize && !toSize) || clobber) + use = FROM; + else + use = TO; + + if (toSize && fromSize && report) + { + INFO("Multiple symbols for group %d, level %d on key %s\n", + group + 1, i + 1, longText(into->name)); + ACTION("Using %s, ignoring %s\n", + (use == FROM ? "from" : "to"), + (use == FROM ? "to" : "from")); + } + + if (use == FROM) + { + memcpy(&resultSyms[cur_idx], + &from->syms[group][from->symsMapIndex[group][i]], + from->symsMapNumEntries[group][i] * sizeof(xkb_keysym_t)); + into->symsMapIndex[group][i] = cur_idx; + into->symsMapNumEntries[group][i] = + from->symsMapNumEntries[group][i]; + } + else + { + memcpy(&resultSyms[cur_idx], + &into->syms[group][from->symsMapIndex[group][i]], + into->symsMapNumEntries[group][i] * sizeof(xkb_keysym_t)); + into->symsMapIndex[group][i] = cur_idx; + } + cur_idx += into->symsMapNumEntries[group][i]; + } + +out: if (resultActs != into->acts[group]) free(into->acts[group]); if (resultActs != from->acts[group]) free(from->acts[group]); into->numLevels[group] = resultWidth; + free(into->syms[group]); into->syms[group] = resultSyms; + free(from->syms[group]); from->syms[group] = NULL; + from->sizeSyms[group] = 0; + into->sizeSyms[group] = resultSize; + free(from->symsMapIndex[group]); + from->symsMapIndex[group] = NULL; + free(from->symsMapNumEntries[group]); + from->symsMapNumEntries[group] = NULL; into->acts[group] = resultActs; from->acts[group] = NULL; into->symsDefined |= (1 << group); from->symsDefined &= ~(1 << group); into->actsDefined |= (1 << group); from->actsDefined &= ~(1 << group); - return True; + + return true; } -static Bool +static bool MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from) { int i; unsigned collide = 0; - Bool report; + bool report; if (from->defs.merge == MergeReplace) { @@ -471,7 +606,7 @@ } *into = *from; memset(from, 0, sizeof(KeyInfo)); - return True; + return true; } report = ((warningLevel > 9) || ((into->defs.fileID == from->defs.fileID) @@ -484,9 +619,15 @@ { into->numLevels[i] = from->numLevels[i]; into->syms[i] = from->syms[i]; + into->sizeSyms[i] = from->sizeSyms[i]; + into->symsMapIndex[i] = from->symsMapIndex[i]; + into->symsMapNumEntries[i] = from->symsMapNumEntries[i]; into->acts[i] = from->acts[i]; into->symsDefined |= (1 << i); from->syms[i] = NULL; + from->sizeSyms[i] = 0; + from->symsMapIndex[i] = NULL; + from->symsMapNumEntries[i] = NULL; from->acts[i] = NULL; from->numLevels[i] = 0; from->symsDefined &= ~(1 << i); @@ -507,9 +648,9 @@ MergeKeyGroups(info, into, from, (unsigned) i); } } - if (from->types[i] != None) + if (from->types[i] != XKB_ATOM_NONE) { - if ((into->types[i] != None) && (report) && + if ((into->types[i] != XKB_ATOM_NONE) && report && (into->types[i] != from->types[i])) { xkb_atom_t use, ignore; @@ -532,7 +673,7 @@ XkbcAtomText(ignore)); } if ((from->defs.merge != MergeAugment) - || (into->types[i] == None)) + || (into->types[i] == XKB_ATOM_NONE)) { into->types[i] = from->types[i]; } @@ -570,13 +711,13 @@ ACTION("Using %s definition for conflicting fields\n", (from->defs.merge == MergeAugment ? "first" : "last")); } - return True; + return true; } -static Bool -AddKeySymbols(SymbolsInfo * info, KeyInfo * key, struct xkb_desc * xkb) +static bool +AddKeySymbols(SymbolsInfo * info, KeyInfo * key, struct xkb_keymap * xkb) { - int i; + unsigned int i; unsigned long real_name; for (i = 0; i < info->nKeys; i++) @@ -601,17 +742,17 @@ { WSGO("Could not allocate key symbols descriptions\n"); ACTION("Some key symbols definitions may be lost\n"); - return False; + return false; } } - return CopyKeyInfo(key, &info->keys[info->nKeys++], True); + return CopyKeyInfo(key, &info->keys[info->nKeys++], true); } -static Bool +static bool AddModMapEntry(SymbolsInfo * info, ModMapEntry * new) { ModMapEntry *mm; - Bool clobber; + bool clobber; clobber = (new->defs.merge != MergeAugment); for (mm = info->modMap; mm != NULL; mm = (ModMapEntry *) mm->defs.next) @@ -640,7 +781,7 @@ XkbcModIndexText(ignore)); mm->modifier = use; } - return True; + return true; } if ((!new->haveSymbol) && (!mm->haveSymbol) && (new->u.keyName == mm->u.keyName)) @@ -665,7 +806,7 @@ XkbcModIndexText(ignore)); mm->modifier = use; } - return True; + return true; } } mm = uTypedAlloc(ModMapEntry); @@ -674,21 +815,21 @@ WSGO("Could not allocate modifier map entry\n"); ACTION("Modifier map for %s will be incomplete\n", XkbcModIndexText(new->modifier)); - return False; + return false; } *mm = *new; mm->defs.next = &info->modMap->defs; info->modMap = mm; - return True; + return true; } /***====================================================================***/ static void MergeIncludedSymbols(SymbolsInfo * into, SymbolsInfo * from, - unsigned merge, struct xkb_desc * xkb) + unsigned merge, struct xkb_keymap * xkb) { - int i; + unsigned int i; KeyInfo *key; if (from->errorCount > 0) @@ -703,9 +844,10 @@ } for (i = 0; i < XkbNumKbdGroups; i++) { - if (from->groupNames[i] != None) + if (from->groupNames[i] != XKB_ATOM_NONE) { - if ((merge != MergeAugment) || (into->groupNames[i] == None)) + if ((merge != MergeAugment) || + (into->groupNames[i] == XKB_ATOM_NONE)) into->groupNames[i] = from->groupNames[i]; } } @@ -734,29 +876,27 @@ into->errorCount++; } -typedef void (*FileHandler) (XkbFile * /* rtrn */ , - struct xkb_desc * /* xkb */ , - unsigned /* merge */ , - SymbolsInfo * /* included */ - ); +typedef void (*FileHandler) (XkbFile *rtrn, struct xkb_keymap *xkb, + unsigned merge, SymbolsInfo *included); -static Bool +static bool HandleIncludeSymbols(IncludeStmt * stmt, - struct xkb_desc * xkb, SymbolsInfo * info, FileHandler hndlr) + struct xkb_keymap * xkb, SymbolsInfo * info, FileHandler hndlr) { unsigned newMerge; XkbFile *rtrn; SymbolsInfo included; - Bool haveSelf; + bool haveSelf; - haveSelf = False; + haveSelf = false; if ((stmt->file == NULL) && (stmt->map == NULL)) { - haveSelf = True; + haveSelf = true; included = *info; memset(info, 0, sizeof(SymbolsInfo)); } - else if (ProcessIncludeFile(stmt, XkmSymbolsIndex, &rtrn, &newMerge)) + else if (ProcessIncludeFile(xkb->context, stmt, XkmSymbolsIndex, &rtrn, + &newMerge)) { InitSymbolsInfo(&included, xkb); included.fileID = included.dflt.defs.fileID = rtrn->id; @@ -781,7 +921,7 @@ else { info->errorCount += 10; - return False; + return false; } if ((stmt->next != NULL) && (included.errorCount < 1)) { @@ -793,11 +933,12 @@ { if ((next->file == NULL) && (next->map == NULL)) { - haveSelf = True; + haveSelf = true; MergeIncludedSymbols(&included, info, next->merge, xkb); FreeSymbolsInfo(info); } - else if (ProcessIncludeFile(next, XkmSymbolsIndex, &rtrn, &op)) + else if (ProcessIncludeFile(xkb->context, next, XkmSymbolsIndex, + &rtrn, &op)) { InitSymbolsInfo(&next_incl, xkb); next_incl.fileID = next_incl.dflt.defs.fileID = rtrn->id; @@ -818,10 +959,15 @@ else { info->errorCount += 10; - return False; + FreeSymbolsInfo(&included); + return false; } } } + else if (stmt->next) + { + info->errorCount += included.errorCount; + } if (haveSelf) *info = included; else @@ -835,7 +981,7 @@ #define SYMBOLS 1 #define ACTIONS 2 -static Bool +static bool GetGroupIndex(KeyInfo * key, ExprDef * arrayNdx, unsigned what, unsigned *ndx_rtrn) { @@ -861,112 +1007,121 @@ if ((defined & (1 << i)) == 0) { *ndx_rtrn = i; - return True; + return true; } } ERROR("Too many groups of %s for key %s (max %d)\n", name, longText(key->name), XkbNumKbdGroups + 1); ACTION("Ignoring %s defined for extra groups\n", name); - return False; + return false; } if (!ExprResolveGroup(arrayNdx, &tmp)) { ERROR("Illegal group index for %s of key %s\n", name, longText(key->name)); ACTION("Definition with non-integer array index ignored\n"); - return False; + return false; } *ndx_rtrn = tmp.uval - 1; - return True; + return true; } -static Bool +static bool AddSymbolsToKey(KeyInfo * key, - struct xkb_desc * xkb, - char *field, + struct xkb_keymap * xkb, ExprDef * arrayNdx, ExprDef * value, SymbolsInfo * info) { - unsigned ndx, nSyms; - int i; + unsigned ndx, nSyms, nLevels; + unsigned int i; + long j; if (!GetGroupIndex(key, arrayNdx, SYMBOLS, &ndx)) - return False; + return false; if (value == NULL) { key->symsDefined |= (1 << ndx); - return True; + return true; } if (value->op != ExprKeysymList) { ERROR("Expected a list of symbols, found %s\n", exprOpText(value->op)); ACTION("Ignoring symbols for group %d of %s\n", ndx + 1, longText(key->name)); - return False; + return false; } - if (key->syms[ndx] != NULL) + if (key->sizeSyms[ndx] != 0) { ERROR("Symbols for key %s, group %d already defined\n", longText(key->name), ndx + 1); ACTION("Ignoring duplicate definition\n"); - return False; + return false; } nSyms = value->value.list.nSyms; + nLevels = value->value.list.nLevels; if (((key->numLevels[ndx] < nSyms) || (key->syms[ndx] == NULL)) && - (!ResizeKeyGroup(key, ndx, nSyms, False))) + (!ResizeKeyGroup(key, ndx, nLevels, nSyms, false))) { WSGO("Could not resize group %d of key %s to contain %d levels\n", ndx + 1, longText(key->name), nSyms); ACTION("Symbols lost\n"); - return False; + return false; } key->symsDefined |= (1 << ndx); - for (i = 0; i < nSyms; i++) { - if (!LookupKeysym(value->value.list.syms[i], &key->syms[ndx][i])) { - WARN("Could not resolve keysym %s for key %s, group %d (%s), level %d\n", - value->value.list.syms[i], longText(key->name), ndx + 1, - XkbcAtomText(info->groupNames[ndx]), nSyms); - key->syms[ndx][i] = NoSymbol; + for (i = 0; i < nLevels; i++) { + key->symsMapIndex[ndx][i] = value->value.list.symsMapIndex[i]; + key->symsMapNumEntries[ndx][i] = value->value.list.symsNumEntries[i]; + for (j = 0; j < key->symsMapNumEntries[ndx][i]; j++) { + if (key->symsMapIndex[ndx][i] + j >= nSyms) + abort(); + if (!LookupKeysym(value->value.list.syms[value->value.list.symsMapIndex[i] + j], + &key->syms[ndx][key->symsMapIndex[ndx][i] + j])) { + WARN("Could not resolve keysym %s for key %s, group %d (%s), level %d\n", + value->value.list.syms[i], longText(key->name), ndx + 1, + XkbcAtomText(info->groupNames[ndx]), nSyms); + while (--j >= 0) + key->syms[ndx][key->symsMapIndex[ndx][i] + j] = NoSymbol; + key->symsMapIndex[ndx][i] = -1; + key->symsMapNumEntries[ndx][i] = 0; + break; + } } } - for (i = key->numLevels[ndx] - 1; - (i >= 0) && (key->syms[ndx][i] == NoSymbol); i--) - { + for (j = key->numLevels[ndx] - 1; + j >= 0 && key->symsMapNumEntries[ndx][j] == 0; j--) key->numLevels[ndx]--; - } - return True; + return true; } -static Bool +static bool AddActionsToKey(KeyInfo * key, - struct xkb_desc * xkb, - char *field, + struct xkb_keymap * xkb, ExprDef * arrayNdx, ExprDef * value, SymbolsInfo * info) { - int i; + unsigned int i; unsigned ndx, nActs; ExprDef *act; struct xkb_any_action *toAct; if (!GetGroupIndex(key, arrayNdx, ACTIONS, &ndx)) - return False; + return false; if (value == NULL) { key->actsDefined |= (1 << ndx); - return True; + return true; } if (value->op != ExprActionList) { WSGO("Bad expression type (%d) for action list value\n", value->op); ACTION("Ignoring actions for group %d of %s\n", ndx, longText(key->name)); - return False; + return false; } if (key->acts[ndx] != NULL) { WSGO("Actions for key %s, group %d already defined\n", longText(key->name), ndx); - return False; + return false; } for (nActs = 0, act = value->value.child; act != NULL; nActs++) { @@ -975,15 +1130,15 @@ if (nActs < 1) { WSGO("Action list but not actions in AddActionsToKey\n"); - return False; + return false; } if (((key->numLevels[ndx] < nActs) || (key->acts[ndx] == NULL)) && - (!ResizeKeyGroup(key, ndx, nActs, True))) + (!ResizeKeyGroup(key, ndx, nActs, nActs, true))) { WSGO("Could not resize group %d of key %s\n", ndx, longText(key->name)); ACTION("Actions lost\n"); - return False; + return false; } key->actsDefined |= (1 << ndx); @@ -991,7 +1146,7 @@ act = value->value.child; for (i = 0; i < nActs; i++, toAct++) { - if (!HandleActionDef(act, xkb, toAct, MergeOverride, info->action)) + if (!HandleActionDef(act, xkb, toAct, info->action)) { ERROR("Illegal action definition for %s\n", longText(key->name)); @@ -999,7 +1154,7 @@ } act = (ExprDef *) act->common.next; } - return True; + return true; } static const LookupEntry lockingEntries[] = { @@ -1024,16 +1179,16 @@ {NULL, 0} }; -static Bool +static bool SetSymbolsField(KeyInfo * key, - struct xkb_desc * xkb, + struct xkb_keymap * xkb, char *field, ExprDef * arrayNdx, ExprDef * value, SymbolsInfo * info) { - Bool ok = True; + bool ok = true; ExprResult tmp; - if (uStrCaseCmp(field, "type") == 0) + if (strcasecmp(field, "type") == 0) { ExprResult ndx; if ((!ExprResolveString(value, &tmp)) @@ -1053,7 +1208,7 @@ longText(key->name)); ACTION("Definition with non-integer array index ignored\n"); free(tmp.str); - return False; + return false; } else { @@ -1062,13 +1217,13 @@ } free(tmp.str); } - else if (uStrCaseCmp(field, "symbols") == 0) - return AddSymbolsToKey(key, xkb, field, arrayNdx, value, info); - else if (uStrCaseCmp(field, "actions") == 0) - return AddActionsToKey(key, xkb, field, arrayNdx, value, info); - else if ((uStrCaseCmp(field, "vmods") == 0) || - (uStrCaseCmp(field, "virtualmods") == 0) || - (uStrCaseCmp(field, "virtualmodifiers") == 0)) + else if (strcasecmp(field, "symbols") == 0) + return AddSymbolsToKey(key, xkb, arrayNdx, value, info); + else if (strcasecmp(field, "actions") == 0) + return AddActionsToKey(key, xkb, arrayNdx, value, info); + else if ((strcasecmp(field, "vmods") == 0) || + (strcasecmp(field, "virtualmods") == 0) || + (strcasecmp(field, "virtualmodifiers") == 0)) { ok = ExprResolveVModMask(value, &tmp, xkb); if (ok) @@ -1084,22 +1239,22 @@ longText(key->name)); } } - else if ((uStrCaseCmp(field, "locking") == 0) - || (uStrCaseCmp(field, "lock") == 0) - || (uStrCaseCmp(field, "locks") == 0)) + else if ((strcasecmp(field, "locking") == 0) || + (strcasecmp(field, "lock") == 0) || + (strcasecmp(field, "locks") == 0)) { ok = ExprResolveEnum(value, &tmp, lockingEntries); if (ok) key->behavior.type = tmp.uval; key->defs.defined |= _Key_Behavior; } - else if ((uStrCaseCmp(field, "radiogroup") == 0) || - (uStrCaseCmp(field, "permanentradiogroup") == 0) || - (uStrCaseEqual(field, "allownone"))) + else if ((strcasecmp(field, "radiogroup") == 0) || + (strcasecmp(field, "permanentradiogroup") == 0) || + (strcasecmp(field, "allownone") == 0)) { ERROR("Radio groups not supported\n"); ACTION("Ignoring radio group specification for key %s\n", longText(key->name)); - return False; + return false; } else if (uStrCasePrefix("overlay", field) || uStrCasePrefix("permanentoverlay", field)) @@ -1107,9 +1262,9 @@ ERROR("Overlays not supported\n"); ACTION("Ignoring overlay specification for key %s\n", longText(key->name)); } - else if ((uStrCaseCmp(field, "repeating") == 0) || - (uStrCaseCmp(field, "repeats") == 0) || - (uStrCaseCmp(field, "repeat") == 0)) + else if ((strcasecmp(field, "repeating") == 0) || + (strcasecmp(field, "repeats") == 0) || + (strcasecmp(field, "repeat") == 0)) { ok = ExprResolveEnum(value, &tmp, repeatEntries); if (!ok) @@ -1117,13 +1272,13 @@ ERROR("Illegal repeat setting for %s\n", longText(key->name)); ACTION("Non-boolean repeat setting ignored\n"); - return False; + return false; } key->repeat = tmp.uval; key->defs.defined |= _Key_Repeat; } - else if ((uStrCaseCmp(field, "groupswrap") == 0) || - (uStrCaseCmp(field, "wrapgroups") == 0)) + else if ((strcasecmp(field, "groupswrap") == 0) || + (strcasecmp(field, "wrapgroups") == 0)) { ok = ExprResolveBoolean(value, &tmp); if (!ok) @@ -1131,7 +1286,7 @@ ERROR("Illegal groupsWrap setting for %s\n", longText(key->name)); ACTION("Non-boolean value ignored\n"); - return False; + return false; } if (tmp.uval) key->groupInfo = XkbWrapIntoRange; @@ -1139,8 +1294,8 @@ key->groupInfo = XkbClampIntoRange; key->defs.defined |= _Key_GroupInfo; } - else if ((uStrCaseCmp(field, "groupsclamp") == 0) || - (uStrCaseCmp(field, "clampgroups") == 0)) + else if ((strcasecmp(field, "groupsclamp") == 0) || + (strcasecmp(field, "clampgroups") == 0)) { ok = ExprResolveBoolean(value, &tmp); if (!ok) @@ -1148,7 +1303,7 @@ ERROR("Illegal groupsClamp setting for %s\n", longText(key->name)); ACTION("Non-boolean value ignored\n"); - return False; + return false; } if (tmp.uval) key->groupInfo = XkbClampIntoRange; @@ -1156,15 +1311,15 @@ key->groupInfo = XkbWrapIntoRange; key->defs.defined |= _Key_GroupInfo; } - else if ((uStrCaseCmp(field, "groupsredirect") == 0) || - (uStrCaseCmp(field, "redirectgroups") == 0)) + else if ((strcasecmp(field, "groupsredirect") == 0) || + (strcasecmp(field, "redirectgroups") == 0)) { if (!ExprResolveGroup(value, &tmp)) { ERROR("Illegal group index for redirect of key %s\n", longText(key->name)); ACTION("Definition with non-integer group ignored\n"); - return False; + return false; } key->groupInfo = XkbSetGroupInfo(0, XkbRedirectIntoRange, tmp.uval - 1); @@ -1174,7 +1329,7 @@ { ERROR("Unknown field %s in a symbol interpretation\n", field); ACTION("Definition ignored\n"); - ok = False; + ok = false; } return ok; } @@ -1188,104 +1343,104 @@ { WARN("You must specify an index when specifying a group name\n"); ACTION("Group name definition without array subscript ignored\n"); - return False; + return false; } if (!ExprResolveGroup(arrayNdx, &tmp)) { ERROR("Illegal index in group name definition\n"); ACTION("Definition with non-integer array index ignored\n"); - return False; + return false; } if (!ExprResolveString(value, &name)) { ERROR("Group name must be a string\n"); ACTION("Illegal name for group %d ignored\n", tmp.uval); - return False; + return false; } info->groupNames[tmp.uval - 1 + info->explicit_group] = xkb_intern_atom(name.str); free(name.str); - return True; + return true; } static int -HandleSymbolsVar(VarDef * stmt, struct xkb_desc * xkb, SymbolsInfo * info) +HandleSymbolsVar(VarDef * stmt, struct xkb_keymap * xkb, SymbolsInfo * info) { ExprResult elem, field, tmp; ExprDef *arrayNdx; - Bool ret; + bool ret; if (ExprResolveLhs(stmt->name, &elem, &field, &arrayNdx) == 0) return 0; /* internal error, already reported */ - if (elem.str && (uStrCaseCmp(elem.str, "key") == 0)) + if (elem.str && (strcasecmp(elem.str, "key") == 0)) { ret = SetSymbolsField(&info->dflt, xkb, field.str, arrayNdx, stmt->value, info); } - else if ((elem.str == NULL) && ((uStrCaseCmp(field.str, "name") == 0) || - (uStrCaseCmp(field.str, "groupname") == + else if ((elem.str == NULL) && ((strcasecmp(field.str, "name") == 0) || + (strcasecmp(field.str, "groupname") == 0))) { ret = SetGroupName(info, arrayNdx, stmt->value); } else if ((elem.str == NULL) - && ((uStrCaseCmp(field.str, "groupswrap") == 0) - || (uStrCaseCmp(field.str, "wrapgroups") == 0))) + && ((strcasecmp(field.str, "groupswrap") == 0) || + (strcasecmp(field.str, "wrapgroups") == 0))) { if (!ExprResolveBoolean(stmt->value, &tmp)) { ERROR("Illegal setting for global groupsWrap\n"); ACTION("Non-boolean value ignored\n"); - ret = False; + ret = false; } else { if (tmp.uval) info->groupInfo = XkbWrapIntoRange; else info->groupInfo = XkbClampIntoRange; - ret = True; + ret = true; } } else if ((elem.str == NULL) - && ((uStrCaseCmp(field.str, "groupsclamp") == 0) - || (uStrCaseCmp(field.str, "clampgroups") == 0))) + && ((strcasecmp(field.str, "groupsclamp") == 0) || + (strcasecmp(field.str, "clampgroups") == 0))) { if (!ExprResolveBoolean(stmt->value, &tmp)) { ERROR("Illegal setting for global groupsClamp\n"); ACTION("Non-boolean value ignored\n"); - return False; + return false; } else { if (tmp.uval) info->groupInfo = XkbClampIntoRange; else info->groupInfo = XkbWrapIntoRange; - ret = True; + ret = true; } } else if ((elem.str == NULL) - && ((uStrCaseCmp(field.str, "groupsredirect") == 0) - || (uStrCaseCmp(field.str, "redirectgroups") == 0))) + && ((strcasecmp(field.str, "groupsredirect") == 0) || + (strcasecmp(field.str, "redirectgroups") == 0))) { if (!ExprResolveGroup(stmt->value, &tmp)) { ERROR("Illegal group index for global groupsRedirect\n"); ACTION("Definition with non-integer group ignored\n"); - ret = False; + ret = false; } else { info->groupInfo = XkbSetGroupInfo(0, XkbRedirectIntoRange, tmp.uval); - ret = True; + ret = true; } } - else if ((elem.str == NULL) && (uStrCaseCmp(field.str, "allownone") == 0)) + else if ((elem.str == NULL) && (strcasecmp(field.str, "allownone") == 0)) { ERROR("Radio groups not supported\n"); ACTION("Ignoring \"allow none\" specification\n"); - ret = False; + ret = false; } else { ret = SetActionField(xkb, elem.str, field.str, arrayNdx, stmt->value, @@ -1297,11 +1452,11 @@ return ret; } -static Bool +static bool HandleSymbolsBody(VarDef * def, - struct xkb_desc * xkb, KeyInfo * key, SymbolsInfo * info) + struct xkb_keymap * xkb, KeyInfo * key, SymbolsInfo * info) { - Bool ok = True; + bool ok = true; ExprResult tmp, field; ExprDef *arrayNdx; @@ -1336,13 +1491,13 @@ return ok; } -static Bool +static bool SetExplicitGroup(SymbolsInfo * info, KeyInfo * key) { unsigned group = info->explicit_group; if (group == 0) - return True; + return true; if ((key->typesDefined | key->symsDefined | key->actsDefined) & ~1) { @@ -1367,71 +1522,77 @@ key->numLevels[0] = 0; key->syms[group] = key->syms[0]; key->syms[0] = NULL; + key->sizeSyms[group] = key->sizeSyms[0]; + key->sizeSyms[0] = 0; + key->symsMapIndex[group] = key->symsMapIndex[0]; + key->symsMapIndex[0] = NULL; + key->symsMapNumEntries[group] = key->symsMapNumEntries[0]; + key->symsMapNumEntries[0] = NULL; key->acts[group] = key->acts[0]; key->acts[0] = NULL; key->types[group] = key->types[0]; key->types[0] = 0; - return True; + return true; } static int HandleSymbolsDef(SymbolsDef * stmt, - struct xkb_desc * xkb, unsigned merge, SymbolsInfo * info) + struct xkb_keymap *xkb, SymbolsInfo *info) { KeyInfo key; InitKeyInfo(&key); - CopyKeyInfo(&info->dflt, &key, False); + CopyKeyInfo(&info->dflt, &key, false); key.defs.merge = stmt->merge; key.name = KeyNameToLong(stmt->keyName); if (!HandleSymbolsBody((VarDef *) stmt->symbols, xkb, &key, info)) { info->errorCount++; - return False; + return false; } if (!SetExplicitGroup(info, &key)) { info->errorCount++; - return False; + return false; } if (!AddKeySymbols(info, &key, xkb)) { info->errorCount++; - return False; + return false; } - return True; + return true; } -static Bool +static bool HandleModMapDef(ModMapDef * def, - struct xkb_desc * xkb, unsigned merge, SymbolsInfo * info) + struct xkb_keymap * xkb, SymbolsInfo * info) { ExprDef *key; ModMapEntry tmp; ExprResult rtrn; - Bool ok; + bool ok; if (!LookupModIndex(NULL, def->modifier, TypeInt, &rtrn)) { ERROR("Illegal modifier map definition\n"); ACTION("Ignoring map for non-modifier \"%s\"\n", XkbcAtomText(def->modifier)); - return False; + return false; } - ok = True; + ok = true; tmp.modifier = rtrn.uval; for (key = def->keys; key != NULL; key = (ExprDef *) key->common.next) { if ((key->op == ExprValue) && (key->type == TypeKeyName)) { - tmp.haveSymbol = False; + tmp.haveSymbol = false; tmp.u.keyName = KeyNameToLong(key->value.keyName); } else if (ExprResolveKeySym(key, &rtrn)) { - tmp.haveSymbol = True; + tmp.haveSymbol = true; tmp.u.keySym = rtrn.uval; } else @@ -1449,12 +1610,12 @@ static void HandleSymbolsFile(XkbFile * file, - struct xkb_desc * xkb, unsigned merge, SymbolsInfo * info) + struct xkb_keymap * xkb, unsigned merge, SymbolsInfo * info) { ParseCommon *stmt; free(info->name); - info->name = _XkbDupString(file->name); + info->name = uDupString(file->name); stmt = file->defs; while (stmt) { @@ -1466,7 +1627,7 @@ info->errorCount++; break; case StmtSymbolsDef: - if (!HandleSymbolsDef((SymbolsDef *) stmt, xkb, merge, info)) + if (!HandleSymbolsDef((SymbolsDef *) stmt, xkb, info)) info->errorCount++; break; case StmtVarDef: @@ -1488,7 +1649,7 @@ info->errorCount++; break; case StmtModMapDef: - if (!HandleModMapDef((ModMapDef *) stmt, xkb, merge, info)) + if (!HandleModMapDef((ModMapDef *) stmt, xkb, info)) info->errorCount++; break; default: @@ -1508,32 +1669,28 @@ } } -static Bool -FindKeyForSymbol(struct xkb_desc * xkb, xkb_keysym_t sym, xkb_keycode_t *kc_rtrn) +static bool +FindKeyForSymbol(struct xkb_keymap * xkb, xkb_keysym_t sym, xkb_keycode_t *kc_rtrn) { - int i, j; - Bool gotOne; + xkb_keycode_t key; + unsigned int group, level; - j = 0; - do + for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) { - gotOne = False; - for (i = xkb->min_key_code; i <= (int) xkb->max_key_code; i++) + for (group = 0; group < XkbKeyNumGroups(xkb, key); group++) { - if (j < (int) XkbKeyNumSyms(xkb, i)) + for (level = 0; level < XkbKeyGroupWidth(xkb, key, group); level++) { - gotOne = True; - if (XkbKeySym(xkb, i, j) == sym) - { - *kc_rtrn = i; - return True; - } + if (XkbKeyNumSyms(xkb, key, group, level) != 1 || + (XkbKeySymEntry(xkb, key, group, level))[0] != sym) + continue; + *kc_rtrn = key; + return true; } } - j++; } - while (gotOne); - return False; + + return false; } /** @@ -1542,10 +1699,10 @@ * @param atom The atom to search for. * @param type_rtrn Set to the index of the name if found. * - * @return True if found, False otherwise. + * @return true if found, false otherwise. */ -static Bool -FindNamedType(struct xkb_desc * xkb, xkb_atom_t atom, unsigned *type_rtrn) +static bool +FindNamedType(struct xkb_keymap * xkb, xkb_atom_t atom, unsigned *type_rtrn) { unsigned n; const char *name = XkbcAtomText(atom); @@ -1557,11 +1714,11 @@ if (strcmp(xkb->map->types[n].name, name) == 0) { *type_rtrn = n; - return True; + return true; } } } - return False; + return false; } /** @@ -1578,17 +1735,17 @@ * @param syms The keysyms for the given key (must be size width). * @param typeNameRtrn Set to the Atom of the type name. * - * @returns True if a type could be found, False otherwise. + * @returns true if a type could be found, false otherwise. */ -static Bool +static bool FindAutomaticType(int width, xkb_keysym_t * syms, xkb_atom_t * typeNameRtrn, - Bool * autoType) + bool * autoType) { - *autoType = False; + *autoType = false; if ((width == 1) || (width == 0)) { *typeNameRtrn = xkb_intern_atom("ONE_LEVEL"); - *autoType = True; + *autoType = true; } else if (width == 2) { @@ -1599,12 +1756,12 @@ else if (syms && (XkbKSIsKeypad(syms[0]) || XkbKSIsKeypad(syms[1]))) { *typeNameRtrn = xkb_intern_atom("KEYPAD"); - *autoType = True; + *autoType = true; } else { *typeNameRtrn = xkb_intern_atom("TWO_LEVEL"); - *autoType = True; + *autoType = true; } } else if (width <= 4) @@ -1633,7 +1790,7 @@ PrepareKeyDef(KeyInfo * key) { int i, j, width, defined, lastGroup; - Bool identical; + bool identical; defined = key->symsDefined | key->actsDefined | key->typesDefined; /* get highest group number */ @@ -1672,12 +1829,34 @@ width * sizeof(union xkb_action)); key->actsDefined |= 1 << i; } - if ((key->symsDefined & 1) && key->syms[0]) + if ((key->symsDefined & 1) && key->sizeSyms[0]) { - key->syms[i] = uTypedCalloc(width, xkb_keysym_t); + key->syms[i] = uTypedCalloc(key->sizeSyms[0], xkb_keysym_t); if (key->syms[i] == NULL) continue; - memcpy(key->syms[i], key->syms[0], width * sizeof(xkb_keysym_t)); + memcpy(key->syms[i], key->syms[0], + key->sizeSyms[0] * sizeof(xkb_keysym_t)); + key->symsMapIndex[i] = uTypedCalloc(width, int); + if (!key->symsMapIndex[i]) + { + free(key->syms[i]); + key->syms[i] = NULL; + continue; + } + memcpy(key->symsMapIndex[i], key->symsMapIndex[0], + width * sizeof(int)); + key->symsMapNumEntries[i] = uTypedCalloc(width, unsigned int); + if (!key->symsMapNumEntries[i]) + { + free(key->syms[i]); + key->syms[i] = NULL; + free(key->symsMapIndex[i]); + key->symsMapIndex[i] = NULL; + continue; + } + memcpy(key->symsMapNumEntries[i], key->symsMapNumEntries[0], + width * sizeof(int)); + key->sizeSyms[i] = key->sizeSyms[0]; key->symsDefined |= 1 << i; } if (defined & 1) @@ -1687,29 +1866,47 @@ } /* If all groups are completely identical remove them all */ /* exept the first one. */ - identical = True; + identical = true; for (i = lastGroup; i > 0; i--) { if ((key->numLevels[i] != key->numLevels[0]) || (key->types[i] != key->types[0])) { - identical = False; + identical = false; break; } if ((key->syms[i] != key->syms[0]) && (key->syms[i] == NULL || key->syms[0] == NULL || + key->sizeSyms[i] != key->sizeSyms[0] || memcmp(key->syms[i], key->syms[0], - sizeof(xkb_keysym_t) * key->numLevels[0]))) + sizeof(xkb_keysym_t) * key->sizeSyms[0]))) { - identical = False; + identical = false; break; } + if ((key->symsMapIndex[i] != key->symsMapIndex[i]) && + (key->symsMapIndex[i] == NULL || key->symsMapIndex[0] == NULL || + memcmp(key->symsMapIndex[i], key->symsMapIndex[0], + key->numLevels[0] * sizeof(int)))) + { + identical = false; + continue; + } + if ((key->symsMapNumEntries[i] != key->symsMapNumEntries[i]) && + (key->symsMapNumEntries[i] == NULL || + key->symsMapNumEntries[0] == NULL || + memcmp(key->symsMapNumEntries[i], key->symsMapNumEntries[0], + key->numLevels[0] * sizeof(int)))) + { + identical = false; + continue; + } if ((key->acts[i] != key->acts[0]) && (key->acts[i] == NULL || key->acts[0] == NULL || memcmp(key->acts[i], key->acts[0], sizeof(union xkb_action) * key->numLevels[0]))) { - identical = False; + identical = false; break; } } @@ -1720,6 +1917,11 @@ key->numLevels[i] = 0; free(key->syms[i]); key->syms[i] = NULL; + key->sizeSyms[i] = 0; + free(key->symsMapIndex[i]); + key->symsMapIndex[i] = NULL; + free(key->symsMapNumEntries[i]); + key->symsMapNumEntries[i] = NULL; free(key->acts[i]); key->acts[i] = NULL; key->types[i] = 0; @@ -1735,17 +1937,18 @@ * * This function recurses. */ -static Bool -CopySymbolsDef(struct xkb_desc * xkb, KeyInfo *key, int start_from) +static bool +CopySymbolsDef(struct xkb_keymap * xkb, KeyInfo *key, int start_from) { - int i; + unsigned int i; xkb_keycode_t kc; + unsigned int sizeSyms = 0; unsigned width, tmp, nGroups; struct xkb_key_type * type; - Bool haveActions, autoType, useAlias; - xkb_keysym_t *outSyms; - union xkb_action *outActs; + bool haveActions, autoType, useAlias; unsigned types[XkbNumKbdGroups]; + union xkb_action *outActs; + unsigned int symIndex = 0; useAlias = (start_from == 0); @@ -1758,10 +1961,10 @@ WARN("Key %s not found in keycodes\n", longText(key->name)); ACTION("Symbols ignored\n"); } - return False; + return false; } - haveActions = False; + haveActions = false; for (i = width = nGroups = 0; i < XkbNumKbdGroups; i++) { if (((i + 1) > nGroups) @@ -1769,12 +1972,12 @@ || (key->typesDefined) & (1 << i))) nGroups = i + 1; if (key->acts[i]) - haveActions = True; - autoType = False; + haveActions = true; + autoType = false; /* Assign the type to the key, if it is missing. */ - if (key->types[i] == None) + if (key->types[i] == XKB_ATOM_NONE) { - if (key->dfltType != None) + if (key->dfltType != XKB_ATOM_NONE) key->types[i] = key->dfltType; else if (FindAutomaticType(key->numLevels[i], key->syms[i], &key->types[i], &autoType)) @@ -1808,7 +2011,7 @@ } types[i] = XkbTwoLevelIndex; } - /* if the type specifies less syms than the key has, shrink the key */ + /* if the type specifies fewer levels than the key has, shrink the key */ type = &xkb->map->types[types[i]]; if (type->num_levels < key->numLevels[i]) { @@ -1825,26 +2028,23 @@ width = key->numLevels[i]; if (type->num_levels > width) width = type->num_levels; + sizeSyms += key->sizeSyms[i]; } - /* width is now the largest width found */ - - i = width * nGroups; - outSyms = XkbcResizeKeySyms(xkb, kc, i); - if (outSyms == NULL) + if (!XkbcResizeKeySyms(xkb, kc, sizeSyms)) { WSGO("Could not enlarge symbols for %s (keycode %d)\n", longText(key->name), kc); - return False; + return false; } if (haveActions) { - outActs = XkbcResizeKeyActions(xkb, kc, i); + outActs = XkbcResizeKeyActions(xkb, kc, width * nGroups); if (outActs == NULL) { WSGO("Could not enlarge actions for %s (key %d)\n", longText(key->name), kc); - return False; + return false; } xkb->server->explicit[kc] |= XkbExplicitInterpretMask; } @@ -1857,6 +2057,9 @@ xkb->map->key_sym_map[kc].group_info = XkbSetNumGroups(i, nGroups); xkb->map->key_sym_map[kc].width = width; + xkb->map->key_sym_map[kc].sym_index = uTypedCalloc(nGroups * width, int); + xkb->map->key_sym_map[kc].num_syms = uTypedCalloc(nGroups * width, + unsigned int); for (i = 0; i < nGroups; i++) { /* assign kt_index[i] to the index of the type in map->types. @@ -1868,15 +2071,29 @@ */ if (key->numLevels[i]) xkb->map->key_sym_map[kc].kt_index[i] = types[i]; - if (key->syms[i] != NULL) + if (key->sizeSyms[i] != 0) { /* fill key to "width" symbols*/ for (tmp = 0; tmp < width; tmp++) { - if (tmp < key->numLevels[i]) - outSyms[tmp] = key->syms[i][tmp]; + if (tmp < key->numLevels[i] && key->symsMapNumEntries[i][tmp]) + { + memcpy(&xkb->map->key_sym_map[kc].syms[symIndex], + &key->syms[i][key->symsMapIndex[i][tmp]], + key->symsMapNumEntries[i][tmp] * + sizeof(xkb_keysym_t)); + xkb->map->key_sym_map[kc].sym_index[(i * width) + tmp] = + symIndex; + xkb->map->key_sym_map[kc].num_syms[(i * width) + tmp] = + key->symsMapNumEntries[i][tmp]; + symIndex += + xkb->map->key_sym_map[kc].num_syms[(i * width) + tmp]; + } else - outSyms[tmp] = NoSymbol; + { + xkb->map->key_sym_map[kc].sym_index[(i * width) + tmp] = -1; + xkb->map->key_sym_map[kc].num_syms[(i * width) + tmp] = 0; + } if ((outActs != NULL) && (key->acts[i] != NULL)) { if (tmp < key->numLevels[i]) @@ -1886,9 +2103,6 @@ } } } - outSyms += width; - if (outActs) - outActs += width; } switch (key->behavior.type & XkbKB_OpMask) { @@ -1918,18 +2132,18 @@ /* do the same thing for the next key */ CopySymbolsDef(xkb, key, kc + 1); - return True; + return true; } -static Bool -CopyModMapDef(struct xkb_desc * xkb, ModMapEntry *entry) +static bool +CopyModMapDef(struct xkb_keymap * xkb, ModMapEntry *entry) { xkb_keycode_t kc; if ((!entry->haveSymbol) && (!FindNamedKey - (xkb, entry->u.keyName, &kc, True, CreateKeyNames(xkb), 0))) + (xkb, entry->u.keyName, &kc, true, CreateKeyNames(xkb), 0))) { if (warningLevel >= 5) { @@ -1938,7 +2152,7 @@ ACTION("Modifier map entry for %s not updated\n", XkbcModIndexText(entry->modifier)); } - return False; + return false; } else if (entry->haveSymbol && (!FindKeyForSymbol(xkb, entry->u.keySym, &kc))) @@ -1950,10 +2164,10 @@ ACTION("Modifier map entry for %s not updated\n", XkbcModIndexText(entry->modifier)); } - return False; + return false; } xkb->map->modmap[kc] |= (1 << entry->modifier); - return True; + return true; } /** @@ -1963,10 +2177,10 @@ * @param xkb Handle to the keyboard description to store the symbols in. * @param merge Merge strategy (e.g. MergeOverride). */ -Bool -CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge) +bool +CompileSymbols(XkbFile *file, struct xkb_keymap * xkb, unsigned merge) { - int i; + unsigned int i; SymbolsInfo info; InitSymbolsInfo(&info, xkb); @@ -1976,7 +2190,7 @@ if (info.nKeys == 0) { FreeSymbolsInfo(&info); - return True; + return false; } if (info.errorCount == 0) @@ -1988,26 +2202,26 @@ { WSGO("Can not allocate names in CompileSymbols\n"); ACTION("Symbols not added\n"); - return False; + return false; } if (XkbcAllocClientMap(xkb, XkbKeySymsMask | XkbModifierMapMask, 0) != Success) { WSGO("Could not allocate client map in CompileSymbols\n"); ACTION("Symbols not added\n"); - return False; + return false; } if (XkbcAllocServerMap(xkb, XkbAllServerInfoMask, 32) != Success) { WSGO("Could not allocate server map in CompileSymbols\n"); ACTION("Symbols not added\n"); - return False; + return false; } - if (XkbcAllocControls(xkb, XkbPerKeyRepeatMask) != Success) + if (XkbcAllocControls(xkb) != Success) { WSGO("Could not allocate controls in CompileSymbols\n"); ACTION("Symbols not added\n"); - return False; + return false; } /* now copy info into xkb. */ @@ -2015,9 +2229,9 @@ ApplyAliases(xkb, &info.aliases); for (i = 0; i < XkbNumKbdGroups; i++) { - if (info.groupNames[i] != None) + if (info.groupNames[i] != XKB_ATOM_NONE) { - free((char *) xkb->names->groups[i]); + free(UNCONSTIFY(xkb->names->groups[i])); xkb->names->groups[i] = XkbcAtomGetString(info.groupNames[i]); } } @@ -2060,9 +2274,9 @@ } } FreeSymbolsInfo(&info); - return True; + return true; } FreeSymbolsInfo(&info); - return False; + return false; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/utils.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/utils.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/utils.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/utils.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,252 +0,0 @@ - - /*\ - * - * COPYRIGHT 1990 - * DIGITAL EQUIPMENT CORPORATION - * MAYNARD, MASSACHUSETTS - * ALL RIGHTS RESERVED. - * - * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND - * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. - * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE - * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED - * WARRANTY. - * - * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT - * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN - * ADDITION TO THAT SET FORTH ABOVE. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Digital Equipment Corporation not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - \*/ - -#include "utils.h" -#include -#include -#include - -void * -recalloc(void * old, unsigned nOld, unsigned nNew, unsigned itemSize) -{ - char *rtrn; - - if (old == NULL) - rtrn = calloc(nNew, itemSize); - else - { - rtrn = realloc(old, nNew * itemSize); - if ((rtrn) && (nNew > nOld)) - { - memset(&rtrn[nOld * itemSize], 0, (nNew - nOld) * itemSize); - } - } - return rtrn; -} - -static FILE *errorFile = NULL; -static int outCount = 0; -static char *preMsg = NULL; -static char *prefix = NULL; - -Boolean -uSetErrorFile(char *name) -{ - if ((errorFile != NULL) && (errorFile != stderr)) - { - fprintf(errorFile, "switching to %s\n", name ? name : "stderr"); - fclose(errorFile); - } - if (name != NullString) - errorFile = fopen(name, "w"); - else - errorFile = stderr; - if (errorFile == NULL) - { - errorFile = stderr; - return (False); - } - return (True); -} - -void -uInformation(const char *s, ...) -{ - va_list args; - - if (!errorFile) - errorFile = stderr; - - va_start(args, s); - vfprintf(errorFile, s, args); - va_end(args); - fflush(errorFile); -} - -/***====================================================================***/ - -void -uAction(const char *s, ...) -{ - va_list args; - - if (!errorFile) - errorFile = stderr; - - if (prefix != NULL) - fprintf(errorFile, "%s", prefix); - fprintf(errorFile, " "); - va_start(args, s); - vfprintf(errorFile, s, args); - va_end(args); - fflush(errorFile); -} - -/***====================================================================***/ - -void -uWarning(const char *s, ...) -{ - va_list args; - - if (!errorFile) - errorFile = stderr; - - if ((outCount == 0) && (preMsg != NULL)) - fprintf(errorFile, "%s\n", preMsg); - if (prefix != NULL) - fprintf(errorFile, "%s", prefix); - fprintf(errorFile, "Warning: "); - va_start(args, s); - vfprintf(errorFile, s, args); - va_end(args); - fflush(errorFile); - outCount++; -} - -/***====================================================================***/ - -void -uError(const char *s, ...) -{ - va_list args; - - if (!errorFile) - errorFile = stderr; - - if ((outCount == 0) && (preMsg != NULL)) - fprintf(errorFile, "%s\n", preMsg); - if (prefix != NULL) - fprintf(errorFile, "%s", prefix); - fprintf(errorFile, "Error: "); - va_start(args, s); - vfprintf(errorFile, s, args); - va_end(args); - fflush(errorFile); - outCount++; -} - -/***====================================================================***/ - -void -uFatalError(const char *s, ...) -{ - va_list args; - - if (!errorFile) - errorFile = stderr; - - if ((outCount == 0) && (preMsg != NULL)) - fprintf(errorFile, "%s\n", preMsg); - if (prefix != NULL) - fprintf(errorFile, "%s", prefix); - fprintf(errorFile, "Fatal Error: "); - va_start(args, s); - vfprintf(errorFile, s, args); - va_end(args); - fprintf(errorFile, " Exiting\n"); - fflush(errorFile); - outCount++; - exit(1); - /* NOTREACHED */ -} - -/***====================================================================***/ - -void -uInternalError(const char *s, ...) -{ - va_list args; - - if (!errorFile) - errorFile = stderr; - - if ((outCount == 0) && (preMsg != NULL)) - fprintf(errorFile, "%s\n", preMsg); - if (prefix != NULL) - fprintf(errorFile, "%s", prefix); - fprintf(errorFile, "Internal error: "); - va_start(args, s); - vfprintf(errorFile, s, args); - va_end(args); - fflush(errorFile); - outCount++; -} - -/***====================================================================***/ - -#ifndef HAVE_STRCASECMP -int -uStrCaseCmp(const char *str1, const char *str2) -{ - char buf1[512], buf2[512]; - char c, *s; - int n; - - for (n = 0, s = buf1; (c = *str1++); n++) - { - if (isupper(c)) - c = tolower(c); - if (n > 510) - break; - *s++ = c; - } - *s = '\0'; - for (n = 0, s = buf2; (c = *str2++); n++) - { - if (isupper(c)) - c = tolower(c); - if (n > 510) - break; - *s++ = c; - } - *s = '\0'; - return (strcmp(buf1, buf2)); -} - -int -uStrCasePrefix(const char *my_prefix, char *str) -{ - char c1; - char c2; - while (((c1 = *my_prefix) != '\0') && ((c2 = *str) != '\0')) - { - if (isupper(c1)) - c1 = tolower(c1); - if (isupper(c2)) - c2 = tolower(c2); - if (c1 != c2) - return 0; - my_prefix++; - str++; - } - if (c1 != '\0') - return 0; - return 1; -} - -#endif diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/utils.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/utils.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/utils.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/utils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -#ifndef UTILS_H -#define UTILS_H 1 - - /*\ - * - * COPYRIGHT 1990 - * DIGITAL EQUIPMENT CORPORATION - * MAYNARD, MASSACHUSETTS - * ALL RIGHTS RESERVED. - * - * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND - * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. - * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE - * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED - * WARRANTY. - * - * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT - * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN - * ADDITION TO THAT SET FORTH ABOVE. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Digital Equipment Corporation not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - \*/ - -/***====================================================================***/ - -#include -#include -#include -#include - -#include -#include "config.h" - -#ifndef NUL -#define NUL '\0' -#endif - -/***====================================================================***/ - -#ifndef BOOLEAN_DEFINED -typedef char Boolean; -#endif - -#ifndef True -#define True ((Boolean)1) -#define False ((Boolean)0) -#endif /* ndef True */ -#define booleanText(b) ((b)?"True":"False") - -#ifndef COMPARISON_DEFINED -typedef int Comparison; - -#define Greater ((Comparison)1) -#define Equal ((Comparison)0) -#define Less ((Comparison)-1) -#define CannotCompare ((Comparison)-37) -#define comparisonText(c) ((c)?((c)<0?"Less":"Greater"):"Equal") -#endif - -/***====================================================================***/ - -extern void * -recalloc(void * old, unsigned nOld, unsigned nNew, unsigned newSize); - -#define uTypedAlloc(t) ((t *)malloc((unsigned)sizeof(t))) -#define uTypedCalloc(n,t) ((t *)calloc((unsigned)n,(unsigned)sizeof(t))) -#define uTypedRealloc(pO,n,t) ((t *)realloc(pO,((unsigned)n)*sizeof(t))) -#define uTypedRecalloc(pO,o,n,t) ((t *)recalloc(pO,((unsigned)o),((unsigned)n),sizeof(t))) -#if (defined mdHasAlloca) && (mdHasAlloca) -#define uTmpAlloc(n) alloca((unsigned)n) -#define uTmpFree(p) -#else -#define uTmpAlloc(n) malloc(n) -#define uTmpFree(p) free(p) -#endif - -/***====================================================================***/ - -extern Boolean -uSetErrorFile(char *name); - -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) -#define __ATTR_PRINTF(i, f) __attribute__ ((format(printf, (i), (f)))) -#else -#define __ATTR_PRINTF(i, f) -#endif - -#define INFO uInformation - -extern __ATTR_PRINTF(1, 2) void -uInformation(const char *s, ...); - -#define ACTION uAction - -extern __ATTR_PRINTF(1, 2) void -uAction(const char *s, ...); - -#define WARN uWarning - -extern __ATTR_PRINTF(1, 2) void -uWarning(const char *s, ...); - -#define ERROR uError - -extern __ATTR_PRINTF(1, 2) void -uError(const char *s, ...); - -#define FATAL uFatalError - -extern __ATTR_PRINTF(1, 2) _X_NORETURN void -uFatalError(const char *s, ...); - -/* WSGO stands for "Weird Stuff Going On" (wtf???) */ -#define WSGO uInternalError - -extern __ATTR_PRINTF(1, 2) void -uInternalError(const char *s, ...); - -/***====================================================================***/ - -#define NullString ((char *)NULL) - -#define uStringText(s) ((s)==NullString?"":(s)) -#define uStringEqual(s1,s2) (uStringCompare(s1,s2)==Equal) -#define uStringPrefix(p,s) (strncmp(p,s,strlen(p))==0) -#define uStringCompare(s1,s2) (((s1)==NullString||(s2)==NullString)?\ - (s1)!=(s2):strcmp(s1,s2)) -#define uStrCaseEqual(s1,s2) (uStrCaseCmp(s1,s2)==0) -#ifdef HAVE_STRCASECMP -#define uStrCaseCmp(s1,s2) (strcasecmp(s1,s2)) -#define uStrCasePrefix(p,s) (strncasecmp(p,s,strlen(p))==0) -#else -extern int -uStrCaseCmp(const char *s1, const char *s2); -extern int -uStrCasePrefix(const char *p, char *str); -#endif - -/***====================================================================***/ - -#ifdef ASSERTIONS_ON -#define uASSERT(where,why) \ - {if (!(why)) uFatalError("assertion botched in %s ( why )\n",where);} -#else -#define uASSERT(where,why) -#endif - -/***====================================================================***/ - -#ifndef DEBUG_VAR -#define DEBUG_VAR debugFlags -#endif - -extern unsigned int DEBUG_VAR; - -#endif /* UTILS_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/vmod.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/vmod.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/vmod.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/vmod.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,7 +24,6 @@ ********************************************************/ -#define DEBUG_VAR debugFlags #include #include "xkbcomp.h" #include "xkballoc.h" @@ -37,23 +36,26 @@ #include "vmod.h" void -InitVModInfo(VModInfo * info, struct xkb_desc * xkb) +InitVModInfo(VModInfo * info, struct xkb_keymap * xkb) { ClearVModInfo(info, xkb); info->errorCount = 0; } void -ClearVModInfo(VModInfo * info, struct xkb_desc * xkb) +ClearVModInfo(VModInfo * info, struct xkb_keymap * xkb) { int i; - if (XkbcAllocNames(xkb, XkbVirtualModNamesMask, 0) != Success) + info->newlyDefined = info->defined = info->available = 0; + + if (XkbcAllocNames(xkb, 0, 0) != Success) return; - if (XkbcAllocServerMap(xkb, XkbVirtualModsMask, 0) != Success) + + if (XkbcAllocServerMap(xkb, 0, 0) != Success) return; + info->xkb = xkb; - info->newlyDefined = info->defined = info->available = 0; if (xkb && xkb->names) { int bit; @@ -75,8 +77,8 @@ * @param stmt The statement specifying the name and (if any the value). * @param mergeMode Merge strategy (e.g. MergeOverride) */ -Bool -HandleVModDef(VModDef * stmt, struct xkb_desc *xkb, unsigned mergeMode, +bool +HandleVModDef(VModDef * stmt, struct xkb_keymap *xkb, unsigned mergeMode, VModInfo * info) { int i, bit, nextFree; @@ -95,7 +97,7 @@ { /* already defined */ info->available |= bit; if (stmt->value == NULL) - return True; + return true; else { const char *str1; @@ -104,23 +106,23 @@ { str1 = XkbcAtomText(stmt->name); ACTION("Declaration of %s ignored\n", str1); - return False; + return false; } if (mod.uval == srv->vmods[i]) - return True; + return true; str1 = XkbcAtomText(stmt->name); WARN("Virtual modifier %s multiply defined\n", str1); - str1 = XkbcModMaskText(srv->vmods[i], True); + str1 = XkbcModMaskText(srv->vmods[i], true); if (mergeMode == MergeOverride) { str2 = str1; - str1 = XkbcModMaskText(mod.uval, True); + str1 = XkbcModMaskText(mod.uval, true); } ACTION("Using %s, ignoring %s\n", str1, str2); if (mergeMode == MergeOverride) srv->vmods[i] = mod.uval; - return True; + return true; } } } @@ -131,21 +133,21 @@ { ERROR("Too many virtual modifiers defined (maximum %d)\n", XkbNumVirtualMods); - return False; + return false; } info->defined |= (1 << nextFree); info->newlyDefined |= (1 << nextFree); info->available |= (1 << nextFree); names->vmods[nextFree] = XkbcAtomGetString(stmt->name); if (stmt->value == NULL) - return True; + return true; if (ExprResolveModMask(stmt->value, &mod)) { srv->vmods[nextFree] = mod.uval; - return True; + return true; } ACTION("Declaration of %s ignored\n", XkbcAtomText(stmt->name)); - return False; + return false; } /** @@ -153,14 +155,14 @@ * * @param priv Pointer to the xkb data structure. * @param field The Atom of the modifier's name (e.g. Atom for LAlt) - * @param type Must be TypeInt, otherwise return False. + * @param type Must be TypeInt, otherwise return false. * @param val_rtrn Set to the index of the modifier that matches. * - * @return True on success, False otherwise. If False is returned, val_rtrn is + * @return true on success, false otherwise. If false is returned, val_rtrn is * undefined. */ static int -LookupVModIndex(const struct xkb_desc *xkb, xkb_atom_t field, unsigned type, +LookupVModIndex(const struct xkb_keymap *xkb, xkb_atom_t field, unsigned type, ExprResult * val_rtrn) { int i; @@ -168,7 +170,7 @@ if ((xkb == NULL) || (xkb->names == NULL) || (type != TypeInt)) { - return False; + return false; } /* For each named modifier, get the name and compare it to the one passed * in. If we get a match, return the index of the modifier. @@ -180,10 +182,10 @@ if (xkb->names->vmods[i] && strcmp(xkb->names->vmods[i], name) == 0) { val_rtrn->uval = i; - return True; + return true; } } - return False; + return false; } /** @@ -193,28 +195,28 @@ * @param priv Pointer to xkb data structure. * @param val_rtrn Member uval is set to the mask returned. * - * @return True on success, False otherwise. If False is returned, val_rtrn is + * @return true on success, false otherwise. If false is returned, val_rtrn is * undefined. */ -int +bool LookupVModMask(const void * priv, xkb_atom_t field, unsigned type, ExprResult * val_rtrn) { if (LookupModMask(NULL, field, type, val_rtrn)) { - return True; + return true; } else if (LookupVModIndex(priv, field, type, val_rtrn)) { unsigned ndx = val_rtrn->uval; val_rtrn->uval = (1 << (XkbNumModifiers + ndx)); - return True; + return true; } - return False; + return false; } int -FindKeypadVMod(struct xkb_desc * xkb) +FindKeypadVMod(struct xkb_keymap * xkb) { xkb_atom_t name; ExprResult rtrn; @@ -227,8 +229,8 @@ return -1; } -Bool -ResolveVirtualModifier(ExprDef * def, struct xkb_desc *xkb, +bool +ResolveVirtualModifier(ExprDef * def, struct xkb_keymap *xkb, ExprResult * val_rtrn, VModInfo * info) { struct xkb_names * names; @@ -240,19 +242,20 @@ const char *name = XkbcAtomText(def->value.str); for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { - if ((info->available & bit) && strcmp(names->vmods[i], name) == 0) + if ((info->available & bit) && names->vmods[i] && + strcmp(names->vmods[i], name) == 0) { val_rtrn->uval = i; - return True; + return true; } } } if (ExprResolveInteger(def, val_rtrn)) { if (val_rtrn->uval < XkbNumVirtualMods) - return True; + return true; ERROR("Illegal virtual modifier %d (must be 0..%d inclusive)\n", val_rtrn->uval, XkbNumVirtualMods - 1); } - return False; + return false; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/vmod.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/vmod.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/vmod.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/vmod.h 2012-05-10 10:10:26.000000000 +0000 @@ -29,38 +29,31 @@ typedef struct _VModInfo { - struct xkb_desc * xkb; + struct xkb_keymap *xkb; unsigned defined; unsigned available; unsigned newlyDefined; int errorCount; } VModInfo; -extern void InitVModInfo(VModInfo * /* info */ , - struct xkb_desc * /* xkb */ - ); - -extern void ClearVModInfo(VModInfo * /* info */ , - struct xkb_desc * /* xkb */ - ); - -extern Bool HandleVModDef(VModDef * /* stmt */ , - struct xkb_desc * /* xkb */ , - unsigned /* mergeMode */ , - VModInfo * /* info */ - ); - -extern Bool ApplyVModDefs(VModInfo * /* info */ , - struct xkb_desc * /* xkb */ - ); - -extern int FindKeypadVMod(struct xkb_desc * /* xkb */ - ); - -extern Bool ResolveVirtualModifier(ExprDef * /* def */ , - struct xkb_desc * /* xkb */ , - ExprResult * /* value_rtrn */ , - VModInfo * /* info */ - ); +extern void +InitVModInfo(VModInfo *info, struct xkb_keymap *xkb); + +extern void +ClearVModInfo(VModInfo *info, struct xkb_keymap *xkb); + +extern bool +HandleVModDef(VModDef *stmt, struct xkb_keymap *xkb, unsigned mergeMode, + VModInfo *info); + +extern bool +ApplyVModDefs(VModInfo *info, struct xkb_keymap *xkb); + +extern int +FindKeypadVMod(struct xkb_keymap *xkb); + +extern bool +ResolveVirtualModifier(ExprDef *def, struct xkb_keymap *xkb, + ExprResult *value_rtrn, VModInfo *info); #endif /* VMOD_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbcomp.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbcomp.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbcomp.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbcomp.c 2012-05-10 10:10:26.000000000 +0000 @@ -33,8 +33,7 @@ #include "parseutils.h" #include "utils.h" -/* Global debugging flags */ -unsigned int debugFlags = 0; +/* Global warning level */ unsigned int warningLevel = 0; #define ISEMPTY(str) (!(str) || (strlen(str) == 0)) @@ -60,25 +59,33 @@ symbols = CreateXKBFile(XkmSymbolsIndex, NULL, (ParseCommon *)inc, 0); AppendStmt(&keycodes->common, &symbols->common); - return CreateXKBFile(XkmKeymapFile, ktcsg->keymap ? ktcsg->keymap : strdup(""), + return CreateXKBFile(XkmKeymapFile, + ktcsg->keymap ? ktcsg->keymap : strdup(""), &keycodes->common, 0); } static struct xkb_component_names * -XkbComponentsFromRules(const char *rules, const XkbRF_VarDefsPtr defs) +XkbComponentsFromRules(struct xkb_context *context, + const char *rules, + const XkbRF_VarDefsPtr defs) { FILE *rulesFile = NULL; char *rulesPath = NULL; XkbRF_RulesPtr loaded = NULL; struct xkb_component_names * names = NULL; + int i; - rulesFile = XkbFindFileInPath(rules, XkmRulesFile, &rulesPath); + rulesFile = XkbFindFileInPath(context, rules, XkmRulesFile, &rulesPath); if (!rulesFile) { ERROR("could not find \"%s\" rules in XKB path\n", rules); + ERROR("%d include paths searched:\n", + xkb_context_num_include_paths(context)); + for (i = 0; i < xkb_context_num_include_paths(context); i++) + ERROR("\t%s\n", xkb_context_include_path_get(context, i)); return NULL; } - if (!(loaded = _XkbTypedCalloc(1, XkbRF_RulesRec))) { + if (!(loaded = uTypedCalloc(1, XkbRF_RulesRec))) { ERROR("failed to allocate XKB rules\n"); goto unwind_file; } @@ -88,7 +95,7 @@ goto unwind_file; } - if (!(names = _XkbTypedCalloc(1, struct xkb_component_names))) { + if (!(names = uTypedCalloc(1, struct xkb_component_names))) { ERROR("failed to allocate XKB components\n"); goto unwind_file; } @@ -112,12 +119,13 @@ return names; } -struct xkb_desc * -xkb_compile_keymap_from_rules(const struct xkb_rule_names *rmlvo) +_X_EXPORT struct xkb_keymap * +xkb_map_new_from_names(struct xkb_context *context, + const struct xkb_rule_names *rmlvo) { XkbRF_VarDefsRec defs; - struct xkb_component_names * names; - struct xkb_desc * xkb; + struct xkb_component_names *names; + struct xkb_keymap *xkb; if (!rmlvo || ISEMPTY(rmlvo->rules) || ISEMPTY(rmlvo->layout)) { ERROR("rules and layout required to generate XKB keymap\n"); @@ -129,14 +137,14 @@ defs.variant = rmlvo->variant; defs.options = rmlvo->options; - names = XkbComponentsFromRules(rmlvo->rules, &defs); + names = XkbComponentsFromRules(context, rmlvo->rules, &defs); if (!names) { ERROR("failed to generate XKB components from rules \"%s\"\n", rmlvo->rules); return NULL; } - xkb = xkb_compile_keymap_from_components(names); + xkb = xkb_map_new_from_kccgst(context, names); free(names->keymap); free(names->keycodes); @@ -182,14 +190,14 @@ return map; } -static struct xkb_desc * -compile_keymap(XkbFile *file, const char *mapName) +static struct xkb_keymap * +compile_keymap(struct xkb_context *context, XkbFile *file) { XkbFile *mapToUse; - struct xkb_desc * xkb = NULL; + struct xkb_keymap * xkb = NULL; /* Find map to use */ - mapToUse = XkbChooseMap(file, mapName); + mapToUse = XkbChooseMap(file, NULL); if (!mapToUse) goto err; @@ -203,96 +211,124 @@ goto err; } - xkb = CompileKeymap(mapToUse, MergeReplace); + xkb = CompileKeymap(context, mapToUse); if (!xkb) goto err; err: FreeXKBFile(file); - free(scanFile); - XkbFreeIncludePath(); + XkbcFreeAllAtoms(); return xkb; } -struct xkb_desc * -xkb_compile_keymap_from_components(const struct xkb_component_names * ktcsg) +_X_EXPORT struct xkb_keymap * +xkb_map_new_from_kccgst(struct xkb_context *context, + const struct xkb_component_names *kccgst) { XkbFile *file; - if (!ktcsg) { + if (!kccgst) { ERROR("no components specified\n"); return NULL; } - if (ISEMPTY(ktcsg->keycodes)) { + if (ISEMPTY(kccgst->keycodes)) { ERROR("keycodes required to generate XKB keymap\n"); return NULL; } - if (ISEMPTY(ktcsg->compat)) { + if (ISEMPTY(kccgst->compat)) { ERROR("compat map required to generate XKB keymap\n"); return NULL; } - if (ISEMPTY(ktcsg->types)) { + if (ISEMPTY(kccgst->types)) { ERROR("types required to generate XKB keymap\n"); return NULL; } - if (ISEMPTY(ktcsg->symbols)) { + if (ISEMPTY(kccgst->symbols)) { ERROR("symbols required to generate XKB keymap\n"); return NULL; } - if (!(file = XkbKeymapFileFromComponents(ktcsg))) { + if (!(file = XkbKeymapFileFromComponents(kccgst))) { ERROR("failed to generate parsed XKB file from components\n"); return NULL; } - return compile_keymap(file, NULL); + return compile_keymap(context, file); } -struct xkb_desc * -xkb_compile_keymap_from_string(const char *string, const char *mapName) +_X_EXPORT struct xkb_keymap * +xkb_map_new_from_string(struct xkb_context *context, + const char *string, + enum xkb_keymap_format format) { XkbFile *file; + if (format != XKB_KEYMAP_FORMAT_TEXT_V1) { + ERROR("unsupported keymap format %d\n", format); + return NULL; + } + if (!string) { ERROR("no string specified to generate XKB keymap\n"); return NULL; } - setScanState("input", 1); - if (!XKBParseString(string, &file) || !file) { + if (!XKBParseString(string, "input", &file) || !file) { ERROR("failed to parse input xkb file\n"); return NULL; } - return compile_keymap(file, mapName); + return compile_keymap(context, file); } -struct xkb_desc * -xkb_compile_keymap_from_file(FILE *inputFile, const char *mapName) +_X_EXPORT struct xkb_keymap * +xkb_map_new_from_fd(struct xkb_context *context, + int fd, + enum xkb_keymap_format format) { XkbFile *file; + FILE *fptr; - if (!inputFile) { + if (format != XKB_KEYMAP_FORMAT_TEXT_V1) { + ERROR("unsupported keymap format %d\n", format); + return NULL; + } + + if (fd < 0) { ERROR("no file specified to generate XKB keymap\n"); return NULL; } - setScanState("input", 1); - if (!XKBParseFile(inputFile, &file) || !file) { + fptr = fdopen(fd, "r"); + if (!fptr) { + ERROR("couldn't associate fd with file pointer\n"); + return NULL; + } + + if (!XKBParseFile(fptr, "(unknown file)", &file) || !file) { ERROR("failed to parse input xkb file\n"); return NULL; } - return compile_keymap(file, mapName); + return compile_keymap(context, file); +} + +_X_EXPORT struct xkb_keymap * +xkb_map_ref(struct xkb_keymap *xkb) +{ + xkb->refcnt++; + return xkb; } -void -xkb_free_keymap(struct xkb_desc *xkb) +_X_EXPORT void +xkb_map_unref(struct xkb_keymap *xkb) { + if (--xkb->refcnt > 0) + return; + XkbcFreeKeyboard(xkb); - XkbcFreeAllAtoms(); } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbcomp.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbcomp.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbcomp.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbcomp.h 2012-05-10 10:10:26.000000000 +0000 @@ -27,21 +27,12 @@ #ifndef XKBCOMP_H #define XKBCOMP_H 1 -#ifndef DEBUG_VAR -#define DEBUG_VAR debugFlags -#endif - -#include -#include - #include "utils.h" #include "xkbcommon/xkbcommon.h" #include "XKBcommonint.h" #include "xkbmisc.h" -extern char *scanFile; - #define TypeUnknown 0 #define TypeBoolean 1 #define TypeInt 2 @@ -80,7 +71,6 @@ #define ExprArrayRef 4 #define ExprKeysymList 5 #define ExprActionList 6 -#define ExprCoord 7 #define OpAdd 20 #define OpSubtract 21 @@ -148,18 +138,16 @@ int nSyms; int szSyms; char **syms; + int nLevels; + int szLevels; + int *symsMapIndex; + unsigned int *symsNumEntries; } list; - struct - { - int x; - int y; - } coord; struct _Expr *child; xkb_atom_t str; unsigned uval; int ival; char keyName[5]; - void * ptr; } value; } ExprDef; @@ -242,7 +230,7 @@ unsigned merge; int ndx; ExprDef *name; - Bool virtual; + bool virtual; } IndicatorNameDef; typedef struct _IndicatorMapDef @@ -257,34 +245,33 @@ typedef struct _XkbFile { ParseCommon common; - int type; + unsigned type; char *topName; char *name; ParseCommon *defs; int id; unsigned flags; - Bool compiled; } XkbFile; -extern struct xkb_desc * -CompileKeymap(XkbFile *file, unsigned merge); +extern struct xkb_keymap * +CompileKeymap(struct xkb_context *context, XkbFile *file); -extern Bool -CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge); +extern bool +CompileKeycodes(XkbFile *file, struct xkb_keymap * xkb, unsigned merge); -extern Bool -CompileKeyTypes(XkbFile *file, struct xkb_desc * xkb, unsigned merge); +extern bool +CompileKeyTypes(XkbFile *file, struct xkb_keymap * xkb, unsigned merge); typedef struct _LEDInfo *LEDInfoPtr; -extern Bool -CompileCompatMap(XkbFile *file, struct xkb_desc * xkb, unsigned merge, +extern bool +CompileCompatMap(XkbFile *file, struct xkb_keymap * xkb, unsigned merge, LEDInfoPtr *unboundLEDs); -extern Bool -CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge); +extern bool +CompileSymbols(XkbFile *file, struct xkb_keymap * xkb, unsigned merge); -extern Bool -UpdateModifiersFromCompat(struct xkb_desc *xkb); +extern bool +UpdateModifiersFromCompat(struct xkb_keymap *xkb); #endif /* XKBCOMP_H */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbparse.y libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbparse.y --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbparse.y 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbparse.y 2012-05-10 10:10:26.000000000 +0000 @@ -24,6 +24,26 @@ ********************************************************/ +%{ +#ifdef DEBUG +#define YYDEBUG 1 +#endif + +#include "parseutils.h" +#include "xkbmisc.h" +#include +#include + +extern int yylex(union YYSTYPE *val, struct YYLTYPE *loc, void *scanner); + +#define scanner param->scanner +%} + +%define api.pure +%locations +%lex-param { void *scanner } +%parse-param { struct parser_param *param } + %token END_OF_FILE 0 ERROR_TOK 255 @@ -88,19 +108,7 @@ KEYPAD_KEYS 75 FUNCTION_KEYS 76 ALTERNATE_GROUP 77 -%{ -#define DEBUG 1 -#ifdef DEBUG -#define YYDEBUG 1 -#endif -#include "parseutils.h" -#include "xkbmisc.h" -#include -#include -extern int yylex(void); -extern FILE *yyin; -%} %right EQUALS %left PLUS MINUS %left TIMES DIVIDE @@ -110,8 +118,9 @@ %union { int ival; unsigned uval; + int64_t num; char *str; - Atom sval; + xkb_atom_t sval; ParseCommon *any; ExprDef *expr; VarDef *var; @@ -128,13 +137,15 @@ void *geom; XkbFile *file; } +%type INTEGER FLOAT +%type IDENT KEYNAME STRING %type Number Integer Float SignedNumber %type XkbCompositeType FileType MergeMode OptMergeMode %type DoodadType Flag Flags OptFlags KeyCode %type KeyName MapName OptMapName KeySym %type FieldSpec Ident Element String %type DeclList Decl -%type OptExprList ExprList Expr Term Lhs Terminal ArrayInit +%type OptExprList ExprList Expr Term Lhs Terminal ArrayInit KeySyms %type OptKeySymList KeySymList Action ActionList Coord CoordList %type VarDecl VarDeclList SymbolsBody SymbolsVarDecl %type VModDecl VModDefList VModDef @@ -154,11 +165,11 @@ %type XkbCompositeMap XkbCompMapList %% XkbFile : XkbCompMapList - { $$= rtrnValue= $1; } + { $$= param->rtrn= $1; } | XkbMapConfigList - { $$= rtrnValue= $1; } + { $$= param->rtrn= $1; } | XkbConfig - { $$= rtrnValue= $1; } + { $$= param->rtrn= $1; } ; XkbCompMapList : XkbCompMapList XkbCompositeMap @@ -254,57 +265,57 @@ Decl : OptMergeMode VarDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode VModDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode InterpretDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode KeyNameDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode KeyAliasDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode KeyTypeDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode SymbolsDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode ModMapDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode GroupCompatDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode IndicatorMapDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode IndicatorNameDecl { - $2->merge= StmtSetMerge(&$2->common,$1); + $2->merge= StmtSetMerge(&$2->common,$1,&@1,scanner); $$= &$2->common; } | OptMergeMode ShapeDecl @@ -319,12 +330,14 @@ | MergeMode STRING { if ($1==MergeAltForm) { - yyerror("cannot use 'alternate' to include other maps"); - $$= &IncludeCreate(scanBuf,MergeDefault)->common; + yyerror(&@1, scanner, + "cannot use 'alternate' to include other maps"); + $$= &IncludeCreate($2,MergeDefault)->common; } else { - $$= &IncludeCreate(scanBuf,$1)->common; + $$= &IncludeCreate($2,$1)->common; } + free($2); } ; @@ -443,9 +456,9 @@ ; IndicatorNameDecl: INDICATOR Integer EQUALS Expr SEMI - { $$= IndicatorNameCreate($2,$4,False); } + { $$= IndicatorNameCreate($2,$4,false); } | VIRTUAL INDICATOR Integer EQUALS Expr SEMI - { $$= IndicatorNameCreate($3,$5,True); } + { $$= IndicatorNameCreate($3,$5,true); } ; ShapeDecl : SHAPE String OBRACE OutlineList CBRACE SEMI @@ -569,11 +582,11 @@ | SHAPE { $$= xkb_intern_atom("shape"); } | ROW - { $$= None; } + { $$= XKB_ATOM_NONE; } | SECTION - { $$= None; } + { $$= XKB_ATOM_NONE; } | TEXT - { $$= None; } + { $$= XKB_ATOM_NONE; } ; OptMergeMode : MergeMode { $$= $1; } @@ -658,7 +671,7 @@ { ExprDef *expr; expr= ExprCreate(ExprArrayRef,TypeUnknown); - expr->value.array.element= None; + expr->value.array.element= XKB_ATOM_NONE; expr->value.array.field= $1; expr->value.array.entry= $3; $$= expr; @@ -709,11 +722,19 @@ KeySymList : KeySymList COMMA KeySym { $$= AppendKeysymList($1,$3); } + | KeySymList COMMA KeySyms + { $$= AppendMultiKeysymList($1,$3); } | KeySym { $$= CreateKeysymList($1); } + | KeySyms + { $$= CreateMultiKeysymList($1); } ; -KeySym : IDENT { $$= strdup(scanBuf); } +KeySyms : OBRACE KeySymList CBRACE + { $$= $2; } + ; + +KeySym : IDENT { $$= $1; } | SECTION { $$= strdup("section"); } | Integer { @@ -733,32 +754,36 @@ | Number { $$= $1; } ; -Number : FLOAT { $$= scanInt; } - | INTEGER { $$= scanInt*XkbGeomPtsPerMM; } +Number : FLOAT { $$= $1; } + | INTEGER { $$= $1*XkbGeomPtsPerMM; } ; Float : FLOAT { $$= 0; } ; -Integer : INTEGER { $$= scanInt; } +Integer : INTEGER { $$= $1; } ; -KeyCode : INTEGER { $$= scanULong; } +KeyCode : INTEGER { $$= $1; } ; -KeyName : KEYNAME { $$= strdup(scanBuf); } +KeyName : KEYNAME { $$= $1; } ; -Ident : IDENT { $$= xkb_intern_atom(scanBuf); } +Ident : IDENT { $$= xkb_intern_atom($1); free($1); } | DEFAULT { $$= xkb_intern_atom("default"); } ; -String : STRING { $$= xkb_intern_atom(scanBuf); } +String : STRING { $$= xkb_intern_atom($1); free($1); } ; OptMapName : MapName { $$= $1; } | { $$= NULL; } ; -MapName : STRING { $$= strdup(scanBuf); } +MapName : STRING { $$= $1; } ; + +%% + +#undef scanner diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbpath.c libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbpath.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbpath.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbpath.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,32 +24,13 @@ ********************************************************/ -#define DEBUG_VAR debugFlags -#include "utils.h" #include +#include #include -#include "xkbpath.h" #include "xkbcommon/xkbcommon.h" #include "XKBcommonint.h" - -#ifndef DFLT_XKB_CONFIG_ROOT -#define DFLT_XKB_CONFIG_ROOT "/usr/lib/X11/xkb" -#endif - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - -/* initial szPath */ -#define PATH_CHUNK 8 - -static Bool noDefaultPath = False; -/* number of entries allocated for includePath */ -static int szPath; -/* number of actual entries in includePath */ -static int nPathEntries; -/* Holds all directories we might be including data from */ -static char **includePath = NULL; +#include "utils.h" +#include "xkbpath.h" /** * Extract the first token from an include statement. @@ -60,7 +41,7 @@ * @param nextop_rtrn Set to the next operation in the complete statement. * @param extra_data Set to the string between ( and ), if any. * - * @return True if parsing was succcessful, False for an illegal string. + * @return true if parsing was succcessful, false for an illegal string. * * Example: "evdev+aliases(qwerty)" * str_inout = aliases(qwerty) @@ -77,7 +58,7 @@ * nextop_retrn = "" * */ -Bool +bool XkbParseIncludeMap(char **str_inout, char **file_rtrn, char **map_rtrn, char *nextop_rtrn, char **extra_data) { @@ -116,7 +97,7 @@ if (tmp != NULL) { *tmp++ = '\0'; - *extra_data = _XkbDupString(tmp); + *extra_data = uDupString(tmp); } else { @@ -125,28 +106,28 @@ tmp = strchr(str, '('); if (tmp == NULL) { - *file_rtrn = _XkbDupString(str); + *file_rtrn = uDupString(str); *map_rtrn = NULL; } else if (str[0] == '(') { free(*extra_data); - return False; + return false; } else { *tmp++ = '\0'; - *file_rtrn = _XkbDupString(str); + *file_rtrn = uDupString(str); str = tmp; tmp = strchr(str, ')'); if ((tmp == NULL) || (tmp[1] != '\0')) { free(*file_rtrn); free(*extra_data); - return False; + return false; } *tmp++ = '\0'; - *map_rtrn = _XkbDupString(str); + *map_rtrn = uDupString(str); } } if (*nextop_rtrn == '\0') @@ -154,117 +135,8 @@ else if ((*nextop_rtrn == '|') || (*nextop_rtrn == '+')) *str_inout = next; else - return False; - return True; -} - -static void -XkbAddDefaultDirectoriesToPath(void); - -/** - * Init memory for include paths. - */ -static Bool -XkbInitIncludePath(void) -{ - if (includePath) - return True; - - szPath = PATH_CHUNK; - includePath = calloc(szPath, sizeof(char *)); - if (!includePath) - return False; - - XkbAddDefaultDirectoriesToPath(); - return True; -} - -/** - * Remove all entries from the global includePath. - */ -static void -XkbClearIncludePath(void) -{ - int i; - - if (szPath > 0) - { - for (i = 0; i < nPathEntries; i++) - { - if (includePath[i] != NULL) - { - free(includePath[i]); - includePath[i] = NULL; - } - } - nPathEntries = 0; - } - noDefaultPath = True; -} - -void -XkbFreeIncludePath(void) -{ - XkbClearIncludePath(); - free(includePath); - includePath = NULL; -} - -/** - * Add the given path to the global includePath variable. - * If dir is NULL, the includePath is emptied. - */ -static Bool -XkbAddDirectoryToPath(const char *dir) -{ - int len; - - if (!XkbInitIncludePath()) - return False; - - if ((dir == NULL) || (dir[0] == '\0')) - { - XkbClearIncludePath(); - return True; - } -#ifdef __UNIXOS2__ - dir = (char *) __XOS2RedirRoot(dir); -#endif - len = strlen(dir); - if (len + 2 >= PATH_MAX) - { /* allow for '/' and at least one character */ - ERROR("Path entry (%s) too long (maxiumum length is %d)\n", - dir, PATH_MAX - 3); - return False; - } - if (nPathEntries >= szPath) - { - szPath += PATH_CHUNK; - includePath = realloc(includePath, szPath * sizeof(char *)); - if (includePath == NULL) - { - WSGO("Allocation failed (includePath)\n"); - return False; - } - } - includePath[nPathEntries] = strdup(dir); - if (includePath[nPathEntries] == NULL) - { - WSGO("Allocation failed (includePath[%d])\n", nPathEntries); - return False; - } - nPathEntries++; - return True; -} - -static void -XkbAddDefaultDirectoriesToPath(void) -{ - if (!XkbInitIncludePath()) - return; - if (noDefaultPath) - return; - XkbAddDirectoryToPath(DFLT_XKB_CONFIG_ROOT); + return false; + return true; } /***====================================================================***/ @@ -291,7 +163,6 @@ return "symbols"; case XkmCompatMapIndex: return "compat"; - case XkmGeometryFile: case XkmGeometryIndex: return "geometry"; case XkmRulesFile: @@ -306,43 +177,41 @@ /** * Search for the given file name in the include directories. * + * @param context the XKB context containing the include paths * @param type one of XkbTypesIndex, XkbCompatMapIndex, ..., or - * XkbSemanticsFile, XkmKeymapFile, ... + * XkbSemanticsFile, XkmKeymapFile, ... * @param pathReturn is set to the full path of the file if found. * * @return an FD to the file or NULL. If NULL is returned, the value of * pathRtrn is undefined. */ FILE * -XkbFindFileInPath(const char *name, unsigned type, char **pathRtrn) +XkbFindFileInPath(struct xkb_context *context, + const char *name, unsigned type, char **pathRtrn) { - int i, ret; + size_t i; + int ret; FILE *file = NULL; char buf[PATH_MAX]; const char *typeDir; - if (!XkbInitIncludePath()) - return NULL; - typeDir = XkbDirectoryForInclude(type); - for (i = 0; i < nPathEntries; i++) + for (i = 0; i < xkb_context_num_include_paths(context); i++) { - if (includePath[i] == NULL || *includePath[i] == '\0') - continue; - ret = snprintf(buf, sizeof(buf), "%s/%s/%s", - includePath[i], typeDir, name); - if (ret >= sizeof(buf)) + xkb_context_include_path_get(context, i), typeDir, name); + if (ret >= (ssize_t)sizeof(buf)) { - ERROR("File name (%s/%s/%s) too long\n", includePath[i], - typeDir, name); + ERROR("File name (%s/%s/%s) too long\n", + xkb_context_include_path_get(context, i), typeDir, name); ACTION("Ignored\n"); continue; } file = fopen(buf, "r"); if (file == NULL) { - ERROR("Couldn't open file (%s/%s/%s): %s\n", includePath[i], - typeDir, name, strerror(-errno)); + ERROR("Couldn't open file (%s/%s/%s): %s\n", + xkb_context_include_path_get(context, i), typeDir, name, + strerror(-errno)); ACTION("Ignored\n"); continue; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbpath.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbpath.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbpath.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbpath.h 2012-05-10 10:10:26.000000000 +0000 @@ -27,25 +27,20 @@ #ifndef _XKBPATH_H_ #define _XKBPATH_H_ 1 +#include #include -#include -#include -extern const char *XkbDirectoryForInclude(unsigned /* type */ - ); +#include "XKBcommonint.h" -extern FILE *XkbFindFileInPath(const char * /* name */ , - unsigned /* type */ , - char ** /* pathRtrn */ - ); - -extern Bool XkbParseIncludeMap(char ** /* str_inout */ , - char ** /* file_rtrn */ , - char ** /* map_rtrn */ , - char * /* nextop_rtrn */ , - char ** /* extra_data */ - ); +extern const char * +XkbDirectoryForInclude(unsigned type); -extern void XkbFreeIncludePath(void); +extern FILE * +XkbFindFileInPath(struct xkb_context *context, const char *name, + unsigned type, char **pathRtrn); + +extern bool +XkbParseIncludeMap(char **str_inout, char **file_rtrn, char **map_rtrn, + char *nextop_rtrn, char **extra_data); #endif /* _XKBPATH_H_ */ diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbscan.l libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbscan.l --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbcomp/xkbscan.l 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbcomp/xkbscan.l 2012-05-10 10:10:26.000000000 +0000 @@ -28,31 +28,33 @@ #include #include -#include #include "utils.h" #include "parseutils.h" -#include "xkbparse.h" -char *scanFile = NULL; -int lineNum = 0; -int scanInt; -unsigned long scanULong; +extern int yyparse(struct parser_param *param); -static char *s; -char scanBuf[1024]; +#define YY_USER_ACTION { \ + yylloc->first_line = yylineno; \ + yylloc->last_line = yylineno; \ +} -extern int yyparse(void); +#define APPEND_S(ch) do { \ + if (yyextra->s - yyextra->scanBuf >= sizeof(yyextra->scanBuf) - 1) \ + return ERROR_TOK; \ + *yyextra->s++ = ch; \ +} while (0) %} -%option case-insensitive +%option reentrant +%option extra-type="struct scanner_extra *" +%option bison-bridge bison-locations %option yylineno -%option noyywrap +%option nounistd noyywrap noinput nounput %option never-interactive -%option noinput -%option nounput +%option case-insensitive %x S_STR S_KEY @@ -61,15 +63,25 @@ "//"[^\n]* "#"[^\n]* -\" s = scanBuf; BEGIN(S_STR); -\< s = scanBuf; BEGIN(S_KEY); +\" yyextra->s = yyextra->scanBuf; BEGIN(S_STR); +\< yyextra->s = yyextra->scanBuf; BEGIN(S_KEY); -\" BEGIN(INITIAL); *s = '\0'; return STRING; -\> BEGIN(INITIAL); *s = '\0'; return KEYNAME; +\" { + BEGIN(INITIAL); + *yyextra->s = '\0'; + yylval->str = strdup(yyextra->scanBuf); + return STRING; + } +\> { + BEGIN(INITIAL); + *yyextra->s = '\0'; + yylval->str = strdup(yyextra->scanBuf); + return KEYNAME; + } \\[0-7]{1,3} { /* octal escape sequence */ - int result; + unsigned int result; (void) sscanf( yytext + 1, "%o", &result ); @@ -78,7 +90,7 @@ return ERROR_TOK; } - *s++ = result; + APPEND_S(result); } \\[0-9]+ { @@ -86,15 +98,15 @@ return ERROR_TOK; } -\\n *s++ = '\n'; -\\t *s++ = '\t'; -\\r *s++ = '\r'; -\\b *s++ = '\b'; -\\f *s++ = '\f'; -\\v *s++ = '\v'; -\\e *s++ = '\033'; +\\n APPEND_S('\n'); +\\t APPEND_S('\t'); +\\r APPEND_S('\r'); +\\b APPEND_S('\b'); +\\f APPEND_S('\f'); +\\v APPEND_S('\v'); +\\e APPEND_S('\033'); -. *s++ = yytext[0]; +. APPEND_S(yytext[0]); xkb_keymap return XKB_KEYMAP; xkb_keycodes return XKB_KEYCODES; @@ -142,19 +154,18 @@ function_keys return FUNCTION_KEYS; alternate_group return ALTERNATE_GROUP; -[a-zA-Z_][a-zA-Z_0-9]* memcpy(scanBuf, yytext, yyleng + 1); return IDENT; +[a-zA-Z_][a-zA-Z_0-9]* yylval->str = strdup(yytext); return IDENT; 0x[a-fA-F0-9]+ | [0-9]+ { char *end; - scanInt = strtol(yytext, &end, 0); - scanULong = strtoul(yytext, &end, 0); + yylval->num = strtoul(yytext, &end, 0); return INTEGER; } [0-9]+\.[0-9]+ { char *end; - scanInt = strtod(yytext, &end) * XkbGeomPtsPerMM; + yylval->num = strtod(yytext, &end) * XkbGeomPtsPerMM; return FLOAT; } @@ -185,62 +196,74 @@ %% void -yyerror(const char *msg) +yyerror(YYLTYPE *loc, void *scanner, const char *msg) { - if (warningLevel>0) { - fprintf(stderr,"%s: line %d of %s\n",msg,yylineno, - (scanFile?scanFile:"(unknown)")); - if (warningLevel>3) - fprintf(stderr,"last scanned symbol is: %s\n",scanBuf); - } - return; -} + struct scanner_extra *extra = yyget_extra(scanner); -void setScanState(const char *file, int lineno) -{ - yylineno = 1; - free(scanFile); - scanFile = strdup(file); + if (warningLevel > 0) { + fprintf(stderr, "%s: line %d of %s\n", msg, loc->first_line, + extra->scanFile ? extra->scanFile : "(unknown)"); + if (warningLevel > 3) + fprintf(stderr, "last scanned symbol is: %s\n", extra->scanBuf); + } } int -XKBParseString(const char *string, XkbFile ** pRtrn) +XKBParseString(const char *string, const char *fileName, XkbFile **pRtrn) { YY_BUFFER_STATE state; + struct parser_param param; + struct scanner_extra extra; + int ret; *pRtrn = NULL; if (string == NULL) - return 1; + return 1; + + memset(&extra, 0, sizeof(extra)); + ret = yylex_init_extra(&extra, ¶m.scanner); + if (ret != 0) + return 0; + extra.scanFile = strdup(fileName); + + state = yy_scan_string(string, param.scanner); + ret = yyparse(¶m); + yy_delete_buffer(state, param.scanner); + yylex_destroy(param.scanner); + free(extra.scanFile); + if (ret) + return 0; - state = yy_scan_string(string); - rtrnValue = NULL; - if (yyparse() != 0) - return 0; - - yy_delete_buffer(state); - yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); - *pRtrn = rtrnValue; - CheckDefaultMap(rtrnValue); - rtrnValue = NULL; + CheckDefaultMap(param.rtrn, fileName); + *pRtrn = param.rtrn; return 1; } int -XKBParseFile(FILE * file, XkbFile ** pRtrn) +XKBParseFile(FILE * file, const char *fileName, XkbFile ** pRtrn) { + int ret; + struct parser_param param; + struct scanner_extra extra; + *pRtrn = NULL; if (!file) return 1; - yyin = file; - rtrnValue = NULL; - if (yyparse() != 0) + memset(&extra, 0, sizeof(extra)); + if (yylex_init_extra(&extra, ¶m.scanner) != 0) + return 0; + extra.scanFile = strdup(fileName); + + yyset_in(file, param.scanner); + ret = yyparse(¶m); + yylex_destroy(param.scanner); + free(extra.scanFile); + if (ret) return 0; - yylex_destroy(); - *pRtrn = rtrnValue; - CheckDefaultMap(rtrnValue); - rtrnValue = NULL; + CheckDefaultMap(param.rtrn, fileName); + *pRtrn = param.rtrn; return 1; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbmisc.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbmisc.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbmisc.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbmisc.h 2012-05-10 10:10:26.000000000 +0000 @@ -27,25 +27,29 @@ #ifndef _XKBMISC_H_ #define _XKBMISC_H_ -#include -#include +#include +#include + #include "xkbcommon/xkbcommon.h" +#include "XKBcommonint.h" typedef uint32_t xkb_atom_t; +#define XKB_ATOM_NONE 0 + /***====================================================================***/ -extern Bool -XkbcComputeEffectiveMap(struct xkb_desc * xkb, struct xkb_key_type * type, +extern bool +XkbcComputeEffectiveMap(struct xkb_keymap * xkb, struct xkb_key_type * type, unsigned char *map_rtrn); /***====================================================================***/ extern int -XkbcInitCanonicalKeyTypes(struct xkb_desc * xkb, unsigned which, int keypadVMod); +XkbcInitCanonicalKeyTypes(struct xkb_keymap * xkb, unsigned which, int keypadVMod); -extern Bool -XkbcVirtualModsToReal(struct xkb_desc * xkb, unsigned virtual_mask, +extern bool +XkbcVirtualModsToReal(struct xkb_keymap * xkb, unsigned virtual_mask, unsigned *mask_rtrn); extern void @@ -61,11 +65,6 @@ #define XkbcKSIsUpper(k) (_XkbcKSCheckCase(k) & _XkbKSUpper) #define XkbKSIsKeypad(k) (((k) >= XK_KP_Space) && ((k) <= XK_KP_Equal)) -#define XkbKSIsDeadKey(k) \ - (((k) >= XK_dead_grave) && ((k) <= XK_dead_semivoiced_sound)) - -extern Bool -XkbcNameMatchesPattern(char *name, char *ptrn); /***====================================================================***/ @@ -84,13 +83,13 @@ XkbcAtomText(xkb_atom_t atm); extern const char * -XkbcVModMaskText(struct xkb_desc * xkb, unsigned modMask, unsigned mask); +XkbcVModMaskText(struct xkb_keymap * xkb, unsigned modMask, unsigned mask); extern const char * XkbcModIndexText(unsigned ndx); extern const char * -XkbcModMaskText(unsigned mask, Bool cFormat); +XkbcModMaskText(unsigned mask, bool cFormat); extern const char * XkbcConfigText(unsigned config); diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbrules.h libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbrules.h --- libxkbcommon-0.1.0~git20120501.3d672fcf/src/xkbrules.h 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/src/xkbrules.h 2012-05-10 10:10:26.000000000 +0000 @@ -27,52 +27,12 @@ #ifndef _XKBRULES_H_ #define _XKBRULES_H_ -#include -#include -#include -#include "xkbcommon/xkbcommon.h" +#include +#include "xkbcommon/xkbcommon.h" /* From filecommon */ -#define XkbXKMFile 0 -#define XkbCFile 1 -#define XkbXKBFile 2 -#define XkbMessage 3 - -#define XkbMapDefined (1 << 0) -#define XkbStateDefined (1 << 1) - -/***====================================================================***/ - -#define _XkbSuccess 0 -#define _XkbErrMissingNames 1 -#define _XkbErrMissingTypes 2 -#define _XkbErrMissingReqTypes 3 -#define _XkbErrMissingSymbols 4 -#define _XkbErrMissingVMods 5 -#define _XkbErrMissingIndicators 6 -#define _XkbErrMissingCompatMap 7 -#define _XkbErrMissingSymInterps 8 -#define _XkbErrMissingGeometry 9 -#define _XkbErrIllegalDoodad 10 -#define _XkbErrIllegalTOCType 11 -#define _XkbErrIllegalContents 12 -#define _XkbErrEmptyFile 13 -#define _XkbErrFileNotFound 14 -#define _XkbErrFileCannotOpen 15 -#define _XkbErrBadValue 16 -#define _XkbErrBadMatch 17 -#define _XkbErrBadTypeName 18 -#define _XkbErrBadTypeWidth 19 -#define _XkbErrBadFileType 20 -#define _XkbErrBadFileVersion 21 -#define _XkbErrBadFileFormat 22 -#define _XkbErrBadAlloc 23 -#define _XkbErrBadLength 24 -#define _XkbErrXReqFailure 25 -#define _XkbErrBadImplementation 26 - typedef struct _XkbRF_VarDefs { const char * model; const char * layout; @@ -108,7 +68,6 @@ char * symbols; char * types; char * compat; - char * geometry; char * keymap; unsigned flags; } XkbRF_RuleRec,*XkbRF_RulePtr; @@ -130,9 +89,7 @@ XkbRF_DescribeVarsRec layouts; XkbRF_DescribeVarsRec variants; XkbRF_DescribeVarsRec options; - unsigned short sz_extra; unsigned short num_extra; - char ** extra_names; XkbRF_DescribeVarsPtr extra; unsigned short sz_rules; @@ -143,16 +100,13 @@ XkbRF_GroupPtr groups; } XkbRF_RulesRec, *XkbRF_RulesPtr; -#define _XKB_RF_NAMES_PROP_ATOM "_XKB_RULES_NAMES" -#define _XKB_RF_NAMES_PROP_MAXLEN 1024 - /* Action structures used in the server */ -extern Bool +extern bool XkbcRF_GetComponents(XkbRF_RulesPtr rules, XkbRF_VarDefsPtr defs, struct xkb_component_names * names); -extern Bool +extern bool XkbcRF_LoadRules(FILE *file, XkbRF_RulesPtr rules); extern void diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/bad.xkb libxkbcommon-0.1.0~git20120510.409ec8a1/test/bad.xkb --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/bad.xkb 2012-05-01 18:28:54.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/bad.xkb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -xkb_keymap { - xkb_types { include "complete" }; - xkb_compat { include "complete" }; - xkb_symbols { include "pc+us" }; -}; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/basic.xkb libxkbcommon-0.1.0~git20120510.409ec8a1/test/basic.xkb --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/basic.xkb 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/basic.xkb 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -xkb_keymap { - xkb_keycodes { include "xfree86+aliases(qwerty)" }; - xkb_types { include "complete" }; - xkb_compat { include "complete" }; - xkb_symbols { include "pc+us" }; -}; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/canonicalise.c libxkbcommon-0.1.0~git20120510.409ec8a1/test/canonicalise.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/canonicalise.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/canonicalise.c 2012-05-10 10:10:26.000000000 +0000 @@ -23,60 +23,116 @@ * Author: Daniel Stone */ -#include "xkbcommon/xkbcommon.h" +#include #include #include #include -int main(int argc, char *argv[]) +#include "xkbcommon/xkbcommon.h" + +struct test_data { + struct xkb_component_names new; + struct xkb_component_names old; + int pass_old; + const char *exp_keycodes; + const char *exp_compat; + const char *exp_symbols; + const char *exp_types; +}; + +static struct test_data * +new_data(void) +{ + return calloc(1, sizeof(struct test_data)); +} + +static void +free_data(struct test_data *data) +{ + free(data->new.keycodes); + free(data->new.compat); + free(data->new.symbols); + free(data->new.types); + free(data->old.keycodes); + free(data->old.compat); + free(data->old.symbols); + free(data->old.types); + free(data); +} + +static void +set_new(struct test_data *data, const char *keycodes, const char *compat, + const char *symbols, const char *types) +{ + data->new.keycodes = strdup(keycodes); + data->new.compat = strdup(compat); + data->new.symbols = strdup(symbols); + data->new.types = strdup(types); +} + +static void +set_old(struct test_data *data, const char *keycodes, const char *compat, + const char *symbols, const char *types) +{ + data->old.keycodes = strdup(keycodes); + data->old.compat = strdup(compat); + data->old.symbols = strdup(symbols); + data->old.types = strdup(types); + data->pass_old = 1; +} + +static void +set_exp(struct test_data *data, const char *keycodes, const char *compat, + const char *symbols, const char *types) +{ + data->exp_keycodes = keycodes; + data->exp_compat = compat; + data->exp_symbols = symbols; + data->exp_types = types; +} + +static int +test_canonicalise(struct test_data *data) +{ + fprintf(stderr, "New: %s %s %s %s\n", data->new.keycodes, + data->new.compat, data->new.symbols, data->new.types); + if (data->pass_old) + fprintf(stderr, "Old: %s %s %s %s\n", data->old.keycodes, + data->old.compat, data->old.symbols, data->old.types); + fprintf(stderr, "Expected: %s %s %s %s\n", data->exp_keycodes, + data->exp_compat, data->exp_symbols, data->exp_types); + + if (data->pass_old) + xkb_canonicalise_components(&data->new, &data->old); + else + xkb_canonicalise_components(&data->new, NULL); + + fprintf(stderr, "Received: %s %s %s %s\n\n", data->new.keycodes, + data->new.compat, data->new.symbols, data->new.types); + + return (strcmp(data->new.keycodes, data->exp_keycodes) == 0) && + (strcmp(data->new.compat, data->exp_compat) == 0) && + (strcmp(data->new.symbols, data->exp_symbols) == 0) && + (strcmp(data->new.types, data->exp_types) == 0); +} + +int +main(void) { - struct xkb_component_names *new, *old = NULL; + struct test_data *twopart, *onepart; - if (argc != 5 && argc != 9) { - fprintf(stderr, "usage: canonicalise (new kccgst) [old kccgst]\n"); - return 1; - } - - - new = calloc(1, sizeof(*new)); - if (!new) { - fprintf(stderr, "failed to calloc new\n"); - return 1; - } - new->keycodes = strdup(argv[1]); - new->compat = strdup(argv[2]); - new->symbols = strdup(argv[3]); - new->types = strdup(argv[4]); - - if (argc == 9) { - old = calloc(1, sizeof(*old)); - if (!old) { - fprintf(stderr, "failed to calloc old\n"); - return 1; - } - old->keycodes = strdup(argv[5]); - old->compat = strdup(argv[6]); - old->symbols = strdup(argv[7]); - old->types = strdup(argv[8]); - } - - xkb_canonicalise_components(new, old); - - printf("%s %s %s %s\n", new->keycodes, new->compat, new->symbols, new->types); - - free(new->keycodes); - free(new->compat); - free(new->symbols); - free(new->types); - free(new); - - if (old) { - free(old->keycodes); - free(old->compat); - free(old->symbols); - free(old->types); - free(old); - } + twopart = new_data(); + set_new(twopart, "+inet(pc104)", "%+complete", "pc(pc104)+%+ctrl(nocaps)", "|complete"); + set_old(twopart, "xfree86", "basic", "us(dvorak)", "xfree86"); + set_exp(twopart, "xfree86+inet(pc104)", "basic+complete", "pc(pc104)+us(dvorak)+ctrl(nocaps)", "xfree86|complete"); + assert(test_canonicalise(twopart)); + free_data(twopart); + + onepart = new_data(); + set_new(onepart, "evdev", "complete", "pc(pc104)+us+compose(ralt)", "complete"); + set_exp(onepart, "evdev", "complete", "pc(pc104)+us+compose(ralt)", "complete"); + assert(test_canonicalise(onepart)); + free_data(onepart); return 0; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/canonicalise.sh libxkbcommon-0.1.0~git20120510.409ec8a1/test/canonicalise.sh --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/canonicalise.sh 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/canonicalise.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -#!/bin/sh -x - -srcdir=${srcdir-.} -builddir=${builddir-.} - -name=canonicalise -prog="$builddir/$name$EXEEXT" -log="$builddir/$name.log" - -log_kccgst() -{ - echo " keycodes: $1" >>"$log" - echo " compat: $2" >>"$log" - echo " symbols: $3" >>"$log" - echo " types: $4" >>"$log" -} - -rm -f "$log" - -test() { - ret=`$prog $2 $3` - echo "Input (new):" >>"$log" - log_kccgst $2 - echo >>"$log" - echo "Input (old):" >>"$log" - log_kccgst $3 - echo >>"$log" - echo "Expecting:" >>"$log" - log_kccgst $1 - echo >>"$log" - echo "Received:" >>"$log" - log_kccgst $ret - echo >>"$log" - - ret=`echo "$ret" | sed -e 's/[ ]*/ /g;'` - exp=`echo "$1" | sed -e 's/[ ]*/ /g;'` - - if ! [ "$ret" = "$exp" ]; then - echo "Error: Return and expectations different" >>"$log" - exit 1 - fi -} - -# This is a bit of a horror, but I can't really remember how to properly -# handle arrays in shell, and I'm offline. -twopart_new="+inet(pc104) %+complete pc(pc104)+%+ctrl(nocaps) |complete" -twopart_old="xfree86 basic us(dvorak) xfree86" -twopart_exp="xfree86+inet(pc104) basic+complete pc(pc104)+us(dvorak)+ctrl(nocaps) xfree86|complete" - -onepart_new="evdev complete pc(pc104)+us+compose(ralt) complete" -onepart_exp="evdev complete pc(pc104)+us+compose(ralt) complete" - -test "$twopart_exp" "$twopart_new" "$twopart_old" -echo >>"$log" -echo >>"$log" -test "$onepart_exp" "$onepart_new" diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/comprehensive-plus-geom.xkb libxkbcommon-0.1.0~git20120510.409ec8a1/test/comprehensive-plus-geom.xkb --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/comprehensive-plus-geom.xkb 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/comprehensive-plus-geom.xkb 1970-01-01 00:00:00.000000000 +0000 @@ -1,1813 +0,0 @@ -xkb_keymap { -xkb_keycodes "evdev+aliases(qwerty)" { - minimum = 8; - maximum = 255; - = 9; - = 10; - = 11; - = 12; - = 13; - = 14; - = 15; - = 16; - = 17; - = 18; - = 19; - = 20; - = 21; - = 22; - = 23; - = 24; - = 25; - = 26; - = 27; - = 28; - = 29; - = 30; - = 31; - = 32; - = 33; - = 34; - = 35; - = 36; - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 49; - = 50; - = 51; - = 52; - = 53; - = 54; - = 55; - = 56; - = 57; - = 58; - = 59; - = 60; - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - = 73; - = 74; - = 75; - = 76; - = 77; - = 78; - = 79; - = 80; - = 81; - = 82; - = 83; - = 84; - = 85; - = 86; - = 87; - = 88; - = 89; - = 90; - = 91; - = 92; - = 94; - = 95; - = 96; - = 97; - = 98; - = 99; - = 100; - = 101; - = 102; - = 103; - = 104; - = 105; - = 106; - = 107; - = 108; - = 109; - = 110; - = 111; - = 112; - = 113; - = 114; - = 115; - = 116; - = 117; - = 118; - = 119; - = 120; - = 121; - = 122; - = 123; - = 124; - = 125; - = 126; - = 127; - = 128; - = 129; - = 130; - = 131; - = 132; - = 133; - = 134; - = 135; - = 136; - = 137; - = 138; - = 139; - = 140; - = 141; - = 142; - = 143; - = 144; - = 145; - = 146; - = 147; - = 148; - = 149; - = 150; - = 151; - = 152; - = 153; - = 154; - = 155; - = 156; - = 157; - = 158; - = 159; - = 160; - = 161; - = 162; - = 163; - = 164; - = 165; - = 166; - = 167; - = 168; - = 169; - = 170; - = 171; - = 172; - = 173; - = 174; - = 175; - = 176; - = 177; - = 178; - = 179; - = 180; - = 181; - = 182; - = 183; - = 184; - = 185; - = 186; - = 187; - = 188; - = 189; - = 190; - = 191; - = 192; - = 193; - = 194; - = 195; - = 196; - = 197; - = 198; - = 199; - = 200; - = 201; - = 202; - = 203; - = 204; - = 205; - = 206; - = 207; - = 208; - = 209; - = 210; - = 211; - = 212; - = 213; - = 214; - = 215; - = 216; - = 217; - = 218; - = 219; - = 220; - = 221; - = 222; - = 223; - = 224; - = 225; - = 226; - = 227; - = 228; - = 229; - = 230; - = 231; - = 232; - = 233; - = 234; - = 235; - = 236; - = 237; - = 238; - = 239; - = 240; - = 241; - = 242; - = 243; - = 244; - = 245; - = 246; - = 247; - = 248; - = 249; - = 250; - = 251; - = 252; - = 253; - indicator 1 = "Caps Lock"; - indicator 2 = "Num Lock"; - indicator 3 = "Scroll Lock"; - indicator 4 = "Compose"; - indicator 5 = "Kana"; - indicator 6 = "Sleep"; - indicator 7 = "Suspend"; - indicator 8 = "Mute"; - indicator 9 = "Misc"; - indicator 10 = "Mail"; - indicator 11 = "Charging"; - virtual indicator 12 = "Shift Lock"; - virtual indicator 13 = "Group 2"; - virtual indicator 14 = "Mouse Keys"; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; -}; - -xkb_types "complete" { - - virtual_modifiers NumLock,Alt,LevelThree,LAlt,RAlt,RControl,LControl,ScrollLock,LevelFive,AltGr,Meta,Super,Hyper; - - type "ONE_LEVEL" { - modifiers= none; - level_name[Level1]= "Any"; - }; - type "TWO_LEVEL" { - modifiers= Shift; - map[Shift]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - }; - type "ALPHABETIC" { - modifiers= Shift+Lock; - map[Shift]= Level2; - map[Lock]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "Caps"; - }; - type "KEYPAD" { - modifiers= Shift+NumLock; - map[Shift]= Level2; - map[NumLock]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "Number"; - }; - type "SHIFT+ALT" { - modifiers= Shift+Alt; - map[Shift+Alt]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift+Alt"; - }; - type "PC_CONTROL_LEVEL2" { - modifiers= Control; - map[Control]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "Control"; - }; - type "PC_LCONTROL_LEVEL2" { - modifiers= LControl; - map[LControl]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "LControl"; - }; - type "PC_RCONTROL_LEVEL2" { - modifiers= RControl; - map[RControl]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "RControl"; - }; - type "PC_ALT_LEVEL2" { - modifiers= Alt; - map[Alt]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "Alt"; - }; - type "PC_LALT_LEVEL2" { - modifiers= LAlt; - map[LAlt]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "LAlt"; - }; - type "PC_RALT_LEVEL2" { - modifiers= RAlt; - map[RAlt]= Level2; - level_name[Level1]= "Base"; - level_name[Level2]= "RAlt"; - }; - type "CTRL+ALT" { - modifiers= Shift+Control+Alt+LevelThree; - map[Shift]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[Control+Alt]= Level5; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Shift Alt"; - level_name[Level5]= "Ctrl+Alt"; - }; - type "LOCAL_EIGHT_LEVEL" { - modifiers= Shift+Lock+Control+LevelThree; - map[Shift+Lock]= Level1; - map[Shift]= Level2; - map[Lock]= Level2; - map[LevelThree]= Level3; - map[Shift+Lock+LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[Lock+LevelThree]= Level4; - map[Control]= Level5; - map[Shift+Lock+Control]= Level5; - map[Shift+Control]= Level6; - map[Lock+Control]= Level6; - map[Control+LevelThree]= Level7; - map[Shift+Lock+Control+LevelThree]= Level7; - map[Shift+Control+LevelThree]= Level8; - map[Lock+Control+LevelThree]= Level8; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Level3"; - level_name[Level4]= "Shift Level3"; - level_name[Level5]= "Ctrl"; - level_name[Level6]= "Shift Ctrl"; - level_name[Level7]= "Level3 Ctrl"; - level_name[Level8]= "Shift Level3 Ctrl"; - }; - type "THREE_LEVEL" { - modifiers= Shift+LevelThree; - map[Shift]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level3; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Level3"; - }; - type "EIGHT_LEVEL" { - modifiers= Shift+LevelThree+LevelFive; - map[Shift]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[LevelFive]= Level5; - map[Shift+LevelFive]= Level6; - map[LevelThree+LevelFive]= Level7; - map[Shift+LevelThree+LevelFive]= Level8; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Shift Alt"; - level_name[Level5]= "X"; - level_name[Level6]= "X Shift"; - level_name[Level7]= "X Alt Base"; - level_name[Level8]= "X Shift Alt"; - }; - type "EIGHT_LEVEL_ALPHABETIC" { - modifiers= Shift+Lock+LevelThree+LevelFive; - map[Shift]= Level2; - map[Lock]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[Lock+LevelThree]= Level4; - map[Shift+Lock+LevelThree]= Level3; - map[LevelFive]= Level5; - map[Shift+LevelFive]= Level6; - map[Lock+LevelFive]= Level6; - map[LevelThree+LevelFive]= Level7; - map[Shift+LevelThree+LevelFive]= Level8; - map[Lock+LevelThree+LevelFive]= Level8; - map[Shift+Lock+LevelThree+LevelFive]= Level7; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Shift Alt"; - level_name[Level5]= "X"; - level_name[Level6]= "X Shift"; - level_name[Level7]= "X Alt Base"; - level_name[Level8]= "X Shift Alt"; - }; - type "EIGHT_LEVEL_SEMIALPHABETIC" { - modifiers= Shift+Lock+LevelThree+LevelFive; - map[Shift]= Level2; - map[Lock]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[Lock+LevelThree]= Level3; - preserve[Lock+LevelThree]= Lock; - map[Shift+Lock+LevelThree]= Level4; - preserve[Shift+Lock+LevelThree]= Lock; - map[LevelFive]= Level5; - map[Shift+LevelFive]= Level6; - map[Lock+LevelFive]= Level6; - preserve[Lock+LevelFive]= Lock; - map[LevelThree+LevelFive]= Level7; - map[Shift+LevelThree+LevelFive]= Level8; - map[Lock+LevelThree+LevelFive]= Level7; - preserve[Lock+LevelThree+LevelFive]= Lock; - map[Shift+Lock+LevelThree+LevelFive]= Level8; - preserve[Shift+Lock+LevelThree+LevelFive]= Lock; - map[Shift+Lock+LevelFive]= Level1; - preserve[Shift+Lock+LevelFive]= Lock; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Shift Alt"; - level_name[Level5]= "X"; - level_name[Level6]= "X Shift"; - level_name[Level7]= "X Alt Base"; - level_name[Level8]= "X Shift Alt"; - }; - type "FOUR_LEVEL" { - modifiers= Shift+LevelThree; - map[Shift]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Shift Alt"; - }; - type "FOUR_LEVEL_ALPHABETIC" { - modifiers= Shift+Lock+LevelThree; - map[Shift]= Level2; - map[Lock]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[Lock+LevelThree]= Level4; - map[Shift+Lock+LevelThree]= Level3; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Shift Alt"; - }; - type "FOUR_LEVEL_SEMIALPHABETIC" { - modifiers= Shift+Lock+LevelThree; - map[Shift]= Level2; - map[Lock]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[Lock+LevelThree]= Level3; - preserve[Lock+LevelThree]= Lock; - map[Shift+Lock+LevelThree]= Level4; - preserve[Shift+Lock+LevelThree]= Lock; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Shift Alt"; - }; - type "FOUR_LEVEL_MIXED_KEYPAD" { - modifiers= Shift+NumLock+LevelThree; - map[Shift+NumLock]= Level1; - map[NumLock]= Level2; - map[Shift]= Level2; - map[LevelThree]= Level3; - map[NumLock+LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[Shift+NumLock+LevelThree]= Level4; - level_name[Level1]= "Base"; - level_name[Level2]= "Number"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Shift Alt"; - }; - type "FOUR_LEVEL_X" { - modifiers= Shift+Control+Alt+LevelThree; - map[LevelThree]= Level2; - map[Shift+LevelThree]= Level3; - map[Control+Alt]= Level4; - level_name[Level1]= "Base"; - level_name[Level2]= "Alt Base"; - level_name[Level3]= "Shift Alt"; - level_name[Level4]= "Ctrl+Alt"; - }; - type "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC" { - modifiers= Shift+Lock+LevelThree; - map[Shift]= Level2; - map[Lock]= Level4; - preserve[Lock]= Lock; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[Lock+LevelThree]= Level3; - preserve[Lock+LevelThree]= Lock; - map[Shift+Lock+LevelThree]= Level3; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "AltGr Base"; - level_name[Level4]= "Shift AltGr"; - }; - type "FOUR_LEVEL_PLUS_LOCK" { - modifiers= Shift+Lock+LevelThree; - map[Shift]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[Lock]= Level5; - map[Shift+Lock]= Level2; - map[Lock+LevelThree]= Level3; - map[Shift+Lock+LevelThree]= Level4; - level_name[Level1]= "Base"; - level_name[Level2]= "Shift"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Shift Alt"; - level_name[Level5]= "Lock"; - }; - type "FOUR_LEVEL_KEYPAD" { - modifiers= Shift+NumLock+LevelThree; - map[Shift]= Level2; - map[NumLock]= Level2; - map[LevelThree]= Level3; - map[Shift+LevelThree]= Level4; - map[NumLock+LevelThree]= Level4; - map[Shift+NumLock+LevelThree]= Level3; - level_name[Level1]= "Base"; - level_name[Level2]= "Number"; - level_name[Level3]= "Alt Base"; - level_name[Level4]= "Alt Number"; - }; -}; - -xkb_compatibility "complete" { - - virtual_modifiers NumLock,Alt,LevelThree,LAlt,RAlt,RControl,LControl,ScrollLock,LevelFive,AltGr,Meta,Super,Hyper; - - interpret.useModMapMods= AnyLevel; - interpret.repeat= False; - interpret.locking= False; - interpret ISO_Level2_Latch+Exactly(Shift) { - useModMapMods=level1; - action= LatchMods(modifiers=Shift,clearLocks,latchToLock); - }; - interpret Shift_Lock+AnyOf(Shift+Lock) { - action= LockMods(modifiers=Shift); - }; - interpret Num_Lock+AnyOf(all) { - virtualModifier= NumLock; - action= LockMods(modifiers=NumLock); - }; - interpret ISO_Lock+AnyOf(all) { - action= ISOLock(modifiers=modMapMods,affect=all); - }; - interpret ISO_Level3_Shift+AnyOf(all) { - virtualModifier= LevelThree; - useModMapMods=level1; - action= SetMods(modifiers=LevelThree,clearLocks); - }; - interpret ISO_Level3_Latch+AnyOf(all) { - virtualModifier= LevelThree; - useModMapMods=level1; - action= LatchMods(modifiers=LevelThree,clearLocks,latchToLock); - }; - interpret ISO_Level3_Lock+AnyOf(all) { - virtualModifier= LevelThree; - useModMapMods=level1; - action= LockMods(modifiers=LevelThree); - }; - interpret Alt_L+AnyOf(all) { - virtualModifier= Alt; - action= SetMods(modifiers=modMapMods,clearLocks); - }; - interpret Alt_R+AnyOf(all) { - virtualModifier= Alt; - action= SetMods(modifiers=modMapMods,clearLocks); - }; - interpret Meta_L+AnyOf(all) { - virtualModifier= Meta; - action= SetMods(modifiers=modMapMods,clearLocks); - }; - interpret Meta_R+AnyOf(all) { - virtualModifier= Meta; - action= SetMods(modifiers=modMapMods,clearLocks); - }; - interpret Super_L+AnyOf(all) { - virtualModifier= Super; - action= SetMods(modifiers=modMapMods,clearLocks); - }; - interpret Super_R+AnyOf(all) { - virtualModifier= Super; - action= SetMods(modifiers=modMapMods,clearLocks); - }; - interpret Hyper_L+AnyOf(all) { - virtualModifier= Hyper; - action= SetMods(modifiers=modMapMods,clearLocks); - }; - interpret Hyper_R+AnyOf(all) { - virtualModifier= Hyper; - action= SetMods(modifiers=modMapMods,clearLocks); - }; - interpret Scroll_Lock+AnyOf(all) { - virtualModifier= ScrollLock; - action= LockMods(modifiers=modMapMods); - }; - interpret ISO_Level5_Shift+AnyOf(all) { - virtualModifier= LevelFive; - useModMapMods=level1; - action= SetMods(modifiers=LevelFive,clearLocks); - }; - interpret ISO_Level5_Latch+AnyOf(all) { - virtualModifier= LevelFive; - action= LatchMods(modifiers=LevelFive,clearLocks,latchToLock); - }; - interpret ISO_Level5_Lock+AnyOf(all) { - virtualModifier= LevelFive; - action= LockMods(modifiers=LevelFive); - }; - interpret Mode_switch+AnyOfOrNone(all) { - virtualModifier= AltGr; - useModMapMods=level1; - action= SetGroup(group=+1); - }; - interpret ISO_Level3_Shift+AnyOfOrNone(all) { - action= SetMods(modifiers=LevelThree,clearLocks); - }; - interpret ISO_Level3_Latch+AnyOfOrNone(all) { - action= LatchMods(modifiers=LevelThree,clearLocks,latchToLock); - }; - interpret ISO_Level3_Lock+AnyOfOrNone(all) { - action= LockMods(modifiers=LevelThree); - }; - interpret ISO_Group_Latch+AnyOfOrNone(all) { - virtualModifier= AltGr; - useModMapMods=level1; - action= LatchGroup(group=2); - }; - interpret ISO_Next_Group+AnyOfOrNone(all) { - virtualModifier= AltGr; - useModMapMods=level1; - action= LockGroup(group=+1); - }; - interpret ISO_Prev_Group+AnyOfOrNone(all) { - virtualModifier= AltGr; - useModMapMods=level1; - action= LockGroup(group=-1); - }; - interpret ISO_First_Group+AnyOfOrNone(all) { - action= LockGroup(group=1); - }; - interpret ISO_Last_Group+AnyOfOrNone(all) { - action= LockGroup(group=2); - }; - interpret KP_1+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=-1,y=+1); - }; - interpret KP_End+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=-1,y=+1); - }; - interpret KP_2+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+0,y=+1); - }; - interpret KP_Down+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+0,y=+1); - }; - interpret KP_3+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+1,y=+1); - }; - interpret KP_Next+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+1,y=+1); - }; - interpret KP_4+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=-1,y=+0); - }; - interpret KP_Left+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=-1,y=+0); - }; - interpret KP_6+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+1,y=+0); - }; - interpret KP_Right+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+1,y=+0); - }; - interpret KP_7+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=-1,y=-1); - }; - interpret KP_Home+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=-1,y=-1); - }; - interpret KP_8+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+0,y=-1); - }; - interpret KP_Up+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+0,y=-1); - }; - interpret KP_9+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+1,y=-1); - }; - interpret KP_Prior+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+1,y=-1); - }; - interpret KP_5+AnyOfOrNone(all) { - repeat= True; - action= PtrBtn(button=default); - }; - interpret KP_Begin+AnyOfOrNone(all) { - repeat= True; - action= PtrBtn(button=default); - }; - interpret KP_F2+AnyOfOrNone(all) { - repeat= True; - action= SetPtrDflt(affect=button,button=1); - }; - interpret KP_Divide+AnyOfOrNone(all) { - repeat= True; - action= SetPtrDflt(affect=button,button=1); - }; - interpret KP_F3+AnyOfOrNone(all) { - repeat= True; - action= SetPtrDflt(affect=button,button=2); - }; - interpret KP_Multiply+AnyOfOrNone(all) { - repeat= True; - action= SetPtrDflt(affect=button,button=2); - }; - interpret KP_F4+AnyOfOrNone(all) { - repeat= True; - action= SetPtrDflt(affect=button,button=3); - }; - interpret KP_Subtract+AnyOfOrNone(all) { - repeat= True; - action= SetPtrDflt(affect=button,button=3); - }; - interpret KP_Separator+AnyOfOrNone(all) { - repeat= True; - action= PtrBtn(button=default,count=2); - }; - interpret KP_Add+AnyOfOrNone(all) { - repeat= True; - action= PtrBtn(button=default,count=2); - }; - interpret KP_0+AnyOfOrNone(all) { - repeat= True; - action= LockPtrBtn(button=default,affect=lock); - }; - interpret KP_Insert+AnyOfOrNone(all) { - repeat= True; - action= LockPtrBtn(button=default,affect=lock); - }; - interpret KP_Decimal+AnyOfOrNone(all) { - repeat= True; - action= LockPtrBtn(button=default,affect=unlock); - }; - interpret KP_Delete+AnyOfOrNone(all) { - repeat= True; - action= LockPtrBtn(button=default,affect=unlock); - }; - interpret F25+AnyOfOrNone(all) { - repeat= True; - action= SetPtrDflt(affect=button,button=1); - }; - interpret F26+AnyOfOrNone(all) { - repeat= True; - action= SetPtrDflt(affect=button,button=2); - }; - interpret F27+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=-1,y=-1); - }; - interpret F29+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+1,y=-1); - }; - interpret F31+AnyOfOrNone(all) { - repeat= True; - action= PtrBtn(button=default); - }; - interpret F33+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=-1,y=+1); - }; - interpret F35+AnyOfOrNone(all) { - repeat= True; - action= MovePtr(x=+1,y=+1); - }; - interpret Pointer_Button_Dflt+AnyOfOrNone(all) { - action= PtrBtn(button=default); - }; - interpret Pointer_Button1+AnyOfOrNone(all) { - action= PtrBtn(button=1); - }; - interpret Pointer_Button2+AnyOfOrNone(all) { - action= PtrBtn(button=2); - }; - interpret Pointer_Button3+AnyOfOrNone(all) { - action= PtrBtn(button=3); - }; - interpret Pointer_DblClick_Dflt+AnyOfOrNone(all) { - action= PtrBtn(button=default,count=2); - }; - interpret Pointer_DblClick1+AnyOfOrNone(all) { - action= PtrBtn(button=1,count=2); - }; - interpret Pointer_DblClick2+AnyOfOrNone(all) { - action= PtrBtn(button=2,count=2); - }; - interpret Pointer_DblClick3+AnyOfOrNone(all) { - action= PtrBtn(button=3,count=2); - }; - interpret Pointer_Drag_Dflt+AnyOfOrNone(all) { - action= LockPtrBtn(button=default,affect=both); - }; - interpret Pointer_Drag1+AnyOfOrNone(all) { - action= LockPtrBtn(button=1,affect=both); - }; - interpret Pointer_Drag2+AnyOfOrNone(all) { - action= LockPtrBtn(button=2,affect=both); - }; - interpret Pointer_Drag3+AnyOfOrNone(all) { - action= LockPtrBtn(button=3,affect=both); - }; - interpret Pointer_EnableKeys+AnyOfOrNone(all) { - action= LockControls(controls=MouseKeys); - }; - interpret Pointer_Accelerate+AnyOfOrNone(all) { - action= LockControls(controls=MouseKeysAccel); - }; - interpret Pointer_DfltBtnNext+AnyOfOrNone(all) { - action= SetPtrDflt(affect=button,button=+1); - }; - interpret Pointer_DfltBtnPrev+AnyOfOrNone(all) { - action= SetPtrDflt(affect=button,button=-1); - }; - interpret AccessX_Enable+AnyOfOrNone(all) { - action= LockControls(controls=AccessXKeys); - }; - interpret AccessX_Feedback_Enable+AnyOfOrNone(all) { - action= LockControls(controls=AccessXFeedback); - }; - interpret RepeatKeys_Enable+AnyOfOrNone(all) { - action= LockControls(controls=RepeatKeys); - }; - interpret SlowKeys_Enable+AnyOfOrNone(all) { - action= LockControls(controls=SlowKeys); - }; - interpret BounceKeys_Enable+AnyOfOrNone(all) { - action= LockControls(controls=BounceKeys); - }; - interpret StickyKeys_Enable+AnyOfOrNone(all) { - action= LockControls(controls=StickyKeys); - }; - interpret MouseKeys_Enable+AnyOfOrNone(all) { - action= LockControls(controls=MouseKeys); - }; - interpret MouseKeys_Accel_Enable+AnyOfOrNone(all) { - action= LockControls(controls=MouseKeysAccel); - }; - interpret Overlay1_Enable+AnyOfOrNone(all) { - action= LockControls(controls=Overlay1); - }; - interpret Overlay2_Enable+AnyOfOrNone(all) { - action= LockControls(controls=Overlay2); - }; - interpret AudibleBell_Enable+AnyOfOrNone(all) { - action= LockControls(controls=AudibleBell); - }; - interpret Terminate_Server+AnyOfOrNone(all) { - action= Terminate(); - }; - interpret Alt_L+AnyOfOrNone(all) { - action= SetMods(modifiers=Alt,clearLocks); - }; - interpret Alt_R+AnyOfOrNone(all) { - action= SetMods(modifiers=Alt,clearLocks); - }; - interpret Meta_L+AnyOfOrNone(all) { - action= SetMods(modifiers=Meta,clearLocks); - }; - interpret Meta_R+AnyOfOrNone(all) { - action= SetMods(modifiers=Meta,clearLocks); - }; - interpret Super_L+AnyOfOrNone(all) { - action= SetMods(modifiers=Super,clearLocks); - }; - interpret Super_R+AnyOfOrNone(all) { - action= SetMods(modifiers=Super,clearLocks); - }; - interpret Hyper_L+AnyOfOrNone(all) { - action= SetMods(modifiers=Hyper,clearLocks); - }; - interpret Hyper_R+AnyOfOrNone(all) { - action= SetMods(modifiers=Hyper,clearLocks); - }; - interpret Shift_L+AnyOfOrNone(all) { - action= SetMods(modifiers=Shift,clearLocks); - }; - interpret XF86Switch_VT_1+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=1,!same); - }; - interpret XF86Switch_VT_2+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=2,!same); - }; - interpret XF86Switch_VT_3+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=3,!same); - }; - interpret XF86Switch_VT_4+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=4,!same); - }; - interpret XF86Switch_VT_5+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=5,!same); - }; - interpret XF86Switch_VT_6+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=6,!same); - }; - interpret XF86Switch_VT_7+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=7,!same); - }; - interpret XF86Switch_VT_8+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=8,!same); - }; - interpret XF86Switch_VT_9+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=9,!same); - }; - interpret XF86Switch_VT_10+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=10,!same); - }; - interpret XF86Switch_VT_11+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=11,!same); - }; - interpret XF86Switch_VT_12+AnyOfOrNone(all) { - repeat= True; - action= SwitchScreen(screen=12,!same); - }; - interpret XF86LogGrabInfo+AnyOfOrNone(all) { - repeat= True; - action= Private(type=0x86,data[0]=0x50,data[1]=0x72,data[2]=0x47,data[3]=0x72,data[4]=0x62,data[5]=0x73,data[6]=0x00); - }; - interpret XF86LogWindowTree+AnyOfOrNone(all) { - repeat= True; - action= Private(type=0x86,data[0]=0x50,data[1]=0x72,data[2]=0x57,data[3]=0x69,data[4]=0x6e,data[5]=0x73,data[6]=0x00); - }; - interpret XF86Next_VMode+AnyOfOrNone(all) { - repeat= True; - action= Private(type=0x86,data[0]=0x2b,data[1]=0x56,data[2]=0x4d,data[3]=0x6f,data[4]=0x64,data[5]=0x65,data[6]=0x00); - }; - interpret XF86Prev_VMode+AnyOfOrNone(all) { - repeat= True; - action= Private(type=0x86,data[0]=0x2d,data[1]=0x56,data[2]=0x4d,data[3]=0x6f,data[4]=0x64,data[5]=0x65,data[6]=0x00); - }; - interpret ISO_Level5_Shift+AnyOfOrNone(all) { - action= SetMods(modifiers=LevelFive,clearLocks); - }; - interpret ISO_Level5_Latch+AnyOfOrNone(all) { - action= LatchMods(modifiers=LevelFive,clearLocks,latchToLock); - }; - interpret ISO_Level5_Lock+AnyOfOrNone(all) { - action= LockMods(modifiers=LevelFive); - }; - interpret Caps_Lock+AnyOfOrNone(all) { - action= LockMods(modifiers=Lock); - }; - interpret Any+Exactly(Lock) { - action= LockMods(modifiers=Lock); - }; - interpret Any+AnyOf(all) { - action= SetMods(modifiers=modMapMods,clearLocks); - }; - indicator "Caps Lock" { - !allowExplicit; - whichModState= locked; - modifiers= Lock; - }; - indicator "Num Lock" { - !allowExplicit; - whichModState= locked; - modifiers= NumLock; - }; - indicator "Scroll Lock" { - whichModState= locked; - modifiers= ScrollLock; - }; - indicator "Shift Lock" { - !allowExplicit; - whichModState= locked; - modifiers= Shift; - }; - indicator "Group 2" { - !allowExplicit; - groups= 0xfe; - }; - indicator "Mouse Keys" { - indicatorDrivesKeyboard; - controls= mouseKeys; - }; -}; - -xkb_symbols "pc+us+inet(evdev)+ctrl(nocaps)+compose(rwin)+terminate(ctrl_alt_bksp)" { - - name[group1]="English (US)"; - - key { [ Escape ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ BackSpace, BackSpace, NoSymbol, NoSymbol, Terminate_Server ] - }; - key { [ Tab, ISO_Left_Tab ] }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ q, Q ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ w, W ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ e, E ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ r, R ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ t, T ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ y, Y ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ u, U ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ i, I ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ o, O ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ p, P ] - }; - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright ] }; - key { [ Return ] }; - key { [ Control_L ] }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ a, A ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ s, S ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ d, D ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ f, F ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ g, G ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ h, H ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ j, J ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ k, K ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ l, L ] - }; - key { [ semicolon, colon ] }; - key { [ apostrophe, quotedbl ] }; - key { [ grave, asciitilde ] }; - key { [ Shift_L ] }; - key { [ backslash, bar ] }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ z, Z ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ x, X ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ c, C ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ v, V ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ b, B ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ n, N ] - }; - key { - type= "ALPHABETIC", - symbols[Group1]= [ m, M ] - }; - key { [ comma, less ] }; - key { [ period, greater ] }; - key { [ slash, question ] }; - key { [ Shift_R ] }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ KP_Multiply, KP_Multiply, KP_Multiply, KP_Multiply, XF86ClearGrab ] - }; - key { [ Alt_L, Meta_L ] }; - key { [ space ] }; - key { [ Control_L, Control_L ] }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F1, F1, F1, F1, XF86Switch_VT_1 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F2, F2, F2, F2, XF86Switch_VT_2 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F3, F3, F3, F3, XF86Switch_VT_3 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F4, F4, F4, F4, XF86Switch_VT_4 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F5, F5, F5, F5, XF86Switch_VT_5 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F6, F6, F6, F6, XF86Switch_VT_6 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F7, F7, F7, F7, XF86Switch_VT_7 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F8, F8, F8, F8, XF86Switch_VT_8 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F9, F9, F9, F9, XF86Switch_VT_9 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F10, F10, F10, F10, XF86Switch_VT_10 ] - }; - key { [ Num_Lock ] }; - key { [ Scroll_Lock ] }; - key { [ KP_Home, KP_7 ] }; - key { [ KP_Up, KP_8 ] }; - key { [ KP_Prior, KP_9 ] }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86Prev_VMode ] - }; - key { [ KP_Left, KP_4 ] }; - key { [ KP_Begin, KP_5 ] }; - key { [ KP_Right, KP_6 ] }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ KP_Add, KP_Add, KP_Add, KP_Add, XF86Next_VMode ] - }; - key { [ KP_End, KP_1 ] }; - key { [ KP_Down, KP_2 ] }; - key { [ KP_Next, KP_3 ] }; - key { [ KP_Insert, KP_0 ] }; - key { [ KP_Delete, KP_Decimal ] }; - key { [ ISO_Level3_Shift ] }; - key { - type= "FOUR_LEVEL", - symbols[Group1]= [ less, greater, bar, brokenbar ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F11, F11, F11, F11, XF86Switch_VT_11 ] - }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ F12, F12, F12, F12, XF86Switch_VT_12 ] - }; - key { [ Katakana ] }; - key { [ Hiragana ] }; - key { [ Henkan_Mode ] }; - key { [ Hiragana_Katakana ] }; - key { [ Muhenkan ] }; - key { [ KP_Enter ] }; - key { [ Control_R ] }; - key { - type= "CTRL+ALT", - symbols[Group1]= [ KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86Ungrab ] - }; - key { - type= "PC_ALT_LEVEL2", - symbols[Group1]= [ Print, Sys_Req ] - }; - key { - type= "TWO_LEVEL", - symbols[Group1]= [ Alt_R, Meta_R ] - }; - key { [ Linefeed ] }; - key { [ Home ] }; - key { [ Up ] }; - key { [ Prior ] }; - key { [ Left ] }; - key { [ Right ] }; - key { [ End ] }; - key { [ Down ] }; - key { [ Next ] }; - key { [ Insert ] }; - key { [ Delete ] }; - key { [ XF86AudioMute ] }; - key { [ XF86AudioLowerVolume ] }; - key { [ XF86AudioRaiseVolume ] }; - key { [ XF86PowerOff ] }; - key { [ KP_Equal ] }; - key { [ plusminus ] }; - key { - type= "PC_CONTROL_LEVEL2", - symbols[Group1]= [ Pause, Break ] - }; - key { [ XF86LaunchA ] }; - key { [ KP_Decimal, KP_Decimal ] }; - key { [ Hangul ] }; - key { [ Hangul_Hanja ] }; - key { [ Super_L ] }; - key { - type= "TWO_LEVEL", - symbols[Group1]= [ Multi_key, Multi_key ] - }; - key { [ Menu ] }; - key { [ Cancel ] }; - key { [ Redo ] }; - key { [ SunProps ] }; - key { [ Undo ] }; - key { [ SunFront ] }; - key { [ XF86Copy ] }; - key { [ SunOpen ] }; - key { [ XF86Paste ] }; - key { [ Find ] }; - key { [ XF86Cut ] }; - key { [ Help ] }; - key { [ XF86MenuKB ] }; - key { [ XF86Calculator ] }; - key { [ XF86Sleep ] }; - key { [ XF86WakeUp ] }; - key { [ XF86Explorer ] }; - key { [ XF86Send ] }; - key { [ XF86Xfer ] }; - key { [ XF86Launch1 ] }; - key { [ XF86Launch2 ] }; - key { [ XF86WWW ] }; - key { [ XF86DOS ] }; - key { [ XF86ScreenSaver ] }; - key { [ XF86RotateWindows ] }; - key { [ XF86Mail ] }; - key { [ XF86Favorites ] }; - key { [ XF86MyComputer ] }; - key { [ XF86Back ] }; - key { [ XF86Forward ] }; - key { [ XF86Eject ] }; - key { [ XF86Eject, XF86Eject ] }; - key { [ XF86AudioNext ] }; - key { [ XF86AudioPlay, XF86AudioPause ] }; - key { [ XF86AudioPrev ] }; - key { [ XF86AudioStop, XF86Eject ] }; - key { [ XF86AudioRecord ] }; - key { [ XF86AudioRewind ] }; - key { [ XF86Phone ] }; - key { [ XF86Tools ] }; - key { [ XF86HomePage ] }; - key { [ XF86Reload ] }; - key { [ XF86Close ] }; - key { [ XF86ScrollUp ] }; - key { [ XF86ScrollDown ] }; - key { [ parenleft ] }; - key { [ parenright ] }; - key { [ XF86New ] }; - key { [ Redo ] }; - key { [ XF86Tools ] }; - key { [ XF86Launch5 ] }; - key { [ XF86Launch6 ] }; - key { [ XF86Launch7 ] }; - key { [ XF86Launch8 ] }; - key { [ XF86Launch9 ] }; - key { [ XF86TouchpadToggle ] }; - key { [ XF86TouchpadOn ] }; - key { [ XF86TouchpadOff ] }; - key { [ Mode_switch ] }; - key { [ NoSymbol, Alt_L ] }; - key { [ NoSymbol, Meta_L ] }; - key { [ NoSymbol, Super_L ] }; - key { [ NoSymbol, Hyper_L ] }; - key { [ XF86AudioPlay ] }; - key { [ XF86AudioPause ] }; - key { [ XF86Launch3 ] }; - key { [ XF86Launch4 ] }; - key { [ XF86LaunchB ] }; - key { [ XF86Suspend ] }; - key { [ XF86Close ] }; - key { [ XF86AudioPlay ] }; - key { [ XF86AudioForward ] }; - key { [ Print ] }; - key { [ XF86WebCam ] }; - key { [ XF86Mail ] }; - key { [ XF86Messenger ] }; - key { [ XF86Search ] }; - key { [ XF86Go ] }; - key { [ XF86Finance ] }; - key { [ XF86Game ] }; - key { [ XF86Shop ] }; - key { [ Cancel ] }; - key { [ XF86MonBrightnessDown ] }; - key { [ XF86MonBrightnessUp ] }; - key { [ XF86AudioMedia ] }; - key { [ XF86Display ] }; - key { [ XF86KbdLightOnOff ] }; - key { [ XF86KbdBrightnessDown ] }; - key { [ XF86KbdBrightnessUp ] }; - key { [ XF86Send ] }; - key { [ XF86Reply ] }; - key { [ XF86MailForward ] }; - key { [ XF86Save ] }; - key { [ XF86Documents ] }; - key { [ XF86Battery ] }; - key { [ XF86Bluetooth ] }; - key { [ XF86WLAN ] }; - modifier_map Control { }; - modifier_map Shift { }; - modifier_map Shift { }; - modifier_map Mod1 { }; - modifier_map Control { }; - modifier_map Mod2 { }; - modifier_map Mod5 { }; - modifier_map Control { }; - modifier_map Mod1 { }; - modifier_map Mod4 { }; - modifier_map Mod5 { }; - modifier_map Mod1 { }; - modifier_map Mod4 { }; - modifier_map Mod4 { }; -}; - -xkb_geometry "pc(pc105)" { - - width= 470; - height= 180; - - alias = ; - alias = ; - - baseColor= "white"; - labelColor= "black"; - xfont= "-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1"; - description= "Generic 105"; - - shape "NORM" { - corner= 1, - { [ 18, 18 ] }, - { [ 2, 1 ], [ 16, 16 ] } - }; - shape "BKSP" { - corner= 1, - { [ 38, 18 ] }, - { [ 2, 1 ], [ 36, 16 ] } - }; - shape "TABK" { - corner= 1, - { [ 28, 18 ] }, - { [ 2, 1 ], [ 26, 16 ] } - }; - shape "BKSL" { - corner= 1, - { [ 28, 18 ] }, - { [ 2, 1 ], [ 26, 16 ] } - }; - shape "RTRN" { - corner= 1, - { [ 0, 0 ], [ 28, 0 ], [ 28, 37 ], [ 5, 37 ], - [ 5, 18 ], [ 0, 18 ] }, - { [ 2, 1 ], [ 26, 1 ], [ 26, 35 ], [ 7, 35 ], - [ 7, 16 ], [ 2, 16 ] }, - approx= { [ 5, 0 ], [ 28, 37 ] } - }; - shape "CAPS" { - corner= 1, - { [ 33, 18 ] }, - { [ 2, 1 ], [ 31, 16 ] } - }; - shape "LFSH" { - corner= 1, - { [ 25, 18 ] }, - { [ 2, 1 ], [ 23, 16 ] } - }; - shape "RTSH" { - corner= 1, - { [ 50, 18 ] }, - { [ 2, 1 ], [ 48, 16 ] } - }; - shape "MODK" { - corner= 1, - { [ 27, 18 ] }, - { [ 2, 1 ], [ 25, 16 ] } - }; - shape "SMOD" { - corner= 1, - { [ 23, 18 ] }, - { [ 2, 1 ], [ 21, 16 ] } - }; - shape "SPCE" { - corner= 1, - { [ 113, 18 ] }, - { [ 2, 1 ], [ 111, 16 ] } - }; - shape "KP0" { - corner= 1, - { [ 37, 18 ] }, - { [ 2, 1 ], [ 35, 16 ] } - }; - shape "KPAD" { - corner= 1, - { [ 18, 37 ] }, - { [ 2, 1 ], [ 16, 35 ] } - }; - shape "LEDS" { { [ 75, 20 ] } }; - shape "LED" { { [ 5, 1 ] } }; - section "Function" { - key.color= "grey20"; - priority= 7; - top= 22; - left= 19; - width= 351; - height= 19; - row { - top= 1; - left= 1; - keys { - { , "NORM", 1 }, - { , "NORM", 20, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 11, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 11, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 8, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" } - }; - }; - }; // End of "Function" section - - section "Alpha" { - key.color= "white"; - priority= 8; - top= 61; - left= 19; - width= 287; - height= 95; - row { - top= 1; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "BKSP", 1, color="grey20" } - }; - }; - row { - top= 20; - left= 1; - keys { - { , "TABK", 1, color="grey20" }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "RTRN", 1, color="grey20" } - }; - }; - row { - top= 39; - left= 1; - keys { - { , "CAPS", 1, color="grey20" }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 } - }; - }; - row { - top= 58; - left= 1; - keys { - { , "LFSH", 1, color="grey20" }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "RTSH", 1, color="grey20" } - }; - }; - row { - top= 77; - left= 1; - keys { - { , "MODK", 1, color="grey20" }, - { , "SMOD", 1, color="grey20" }, - { , "SMOD", 1, color="grey20" }, - { , "SPCE", 1 }, - { , "SMOD", 1, color="grey20" }, - { , "SMOD", 1, color="grey20" }, - { , "SMOD", 1, color="grey20" }, - { , "SMOD", 1, color="grey20" } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - key.color= "grey20"; - priority= 9; - top= 61; - left= 312; - width= 58; - height= 95; - row { - top= 1; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 20; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 58; - left= 20; - keys { - { , "NORM", 1 } - }; - }; - row { - top= 77; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - }; // End of "Editing" section - - section "Keypad" { - key.color= "grey20"; - priority= 10; - top= 61; - left= 376; - width= 77; - height= 95; - row { - top= 1; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 } - }; - }; - row { - top= 20; - left= 1; - keys { - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "KPAD", 1 } - }; - }; - row { - top= 39; - left= 1; - keys { - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" } - }; - }; - row { - top= 58; - left= 1; - keys { - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "NORM", 1, color="white" }, - { , "KPAD", 1 } - }; - }; - row { - top= 77; - left= 1; - keys { - { , "KP0", 1, color="white" }, - { , "NORM", 1, color="white" } - }; - }; - }; // End of "Keypad" section - - solid "LedPanel" { - top= 22; - left= 377; - priority= 0; - color= "grey10"; - shape= "LEDS"; - }; - indicator "Num Lock" { - top= 37; - left= 382; - priority= 1; - onColor= "green"; - offColor= "green30"; - shape= "LED"; - }; - indicator "Caps Lock" { - top= 37; - left= 407; - priority= 2; - onColor= "green"; - offColor= "green30"; - shape= "LED"; - }; - indicator "Scroll Lock" { - top= 37; - left= 433; - priority= 3; - onColor= "green"; - offColor= "green30"; - shape= "LED"; - }; - text "NumLockLabel" { - top= 25; - left= 378; - priority= 4; - width= 19.8; - height= 10; - XFont= "-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1"; - text= "Num\nLock"; - }; - text "CapsLockLabel" { - top= 25; - left= 403; - priority= 5; - width= 26.4; - height= 10; - XFont= "-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1"; - text= "Caps\nLock"; - }; - text "ScrollLockLabel" { - top= 25; - left= 428; - priority= 6; - width= 39.6; - height= 10; - XFont= "-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1"; - text= "Scroll\nLock"; - }; -}; - -}; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/context.c libxkbcommon-0.1.0~git20120510.409ec8a1/test/context.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/context.c 1970-01-01 00:00:00.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/context.c 2012-05-10 10:10:26.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone + */ + +#include + +#include "xkbcommon/xkbcommon.h" + +int +main(void) +{ + struct xkb_context *context = xkb_context_new(); + + assert(context); + + /* FIXME: Test include path stuff. */ + + xkb_context_unref(context); + + return 0; +} diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/data/bad.xkb libxkbcommon-0.1.0~git20120510.409ec8a1/test/data/bad.xkb --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/data/bad.xkb 1970-01-01 00:00:00.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/data/bad.xkb 2012-05-10 10:10:26.000000000 +0000 @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+us" }; +}; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/data/basic.xkb libxkbcommon-0.1.0~git20120510.409ec8a1/test/data/basic.xkb --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/data/basic.xkb 1970-01-01 00:00:00.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/data/basic.xkb 2012-05-10 10:10:26.000000000 +0000 @@ -0,0 +1,6 @@ +xkb_keymap { + xkb_keycodes { include "xfree86+aliases(qwerty)" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+us" }; +}; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/data/comprehensive-plus-geom.xkb libxkbcommon-0.1.0~git20120510.409ec8a1/test/data/comprehensive-plus-geom.xkb --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/data/comprehensive-plus-geom.xkb 1970-01-01 00:00:00.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/data/comprehensive-plus-geom.xkb 2012-05-10 10:10:26.000000000 +0000 @@ -0,0 +1,1813 @@ +xkb_keymap { +xkb_keycodes "evdev+aliases(qwerty)" { + minimum = 8; + maximum = 255; + = 9; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 22; + = 23; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 36; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 50; + = 51; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 75; + = 76; + = 77; + = 78; + = 79; + = 80; + = 81; + = 82; + = 83; + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 90; + = 91; + = 92; + = 94; + = 95; + = 96; + = 97; + = 98; + = 99; + = 100; + = 101; + = 102; + = 103; + = 104; + = 105; + = 106; + = 107; + = 108; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + = 118; + = 119; + = 120; + = 121; + = 122; + = 123; + = 124; + = 125; + = 126; + = 127; + = 128; + = 129; + = 130; + = 131; + = 132; + = 133; + = 134; + = 135; + = 136; + = 137; + = 138; + = 139; + = 140; + = 141; + = 142; + = 143; + = 144; + = 145; + = 146; + = 147; + = 148; + = 149; + = 150; + = 151; + = 152; + = 153; + = 154; + = 155; + = 156; + = 157; + = 158; + = 159; + = 160; + = 161; + = 162; + = 163; + = 164; + = 165; + = 166; + = 167; + = 168; + = 169; + = 170; + = 171; + = 172; + = 173; + = 174; + = 175; + = 176; + = 177; + = 178; + = 179; + = 180; + = 181; + = 182; + = 183; + = 184; + = 185; + = 186; + = 187; + = 188; + = 189; + = 190; + = 191; + = 192; + = 193; + = 194; + = 195; + = 196; + = 197; + = 198; + = 199; + = 200; + = 201; + = 202; + = 203; + = 204; + = 205; + = 206; + = 207; + = 208; + = 209; + = 210; + = 211; + = 212; + = 213; + = 214; + = 215; + = 216; + = 217; + = 218; + = 219; + = 220; + = 221; + = 222; + = 223; + = 224; + = 225; + = 226; + = 227; + = 228; + = 229; + = 230; + = 231; + = 232; + = 233; + = 234; + = 235; + = 236; + = 237; + = 238; + = 239; + = 240; + = 241; + = 242; + = 243; + = 244; + = 245; + = 246; + = 247; + = 248; + = 249; + = 250; + = 251; + = 252; + = 253; + indicator 1 = "Caps Lock"; + indicator 2 = "Num Lock"; + indicator 3 = "Scroll Lock"; + indicator 4 = "Compose"; + indicator 5 = "Kana"; + indicator 6 = "Sleep"; + indicator 7 = "Suspend"; + indicator 8 = "Mute"; + indicator 9 = "Misc"; + indicator 10 = "Mail"; + indicator 11 = "Charging"; + virtual indicator 12 = "Shift Lock"; + virtual indicator 13 = "Group 2"; + virtual indicator 14 = "Mouse Keys"; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; +}; + +xkb_types "complete" { + + virtual_modifiers NumLock,Alt,LevelThree,LAlt,RAlt,RControl,LControl,ScrollLock,LevelFive,AltGr,Meta,Super,Hyper; + + type "ONE_LEVEL" { + modifiers= none; + level_name[Level1]= "Any"; + }; + type "TWO_LEVEL" { + modifiers= Shift; + map[Shift]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + }; + type "ALPHABETIC" { + modifiers= Shift+Lock; + map[Shift]= Level2; + map[Lock]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Caps"; + }; + type "KEYPAD" { + modifiers= Shift+NumLock; + map[Shift]= Level2; + map[NumLock]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Number"; + }; + type "SHIFT+ALT" { + modifiers= Shift+Alt; + map[Shift+Alt]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift+Alt"; + }; + type "PC_CONTROL_LEVEL2" { + modifiers= Control; + map[Control]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Control"; + }; + type "PC_LCONTROL_LEVEL2" { + modifiers= LControl; + map[LControl]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "LControl"; + }; + type "PC_RCONTROL_LEVEL2" { + modifiers= RControl; + map[RControl]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "RControl"; + }; + type "PC_ALT_LEVEL2" { + modifiers= Alt; + map[Alt]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Alt"; + }; + type "PC_LALT_LEVEL2" { + modifiers= LAlt; + map[LAlt]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "LAlt"; + }; + type "PC_RALT_LEVEL2" { + modifiers= RAlt; + map[RAlt]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "RAlt"; + }; + type "CTRL+ALT" { + modifiers= Shift+Control+Alt+LevelThree; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Control+Alt]= Level5; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "Ctrl+Alt"; + }; + type "LOCAL_EIGHT_LEVEL" { + modifiers= Shift+Lock+Control+LevelThree; + map[Shift+Lock]= Level1; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+Lock+LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level4; + map[Control]= Level5; + map[Shift+Lock+Control]= Level5; + map[Shift+Control]= Level6; + map[Lock+Control]= Level6; + map[Control+LevelThree]= Level7; + map[Shift+Lock+Control+LevelThree]= Level7; + map[Shift+Control+LevelThree]= Level8; + map[Lock+Control+LevelThree]= Level8; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Level3"; + level_name[Level4]= "Shift Level3"; + level_name[Level5]= "Ctrl"; + level_name[Level6]= "Shift Ctrl"; + level_name[Level7]= "Level3 Ctrl"; + level_name[Level8]= "Shift Level3 Ctrl"; + }; + type "THREE_LEVEL" { + modifiers= Shift+LevelThree; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Level3"; + }; + type "EIGHT_LEVEL" { + modifiers= Shift+LevelThree+LevelFive; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[LevelFive]= Level5; + map[Shift+LevelFive]= Level6; + map[LevelThree+LevelFive]= Level7; + map[Shift+LevelThree+LevelFive]= Level8; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "X"; + level_name[Level6]= "X Shift"; + level_name[Level7]= "X Alt Base"; + level_name[Level8]= "X Shift Alt"; + }; + type "EIGHT_LEVEL_ALPHABETIC" { + modifiers= Shift+Lock+LevelThree+LevelFive; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level4; + map[Shift+Lock+LevelThree]= Level3; + map[LevelFive]= Level5; + map[Shift+LevelFive]= Level6; + map[Lock+LevelFive]= Level6; + map[LevelThree+LevelFive]= Level7; + map[Shift+LevelThree+LevelFive]= Level8; + map[Lock+LevelThree+LevelFive]= Level8; + map[Shift+Lock+LevelThree+LevelFive]= Level7; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "X"; + level_name[Level6]= "X Shift"; + level_name[Level7]= "X Alt Base"; + level_name[Level8]= "X Shift Alt"; + }; + type "EIGHT_LEVEL_SEMIALPHABETIC" { + modifiers= Shift+Lock+LevelThree+LevelFive; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level3; + preserve[Lock+LevelThree]= Lock; + map[Shift+Lock+LevelThree]= Level4; + preserve[Shift+Lock+LevelThree]= Lock; + map[LevelFive]= Level5; + map[Shift+LevelFive]= Level6; + map[Lock+LevelFive]= Level6; + preserve[Lock+LevelFive]= Lock; + map[LevelThree+LevelFive]= Level7; + map[Shift+LevelThree+LevelFive]= Level8; + map[Lock+LevelThree+LevelFive]= Level7; + preserve[Lock+LevelThree+LevelFive]= Lock; + map[Shift+Lock+LevelThree+LevelFive]= Level8; + preserve[Shift+Lock+LevelThree+LevelFive]= Lock; + map[Shift+Lock+LevelFive]= Level1; + preserve[Shift+Lock+LevelFive]= Lock; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "X"; + level_name[Level6]= "X Shift"; + level_name[Level7]= "X Alt Base"; + level_name[Level8]= "X Shift Alt"; + }; + type "FOUR_LEVEL" { + modifiers= Shift+LevelThree; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + }; + type "FOUR_LEVEL_ALPHABETIC" { + modifiers= Shift+Lock+LevelThree; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level4; + map[Shift+Lock+LevelThree]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + }; + type "FOUR_LEVEL_SEMIALPHABETIC" { + modifiers= Shift+Lock+LevelThree; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level3; + preserve[Lock+LevelThree]= Lock; + map[Shift+Lock+LevelThree]= Level4; + preserve[Shift+Lock+LevelThree]= Lock; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + }; + type "FOUR_LEVEL_MIXED_KEYPAD" { + modifiers= Shift+NumLock+LevelThree; + map[Shift+NumLock]= Level1; + map[NumLock]= Level2; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[NumLock+LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Shift+NumLock+LevelThree]= Level4; + level_name[Level1]= "Base"; + level_name[Level2]= "Number"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + }; + type "FOUR_LEVEL_X" { + modifiers= Shift+Control+Alt+LevelThree; + map[LevelThree]= Level2; + map[Shift+LevelThree]= Level3; + map[Control+Alt]= Level4; + level_name[Level1]= "Base"; + level_name[Level2]= "Alt Base"; + level_name[Level3]= "Shift Alt"; + level_name[Level4]= "Ctrl+Alt"; + }; + type "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC" { + modifiers= Shift+Lock+LevelThree; + map[Shift]= Level2; + map[Lock]= Level4; + preserve[Lock]= Lock; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level3; + preserve[Lock+LevelThree]= Lock; + map[Shift+Lock+LevelThree]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "AltGr Base"; + level_name[Level4]= "Shift AltGr"; + }; + type "FOUR_LEVEL_PLUS_LOCK" { + modifiers= Shift+Lock+LevelThree; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock]= Level5; + map[Shift+Lock]= Level2; + map[Lock+LevelThree]= Level3; + map[Shift+Lock+LevelThree]= Level4; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "Lock"; + }; + type "FOUR_LEVEL_KEYPAD" { + modifiers= Shift+NumLock+LevelThree; + map[Shift]= Level2; + map[NumLock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[NumLock+LevelThree]= Level4; + map[Shift+NumLock+LevelThree]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Number"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Alt Number"; + }; +}; + +xkb_compatibility "complete" { + + virtual_modifiers NumLock,Alt,LevelThree,LAlt,RAlt,RControl,LControl,ScrollLock,LevelFive,AltGr,Meta,Super,Hyper; + + interpret.useModMapMods= AnyLevel; + interpret.repeat= False; + interpret.locking= False; + interpret ISO_Level2_Latch+Exactly(Shift) { + useModMapMods=level1; + action= LatchMods(modifiers=Shift,clearLocks,latchToLock); + }; + interpret Shift_Lock+AnyOf(Shift+Lock) { + action= LockMods(modifiers=Shift); + }; + interpret Num_Lock+AnyOf(all) { + virtualModifier= NumLock; + action= LockMods(modifiers=NumLock); + }; + interpret ISO_Lock+AnyOf(all) { + action= ISOLock(modifiers=modMapMods,affect=all); + }; + interpret ISO_Level3_Shift+AnyOf(all) { + virtualModifier= LevelThree; + useModMapMods=level1; + action= SetMods(modifiers=LevelThree,clearLocks); + }; + interpret ISO_Level3_Latch+AnyOf(all) { + virtualModifier= LevelThree; + useModMapMods=level1; + action= LatchMods(modifiers=LevelThree,clearLocks,latchToLock); + }; + interpret ISO_Level3_Lock+AnyOf(all) { + virtualModifier= LevelThree; + useModMapMods=level1; + action= LockMods(modifiers=LevelThree); + }; + interpret Alt_L+AnyOf(all) { + virtualModifier= Alt; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Alt_R+AnyOf(all) { + virtualModifier= Alt; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Meta_L+AnyOf(all) { + virtualModifier= Meta; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Meta_R+AnyOf(all) { + virtualModifier= Meta; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Super_L+AnyOf(all) { + virtualModifier= Super; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Super_R+AnyOf(all) { + virtualModifier= Super; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Hyper_L+AnyOf(all) { + virtualModifier= Hyper; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Hyper_R+AnyOf(all) { + virtualModifier= Hyper; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Scroll_Lock+AnyOf(all) { + virtualModifier= ScrollLock; + action= LockMods(modifiers=modMapMods); + }; + interpret ISO_Level5_Shift+AnyOf(all) { + virtualModifier= LevelFive; + useModMapMods=level1; + action= SetMods(modifiers=LevelFive,clearLocks); + }; + interpret ISO_Level5_Latch+AnyOf(all) { + virtualModifier= LevelFive; + action= LatchMods(modifiers=LevelFive,clearLocks,latchToLock); + }; + interpret ISO_Level5_Lock+AnyOf(all) { + virtualModifier= LevelFive; + action= LockMods(modifiers=LevelFive); + }; + interpret Mode_switch+AnyOfOrNone(all) { + virtualModifier= AltGr; + useModMapMods=level1; + action= SetGroup(group=+1); + }; + interpret ISO_Level3_Shift+AnyOfOrNone(all) { + action= SetMods(modifiers=LevelThree,clearLocks); + }; + interpret ISO_Level3_Latch+AnyOfOrNone(all) { + action= LatchMods(modifiers=LevelThree,clearLocks,latchToLock); + }; + interpret ISO_Level3_Lock+AnyOfOrNone(all) { + action= LockMods(modifiers=LevelThree); + }; + interpret ISO_Group_Latch+AnyOfOrNone(all) { + virtualModifier= AltGr; + useModMapMods=level1; + action= LatchGroup(group=2); + }; + interpret ISO_Next_Group+AnyOfOrNone(all) { + virtualModifier= AltGr; + useModMapMods=level1; + action= LockGroup(group=+1); + }; + interpret ISO_Prev_Group+AnyOfOrNone(all) { + virtualModifier= AltGr; + useModMapMods=level1; + action= LockGroup(group=-1); + }; + interpret ISO_First_Group+AnyOfOrNone(all) { + action= LockGroup(group=1); + }; + interpret ISO_Last_Group+AnyOfOrNone(all) { + action= LockGroup(group=2); + }; + interpret KP_1+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+1); + }; + interpret KP_End+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+1); + }; + interpret KP_2+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+0,y=+1); + }; + interpret KP_Down+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+0,y=+1); + }; + interpret KP_3+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+1); + }; + interpret KP_Next+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+1); + }; + interpret KP_4+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+0); + }; + interpret KP_Left+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+0); + }; + interpret KP_6+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+0); + }; + interpret KP_Right+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+0); + }; + interpret KP_7+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=-1); + }; + interpret KP_Home+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=-1); + }; + interpret KP_8+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+0,y=-1); + }; + interpret KP_Up+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+0,y=-1); + }; + interpret KP_9+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=-1); + }; + interpret KP_Prior+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=-1); + }; + interpret KP_5+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default); + }; + interpret KP_Begin+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default); + }; + interpret KP_F2+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=1); + }; + interpret KP_Divide+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=1); + }; + interpret KP_F3+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=2); + }; + interpret KP_Multiply+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=2); + }; + interpret KP_F4+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=3); + }; + interpret KP_Subtract+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=3); + }; + interpret KP_Separator+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default,count=2); + }; + interpret KP_Add+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default,count=2); + }; + interpret KP_0+AnyOfOrNone(all) { + repeat= True; + action= LockPtrBtn(button=default,affect=lock); + }; + interpret KP_Insert+AnyOfOrNone(all) { + repeat= True; + action= LockPtrBtn(button=default,affect=lock); + }; + interpret KP_Decimal+AnyOfOrNone(all) { + repeat= True; + action= LockPtrBtn(button=default,affect=unlock); + }; + interpret KP_Delete+AnyOfOrNone(all) { + repeat= True; + action= LockPtrBtn(button=default,affect=unlock); + }; + interpret F25+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=1); + }; + interpret F26+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=2); + }; + interpret F27+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=-1); + }; + interpret F29+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=-1); + }; + interpret F31+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default); + }; + interpret F33+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+1); + }; + interpret F35+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+1); + }; + interpret Pointer_Button_Dflt+AnyOfOrNone(all) { + action= PtrBtn(button=default); + }; + interpret Pointer_Button1+AnyOfOrNone(all) { + action= PtrBtn(button=1); + }; + interpret Pointer_Button2+AnyOfOrNone(all) { + action= PtrBtn(button=2); + }; + interpret Pointer_Button3+AnyOfOrNone(all) { + action= PtrBtn(button=3); + }; + interpret Pointer_DblClick_Dflt+AnyOfOrNone(all) { + action= PtrBtn(button=default,count=2); + }; + interpret Pointer_DblClick1+AnyOfOrNone(all) { + action= PtrBtn(button=1,count=2); + }; + interpret Pointer_DblClick2+AnyOfOrNone(all) { + action= PtrBtn(button=2,count=2); + }; + interpret Pointer_DblClick3+AnyOfOrNone(all) { + action= PtrBtn(button=3,count=2); + }; + interpret Pointer_Drag_Dflt+AnyOfOrNone(all) { + action= LockPtrBtn(button=default,affect=both); + }; + interpret Pointer_Drag1+AnyOfOrNone(all) { + action= LockPtrBtn(button=1,affect=both); + }; + interpret Pointer_Drag2+AnyOfOrNone(all) { + action= LockPtrBtn(button=2,affect=both); + }; + interpret Pointer_Drag3+AnyOfOrNone(all) { + action= LockPtrBtn(button=3,affect=both); + }; + interpret Pointer_EnableKeys+AnyOfOrNone(all) { + action= LockControls(controls=MouseKeys); + }; + interpret Pointer_Accelerate+AnyOfOrNone(all) { + action= LockControls(controls=MouseKeysAccel); + }; + interpret Pointer_DfltBtnNext+AnyOfOrNone(all) { + action= SetPtrDflt(affect=button,button=+1); + }; + interpret Pointer_DfltBtnPrev+AnyOfOrNone(all) { + action= SetPtrDflt(affect=button,button=-1); + }; + interpret AccessX_Enable+AnyOfOrNone(all) { + action= LockControls(controls=AccessXKeys); + }; + interpret AccessX_Feedback_Enable+AnyOfOrNone(all) { + action= LockControls(controls=AccessXFeedback); + }; + interpret RepeatKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=RepeatKeys); + }; + interpret SlowKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=SlowKeys); + }; + interpret BounceKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=BounceKeys); + }; + interpret StickyKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=StickyKeys); + }; + interpret MouseKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=MouseKeys); + }; + interpret MouseKeys_Accel_Enable+AnyOfOrNone(all) { + action= LockControls(controls=MouseKeysAccel); + }; + interpret Overlay1_Enable+AnyOfOrNone(all) { + action= LockControls(controls=Overlay1); + }; + interpret Overlay2_Enable+AnyOfOrNone(all) { + action= LockControls(controls=Overlay2); + }; + interpret AudibleBell_Enable+AnyOfOrNone(all) { + action= LockControls(controls=AudibleBell); + }; + interpret Terminate_Server+AnyOfOrNone(all) { + action= Terminate(); + }; + interpret Alt_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Alt,clearLocks); + }; + interpret Alt_R+AnyOfOrNone(all) { + action= SetMods(modifiers=Alt,clearLocks); + }; + interpret Meta_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Meta,clearLocks); + }; + interpret Meta_R+AnyOfOrNone(all) { + action= SetMods(modifiers=Meta,clearLocks); + }; + interpret Super_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Super,clearLocks); + }; + interpret Super_R+AnyOfOrNone(all) { + action= SetMods(modifiers=Super,clearLocks); + }; + interpret Hyper_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Hyper,clearLocks); + }; + interpret Hyper_R+AnyOfOrNone(all) { + action= SetMods(modifiers=Hyper,clearLocks); + }; + interpret Shift_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Shift,clearLocks); + }; + interpret XF86Switch_VT_1+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=1,!same); + }; + interpret XF86Switch_VT_2+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=2,!same); + }; + interpret XF86Switch_VT_3+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=3,!same); + }; + interpret XF86Switch_VT_4+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=4,!same); + }; + interpret XF86Switch_VT_5+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=5,!same); + }; + interpret XF86Switch_VT_6+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=6,!same); + }; + interpret XF86Switch_VT_7+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=7,!same); + }; + interpret XF86Switch_VT_8+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=8,!same); + }; + interpret XF86Switch_VT_9+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=9,!same); + }; + interpret XF86Switch_VT_10+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=10,!same); + }; + interpret XF86Switch_VT_11+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=11,!same); + }; + interpret XF86Switch_VT_12+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=12,!same); + }; + interpret XF86LogGrabInfo+AnyOfOrNone(all) { + repeat= True; + action= Private(type=0x86,data[0]=0x50,data[1]=0x72,data[2]=0x47,data[3]=0x72,data[4]=0x62,data[5]=0x73,data[6]=0x00); + }; + interpret XF86LogWindowTree+AnyOfOrNone(all) { + repeat= True; + action= Private(type=0x86,data[0]=0x50,data[1]=0x72,data[2]=0x57,data[3]=0x69,data[4]=0x6e,data[5]=0x73,data[6]=0x00); + }; + interpret XF86Next_VMode+AnyOfOrNone(all) { + repeat= True; + action= Private(type=0x86,data[0]=0x2b,data[1]=0x56,data[2]=0x4d,data[3]=0x6f,data[4]=0x64,data[5]=0x65,data[6]=0x00); + }; + interpret XF86Prev_VMode+AnyOfOrNone(all) { + repeat= True; + action= Private(type=0x86,data[0]=0x2d,data[1]=0x56,data[2]=0x4d,data[3]=0x6f,data[4]=0x64,data[5]=0x65,data[6]=0x00); + }; + interpret ISO_Level5_Shift+AnyOfOrNone(all) { + action= SetMods(modifiers=LevelFive,clearLocks); + }; + interpret ISO_Level5_Latch+AnyOfOrNone(all) { + action= LatchMods(modifiers=LevelFive,clearLocks,latchToLock); + }; + interpret ISO_Level5_Lock+AnyOfOrNone(all) { + action= LockMods(modifiers=LevelFive); + }; + interpret Caps_Lock+AnyOfOrNone(all) { + action= LockMods(modifiers=Lock); + }; + interpret Any+Exactly(Lock) { + action= LockMods(modifiers=Lock); + }; + interpret Any+AnyOf(all) { + action= SetMods(modifiers=modMapMods,clearLocks); + }; + indicator "Caps Lock" { + !allowExplicit; + whichModState= locked; + modifiers= Lock; + }; + indicator "Num Lock" { + !allowExplicit; + whichModState= locked; + modifiers= NumLock; + }; + indicator "Scroll Lock" { + whichModState= locked; + modifiers= ScrollLock; + }; + indicator "Shift Lock" { + !allowExplicit; + whichModState= locked; + modifiers= Shift; + }; + indicator "Group 2" { + !allowExplicit; + groups= 0xfe; + }; + indicator "Mouse Keys" { + indicatorDrivesKeyboard; + controls= mouseKeys; + }; +}; + +xkb_symbols "pc+us+inet(evdev)+ctrl(nocaps)+compose(rwin)+terminate(ctrl_alt_bksp)" { + + name[group1]="English (US)"; + + key { [ Escape ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ BackSpace, BackSpace, NoSymbol, NoSymbol, Terminate_Server ] + }; + key { [ Tab, ISO_Left_Tab ] }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ q, Q ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ w, W ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ e, E ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ r, R ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ t, T ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ y, Y ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ u, U ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ i, I ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ o, O ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ p, P ] + }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + key { [ Return ] }; + key { [ Control_L ] }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ a, A ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ s, S ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ d, D ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ f, F ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ g, G ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ h, H ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ j, J ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ k, K ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ l, L ] + }; + key { [ semicolon, colon ] }; + key { [ apostrophe, quotedbl ] }; + key { [ grave, asciitilde ] }; + key { [ Shift_L ] }; + key { [ backslash, bar ] }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ z, Z ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ x, X ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ c, C ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ v, V ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ b, B ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ n, N ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ m, M ] + }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ slash, question ] }; + key { [ Shift_R ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ KP_Multiply, KP_Multiply, KP_Multiply, KP_Multiply, XF86ClearGrab ] + }; + key { [ Alt_L, Meta_L ] }; + key { [ space ] }; + key { [ Control_L, Control_L ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F1, F1, F1, F1, XF86Switch_VT_1 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F2, F2, F2, F2, XF86Switch_VT_2 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F3, F3, F3, F3, XF86Switch_VT_3 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F4, F4, F4, F4, XF86Switch_VT_4 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F5, F5, F5, F5, XF86Switch_VT_5 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F6, F6, F6, F6, XF86Switch_VT_6 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F7, F7, F7, F7, XF86Switch_VT_7 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F8, F8, F8, F8, XF86Switch_VT_8 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F9, F9, F9, F9, XF86Switch_VT_9 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F10, F10, F10, F10, XF86Switch_VT_10 ] + }; + key { [ Num_Lock ] }; + key { [ Scroll_Lock ] }; + key { [ KP_Home, KP_7 ] }; + key { [ KP_Up, KP_8 ] }; + key { [ KP_Prior, KP_9 ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86Prev_VMode ] + }; + key { [ KP_Left, KP_4 ] }; + key { [ KP_Begin, KP_5 ] }; + key { [ KP_Right, KP_6 ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ KP_Add, KP_Add, KP_Add, KP_Add, XF86Next_VMode ] + }; + key { [ KP_End, KP_1 ] }; + key { [ KP_Down, KP_2 ] }; + key { [ KP_Next, KP_3 ] }; + key { [ KP_Insert, KP_0 ] }; + key { [ KP_Delete, KP_Decimal ] }; + key { [ ISO_Level3_Shift ] }; + key { + type= "FOUR_LEVEL", + symbols[Group1]= [ less, greater, bar, brokenbar ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F11, F11, F11, F11, XF86Switch_VT_11 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F12, F12, F12, F12, XF86Switch_VT_12 ] + }; + key { [ Katakana ] }; + key { [ Hiragana ] }; + key { [ Henkan_Mode ] }; + key { [ Hiragana_Katakana ] }; + key { [ Muhenkan ] }; + key { [ KP_Enter ] }; + key { [ Control_R ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86Ungrab ] + }; + key { + type= "PC_ALT_LEVEL2", + symbols[Group1]= [ Print, Sys_Req ] + }; + key { + type= "TWO_LEVEL", + symbols[Group1]= [ Alt_R, Meta_R ] + }; + key { [ Linefeed ] }; + key { [ Home ] }; + key { [ Up ] }; + key { [ Prior ] }; + key { [ Left ] }; + key { [ Right ] }; + key { [ End ] }; + key { [ Down ] }; + key { [ Next ] }; + key { [ Insert ] }; + key { [ Delete ] }; + key { [ XF86AudioMute ] }; + key { [ XF86AudioLowerVolume ] }; + key { [ XF86AudioRaiseVolume ] }; + key { [ XF86PowerOff ] }; + key { [ KP_Equal ] }; + key { [ plusminus ] }; + key { + type= "PC_CONTROL_LEVEL2", + symbols[Group1]= [ Pause, Break ] + }; + key { [ XF86LaunchA ] }; + key { [ KP_Decimal, KP_Decimal ] }; + key { [ Hangul ] }; + key { [ Hangul_Hanja ] }; + key { [ Super_L ] }; + key { + type= "TWO_LEVEL", + symbols[Group1]= [ Multi_key, Multi_key ] + }; + key { [ Menu ] }; + key { [ Cancel ] }; + key { [ Redo ] }; + key { [ SunProps ] }; + key { [ Undo ] }; + key { [ SunFront ] }; + key { [ XF86Copy ] }; + key { [ SunOpen ] }; + key { [ XF86Paste ] }; + key { [ Find ] }; + key { [ XF86Cut ] }; + key { [ Help ] }; + key { [ XF86MenuKB ] }; + key { [ XF86Calculator ] }; + key { [ XF86Sleep ] }; + key { [ XF86WakeUp ] }; + key { [ XF86Explorer ] }; + key { [ XF86Send ] }; + key { [ XF86Xfer ] }; + key { [ XF86Launch1 ] }; + key { [ XF86Launch2 ] }; + key { [ XF86WWW ] }; + key { [ XF86DOS ] }; + key { [ XF86ScreenSaver ] }; + key { [ XF86RotateWindows ] }; + key { [ XF86Mail ] }; + key { [ XF86Favorites ] }; + key { [ XF86MyComputer ] }; + key { [ XF86Back ] }; + key { [ XF86Forward ] }; + key { [ XF86Eject ] }; + key { [ XF86Eject, XF86Eject ] }; + key { [ XF86AudioNext ] }; + key { [ XF86AudioPlay, XF86AudioPause ] }; + key { [ XF86AudioPrev ] }; + key { [ XF86AudioStop, XF86Eject ] }; + key { [ XF86AudioRecord ] }; + key { [ XF86AudioRewind ] }; + key { [ XF86Phone ] }; + key { [ XF86Tools ] }; + key { [ XF86HomePage ] }; + key { [ XF86Reload ] }; + key { [ XF86Close ] }; + key { [ XF86ScrollUp ] }; + key { [ XF86ScrollDown ] }; + key { [ parenleft ] }; + key { [ parenright ] }; + key { [ XF86New ] }; + key { [ Redo ] }; + key { [ XF86Tools ] }; + key { [ XF86Launch5 ] }; + key { [ XF86Launch6 ] }; + key { [ XF86Launch7 ] }; + key { [ XF86Launch8 ] }; + key { [ XF86Launch9 ] }; + key { [ XF86TouchpadToggle ] }; + key { [ XF86TouchpadOn ] }; + key { [ XF86TouchpadOff ] }; + key { [ Mode_switch ] }; + key { [ NoSymbol, Alt_L ] }; + key { [ NoSymbol, Meta_L ] }; + key { [ NoSymbol, Super_L ] }; + key { [ NoSymbol, Hyper_L ] }; + key { [ XF86AudioPlay ] }; + key { [ XF86AudioPause ] }; + key { [ XF86Launch3 ] }; + key { [ XF86Launch4 ] }; + key { [ XF86LaunchB ] }; + key { [ XF86Suspend ] }; + key { [ XF86Close ] }; + key { [ XF86AudioPlay ] }; + key { [ XF86AudioForward ] }; + key { [ Print ] }; + key { [ XF86WebCam ] }; + key { [ XF86Mail ] }; + key { [ XF86Messenger ] }; + key { [ XF86Search ] }; + key { [ XF86Go ] }; + key { [ XF86Finance ] }; + key { [ XF86Game ] }; + key { [ XF86Shop ] }; + key { [ Cancel ] }; + key { [ XF86MonBrightnessDown ] }; + key { [ XF86MonBrightnessUp ] }; + key { [ XF86AudioMedia ] }; + key { [ XF86Display ] }; + key { [ XF86KbdLightOnOff ] }; + key { [ XF86KbdBrightnessDown ] }; + key { [ XF86KbdBrightnessUp ] }; + key { [ XF86Send ] }; + key { [ XF86Reply ] }; + key { [ XF86MailForward ] }; + key { [ XF86Save ] }; + key { [ XF86Documents ] }; + key { [ XF86Battery ] }; + key { [ XF86Bluetooth ] }; + key { [ XF86WLAN ] }; + modifier_map Control { }; + modifier_map Shift { }; + modifier_map Shift { }; + modifier_map Mod1 { }; + modifier_map Control { }; + modifier_map Mod2 { }; + modifier_map Mod5 { }; + modifier_map Control { }; + modifier_map Mod1 { }; + modifier_map Mod4 { }; + modifier_map Mod5 { }; + modifier_map Mod1 { }; + modifier_map Mod4 { }; + modifier_map Mod4 { }; +}; + +xkb_geometry "pc(pc105)" { + + width= 470; + height= 180; + + alias = ; + alias = ; + + baseColor= "white"; + labelColor= "black"; + xfont= "-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1"; + description= "Generic 105"; + + shape "NORM" { + corner= 1, + { [ 18, 18 ] }, + { [ 2, 1 ], [ 16, 16 ] } + }; + shape "BKSP" { + corner= 1, + { [ 38, 18 ] }, + { [ 2, 1 ], [ 36, 16 ] } + }; + shape "TABK" { + corner= 1, + { [ 28, 18 ] }, + { [ 2, 1 ], [ 26, 16 ] } + }; + shape "BKSL" { + corner= 1, + { [ 28, 18 ] }, + { [ 2, 1 ], [ 26, 16 ] } + }; + shape "RTRN" { + corner= 1, + { [ 0, 0 ], [ 28, 0 ], [ 28, 37 ], [ 5, 37 ], + [ 5, 18 ], [ 0, 18 ] }, + { [ 2, 1 ], [ 26, 1 ], [ 26, 35 ], [ 7, 35 ], + [ 7, 16 ], [ 2, 16 ] }, + approx= { [ 5, 0 ], [ 28, 37 ] } + }; + shape "CAPS" { + corner= 1, + { [ 33, 18 ] }, + { [ 2, 1 ], [ 31, 16 ] } + }; + shape "LFSH" { + corner= 1, + { [ 25, 18 ] }, + { [ 2, 1 ], [ 23, 16 ] } + }; + shape "RTSH" { + corner= 1, + { [ 50, 18 ] }, + { [ 2, 1 ], [ 48, 16 ] } + }; + shape "MODK" { + corner= 1, + { [ 27, 18 ] }, + { [ 2, 1 ], [ 25, 16 ] } + }; + shape "SMOD" { + corner= 1, + { [ 23, 18 ] }, + { [ 2, 1 ], [ 21, 16 ] } + }; + shape "SPCE" { + corner= 1, + { [ 113, 18 ] }, + { [ 2, 1 ], [ 111, 16 ] } + }; + shape "KP0" { + corner= 1, + { [ 37, 18 ] }, + { [ 2, 1 ], [ 35, 16 ] } + }; + shape "KPAD" { + corner= 1, + { [ 18, 37 ] }, + { [ 2, 1 ], [ 16, 35 ] } + }; + shape "LEDS" { { [ 75, 20 ] } }; + shape "LED" { { [ 5, 1 ] } }; + section "Function" { + key.color= "grey20"; + priority= 7; + top= 22; + left= 19; + width= 351; + height= 19; + row { + top= 1; + left= 1; + keys { + { , "NORM", 1 }, + { , "NORM", 20, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 11, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 11, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 8, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" } + }; + }; + }; // End of "Function" section + + section "Alpha" { + key.color= "white"; + priority= 8; + top= 61; + left= 19; + width= 287; + height= 95; + row { + top= 1; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "BKSP", 1, color="grey20" } + }; + }; + row { + top= 20; + left= 1; + keys { + { , "TABK", 1, color="grey20" }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "RTRN", 1, color="grey20" } + }; + }; + row { + top= 39; + left= 1; + keys { + { , "CAPS", 1, color="grey20" }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 } + }; + }; + row { + top= 58; + left= 1; + keys { + { , "LFSH", 1, color="grey20" }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "RTSH", 1, color="grey20" } + }; + }; + row { + top= 77; + left= 1; + keys { + { , "MODK", 1, color="grey20" }, + { , "SMOD", 1, color="grey20" }, + { , "SMOD", 1, color="grey20" }, + { , "SPCE", 1 }, + { , "SMOD", 1, color="grey20" }, + { , "SMOD", 1, color="grey20" }, + { , "SMOD", 1, color="grey20" }, + { , "SMOD", 1, color="grey20" } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + key.color= "grey20"; + priority= 9; + top= 61; + left= 312; + width= 58; + height= 95; + row { + top= 1; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 20; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 58; + left= 20; + keys { + { , "NORM", 1 } + }; + }; + row { + top= 77; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + }; // End of "Editing" section + + section "Keypad" { + key.color= "grey20"; + priority= 10; + top= 61; + left= 376; + width= 77; + height= 95; + row { + top= 1; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 } + }; + }; + row { + top= 20; + left= 1; + keys { + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "KPAD", 1 } + }; + }; + row { + top= 39; + left= 1; + keys { + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" } + }; + }; + row { + top= 58; + left= 1; + keys { + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "NORM", 1, color="white" }, + { , "KPAD", 1 } + }; + }; + row { + top= 77; + left= 1; + keys { + { , "KP0", 1, color="white" }, + { , "NORM", 1, color="white" } + }; + }; + }; // End of "Keypad" section + + solid "LedPanel" { + top= 22; + left= 377; + priority= 0; + color= "grey10"; + shape= "LEDS"; + }; + indicator "Num Lock" { + top= 37; + left= 382; + priority= 1; + onColor= "green"; + offColor= "green30"; + shape= "LED"; + }; + indicator "Caps Lock" { + top= 37; + left= 407; + priority= 2; + onColor= "green"; + offColor= "green30"; + shape= "LED"; + }; + indicator "Scroll Lock" { + top= 37; + left= 433; + priority= 3; + onColor= "green"; + offColor= "green30"; + shape= "LED"; + }; + text "NumLockLabel" { + top= 25; + left= 378; + priority= 4; + width= 19.8; + height= 10; + XFont= "-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1"; + text= "Num\nLock"; + }; + text "CapsLockLabel" { + top= 25; + left= 403; + priority= 5; + width= 26.4; + height= 10; + XFont= "-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1"; + text= "Caps\nLock"; + }; + text "ScrollLockLabel" { + top= 25; + left= 428; + priority= 6; + width= 39.6; + height= 10; + XFont= "-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1"; + text= "Scroll\nLock"; + }; +}; + +}; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/data/default.xkb libxkbcommon-0.1.0~git20120510.409ec8a1/test/data/default.xkb --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/data/default.xkb 1970-01-01 00:00:00.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/data/default.xkb 2012-05-10 10:10:26.000000000 +0000 @@ -0,0 +1,15 @@ +xkb_keymap { + xkb_keycodes { include "xfree86+aliases(qwerty)" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+us" }; + xkb_geometry { include "pc(pc105)" }; +}; + +default xkb_keymap { + xkb_keycodes { include "xfree86+aliases(qwertz)" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+de" }; + xkb_geometry { include "pc(pc105)" }; +}; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/default.xkb libxkbcommon-0.1.0~git20120510.409ec8a1/test/default.xkb --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/default.xkb 2012-05-01 18:28:54.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/default.xkb 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -xkb_keymap { - xkb_keycodes { include "xfree86+aliases(qwerty)" }; - xkb_types { include "complete" }; - xkb_compat { include "complete" }; - xkb_symbols { include "pc+us" }; - xkb_geometry { include "pc(pc105)" }; -}; - -default xkb_keymap { - xkb_keycodes { include "xfree86+aliases(qwertz)" }; - xkb_types { include "complete" }; - xkb_compat { include "complete" }; - xkb_symbols { include "pc+de" }; - xkb_geometry { include "pc(pc105)" }; -}; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/filecomp.c libxkbcommon-0.1.0~git20120510.409ec8a1/test/filecomp.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/filecomp.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/filecomp.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,63 +24,91 @@ authorization from the authors. */ +#include +#include #include #include #include -#include -#include -#include -#include "xkbcommon/xkbcommon.h" -#include "xkbcomp/utils.h" +#include +#include +#include +#include -static char buffer[8192]; +#include "xkbcommon/xkbcommon.h" -int main(int argc, char *argv[]) +static int +test_file(const char *path) { - char *path, *name; - FILE *file; - struct xkb_desc * xkb; - int i, len, from_string = 0; - - /* Require xkb file */ - if (argc < 2) { - fprintf(stderr, "Not enough arguments\n"); - fprintf(stderr, "Usage: %s [-s] XKBFILE [NAME]\n", - argv[0]); - exit(1); - } + int fd; + struct xkb_context *context; + struct xkb_keymap *xkb; - i = 1; - if (strcmp(argv[1], "-s") == 0) { - from_string = 2; - i++; - } + fd = open(path, O_RDONLY); + assert(fd >= 0); - path = argv[i]; - name = (argc > i + 1) ? argv[i + 1] : NULL; + context = xkb_context_new(); + assert(context); - file = fopen(path, "r"); - if (!file) { - fprintf(stderr, "Failed to open file \"%s\": %s\n", path, - strerror(errno)); - exit(1); - } + fprintf(stderr, "\nCompiling path: %s\n", path); - if (from_string) { - len = fread(buffer, 1, sizeof buffer, file); - buffer[len] = '\0'; - xkb = xkb_compile_keymap_from_string(buffer, name); - } else { - xkb = xkb_compile_keymap_from_file(file, name); - } - fclose(file); + xkb = xkb_map_new_from_fd(context, fd, XKB_KEYMAP_FORMAT_TEXT_V1); + close(fd); if (!xkb) { fprintf(stderr, "Failed to compile keymap\n"); - exit(1); + xkb_context_unref(context); + return 0; } - xkb_free_keymap(xkb); + xkb_map_unref(xkb); + xkb_context_unref(context); + return 1; +} + +static int +test_file_name(const char *file_name) +{ + static char path[PATH_MAX]; + const char *srcdir = getenv("srcdir"); + + snprintf(path, PATH_MAX - 1, "%s/test/data/%s", srcdir ? srcdir : ".", file_name); + return test_file(path); +} + +static int +test_string(const char *string) +{ + struct xkb_context *context; + struct xkb_keymap *xkb; + + context = xkb_context_new(); + assert(context); + + fprintf(stderr, "\nCompiling string\n"); + + xkb = xkb_map_new_from_string(context, string, XKB_KEYMAP_FORMAT_TEXT_V1); + if (!xkb) { + xkb_context_unref(context); + return 0; + } + + xkb_map_unref(xkb); + xkb_context_unref(context); + return 1; +} + +int +main(void) +{ + + assert(test_file_name("basic.xkb")); + /* XXX check we actually get qwertz here ... */ + assert(test_file_name("default.xkb")); + assert(test_file_name("comprehensive-plus-geom.xkb")); + + assert(!test_file_name("bad.xkb")); + + assert(!test_string("")); return 0; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/filecomp.sh libxkbcommon-0.1.0~git20120510.409ec8a1/test/filecomp.sh --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/filecomp.sh 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/filecomp.sh 2012-05-10 10:10:26.000000000 +0000 @@ -24,12 +24,7 @@ rm -f "$log" compile $srcdir/basic.xkb -compile $srcdir/named.xkb -compile $srcdir/named.xkb de -compile $srcdir/named.xkb us +# XXX check we actually get qwertz here ... compile $srcdir/default.xkb compile $srcdir/comprehensive-plus-geom.xkb - -failcompile $srcdir/basic.xkb foo -failcompile $srcdir/named.xkb foo failcompile $srcdir/bad.xkb diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/.gitignore libxkbcommon-0.1.0~git20120510.409ec8a1/test/.gitignore --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/.gitignore 2012-05-01 18:28:54.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/.gitignore 2012-05-10 10:10:26.000000000 +0000 @@ -4,3 +4,5 @@ namescomp rulescomp xkey +state +context diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/Makefile.am libxkbcommon-0.1.0~git20120510.409ec8a1/test/Makefile.am --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/Makefile.am 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) -LDADD = $(top_builddir)/src/libxkbcommon.la - -TESTS_ENVIRONMENT = $(SHELL) - -check_PROGRAMS = xkey filecomp namescomp rulescomp canonicalise state -TESTS = $(check_PROGRAMS:=.sh) - -EXTRA_DIST = \ - $(TESTS) \ - bad.xkb \ - basic.xkb \ - default.xkb \ - named.xkb - -clean-local: - rm -f *.log diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/named.xkb libxkbcommon-0.1.0~git20120510.409ec8a1/test/named.xkb --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/named.xkb 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/named.xkb 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -default xkb_keymap "us" { - xkb_keycodes { include "xfree86+aliases(qwerty)" }; - xkb_types { include "complete" }; - xkb_compat { include "complete" }; - xkb_symbols { include "pc+us" }; - xkb_geometry { include "pc(pc105)" }; -}; - -xkb_keymap "de" { - xkb_keycodes { include "xfree86+aliases(qwertz)" }; - xkb_types { include "complete" }; - xkb_compat { include "complete" }; - xkb_symbols { include "pc+de" }; - xkb_geometry { include "pc(pc105)" }; -}; diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/namescomp.c libxkbcommon-0.1.0~git20120510.409ec8a1/test/namescomp.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/namescomp.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/namescomp.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,40 +24,65 @@ authorization from the authors. */ +#include #include #include -#include -#include +#include + #include "xkbcommon/xkbcommon.h" -#include "xkbcomp/utils.h" -int main(int argc, char *argv[]) +static int +test_names(const char *keycodes, const char *types, + const char *compat, const char *symbols) { - struct xkb_component_names ktcsg; - struct xkb_desc * xkb; - - /* Require Kc + T + C + S */ - if (argc < 5) { - fprintf(stderr, "Not enough arguments\n"); - fprintf(stderr, "Usage: %s KEYCODES TYPES COMPAT SYMBOLS\n", - argv[0]); - exit(1); - } + int ret = 1; + struct xkb_context *context; + struct xkb_keymap *xkb; + struct xkb_component_names kccgst = { + .keymap = NULL, + .keycodes = strdup(keycodes), + .types = strdup(types), + .compat = strdup(compat), + .symbols = strdup(symbols), + }; - ktcsg.keymap = NULL; - ktcsg.keycodes = argv[1]; - ktcsg.types = argv[2]; - ktcsg.compat = argv[3]; - ktcsg.symbols = argv[4]; + context = xkb_context_new(); + assert(context); - xkb = xkb_compile_keymap_from_components(&ktcsg); + fprintf(stderr, "\nCompiling %s %s %s %s\n", kccgst.keycodes, kccgst.types, + kccgst.compat, kccgst.symbols); + xkb = xkb_map_new_from_kccgst(context, &kccgst); if (!xkb) { - fprintf(stderr, "Failed to compile keymap\n"); - exit(1); + ret = 0; + goto err_ctx; } - xkb_free_keymap(xkb); + xkb_map_unref(xkb); +err_ctx: + xkb_context_unref(context); + free(kccgst.keycodes); + free(kccgst.types); + free(kccgst.compat); + free(kccgst.symbols); + return ret; +} + +int +main(void) +{ + assert(test_names("xfree86+aliases(qwertz)", "complete", "complete", "pc+de")); + assert(test_names("xfree86+aliases(qwerty)", "complete", "complete", "pc+us")); + assert(test_names("xfree86+aliases(qwertz)", "complete", "complete", + "pc+de+level3(ralt_switch_for_alts_toggle)+group(alts_toggle)")); + + assert(!test_names("", "", "", "")); + assert(!test_names("xfree86+aliases(qwerty)", "", "", "")); + assert(!test_names("xfree86+aliases(qwertz)", "", "", "pc+de")); + assert(!test_names("xfree86+aliases(qwertz)", "complete", "", "pc+de")); + assert(!test_names("xfree86+aliases(qwertz)", "", "complete", "pc+de")); + assert(!test_names("xfree86+aliases(qwertz)", "complete", "complete", "")); + assert(!test_names("badnames", "complete", "pc+us", "pc(pc101)")); return 0; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/namescomp.sh libxkbcommon-0.1.0~git20120510.409ec8a1/test/namescomp.sh --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/namescomp.sh 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/namescomp.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -#!/bin/sh - -srcdir=${srcdir-.} -builddir=${builddir-.} - -name=namescomp -prog="$builddir/$name$EXEEXT" -log="$builddir/$name.log" - -compile() -{ - echo "$prog '$1' '$2' '$3' '$4'" >>"$log" - $prog "$1" "$2" "$3" "$4" >>"$log" 2>&1 || exit $? -} - -failcompile() -{ - echo "$prog '$1' '$2' '$3' '$4'" >>"$log" - if $prog "$1" "$2" "$3" "$4" >>"$log" 2>&1; then - exit 1 - fi -} - -rm -f "$log" - -compile "xfree86+aliases(qwertz)" "complete" "complete" "pc+de" -compile "xfree86+aliases(qwerty)" "complete" "complete" "pc+us" -compile "xfree86+aliases(qwertz)" "complete" "complete" \ - "pc+de+level3(ralt_switch_for_alts_toggle)+group(alts_toggle)" - -failcompile "" "" "" "" -failcompile "xfree86+aliases(qwerty)" "" "" "" -failcompile "xfree86+aliases(qwertz)" "" "" "pc+de" -failcompile "xfree86+aliases(qwertz)" "complete" "" "pc+de" -failcompile "xfree86+aliases(qwertz)" "" "complete" "pc+de" -failcompile "xfree86+aliases(qwertz)" "complete" "complete" "" -failcompile "badnames" "complete" "pc+us" "pc(pc101)" diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/rulescomp.c libxkbcommon-0.1.0~git20120510.409ec8a1/test/rulescomp.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/rulescomp.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/rulescomp.c 2012-05-10 10:10:26.000000000 +0000 @@ -24,40 +24,58 @@ authorization from the authors. */ -#include +#include #include -#include -#include + #include "xkbcommon/xkbcommon.h" -#include "xkbcomp/utils.h" -int main(int argc, char *argv[]) +static int +test_rmlvo(const char *rules, const char *model, const char *layout, + const char *variant, const char *options) { - struct xkb_rule_names rmlvo; - struct xkb_desc * xkb; - - /* Require rmlvo */ - if (argc < 6) { - fprintf(stderr, "Not enough arguments\n"); - fprintf(stderr, "Usage: %s RULES MODEL LAYOUT VARIANT OPTIONS\n", - argv[0]); - exit(1); - } + struct xkb_context *context; + struct xkb_keymap *xkb; + struct xkb_rule_names rmlvo = { + .rules = rules, + .model = model, + .layout = layout, + .variant = variant, + .options = options + }; - rmlvo.rules = argv[1]; - rmlvo.model = argv[2]; - rmlvo.layout = argv[3]; - rmlvo.variant = argv[4]; - rmlvo.options = argv[5]; + context = xkb_context_new(); + assert(context); - xkb = xkb_compile_keymap_from_rules(&rmlvo); + fprintf(stderr, "\nCompiling %s %s %s %s %s\n", rmlvo.rules, rmlvo.model, + rmlvo.layout, rmlvo.variant, rmlvo.options); + xkb = xkb_map_new_from_names(context, &rmlvo); +#if 0 if (!xkb) { - fprintf(stderr, "Failed to compile keymap\n"); - exit(1); + xkb_context_unref(context); + return 0; } - xkb_free_keymap(xkb); + xkb_map_unref(xkb); + xkb_context_unref(context); +#endif + return 1; +} + +int +main(void) +{ + assert(test_rmlvo("base", "pc105", "us,il,ru,ca", ",,,multix", "grp:alts_toggle,ctrl:nocaps,compose:rwin")); +#if 0 + assert(test_rmlvo("base", "", "us", "", "")); + assert(test_rmlvo("evdev", "pc105", "us", "intl", "")); + assert(test_rmlvo("evdev", "pc105", "us", "intl", "grp:alts_toggle")); + + assert(!test_rmlvo("", "", "", "", "")); + assert(!test_rmlvo("base", "", "", "", "")); + assert(!test_rmlvo("base", "pc105", "", "", "")); + assert(!test_rmlvo("badrules", "", "us", "", "")); +#endif return 0; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/rulescomp.sh libxkbcommon-0.1.0~git20120510.409ec8a1/test/rulescomp.sh --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/rulescomp.sh 2012-05-01 18:28:54.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/rulescomp.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#!/bin/sh - -srcdir=${srcdir-.} -builddir=${builddir-.} - -name=rulescomp -prog="$builddir/$name$EXEEXT" -log="$builddir/$name.log" - -compile() -{ - echo "$prog '$1' '$2' '$3' '$4' '$5'" >>"$log" - $prog "$1" "$2" "$3" "$4" "$5" >>"$log" 2>&1 || exit $? -} - -failcompile() -{ - echo "$prog '$1' '$2' '$3' '$4' '$5'" >>"$log" - if $prog "$1" "$2" "$3" "$4" "$5" >>"$log" 2>&1; then - exit 1 - fi -} - -rm -f "$log" - -compile base pc105 us "" "" -compile base "" us "" "" -compile evdev pc105 us intl "" -compile evdev pc105 us intl grp:alts_toggle - -failcompile "" "" "" "" "" "" -failcompile base "" "" "" "" "" -failcompile base pc105 "" "" "" "" -failcompile badrules "" us "" "" "" diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/state.c libxkbcommon-0.1.0~git20120510.409ec8a1/test/state.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/state.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/state.c 2012-05-10 10:10:26.000000000 +0000 @@ -26,12 +26,10 @@ #include #include #include -#include -#include #include #include + #include "xkbcommon/xkbcommon.h" -#include "xkbcomp/utils.h" #include "XKBcommonint.h" /* Offset between evdev keycodes (where KEY_ESCAPE is 1), and the evdev XKB @@ -89,39 +87,24 @@ } } -int -main(int argc, char *argv[]) +static void +test_update_key(struct xkb_keymap *xkb) { - struct xkb_rule_names rmlvo; - struct xkb_desc *xkb; - struct xkb_state *state; + struct xkb_state *state = xkb_state_new(xkb); + const xkb_keysym_t *syms; int num_syms; - xkb_keysym_t *syms; - - rmlvo.rules = "evdev"; - rmlvo.model = "pc104"; - rmlvo.layout = "us"; - rmlvo.variant = NULL; - rmlvo.options = NULL; - - xkb = xkb_compile_keymap_from_rules(&rmlvo); - - if (!xkb) { - fprintf(stderr, "Failed to compile keymap\n"); - exit(1); - } - state = xkb_state_new(xkb); + assert(state); /* LCtrl down */ - xkb_state_update_key(state, KEY_LEFTCTRL + EVDEV_OFFSET, 1); + xkb_state_update_key(state, KEY_LEFTCTRL + EVDEV_OFFSET, XKB_KEY_DOWN); fprintf(stderr, "dumping state for LCtrl down:\n"); print_state(state); assert(xkb_state_mod_name_is_active(state, "Control", XKB_STATE_DEPRESSED)); /* LCtrl + RAlt down */ - xkb_state_update_key(state, KEY_RIGHTALT + EVDEV_OFFSET, 1); + xkb_state_update_key(state, KEY_RIGHTALT + EVDEV_OFFSET, XKB_KEY_DOWN); fprintf(stderr, "dumping state for LCtrl + RAlt down:\n"); print_state(state); assert(xkb_state_mod_name_is_active(state, "Control", @@ -130,7 +113,7 @@ XKB_STATE_DEPRESSED)); /* RAlt down */ - xkb_state_update_key(state, KEY_LEFTCTRL + EVDEV_OFFSET, 0); + xkb_state_update_key(state, KEY_LEFTCTRL + EVDEV_OFFSET, XKB_KEY_UP); fprintf(stderr, "dumping state for RAlt down:\n"); print_state(state); assert(!xkb_state_mod_name_is_active(state, "Control", @@ -139,13 +122,13 @@ XKB_STATE_DEPRESSED)); /* none down */ - xkb_state_update_key(state, KEY_RIGHTALT + EVDEV_OFFSET, 0); + xkb_state_update_key(state, KEY_RIGHTALT + EVDEV_OFFSET, XKB_KEY_UP); assert(!xkb_state_mod_name_is_active(state, "Mod1", XKB_STATE_EFFECTIVE)); /* Caps locked */ - xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, 1); - xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, 0); + xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_DOWN); + xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_UP); fprintf(stderr, "dumping state for Caps Lock:\n"); print_state(state); assert(xkb_state_mod_name_is_active(state, "Caps Lock", @@ -155,8 +138,8 @@ assert(num_syms == 1 && syms[0] == XK_Q); /* Caps unlocked */ - xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, 1); - xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, 0); + xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_DOWN); + xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_UP); assert(!xkb_state_mod_name_is_active(state, "Caps Lock", XKB_STATE_EFFECTIVE)); assert(!xkb_state_led_name_is_active(state, "Caps Lock")); @@ -164,7 +147,83 @@ assert(num_syms == 1 && syms[0] == XK_q); xkb_state_unref(state); - xkb_free_keymap(xkb); +} + +static void +test_serialisation(struct xkb_keymap *xkb) +{ + struct xkb_state *state = xkb_state_new(xkb); + xkb_mod_mask_t base_mods; + xkb_mod_mask_t latched_mods; + xkb_mod_mask_t locked_mods; + xkb_mod_mask_t effective_mods; + xkb_mod_index_t caps, shift, ctrl; + xkb_group_index_t base_group = 0; + xkb_group_index_t latched_group = 0; + xkb_group_index_t locked_group = 0; + + assert(state); + + caps = xkb_map_mod_get_index(state->xkb, "Caps Lock"); + assert(caps != XKB_MOD_INVALID); + shift = xkb_map_mod_get_index(state->xkb, "Shift"); + assert(shift != XKB_MOD_INVALID); + ctrl = xkb_map_mod_get_index(state->xkb, "Control"); + assert(ctrl != XKB_MOD_INVALID); + + xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_DOWN); + xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_UP); + base_mods = xkb_state_serialise_mods(state, XKB_STATE_DEPRESSED); + assert(base_mods == 0); + latched_mods = xkb_state_serialise_mods(state, XKB_STATE_LATCHED); + assert(latched_mods == 0); + locked_mods = xkb_state_serialise_mods(state, XKB_STATE_LOCKED); + assert(locked_mods == (1 << caps)); + effective_mods = xkb_state_serialise_mods(state, XKB_STATE_EFFECTIVE); + assert(effective_mods == locked_mods); + + xkb_state_update_key(state, KEY_LEFTSHIFT + EVDEV_OFFSET, XKB_KEY_DOWN); + base_mods = xkb_state_serialise_mods(state, XKB_STATE_DEPRESSED); + assert(base_mods == (1 << shift)); + latched_mods = xkb_state_serialise_mods(state, XKB_STATE_LATCHED); + assert(latched_mods == 0); + locked_mods = xkb_state_serialise_mods(state, XKB_STATE_LOCKED); + assert(locked_mods == (1 << caps)); + effective_mods = xkb_state_serialise_mods(state, XKB_STATE_EFFECTIVE); + assert(effective_mods == (base_mods | locked_mods)); + + base_mods |= (1 << ctrl); + xkb_state_update_mask(state, base_mods, latched_mods, locked_mods, + base_group, latched_group, locked_group); + + assert(xkb_state_mod_index_is_active(state, ctrl, XKB_STATE_DEPRESSED)); + assert(xkb_state_mod_index_is_active(state, ctrl, XKB_STATE_EFFECTIVE)); + + xkb_state_unref(state); +} + +int +main(void) +{ + struct xkb_context *context; + struct xkb_keymap *xkb; + struct xkb_rule_names rmlvo = { + .rules = "evdev", + .model = "pc104", + .layout = "us", + .variant = NULL, + .options = NULL, + }; + + context = xkb_context_new(); + assert(context); + + xkb = xkb_map_new_from_names(context, &rmlvo); + assert(xkb); + + test_update_key(xkb); + test_serialisation(xkb); - return 0; + xkb_map_unref(xkb); + xkb_context_unref(context); } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/state.sh libxkbcommon-0.1.0~git20120510.409ec8a1/test/state.sh --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/state.sh 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/state.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#!/bin/sh - -srcdir=${srcdir-.} -builddir=${builddir-.} - -name=state -prog="$builddir/$name$EXEEXT" -log="$builddir/$name.log" - -rm -f "$log" -srcdir=${srcdir-.} -builddir=${builddir-.} -$builddir/$name$EXEEXT >> $log 2>&1 diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/xkey.c libxkbcommon-0.1.0~git20120510.409ec8a1/test/xkey.c --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/xkey.c 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/xkey.c 2012-05-10 10:10:26.000000000 +0000 @@ -1,51 +1,50 @@ -#include "xkbmisc.h" -#include "xkbcommon/xkbcommon.h" +#include #include #include #include -static void print_keysym(const char *s) +#include "xkbcommon/xkbcommon.h" + +static int +test_string(const char *string, xkb_keysym_t expected) { - KeySym ks = xkb_string_to_keysym(s); - if (ks == NoSymbol) - printf("NoSymbol\n"); - else - printf("0x%lX\n", ks); + xkb_keysym_t keysym; + + keysym = xkb_string_to_keysym(string); + + fprintf(stderr, "Expected string %s -> %x\n", string, expected); + fprintf(stderr, "Received string %s -> %x\n\n", string, keysym); + + return keysym == expected; } -static void print_string(KeySym ks) +static int +test_keysym(xkb_keysym_t keysym, const char *expected) { char s[16]; - xkb_keysym_to_string(ks, s, sizeof s); - printf("%s\n", s); + xkb_keysym_to_string(keysym, s, sizeof(s)); + + fprintf(stderr, "Expected keysym %#x -> %s\n", keysym, expected); + fprintf(stderr, "Received keysym %#x -> %s\n\n", keysym, s); + + return strcmp(s, expected) == 0; } -int main(int argc, char *argv[]) +int +main(void) { - int mode; - KeySym sym; - - if (argc < 3) { - fprintf(stderr, "error: not enough arguments\n"); - exit(EXIT_FAILURE); - } - - if (strcmp(argv[1], "-k") == 0) { - mode = 0; - sym = strtoul(argv[2], NULL, 16); - } - else if (strcmp(argv[1], "-s") == 0) - mode = 1; - else { - fprintf(stderr, "error: unrecognized argument \"%s\"\n", argv[1]); - exit(EXIT_FAILURE); - } - - if (mode == 0) - print_string(sym); - else - print_keysym(argv[2]); + assert(test_string("Undo", 0xFF65)); + assert(test_string("ThisKeyShouldNotExist", XKB_KEYSYM_NO_SYMBOL)); + assert(test_string("XF86_Switch_VT_5", 0x1008FE05)); + assert(test_string("VoidSymbol", 0xFFFFFF)); + assert(test_string("U4567", 0x1004567)); + assert(test_string("0x10203040", 0x10203040)); + + assert(test_keysym(0x1008FF56, "XF86Close")); + assert(test_keysym(0x0, "NoSymbol")); + assert(test_keysym(0x1008FE20, "XF86Ungrab")); + assert(test_keysym(0x01001234, "U1234")); return 0; } diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/test/xkey.sh libxkbcommon-0.1.0~git20120510.409ec8a1/test/xkey.sh --- libxkbcommon-0.1.0~git20120501.3d672fcf/test/xkey.sh 2012-05-01 18:28:59.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/test/xkey.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -#!/bin/sh - -srcdir=${srcdir-.} -builddir=${builddir-.} - -name=xkey -prog="$builddir/$name$EXEEXT" -log="$builddir/$name.log" - -check_error() -{ - if [ "$2" != "$3" ]; then - echo "error checking $1" >&2 - echo " expected: $2" >&2 - echo " received: $3" >&2 - return 1 - fi -} - -check_string() -{ - echo "$prog -s '$1'" >>"$log" - val=`$prog -s "$1"` && - echo "$val" >>"$log" && - check_error "$1" "$2" "$val" >>"$log" 2>&1 || - exit $? -} - -check_key() -{ - echo "$prog -k '$1'" >>"$log" - val=`$prog -k "$1"` && \ - echo "$val" >>"$log" && - check_error "$1" "$2" "$val" >>"$log" 2>&1 || \ - exit $? -} - -rm -f "$log" - -check_string Undo 0xFF65 -check_key 0x1008FF56 XF86Close -check_string ThisKeyShouldNotExist NoSymbol -check_key 0x0 NoSymbol -check_string XF86_Switch_VT_5 0x1008FE05 -check_key 0x1008FE20 XF86Ungrab -check_string VoidSymbol 0xFFFFFF -check_key 0x01001234 U1234 -check_string U4567 0x1004567 -check_string 0x10203040 0x10203040 diff -Nru libxkbcommon-0.1.0~git20120501.3d672fcf/xkbcommon.pc.in libxkbcommon-0.1.0~git20120510.409ec8a1/xkbcommon.pc.in --- libxkbcommon-0.1.0~git20120501.3d672fcf/xkbcommon.pc.in 2012-05-01 18:28:54.000000000 +0000 +++ libxkbcommon-0.1.0~git20120510.409ec8a1/xkbcommon.pc.in 2012-05-10 10:10:26.000000000 +0000 @@ -6,6 +6,5 @@ Name: xkbcommon Description: XKB API common to servers and clients Version: @PACKAGE_VERSION@ -Requires: xproto kbproto >= 1.0.4 Cflags: -I${includedir} Libs: -L${libdir} -lxkbcommon