Package version up to 0.10.2
[platform/adaptation/broadcom/libtdm-vc4.git] / configure.ac
1 AC_PREREQ([2.60])
2 AC_INIT([libtdm-vc4],
3         [0.1.0],
4         [https://www.tizen.org],
5         [libtdm-vc4])
6
7 AC_CONFIG_HEADERS([config.h])
8 AC_CONFIG_SRCDIR([Makefile.am])
9 AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2])
10 AM_MAINTAINER_MODE([enable])
11
12 # Check for programs
13 AC_PROG_CC
14
15 AC_USE_SYSTEM_EXTENSIONS
16 AC_SYS_LARGEFILE
17 AC_FUNC_ALLOCA
18
19 # Initialize libtool
20 LT_PREREQ([2.2])
21 LT_INIT([disable-static])
22
23 # Enable quiet compiles on automake 1.11.
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25
26 PKG_CHECK_MODULES(TDM_VC4, libtdm libtbm libdrm)
27 PKG_CHECK_MODULES(UDEV, libudev, [udev=yes], [udev=no])
28 if test x"$udev" = xyes; then
29         AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
30         TDM_VC4_CFLAGS="$TDM_VC4_CFLAGS $UDEV_CFLAGS"
31         TDM_VC4_LIBS="$TDM_VC4_LIBS $UDEV_LIBS"
32 fi
33
34 AC_SUBST(TDM_VC4_CFLAGS)
35 AC_SUBST(TDM_VC4_LIBS)
36
37 AC_DEFINE_UNQUOTED(LIBDRM_MAJOR_VERSION, [`pkg-config --modversion libdrm | cut -d '.' -f 1`], dnl
38                    [libdrm major version])
39 AC_DEFINE_UNQUOTED(LIBDRM_MINOR_VERSION, [`pkg-config --modversion libdrm | cut -d '.' -f 2`], dnl
40                    [libdrm major version])
41 AC_DEFINE_UNQUOTED(LIBDRM_MICRO_VERSION, [`pkg-config --modversion libdrm | cut -d '.' -f 3`], dnl
42                    [libdrm major version])
43
44 # set the dir for the tbm module
45 DEFAULT_TDM_MODULE_PATH="${libdir}/tdm"
46 AC_ARG_WITH(tdm-module-path, AS_HELP_STRING([--with-tdm-module-path=PATH], [tdm module dir]),
47                                 [ TDM_MODULE_PATH="$withval" ],
48                                 [ TDM_MODULE_PATH="${DEFAULT_TDM_MODULE_PATH}" ])
49 AC_SUBST(TDM_MODULE_PATH)
50
51 # For enumerating devices in test case
52 AC_OUTPUT([
53         Makefile
54         src/Makefile])
55
56 echo ""
57 echo "$PACKAGE_STRING will be compiled with:"
58 echo ""
59 echo "TDM_VC4_CFLAGS : $TDM_VC4_CFLAGS"
60 echo "TDM_VC4_LIBS   : $TDM_VC4_LIBS"
61 echo "TDM_MODULE_DIR : $TDM_MODULE_PATH"
62 echo ""