# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AC_PREREQ(2.60)
-AC_INIT(libtbm, 1.0.0)
+AC_INIT(libtbm, 1.1.0)
AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2])
# Enable quiet compiles on automake 1.11.
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+dnl Make sure the pkg-config macros are defined
+m4_ifndef([PKG_PROG_PKG_CONFIG],
+ [m4_fatal([Could not locate the pkg-config autoconf macros.
+ These are usually located in /usr/share/aclocal/pkg.m4. If your macros
+ are in a different location, try setting the environment variable
+ ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
+PKG_PROG_PKG_CONFIG()
+
# set the dir for the tbm module
-DEFAULT_BUFMGR_MODULE_PATH="/usr/lib/bufmgr"
+DEFAULT_BUFMGR_MODULE_PATH="${libdir}/bufmgr"
AC_ARG_WITH(bufmgr-module-path, AS_HELP_STRING([--with-bufmgr-module-path=PATH], [tbm bufmgr module dir]),
[ BUFMGR_MODULE_PATH="$withval" ],
[ BUFMGR_MODULE_PATH="${DEFAULT_BUFMGR_MODULE_PATH}" ])
+
#AC_DEFINE(BUFMGR_MODULE_DIR, "${BUFMGR_MODULE_PATH}", [Directory for the modules of tbm_bufmgr])
AC_DEFINE_UNQUOTED(BUFMGR_MODULE_DIR, "${BUFMGR_MODULE_PATH}", [Directory for the modules of tbm_bufmgr])
[AC_MSG_ERROR([Couldn't find clock_gettime])])])
AC_SUBST([CLOCK_LIB])
-PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
+AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+if test x$wayland_scanner = x; then
+ AC_MSG_ERROR([wayland-scanner is needed to compile wayland-tbm])
+fi
+
+PKG_CHECK_MODULES(CAPI, [capi-base-common >= 0.1.1], [capi_0_1_1=yes], [capi_0_1_1=no])
+if test x"$capi_0_1_1" = xyes; then
+ AC_DEFINE(HAVE_CAPI_0_1_1,1,[The version of capi-base-common is over 0.1.1])
+fi
+
PKG_CHECK_MODULES(LIBDRM, libdrm)
-PKG_CHECK_MODULES(LIBDRI2, libdri2)
-PKG_CHECK_MODULES(X11, x11)
-PKG_CHECK_MODULES(CAPI, capi-base-common)
-# PKG_CHECK_MODULES(CAPI, capi-base-common >= 0.1.1)
+PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
+PKG_CHECK_MODULES(WL_CLIENT, wayland-client)
+PKG_CHECK_MODULES(WL_SERVER, wayland-server)
+PKG_CHECK_MODULES(WL_SCANNER, wayland-scanner)
-LIBTBM_CFLAGS="$PTHREADSTUBS_CFLAGS $LIBDRM_CFLAGS $LIBDRI2_CFLAGS $X11_CFLAGS $CAPI_CFLAGS"
-LIBTBM_LIBS="$PTHREADSTUBS_LIBS $LIBDRM_LIBS $LIBDRI2_LIBS $X11_LIBS $CAPI_LIBS"
+LIBTBM_CFLAGS+="$LIBTBM_CFALGS $LIBDRM_CFLAGS $PTHREADSTUBS_CFLAGS $CAPI_CFLAGS $WL_CLIENT_CFLAGS $WL_SERVER_CFLAGS"
+LIBTBM_LIBS+="$LIBTBM_LIBS $LIBDRM_LIBS $PTHREADSTUBS_LIBS $CAPI_LIBS $WL_CLIENT_LIBS $WL_SERVER_LIBS"
AC_SUBST(LIBTBM_CFLAGS)
AC_SUBST(LIBTBM_LIBS)
+HOST_CPU_X86_64=no
+case $host_cpu in
+ x86_64*|amd64*)
+ HOST_CPU_X86_64=yes
+esac
+
+AM_CONDITIONAL(HOST_CPU_X86_64, test "x$HOST_CPU_X86_64" = "xyes")
+
AC_OUTPUT([
- src/Makefile
- drm_slp/Makefile
+ src/Makefile
Makefile
libtbm.pc])