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, 1.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])
36 # Enable quiet compiles on automake 1.11.
37 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
39 # set the dir for the tbm module
40 DEFAULT_BUFMGR_MODULE_PATH="/usr/lib/bufmgr"
41 AC_ARG_WITH(bufmgr-module-path, AS_HELP_STRING([--with-bufmgr-module-path=PATH], [tbm bufmgr module dir]),
42 [ BUFMGR_MODULE_PATH="$withval" ],
43 [ BUFMGR_MODULE_PATH="${DEFAULT_BUFMGR_MODULE_PATH}" ])
45 # set the window system platform where the bufmgr initializes
46 AC_ARG_WITH(tbm-platform, AS_HELP_STRING([--with-tbm-platform=WINSYS], [tbm platform (default: X11)]),
47 [ TBM_PLATFORM="$withval" ],
48 [ TBM_PLATFORM="X11" ])
49 AC_SUBST(TBM_PLATFORM)
51 #AC_DEFINE(BUFMGR_MODULE_DIR, "${BUFMGR_MODULE_PATH}", [Directory for the modules of tbm_bufmgr])
52 AC_DEFINE_UNQUOTED(BUFMGR_MODULE_DIR, "${BUFMGR_MODULE_PATH}", [Directory for the modules of tbm_bufmgr])
54 AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
55 [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
56 [AC_MSG_ERROR([Couldn't find clock_gettime])])])
59 PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
60 PKG_CHECK_MODULES(LIBDRM, libdrm)
61 PKG_CHECK_MODULES(LIBDRI2, libdri2)
62 PKG_CHECK_MODULES(X11, x11)
63 PKG_CHECK_MODULES(CAPI, [capi-base-common >= 0.1.1], [capi_0.1.1=yes], [capi_0.1.1=no])
64 if test x"$capi_0.1.1" = xyes; then
65 AC_DEFINE(HAVE_CAPI_0_1_1,1,[The version of capi-base-common is over 0.1.1])
68 LIBTBM_CFLAGS="$PTHREADSTUBS_CFLAGS $LIBDRM_CFLAGS $LIBDRI2_CFLAGS $X11_CFLAGS $CAPI_CFLAGS"
69 LIBTBM_LIBS="$PTHREADSTUBS_LIBS $LIBDRM_LIBS $LIBDRI2_LIBS $X11_LIBS $CAPI_LIBS"
70 AC_SUBST(LIBTBM_CFLAGS)
73 if test "x$TBM_PLATFORM" = "xX11"; then
74 AC_DEFINE(HAVE_X11,1,[The window system is X11.])
76 AC_DEFINE(HAVE_WAYLAND,1,[The window system is WAYLAND.])
86 echo "CFLAGS : $CFLAGS"
87 echo "LDFLAGS : $LDFLAGS"
88 echo "LIBTBM_CFLAGS : $LIBTBM_CFLAGS"
89 echo "LIBTBM_LIBS : $LIBTBM_LIBS"
90 echo "BUFMGR_MODULE_DIR : $BUFMGR_MODULE_PATH"
91 echo "TBM_PLATFORM : $TBM_PLATFORM"