configure.ac revision 84bf8334
1659607e0Smrg#  Copyright 2005 Adam Jackson.
2659607e0Smrg#
3659607e0Smrg#  Permission is hereby granted, free of charge, to any person obtaining a
4659607e0Smrg#  copy of this software and associated documentation files (the "Software"),
5659607e0Smrg#  to deal in the Software without restriction, including without limitation
6659607e0Smrg#  on the rights to use, copy, modify, merge, publish, distribute, sub
7659607e0Smrg#  license, and/or sell copies of the Software, and to permit persons to whom
8659607e0Smrg#  the Software is furnished to do so, subject to the following conditions:
9659607e0Smrg#
10659607e0Smrg#  The above copyright notice and this permission notice (including the next
11659607e0Smrg#  paragraph) shall be included in all copies or substantial portions of the
12659607e0Smrg#  Software.
13659607e0Smrg#
14659607e0Smrg#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15659607e0Smrg#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16659607e0Smrg#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
17659607e0Smrg#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18659607e0Smrg#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19659607e0Smrg#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20659607e0Smrg#
21659607e0Smrg# Process this file with autoconf to produce a configure script
22659607e0Smrg
23b73be646Smrg# Initialize Autoconf
24b73be646SmrgAC_PREREQ([2.60])
25659607e0SmrgAC_INIT([xf86-input-mouse],
2684bf8334Smrg        [1.9.1],
27659607e0Smrg        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
28b73be646Smrg        [xf86-input-mouse])
29659607e0SmrgAC_CONFIG_SRCDIR([Makefile.am])
30b73be646SmrgAC_CONFIG_HEADERS([config.h])
31659607e0SmrgAC_CONFIG_AUX_DIR(.)
3284bf8334SmrgAC_USE_SYSTEM_EXTENSIONS
33659607e0Smrg
34b73be646Smrg# Initialize Automake
35b73be646SmrgAM_INIT_AUTOMAKE([foreign dist-bzip2])
36659607e0Smrg
37b73be646Smrg# Initialize libtool
38659607e0SmrgAC_DISABLE_STATIC
39659607e0SmrgAC_PROG_LIBTOOL
40b73be646Smrg
41b73be646Smrg# Initialize X.Org macros
42b73be646Smrgm4_ifndef([XORG_MACROS_VERSION],
43b73be646Smrg          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
44b73be646SmrgXORG_MACROS_VERSION(1.8)
45fc27e79cSmrgXORG_DEFAULT_OPTIONS
46b73be646SmrgXORG_WITH_LINT
47659607e0Smrg
4884bf8334Smrg# Checks for library functions
4984bf8334SmrgAC_CHECK_FUNCS([asprintf])
5084bf8334Smrg
51b73be646Smrg# Obtain compiler/linker options from server and required extensions
52a73597f9SmrgPKG_CHECK_MODULES(XORG, [xorg-server >= 1.7] xproto inputproto)
53659607e0Smrg
54b73be646Smrg# Define a configure option for an alternate input module directory
55659607e0SmrgAC_ARG_WITH(xorg-module-dir,
56b73be646Smrg            AS_HELP_STRING([--with-xorg-module-dir=DIR],
57659607e0Smrg                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
58659607e0Smrg            [moduledir="$withval"],
59659607e0Smrg            [moduledir="$libdir/xorg/modules"])
60659607e0Smrginputdir=${moduledir}/input
61659607e0SmrgAC_SUBST(inputdir)
62659607e0Smrg
63a73597f9Smrg# X Server SDK location is required to install xf86-mouse-properties.h
64a73597f9Smrg# This location is also relayed in the xorg-mouse.pc file
65a73597f9Smrgsdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
66a73597f9Smrg
67a73597f9Smrg# Workaround overriding sdkdir to be able to create a tarball when user has no
68a73597f9Smrg# write permission in sdkdir. See DISTCHECK_CONFIGURE_FLAGS in Makefile.am
69a73597f9SmrgAC_ARG_WITH([sdkdir], [], [sdkdir="$withval"])
70a73597f9SmrgAC_SUBST([sdkdir])
71a73597f9Smrg
72a73597f9Smrg
736aab59a7Smrg# Work out which OS mouse driver we need to build
746aab59a7Smrgcase $host_os in
756aab59a7Smrg  linux*)
766aab59a7Smrg    OS_MOUSE_NAME=lnx
776aab59a7Smrg    ;;
786aab59a7Smrg  freebsd*|kfreebsd*-gnu|dragonfly*|netbsd*|openbsd*)
796aab59a7Smrg    OS_MOUSE_NAME=bsd
806aab59a7Smrg    ;;
816aab59a7Smrg  solaris*)
826aab59a7Smrg    OS_MOUSE_NAME=sun
836aab59a7Smrg    ;;
846aab59a7Smrg  gnu*)
856aab59a7Smrg    OS_MOUSE_NAME=hurd
866aab59a7Smrg    ;;
876aab59a7Smrgesac
886aab59a7SmrgAC_SUBST([OS_MOUSE_NAME])
896aab59a7Smrg
90b73be646SmrgDRIVER_NAME=mouse
91b73be646SmrgAC_SUBST([DRIVER_NAME])
92659607e0Smrg
93b73be646SmrgAC_CONFIG_FILES([Makefile
94a73597f9Smrg                 xorg-mouse.pc
95a73597f9Smrg                 include/Makefile
96b73be646Smrg                 src/Makefile
97b73be646Smrg                 man/Makefile])
98b73be646SmrgAC_OUTPUT
99