1dnl  Copyright 2005 Red Hat, Inc.
2dnl
3dnl  Permission to use, copy, modify, distribute, and sell this software and its
4dnl  documentation for any purpose is hereby granted without fee, provided that
5dnl  the above copyright notice appear in all copies and that both that
6dnl  copyright notice and this permission notice appear in supporting
7dnl  documentation, and that the name of Red Hat not be used in
8dnl  advertising or publicity pertaining to distribution of the software without
9dnl  specific, written prior permission.  Red Hat makes no
10dnl  representations about the suitability of this software for any purpose.  It
11dnl  is provided "as is" without express or implied warranty.
12dnl
13dnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15dnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19dnl  PERFORMANCE OF THIS SOFTWARE.
20dnl
21dnl Process this file with autoconf to create configure.
22
23# Initialize Autoconf
24AC_PREREQ([2.70])
25AC_INIT([xkbcomp], [1.4.7],
26        [https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/issues], [xkbcomp])
27AC_CONFIG_SRCDIR([Makefile.am])
28AC_CONFIG_HEADERS([config.h])
29
30# Set common system defines for POSIX extensions, such as _GNU_SOURCE
31# Must be called before any macros that run the compiler (like AC_PROG_LIBTOOL)
32# to avoid autoconf errors.
33AC_USE_SYSTEM_EXTENSIONS
34
35# Initialize Automake
36AM_INIT_AUTOMAKE([foreign dist-xz])
37
38# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
39m4_ifndef([XORG_MACROS_VERSION],
40          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
41XORG_MACROS_VERSION(1.8)
42XORG_DEFAULT_OPTIONS
43
44# If both the C file and YACC are missing, the package cannot be build.
45AC_PROG_YACC
46AC_PATH_PROG([YACC_INST], $YACC)
47if test ! -f "$srcdir/xkbparse.c"; then
48   if test -z "$YACC_INST"; then
49      AC_MSG_ERROR([yacc not found - unable to compile xkbparse.y])
50   fi
51fi
52
53AC_CHECK_FUNCS([asprintf reallocarray recallocarray strdup strcasecmp])
54
55# Checks for pkg-config packages
56PKG_CHECK_MODULES(XKBCOMP, [x11 xkbfile xproto >= 7.0.17])
57
58# Checks for typedefs, structures, and compiler characteristics.
59AC_SYS_LARGEFILE
60
61AC_ARG_WITH([xkb_config_root],
62    [AS_HELP_STRING([--with-xkb-config-root=<paths>],
63        [Set default XKB config root (default: ${datadir}/X11/xkb)])],
64    [XKBCONFIGROOT="$withval"],
65    [XKBCONFIGROOT='${datadir}/X11/xkb'])
66AC_SUBST([XKBCONFIGROOT])
67
68
69AC_CONFIG_FILES([
70	Makefile
71	man/Makefile
72	xkbcomp.pc])
73AC_OUTPUT
74