configure.ac revision ee3138f1
1ee3138f1Smrg#  Copyright 2005 Adam Jackson.
2ee3138f1Smrg#
3ee3138f1Smrg#  Permission is hereby granted, free of charge, to any person obtaining a
4ee3138f1Smrg#  copy of this software and associated documentation files (the "Software"),
5ee3138f1Smrg#  to deal in the Software without restriction, including without limitation
6ee3138f1Smrg#  on the rights to use, copy, modify, merge, publish, distribute, sub
7ee3138f1Smrg#  license, and/or sell copies of the Software, and to permit persons to whom
8ee3138f1Smrg#  the Software is furnished to do so, subject to the following conditions:
9ee3138f1Smrg#
10ee3138f1Smrg#  The above copyright notice and this permission notice (including the next
11ee3138f1Smrg#  paragraph) shall be included in all copies or substantial portions of the
12ee3138f1Smrg#  Software.
13ee3138f1Smrg#
14ee3138f1Smrg#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15ee3138f1Smrg#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16ee3138f1Smrg#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
17ee3138f1Smrg#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18ee3138f1Smrg#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19ee3138f1Smrg#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20ee3138f1Smrg#
21ee3138f1Smrg# Process this file with autoconf to produce a configure script
22ee3138f1Smrg
23ee3138f1SmrgAC_PREREQ(2.57)
24ee3138f1SmrgAC_INIT([xf86-input-keyboard],
25ee3138f1Smrg        1.3.1,
26ee3138f1Smrg        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
27ee3138f1Smrg        xf86-input-keyboard)
28ee3138f1Smrg
29ee3138f1SmrgAC_CONFIG_SRCDIR([Makefile.am])
30ee3138f1SmrgAC_CONFIG_AUX_DIR(.)
31ee3138f1SmrgAM_INIT_AUTOMAKE([dist-bzip2])
32ee3138f1Smrg
33ee3138f1SmrgAM_MAINTAINER_MODE
34ee3138f1Smrg
35ee3138f1SmrgDRIVER_NAME=kbd
36ee3138f1SmrgAC_SUBST([DRIVER_NAME])
37ee3138f1Smrg
38ee3138f1SmrgAM_CONFIG_HEADER([config.h])
39ee3138f1Smrg
40ee3138f1Smrg# Checks for programs.
41ee3138f1SmrgAC_DISABLE_STATIC
42ee3138f1SmrgAC_PROG_LIBTOOL
43ee3138f1SmrgAC_PROG_CC
44ee3138f1Smrg
45ee3138f1SmrgAH_TOP([#include "xorg-server.h"])
46ee3138f1Smrg
47ee3138f1Smrgm4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
48ee3138f1Smrg
49ee3138f1Smrgcase $host_os in
50ee3138f1Smrg  linux*)
51ee3138f1Smrg    IS_LINUX="yes"
52ee3138f1Smrg    # check whether struct kbd_repeat has the 'period' field.
53ee3138f1Smrg    # on kernels < 2.5.42 it's called 'rate' instead.
54ee3138f1Smrg    AC_TRY_COMPILE([
55ee3138f1Smrg#include <linux/kd.h>
56ee3138f1Smrg#ifdef __sparc__
57ee3138f1Smrg#include <asm/param.h>
58ee3138f1Smrg#include <asm/kbio.h>
59ee3138f1Smrg#endif
60ee3138f1Smrg],[
61ee3138f1Smrgint main () {
62ee3138f1Smrg        struct kbd_repeat k;
63ee3138f1Smrg        k.period = 0;
64ee3138f1Smrg        return 0;
65ee3138f1Smrg}],
66ee3138f1Smrg    [period_field="period"],
67ee3138f1Smrg    [period_field="rate"])
68ee3138f1Smrg    AC_DEFINE_UNQUOTED(LNX_KBD_PERIOD_NAME, [$period_field],
69ee3138f1Smrg                       [Name of the period field in struct kbd_repeat])
70ee3138f1Smrg    ;;
71ee3138f1Smrg
72ee3138f1Smrg  freebsd* | kfreebsd-gnu* | netbsd* | openbsd*)
73ee3138f1Smrg    IS_BSD="yes"
74ee3138f1Smrg    ;;
75ee3138f1Smrg
76ee3138f1Smrg  solaris*)
77ee3138f1Smrg    IS_SOLARIS="yes"
78ee3138f1Smrg    ;;
79ee3138f1Smrg
80ee3138f1Smrg  gnu*)
81ee3138f1Smrg    IS_HURD="yes"
82ee3138f1Smrg    ;;
83ee3138f1Smrg
84ee3138f1Smrg  *)
85ee3138f1Smrg    AC_MSG_ERROR([Your operating system is not supported by the kbd driver.
86ee3138f1Smrg                  Contact xorg@lists.freedesktop.org if you are interested in
87ee3138f1Smrg                  porting it.])
88ee3138f1Smrg    ;;
89ee3138f1Smrgesac
90ee3138f1SmrgAM_CONDITIONAL(LINUX, [test "x$IS_LINUX" = xyes])
91ee3138f1SmrgAM_CONDITIONAL(BSD, [test "x$IS_BSD" = xyes])
92ee3138f1SmrgAM_CONDITIONAL(SOLARIS, [test "x$IS_SOLARIS" = xyes])
93ee3138f1SmrgAM_CONDITIONAL(HURD, [test "x$IS_HURD" = xyes])
94ee3138f1SmrgAM_CONDITIONAL(SCO, [test "x$IS_SCO" = xyes])
95ee3138f1Smrg
96ee3138f1SmrgAC_ARG_WITH(xorg-module-dir,
97ee3138f1Smrg            AC_HELP_STRING([--with-xorg-module-dir=DIR],
98ee3138f1Smrg                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
99ee3138f1Smrg            [moduledir="$withval"],
100ee3138f1Smrg            [moduledir="$libdir/xorg/modules"])
101ee3138f1Smrginputdir=${moduledir}/input
102ee3138f1SmrgAC_SUBST(inputdir)
103ee3138f1Smrg
104ee3138f1Smrg# Checks for extensions
105ee3138f1SmrgXORG_DRIVER_CHECK_EXT(RANDR, randrproto)
106ee3138f1SmrgXORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
107ee3138f1SmrgXORG_DRIVER_CHECK_EXT(XKB, kbproto)
108ee3138f1Smrg
109ee3138f1Smrg# Checks for pkg-config packages
110ee3138f1SmrgPKG_CHECK_MODULES(XORG, [xorg-server >= 1.2.99.0] xproto $REQUIRED_MODULES)
111ee3138f1Smrgsdkdir=$(pkg-config --variable=sdkdir xorg-server)
112ee3138f1Smrg
113ee3138f1SmrgCFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
114ee3138f1SmrgAC_SUBST([CFLAGS])
115ee3138f1Smrg
116ee3138f1Smrg# Checks for libraries.
117ee3138f1Smrg
118ee3138f1Smrg# Checks for header files.
119ee3138f1SmrgAC_HEADER_STDC
120ee3138f1Smrg
121ee3138f1SmrgXORG_MANPAGE_SECTIONS
122ee3138f1SmrgXORG_RELEASE_VERSION
123ee3138f1Smrg
124ee3138f1SmrgAC_OUTPUT([Makefile src/Makefile man/Makefile])
125