2 # Permission is hereby granted, free of charge, to any person obtaining a
3 # copy of this software and associated documentation files (the "Software"),
4 # to deal in the Software without restriction, including without limitation
5 # on the rights to use, copy, modify, merge, publish, distribute, sub
6 # license, and/or sell copies of the Software, and to permit persons to whom
7 # the Software is furnished to do so, subject to the following conditions:
9 # The above copyright notice and this permission notice (including the next
10 # paragraph) shall be included in all copies or substantial portions of the
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
16 # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 AC_INIT(libtbm, 3.0.0)
22 AC_USE_SYSTEM_EXTENSIONS
23 AC_CONFIG_SRCDIR([Makefile.am])
24 AM_INIT_AUTOMAKE([dist-bzip2])
26 AM_CONFIG_HEADER([config.h])
37 # Enable quiet compiles on automake 1.11.
38 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
40 dnl Make sure the pkg-config macros are defined
41 m4_ifndef([PKG_PROG_PKG_CONFIG],
42 [m4_fatal([Could not locate the pkg-config autoconf macros.
43 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
44 are in a different location, try setting the environment variable
45 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
48 # set the dir for the tbm module
49 DEFAULT_BUFMGR_MODULE_PATH="${libdir}/bufmgr"
50 AC_ARG_WITH(bufmgr-module-path, AS_HELP_STRING([--with-bufmgr-module-path=PATH], [tbm bufmgr module dir]),
51 [ BUFMGR_MODULE_PATH="$withval" ],
52 [ BUFMGR_MODULE_PATH="${DEFAULT_BUFMGR_MODULE_PATH}" ])
54 AC_ARG_WITH(haltests, AS_HELP_STRING([--with-haltests=yes/no], [whether build/run unit tests or not]),
55 [ haltests="$withval" ],
58 AM_CONDITIONAL(HAVE_HALTESTS, test "x$haltests" = "xyes")
60 AC_ARG_WITH(default-dlog, AS_HELP_STRING([--with-default-dlog=yes/no], [whether use dlog as a default log or not]),
61 [ use_dlog="$withval" ],
64 AM_CONDITIONAL(ENABLE_DLOG, test "x$use_dlog" = "xyes")
66 if test "x$use_dlog" = "xyes"; then
67 AC_DEFINE([ENABLE_DLOG], 1, "Use dlog as a default log")
70 #AC_DEFINE(BUFMGR_MODULE_DIR, "${BUFMGR_MODULE_PATH}", [Directory for the modules of tbm_bufmgr])
71 AC_DEFINE_UNQUOTED(BUFMGR_MODULE_DIR, "${BUFMGR_MODULE_PATH}", [Directory for the modules of tbm_bufmgr])
73 AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
74 [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
75 [AC_MSG_ERROR([Couldn't find clock_gettime])])])
78 AC_PATH_PROG([wayland_scanner], [wayland-scanner])
79 if test x$wayland_scanner = x; then
80 AC_MSG_ERROR([wayland-scanner is needed to compile wayland-tbm])
83 PKG_CHECK_MODULES(CAPI, [capi-base-common >= 0.1.1], [capi_0_1_1=yes], [capi_0_1_1=no])
84 if test x"$capi_0_1_1" = xyes; then
85 AC_DEFINE(HAVE_CAPI_0_1_1,1,[The version of capi-base-common is over 0.1.1])
88 PKG_CHECK_MODULES(HAL_API_TBM, hal-api-tbm)
89 PKG_CHECK_MODULES(LIBDRM, libdrm)
90 PKG_CHECK_MODULES(WL_CLIENT, wayland-client)
91 PKG_CHECK_MODULES(WL_SERVER, wayland-server)
92 PKG_CHECK_MODULES(WL_SCANNER, wayland-scanner)
93 PKG_CHECK_MODULES(LIBPNG, libpng)
94 PKG_CHECK_MODULES(LIBPIXMAN, pixman-1)
95 PKG_CHECK_MODULES(GMOCK, gmock)
97 LIBTBM_CFLAGS="$LIBTBM_CFALGS $HAL_API_TBM_CFLAGS $LIBDRM_CFLAGS $CAPI_CFLAGS $WL_CLIENT_CFLAGS $WL_SERVER_CFLAGS $LIBPNG_CFLAGS $LIBPIXMAN_CFLAGS "
98 LIBTBM_LIBS="$LIBTBM_LIBS $HAL_API_TBM_LIBS $LIBDRM_LIBS $CAPI_LIBS $WL_CLIENT_LIBS $WL_SERVER_LIBS $LIBPNG_LIBS $LIBPIXMAN_LIBS "
100 LIBTBM_TEST_CFLAGS="$GMOCK_CFLAGS"
101 LIBTBM_TEST_LIBS="$GMOCK_LIBS"
103 PKG_CHECK_EXISTS([dlog], [have_dlog="yes"], [have_dlog="no"])
104 AC_MSG_CHECKING([Have dlog logger])
105 AC_MSG_RESULT([${have_dlog}])
106 if test "x${have_dlog}" = "xyes"; then
107 AC_DEFINE([HAVE_DLOG], [1], [Define to 1 if you have dlog])
109 PKG_CHECK_MODULES(DLOG, dlog)
111 LIBTBM_CFLAGS="$LIBTBM_CFLAGS $DLOG_CFLAGS "
112 LIBTBM_LIBS="$LIBTBM_LIBS $DLOG_LIBS "
115 AC_SUBST(LIBTBM_CFLAGS)
116 AC_SUBST(LIBTBM_LIBS)
117 AC_SUBST(LIBTBM_TEST_CFLAGS)
118 AC_SUBST(LIBTBM_TEST_LIBS)
126 AM_CONDITIONAL(HOST_CPU_X86_64, test "x$HOST_CPU_X86_64" = "xyes")
136 echo "CFLAGS : $CFLAGS"
137 echo "LDFLAGS : $LDFLAGS"
138 echo "LIBTBM_CFLAGS : $LIBTBM_CFLAGS"
139 echo "LIBTBM_LIBS : $LIBTBM_LIBS"
140 echo "BUFMGR_MODULE_DIR : $BUFMGR_MODULE_PATH"