1 dnl Copyright © 2008 Dan Nicholson
3 dnl Permission to use, copy, modify, distribute, and sell this software and its
4 dnl documentation for any purpose is hereby granted without fee, provided that
5 dnl the above copyright notice appear in all copies and that both that
6 dnl copyright notice and this permission notice appear in supporting
7 dnl documentation, and that the name of Keith Packard not be used in
8 dnl advertising or publicity pertaining to distribution of the software without
9 dnl specific, written prior permission. Keith Packard makes no
10 dnl representations about the suitability of this software for any purpose. It
11 dnl is provided "as is" without express or implied warranty.
13 dnl DAN NICHOLSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14 dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15 dnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16 dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17 dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 dnl PERFORMANCE OF THIS SOFTWARE.
21 dnl Process this file with autoconf to create configure.
25 AC_INIT([libxkbcommon], [0.1.0],
26 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
27 AC_CONFIG_SRCDIR([Makefile.am])
28 AC_CONFIG_HEADERS([src/config.h])
29 AC_CONFIG_MACRO_DIR([m4])
32 AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects color-tests parallel-tests])
35 # Get _GNU_SOURCE and friends
36 AC_USE_SYSTEM_EXTENSIONS
41 # Require xorg-macros minimum of 1.8 for AM_SILENT_RULES
42 m4_ifndef([XORG_MACROS_VERSION],
43 [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
44 XORG_MACROS_VERSION(1.8)
46 XORG_CHECK_MALLOC_ZERO
48 # Check for compiler features
55 AC_PATH_PROG([YACC_INST], $YACC)
56 if test ! -f "src/xkbcomp/parser.c"; then
57 if test -z "$YACC_INST"; then
58 AC_MSG_ERROR([yacc not found - unable to compile src/xkbcomp/parser.y])
62 # Checks for library functions.
63 AC_CHECK_FUNCS([strcasecmp strncasecmp])
64 if test "x$ac_cv_func_strcasecmp" = xno || \
65 test "x$ac_cv_func_strncasecmp" = xno; then
66 AC_MSG_ERROR([C library does not support strcasecmp/strncasecmp])
69 AC_CHECK_FUNCS([eaccess euidaccess])
71 # Build native compiler needed for makekeys
72 AC_ARG_VAR([CC_FOR_BUILD], [Build native C compiler program])
73 if test "x$CC_FOR_BUILD" = x; then
74 if test "$cross_compiling" != no; then
75 AC_PATH_PROGS([CC_FOR_BUILD], [gcc cc], [cc])
81 if test "x$GCC" = xyes ; then
82 CFLAGS="$CFLAGS -fvisibility=hidden"
85 # Define a configuration option for the XKB config root
86 xkb_base=`$PKG_CONFIG --variable=xkb_base xkeyboard-config`
87 if test "x$xkb_base" = x; then
88 xkb_base=$datadir/X11/xkb
90 AC_ARG_WITH([xkb_config_root],
91 [AS_HELP_STRING([--with-xkb-config-root=<path>],
92 [Set default XKB config root (default: xkeyboard-config install path)])],
93 [XKBCONFIGROOT="$withval"],
94 [XKBCONFIGROOT="$xkb_base"])
95 AC_SUBST([XKBCONFIGROOT])
97 AC_ARG_WITH([default_rules],
98 [AS_HELP_STRING([--with-default-rules=<path>],
99 [Default XKB ruleset (default: evdev)])],
100 [DEFAULT_XKB_RULES="$withval"],
101 [DEFAULT_XKB_RULES="evdev"])
102 AC_DEFINE_UNQUOTED([DEFAULT_XKB_RULES], ["$DEFAULT_XKB_RULES"],
103 [Default XKB ruleset])
105 AC_ARG_WITH([default_model],
106 [AS_HELP_STRING([--with-default-model=<path>],
107 [Default XKB model (default: pc105)])],
108 [DEFAULT_XKB_MODEL="$withval"],
109 [DEFAULT_XKB_MODEL="pc105"])
110 AC_DEFINE_UNQUOTED([DEFAULT_XKB_MODEL], ["$DEFAULT_XKB_MODEL"],
113 AC_ARG_WITH([default_layout],
114 [AS_HELP_STRING([--with-default-layout=<path>],
115 [Default XKB layout (default: us)])],
116 [DEFAULT_XKB_LAYOUT="$withval"],
117 [DEFAULT_XKB_LAYOUT="us"])
118 AC_DEFINE_UNQUOTED([DEFAULT_XKB_LAYOUT], ["$DEFAULT_XKB_LAYOUT"],
119 [Default XKB layout])
124 xkbcommon-uninstalled.pc