2009-01-13 19:25:35 -07:00
|
|
|
dnl Copyright © 2008 Dan Nicholson
|
|
|
|
dnl
|
|
|
|
dnl Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
dnl documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
dnl the above copyright notice appear in all copies and that both that
|
|
|
|
dnl copyright notice and this permission notice appear in supporting
|
|
|
|
dnl documentation, and that the name of Keith Packard not be used in
|
|
|
|
dnl advertising or publicity pertaining to distribution of the software without
|
|
|
|
dnl specific, written prior permission. Keith Packard makes no
|
|
|
|
dnl representations about the suitability of this software for any purpose. It
|
|
|
|
dnl is provided "as is" without express or implied warranty.
|
|
|
|
dnl
|
|
|
|
dnl DAN NICHOLSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
|
|
dnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
|
|
dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
|
dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
dnl PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
dnl
|
|
|
|
dnl Process this file with autoconf to create configure.
|
|
|
|
|
2010-12-02 18:52:34 -07:00
|
|
|
# Initialize Autoconf
|
2012-09-22 06:02:54 -06:00
|
|
|
AC_PREREQ([2.62])
|
2013-06-03 09:43:43 -06:00
|
|
|
AC_INIT([libxkbcommon], [0.3.1],
|
2012-12-10 13:29:26 -07:00
|
|
|
[https://bugs.freedesktop.org/enter_bug.cgi?product=libxkbcommon],
|
|
|
|
[libxkbcommon], [http://xkbcommon.org])
|
2010-12-02 18:52:34 -07:00
|
|
|
AC_CONFIG_SRCDIR([Makefile.am])
|
2009-01-20 08:33:14 -07:00
|
|
|
AC_CONFIG_HEADERS([src/config.h])
|
2010-11-11 15:02:11 -07:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2009-01-13 19:25:35 -07:00
|
|
|
|
2010-12-02 18:52:34 -07:00
|
|
|
# Initialize Automake
|
2012-11-08 20:26:49 -07:00
|
|
|
AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip subdir-objects color-tests parallel-tests])
|
2012-10-10 13:01:15 -06:00
|
|
|
AM_MAINTAINER_MODE([enable])
|
2010-12-02 18:52:34 -07:00
|
|
|
|
2012-04-03 07:29:57 -06:00
|
|
|
# Get _GNU_SOURCE and friends
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
|
2010-12-02 18:52:34 -07:00
|
|
|
# Initialize libtool
|
2012-04-10 13:04:05 -06:00
|
|
|
LT_INIT
|
2010-12-02 18:52:34 -07:00
|
|
|
|
2013-02-25 03:27:24 -07:00
|
|
|
# Add xorg-macros stuff
|
2010-12-07 12:32:57 -07:00
|
|
|
m4_ifndef([XORG_MACROS_VERSION],
|
2012-12-10 13:29:26 -07:00
|
|
|
[m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
|
2012-10-25 17:51:56 -06:00
|
|
|
XORG_MACROS_VERSION(1.16)
|
2010-12-07 12:32:57 -07:00
|
|
|
XORG_DEFAULT_OPTIONS
|
2012-09-21 10:57:37 -06:00
|
|
|
XORG_MEMORY_CHECK_FLAGS
|
2012-09-22 06:02:54 -06:00
|
|
|
XORG_ENABLE_DOCS
|
|
|
|
XORG_WITH_DOXYGEN
|
2010-12-07 12:32:57 -07:00
|
|
|
|
2012-05-18 17:35:15 -06:00
|
|
|
# Check for compiler features
|
|
|
|
AC_C_INLINE
|
|
|
|
|
2010-12-07 12:32:57 -07:00
|
|
|
# Check for programs
|
2012-09-22 06:02:54 -06:00
|
|
|
AC_PROG_MKDIR_P
|
2012-10-26 06:23:07 -06:00
|
|
|
PKG_PROG_PKG_CONFIG
|
Replace flex scanner with a hand-written one
The scanner is very similar in structure to the one in xkbcomp/rules.c.
It avoids copying and has nicer error reporting.
It uses gperf to generate a hashtable for the keywords, which gives a
nice speed boost (compared to the naive strcasecmp method at least). But
since there's hardly a reason to regenerate it every time and require
people to install gperf, the output (keywords.c) is added here as well.
Here are some stats from test/rulescomp:
Before:
compiled 1000 keymaps in 4.052939625s
==22063== total heap usage: 101,101 allocs, 101,101 frees, 11,840,834 bytes allocated
After:
compiled 1000 keymaps in 3.519665434s
==26505== total heap usage: 99,945 allocs, 99,945 frees, 7,033,608 bytes allocated
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-08-12 02:40:02 -06:00
|
|
|
|
2010-12-07 08:59:13 -07:00
|
|
|
AC_PROG_YACC
|
|
|
|
AC_PATH_PROG([YACC_INST], $YACC)
|
2012-05-09 16:02:29 -06:00
|
|
|
if test ! -f "src/xkbcomp/parser.c"; then
|
2010-12-07 08:59:13 -07:00
|
|
|
if test -z "$YACC_INST"; then
|
2012-05-09 16:02:29 -06:00
|
|
|
AC_MSG_ERROR([yacc not found - unable to compile src/xkbcomp/parser.y])
|
2010-12-07 08:59:13 -07:00
|
|
|
fi
|
|
|
|
fi
|
2009-01-13 19:25:35 -07:00
|
|
|
|
2010-12-07 16:17:29 -07:00
|
|
|
# Checks for library functions.
|
2012-03-27 07:06:56 -06:00
|
|
|
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
|
2010-12-07 16:17:29 -07:00
|
|
|
|
2013-03-14 06:33:40 -06:00
|
|
|
AC_CHECK_FUNCS([eaccess euidaccess mmap])
|
2012-05-15 06:23:41 -06:00
|
|
|
|
2013-03-02 10:01:18 -07:00
|
|
|
# Some tests use Linux-specific headers
|
|
|
|
AC_CHECK_HEADER([linux/input.h])
|
|
|
|
AM_CONDITIONAL(BUILD_LINUX_TESTS, [test "x$ac_cv_header_linux_input_h" = xyes])
|
|
|
|
|
2012-10-26 06:43:15 -06:00
|
|
|
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden])
|
2011-01-29 12:06:39 -07:00
|
|
|
|
2010-12-07 16:17:29 -07:00
|
|
|
# Define a configuration option for the XKB config root
|
2010-12-11 16:56:21 -07:00
|
|
|
xkb_base=`$PKG_CONFIG --variable=xkb_base xkeyboard-config`
|
2012-05-07 10:30:47 -06:00
|
|
|
if test "x$xkb_base" = x; then
|
|
|
|
xkb_base=$datadir/X11/xkb
|
|
|
|
fi
|
2009-03-27 07:55:32 -06:00
|
|
|
AC_ARG_WITH([xkb_config_root],
|
2012-05-07 10:30:47 -06:00
|
|
|
[AS_HELP_STRING([--with-xkb-config-root=<path>],
|
|
|
|
[Set default XKB config root (default: xkeyboard-config install path)])],
|
2009-03-27 07:55:32 -06:00
|
|
|
[XKBCONFIGROOT="$withval"],
|
2010-12-11 16:56:21 -07:00
|
|
|
[XKBCONFIGROOT="$xkb_base"])
|
2009-03-27 07:55:32 -06:00
|
|
|
AC_SUBST([XKBCONFIGROOT])
|
|
|
|
|
2012-08-02 18:51:10 -06:00
|
|
|
AC_ARG_WITH([default_rules],
|
|
|
|
[AS_HELP_STRING([--with-default-rules=<path>],
|
|
|
|
[Default XKB ruleset (default: evdev)])],
|
|
|
|
[DEFAULT_XKB_RULES="$withval"],
|
|
|
|
[DEFAULT_XKB_RULES="evdev"])
|
|
|
|
AC_DEFINE_UNQUOTED([DEFAULT_XKB_RULES], ["$DEFAULT_XKB_RULES"],
|
|
|
|
[Default XKB ruleset])
|
|
|
|
|
|
|
|
AC_ARG_WITH([default_model],
|
|
|
|
[AS_HELP_STRING([--with-default-model=<path>],
|
|
|
|
[Default XKB model (default: pc105)])],
|
|
|
|
[DEFAULT_XKB_MODEL="$withval"],
|
|
|
|
[DEFAULT_XKB_MODEL="pc105"])
|
|
|
|
AC_DEFINE_UNQUOTED([DEFAULT_XKB_MODEL], ["$DEFAULT_XKB_MODEL"],
|
|
|
|
[Default XKB model])
|
|
|
|
|
|
|
|
AC_ARG_WITH([default_layout],
|
|
|
|
[AS_HELP_STRING([--with-default-layout=<path>],
|
|
|
|
[Default XKB layout (default: us)])],
|
|
|
|
[DEFAULT_XKB_LAYOUT="$withval"],
|
|
|
|
[DEFAULT_XKB_LAYOUT="us"])
|
|
|
|
AC_DEFINE_UNQUOTED([DEFAULT_XKB_LAYOUT], ["$DEFAULT_XKB_LAYOUT"],
|
|
|
|
[Default XKB layout])
|
2012-05-08 02:46:58 -06:00
|
|
|
|
2013-02-28 11:48:40 -07:00
|
|
|
AC_ARG_WITH([default_variant],
|
|
|
|
[AS_HELP_STRING([--with-default-variant=<path>],
|
|
|
|
[Default XKB variant (default: (none))])],
|
|
|
|
[DEFAULT_XKB_VARIANT="$withval"],
|
|
|
|
[DEFAULT_XKB_VARAINT=])
|
|
|
|
if ! test "x$DEFAULT_XKB_VARIANT" = x; then
|
|
|
|
AC_DEFINE_UNQUOTED([DEFAULT_XKB_VARIANT], ["$DEFAULT_XKB_VARIANT"],
|
|
|
|
[Default XKB variant])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_WITH([default_options],
|
|
|
|
[AS_HELP_STRING([--with-default-options=<path>],
|
|
|
|
[Default XKB options (default: (none))])],
|
|
|
|
[DEFAULT_XKB_OPTIONS="$withval"],
|
|
|
|
[DEFAULT_XKB_OPTIONS=])
|
|
|
|
if ! test "x$DEFAULT_XKB_OPTIONS" = x; then
|
|
|
|
AC_DEFINE_UNQUOTED([DEFAULT_XKB_OPTIONS], ["$DEFAULT_XKB_OPTIONS"],
|
|
|
|
[Default XKB options])
|
|
|
|
fi
|
|
|
|
|
2012-05-08 02:46:58 -06:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
2012-05-15 06:23:42 -06:00
|
|
|
xkbcommon-uninstalled.pc
|
2012-09-22 06:02:54 -06:00
|
|
|
xkbcommon.pc
|
|
|
|
doc/Doxyfile
|
|
|
|
])
|
2010-11-11 15:05:33 -07:00
|
|
|
AC_OUTPUT
|