Don't check for xlib, we don't need it
[profile/ivi/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 AC_PREREQ([2.57])
24 AC_INIT([libxkbcommon], [0.1.0],
25     [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
26 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
27 AM_SILENT_RULES([yes])
28 AC_CONFIG_HEADERS([src/config.h])
29
30 AC_PROG_LIBTOOL
31 AC_PROG_CC
32 AC_PROG_YACC
33 AC_PROG_LEX
34
35 m4_ifndef([PKG_PROG_PKG_CONFIG],
36     [m4_fatal([Could not locate the pkg-config autoconf macros.
37     These are usually located in /usr/share/aclocal/pkg.m4. If your
38     macros are in a different location, try setting the environment
39     variable ACLOCAL="aclocal -I/other/macro/dir" before running
40     autoreconf/autogen.sh.])])
41 PKG_PROG_PKG_CONFIG
42
43 # Require xorg-macros version 1.2.0 or newer for XORG_CHANGELOG macro
44 m4_ifndef([XORG_MACROS_VERSION],
45     [m4_fatal([must install xorg-macros before running autoconf/autogen.sh])])
46 XORG_MACROS_VERSION([1.2.0])
47
48 dnl Build native compiler needed for makekeys
49 AC_ARG_VAR([CC_FOR_BUILD], [Build native C compiler program])
50 if test "x$CC_FOR_BUILD" = x; then
51     if test "$cross_compiling" != no; then
52         AC_PATH_PROGS([CC_FOR_BUILD], [gcc cc], [cc])
53     else
54         CC_FOR_BUILD="$CC"
55     fi
56 fi
57
58 AC_CHECK_FUNCS([strcasecmp])
59 XORG_CHECK_MALLOC_ZERO
60 XORG_CWARNFLAGS
61
62 if  test "x$GCC" = xyes ; then
63   CFLAGS="$CFLAGS -fvisibility=hidden"
64 fi
65
66 PKG_CHECK_MODULES([X11], [xproto kbproto >= 1.0.5])
67
68 dnl Ensure we have keysym headers
69 AC_MSG_CHECKING([for X11 includedir])
70 x11includedir="`$PKG_CONFIG --variable=includedir xproto`/X11"
71 AC_MSG_RESULT([$x11includedir])
72
73 AC_MSG_CHECKING([for keysymdef.h])
74 KEYSYMDEF_H="$x11includedir/keysymdef.h"
75 test -f "$KEYSYMDEF_H" || AC_MSG_ERROR([can't locate keysymdef.h in $x11includedir])
76 AC_MSG_RESULT([$KEYSYMDEF_H])
77 AC_SUBST([KEYSYMDEF_H])
78
79 AC_MSG_CHECKING([for XF86keysym.h])
80 XF86KEYSYM_H="$x11includedir/XF86keysym.h"
81 test -f "$XF86KEYSYM_H" || AC_MSG_ERROR([can't locate XF86keysym.h in $x11includedir])
82 AC_MSG_RESULT([$XF86KEYSYM_H])
83 AC_SUBST([XF86KEYSYM_H])
84
85 AC_SUBST([KS_HEADERS], ['$(KEYSYMDEF_H) $(XF86KEYSYM_H)'])
86
87 AC_ARG_WITH([xkb_config_root],
88     [AC_HELP_STRING([--with-xkb-config-root=<paths>],
89         [Set default XKB config root (default: ${datadir}/X11/xkb)])],
90     [XKBCONFIGROOT="$withval"],
91     [XKBCONFIGROOT='${datadir}/X11/xkb'])
92 AC_SUBST([XKBCONFIGROOT])
93
94 XORG_RELEASE_VERSION
95 XORG_CHANGELOG
96
97 AC_OUTPUT([
98 Makefile
99 xkbcommon.pc
100 include/Makefile
101 src/Makefile
102 src/makekeys/Makefile
103 src/xkbcomp/Makefile
104 test/Makefile
105 ])