5bdbe95384b00b82b26a98883ccf797bb6222b64
[platform/upstream/libwlmessage.git] / configure.ac
1 m4_define([wlmessage_version], 0.1)
2
3 AC_PREREQ([2.64])
4 AC_INIT([wlmessage],
5         [wlmessage_version],
6         [https://bugs.tizen.org/],
7         [wlmessage],
8         [http://www.tizen.org/])
9
10 AC_SUBST([WLMESSAGE_VERSION], [wlmessage_version])
11
12 AC_CONFIG_AUX_DIR([build-aux])
13
14 AC_USE_SYSTEM_EXTENSIONS
15 AC_SYS_LARGEFILE
16
17 AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests subdir-objects])
18
19 AM_SILENT_RULES([yes])
20
21 # Check for programs
22 AC_PROG_CC
23 AC_PROG_SED
24
25 # Initialize libtool
26 LT_PREREQ([2.2])
27 LT_INIT([disable-static])
28
29 PKG_PROG_PKG_CONFIG()
30
31 AC_CHECK_FUNC([dlopen], [],
32               AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
33 AC_SUBST(DLOPEN_LIBS)
34
35 AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
36
37 AC_ARG_ENABLE(egl, [  --disable-egl],,
38               enable_egl=yes)
39 AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
40 if test x$enable_egl = xyes; then
41         AC_DEFINE([ENABLE_EGL], [1], [Build with EGL support])
42         PKG_CHECK_MODULES(EGL, [egl >= 7.10 glesv2])
43 fi
44
45 AC_ARG_WITH(cairo,
46             AS_HELP_STRING([--with-cairo=@<:@image|glesv2@:>@]
47                            [Which Cairo renderer to use for the clients]),
48                            [],[with_cairo="image"])
49
50 if test "x$with_cairo" = "ximage"; then
51         cairo_modules="cairo"
52 else
53 if test "x$with_cairo" = "xglesv2"; then
54         cairo_modules="cairo-glesv2"
55 else
56         AC_ERROR([Unknown cairo renderer requested])
57 fi
58 fi
59
60 # Included for legacy compat
61 AC_ARG_WITH(cairo-glesv2,
62             AS_HELP_STRING([--with-cairo-glesv2],
63                            [Use GLESv2 cairo]))
64 if test "x$with_cairo_glesv2" = "xyes"; then
65   cairo_modules="cairo-glesv2"
66   with_cairo="glesv2"
67 fi
68
69 if test "x$cairo_modules" = "xcairo-glesv2"; then
70 AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
71 fi
72
73 PKG_CHECK_MODULES(PIXMAN, [pixman-1])
74 PKG_CHECK_MODULES(PNG, [libpng])
75
76 AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
77 if test x$have_jpeglib = xyes; then
78   JPEG_LIBS="-ljpeg"
79 else
80   AC_ERROR([libjpeg not found])
81 fi
82 AC_SUBST(JPEG_LIBS)
83
84 PKG_CHECK_MODULES(GLIB, [glib-2.0 gio-2.0])
85
86 PKG_CHECK_MODULES(CLIENT, [wayland-client cairo >= 1.10.0 xkbcommon wayland-cursor])
87
88   # Only check for cairo-egl if a GL or GLES renderer requested
89   AS_IF([test "x$cairo_modules" = "xcairo-glesv2"], [
90     PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
91                       [have_cairo_egl=yes], [have_cairo_egl=no])
92     AS_IF([test "x$have_cairo_egl" = "xyes"],
93           [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
94           [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])],
95   [have_cairo_egl=no])
96
97 AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
98                [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
99
100 AC_CONFIG_FILES([Makefile libwlmessage.pc])
101
102 AC_OUTPUT
103
104 AC_MSG_RESULT([
105         libxkbcommon                    ${enable_xkbcommon}
106 ])