Add a public header for the version number
[profile/ivi/wayland.git] / configure.ac
1 AC_PREREQ([2.64])
2
3 m4_define([wayland_major_version], [0])
4 m4_define([wayland_minor_version], [89])
5 m4_define([wayland_micro_version], [0])
6 m4_define([wayland_version],
7           [wayland_major_version.wayland_minor_version.wayland_micro_version])
8
9 AC_INIT([wayland],
10         [wayland_version],
11         [https://bugs.freedesktop.org/enter_bug.cgi?product=wayland],
12         [wayland],
13         [http://wayland.freedesktop.org/])
14
15 AC_SUBST([WAYLAND_VERSION_MAJOR], [wayland_major_version])
16 AC_SUBST([WAYLAND_VERSION_MINOR], [wayland_minor_version])
17 AC_SUBST([WAYLAND_VERSION_MICRO], [wayland_micro_version])
18 AC_SUBST([WAYLAND_VERSION], [wayland_version])
19
20 AC_CONFIG_HEADERS([config.h])
21 AC_CONFIG_MACRO_DIR([m4])
22
23 AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
24
25 AM_SILENT_RULES([yes])
26
27 # Check for programs
28 AC_PROG_CC
29
30 # Initialize libtool
31 LT_PREREQ([2.2])
32 LT_INIT
33
34 PKG_PROG_PKG_CONFIG()
35 PKG_CHECK_MODULES(FFI, [libffi])
36
37 if test "x$GCC" = "xyes"; then
38         GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden"
39 fi
40 AC_SUBST(GCC_CFLAGS)
41
42 AC_ARG_ENABLE([scanner],
43               [AC_HELP_STRING([--disable-scanner],
44                               [Disable compilation of wayland-scannner])],
45               [],
46               [enable_scanner=yes])
47
48 AC_ARG_ENABLE([documentation],
49               [AC_HELP_STRING([--disable-documentation],
50                               [Disable building the documentation])],
51               [],
52               [enable_documentation=yes])
53
54 AM_CONDITIONAL(ENABLE_SCANNER, test "x$enable_scanner" = xyes)
55
56 EXPAT_LIB=""
57 AC_ARG_WITH(expat, [  --with-expat=<dir>      Use expat from here],
58                    [ expat=$withval
59                      CPPFLAGS="$CPPFLAGS -I$withval/include"
60                      LDFLAGS="$LDFLAGS -L$withval/lib" ] )
61 if test "x$enable_scanner" = "xyes"; then
62         AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
63                          [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
64         AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
65                      [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
66         AC_SUBST(EXPAT_LIBS)
67 fi
68
69 AC_PATH_PROG(XSLTPROC, xsltproc)
70 AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
71
72 if test "x$enable_documentation" = "xyes"; then
73         AC_PATH_PROG(PUBLICAN, publican)
74 fi
75 AM_CONDITIONAL([HAVE_PUBLICAN], [test "x$PUBLICAN" != "x"])
76
77 AC_CONFIG_FILES([Makefile
78                  wayland-scanner.m4
79                  doc/Makefile
80                  doc/Wayland/Makefile
81                  src/Makefile
82                  src/wayland-server.pc
83                  src/wayland-client.pc
84                  src/wayland-version.h
85                  protocol/Makefile
86                  tests/Makefile])
87 AC_OUTPUT