test: rename test/interactive to interactive-evdev
[platform/upstream/libxkbcommon.git] / configure.ac
1 dnl  Copyright © 2008 Dan Nicholson
2 dnl
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.
12 dnl
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.
20 dnl
21 dnl Process this file with autoconf to create configure.
22
23 # Initialize Autoconf
24 AC_PREREQ([2.62])
25 AC_INIT([libxkbcommon], [0.3.2],
26         [https://bugs.freedesktop.org/enter_bug.cgi?product=libxkbcommon],
27         [libxkbcommon], [http://xkbcommon.org])
28 AC_CONFIG_SRCDIR([Makefile.am])
29 AC_CONFIG_HEADERS([src/config.h])
30 AC_CONFIG_MACRO_DIR([m4])
31 AC_CONFIG_AUX_DIR([build-aux])
32
33 # Initialize Automake
34 AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip subdir-objects color-tests parallel-tests check-news])
35 AM_MAINTAINER_MODE([enable])
36
37 # Get _GNU_SOURCE and friends
38 AC_USE_SYSTEM_EXTENSIONS
39
40 # Initialize libtool
41 LT_INIT
42
43 # Add xorg-macros stuff
44 m4_ifndef([XORG_MACROS_VERSION],
45           [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
46 XORG_MACROS_VERSION(1.16)
47 XORG_DEFAULT_OPTIONS
48 XORG_MEMORY_CHECK_FLAGS
49 XORG_ENABLE_DOCS
50 XORG_WITH_DOXYGEN
51
52 # Needed in older Automakes for subdir-objects
53 AM_PROG_CC_C_O
54
55 # Check for compiler features
56 AC_C_INLINE
57
58 # Check for programs
59 AC_PROG_MKDIR_P
60 PKG_PROG_PKG_CONFIG
61
62 # Note: we use some yacc extensions, which work with either GNU bison
63 # (preferred) or byacc. Other yacc's may or may not work.
64 AC_PROG_YACC
65 AC_PATH_PROG([YACC_INST], $YACC)
66 if test ! -f "src/xkbcomp/parser.c"; then
67    if test -z "$YACC_INST"; then
68       AC_MSG_ERROR([yacc not found - unable to compile src/xkbcomp/parser.y])
69    fi
70 fi
71
72 # Checks for library functions.
73 AC_CHECK_FUNCS([strcasecmp strncasecmp])
74 if test "x$ac_cv_func_strcasecmp" = xno || \
75    test "x$ac_cv_func_strncasecmp" = xno; then
76     AC_MSG_ERROR([C library does not support strcasecmp/strncasecmp])
77 fi
78
79 AC_CHECK_FUNCS([eaccess euidaccess mmap])
80
81 # Some tests use Linux-specific headers
82 AC_CHECK_HEADER([linux/input.h])
83 AM_CONDITIONAL(BUILD_LINUX_TESTS, [test "x$ac_cv_header_linux_input_h" = xyes])
84
85 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden])
86
87 # Define a configuration option for the XKB config root
88 xkb_base=`$PKG_CONFIG --variable=xkb_base xkeyboard-config`
89 if test "x$xkb_base" = x; then
90     xkb_base=$datadir/X11/xkb
91 fi
92 AC_ARG_WITH([xkb_config_root],
93     [AS_HELP_STRING([--with-xkb-config-root=<path>],
94         [Set default XKB config root (default: xkeyboard-config install path)])],
95     [XKBCONFIGROOT="$withval"],
96     [XKBCONFIGROOT="$xkb_base"])
97 AC_SUBST([XKBCONFIGROOT])
98
99 AC_ARG_WITH([default_rules],
100     [AS_HELP_STRING([--with-default-rules=<path>],
101         [Default XKB ruleset (default: evdev)])],
102     [DEFAULT_XKB_RULES="$withval"],
103     [DEFAULT_XKB_RULES="evdev"])
104 AC_DEFINE_UNQUOTED([DEFAULT_XKB_RULES], ["$DEFAULT_XKB_RULES"],
105                    [Default XKB ruleset])
106
107 AC_ARG_WITH([default_model],
108     [AS_HELP_STRING([--with-default-model=<path>],
109         [Default XKB model (default: pc105)])],
110     [DEFAULT_XKB_MODEL="$withval"],
111     [DEFAULT_XKB_MODEL="pc105"])
112 AC_DEFINE_UNQUOTED([DEFAULT_XKB_MODEL], ["$DEFAULT_XKB_MODEL"],
113                    [Default XKB model])
114
115 AC_ARG_WITH([default_layout],
116     [AS_HELP_STRING([--with-default-layout=<path>],
117         [Default XKB layout (default: us)])],
118     [DEFAULT_XKB_LAYOUT="$withval"],
119     [DEFAULT_XKB_LAYOUT="us"])
120 AC_DEFINE_UNQUOTED([DEFAULT_XKB_LAYOUT], ["$DEFAULT_XKB_LAYOUT"],
121                    [Default XKB layout])
122
123 AC_ARG_WITH([default_variant],
124     [AS_HELP_STRING([--with-default-variant=<path>],
125         [Default XKB variant (default: (none))])],
126     [DEFAULT_XKB_VARIANT="$withval"],
127     [DEFAULT_XKB_VARAINT=])
128 if ! test "x$DEFAULT_XKB_VARIANT" = x; then
129     AC_DEFINE_UNQUOTED([DEFAULT_XKB_VARIANT], ["$DEFAULT_XKB_VARIANT"],
130                        [Default XKB variant])
131 fi
132
133 AC_ARG_WITH([default_options],
134     [AS_HELP_STRING([--with-default-options=<path>],
135         [Default XKB options (default: (none))])],
136     [DEFAULT_XKB_OPTIONS="$withval"],
137     [DEFAULT_XKB_OPTIONS=])
138 if ! test "x$DEFAULT_XKB_OPTIONS" = x; then
139     AC_DEFINE_UNQUOTED([DEFAULT_XKB_OPTIONS], ["$DEFAULT_XKB_OPTIONS"],
140                        [Default XKB options])
141 fi
142
143 AC_CONFIG_FILES([
144     Makefile
145     xkbcommon-uninstalled.pc
146     xkbcommon.pc
147     doc/Doxyfile
148 ])
149 AC_OUTPUT