51ceb3c612ca48275a1504ac094c279736a313b6
[platform/core/uifw/libtdm.git] / configure.ac
1 AC_PREREQ([2.60])
2
3 m4_define([tdm_major_version],  [2])
4 m4_define([tdm_minor_version],  [0])
5 m4_define([tdm_micro_version],  [0])
6 m4_define([tdm_version],
7           [tdm_major_version.tdm_minor_version.tdm_micro_version])
8
9 AC_INIT([libtdm],
10         [tdm_version],
11         [https://www.tizen.org],
12         [libtdm])
13
14 AC_CONFIG_HEADERS([config.h])
15 AC_CONFIG_SRCDIR([Makefile.am])
16 AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2])
17 AM_MAINTAINER_MODE([enable])
18
19 # Check for programs
20 AC_PROG_CC
21 AC_PROG_CXX
22
23 AC_USE_SYSTEM_EXTENSIONS
24 AC_SYS_LARGEFILE
25 AC_FUNC_ALLOCA
26
27 # Initialize libtool
28 LT_PREREQ([2.2])
29 LT_INIT([disable-static])
30
31 # Enable quiet compiles on automake 1.11.
32 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33
34 AC_ARG_WITH(haltests, AS_HELP_STRING([--with-haltests=yes/no], [whether build/run unit tests or not]),
35                                 [ haltests="$withval" ],
36                                 [ haltests="no" ])
37
38 AM_CONDITIONAL(HAVE_HALTESTS, test "x$haltests" = "xyes")
39
40 AC_PATH_PROG([wayland_scanner], [wayland-scanner])
41 if test x$wayland_scanner = x; then
42    AC_MSG_ERROR([wayland-scanner is needed to compile])
43 fi
44
45 PKG_CHECK_MODULES(WAYLAND_SCANNER, wayland-scanner >= 1.7.0)
46
47 PKG_CHECK_MODULES(TDM, dlog libtbm libpng pixman-1 wayland-server iniparser)
48 PKG_CHECK_MODULES(TDM_CLIENT, dlog libtbm wayland-client)
49
50 PKG_CHECK_MODULES(TTRACE,
51                 [ttrace],
52                 [have_ttrace="yes"], [have_ttrace="no"])
53 if test "x$have_ttrace" = "xyes"; then
54     TDM_CFLAGS="$TDM_CFLAGS $TTRACE_CFLAGS"
55     TDM_LIBS="$TDM_LIBS $TTRACE_LIBS"
56     TDM_CLIENT_CFLAGS="$TDM_CLIENT_CFLAGS $TTRACE_CFLAGS"
57     TDM_CLIENT_LIBS="$TDM_CLIENT_LIBS $TTRACE_LIBS"
58     AC_DEFINE(HAVE_TTRACE, 1, [ttrace available])
59 fi
60
61 AC_SUBST(TDM_CFLAGS)
62 AC_SUBST(TDM_LIBS)
63
64 AC_SUBST(TDM_CLIENT_CFLAGS)
65 AC_SUBST(TDM_CLIENT_LIBS)
66
67 # set the dir for the tdm module
68 DEFAULT_TDM_MODULE_PATH="${libdir}/tdm"
69 AC_ARG_WITH(tdm-module-path, AS_HELP_STRING([--with-tdm-module-path=PATH], [tdm module dir]),
70                                 [ TDM_MODULE_PATH="$withval" ],
71                                 [ TDM_MODULE_PATH="${DEFAULT_TDM_MODULE_PATH}" ])
72 AC_DEFINE_UNQUOTED(TDM_MODULE_PATH, "${TDM_MODULE_PATH}", [Directory for the modules of tdm])
73 AC_SUBST(TDM_MODULE_PATH)
74
75 # set the data dir for the tdm config
76 DEFAULT_TDM_DATA_PATH="${datadir}/tdm"
77 AC_ARG_WITH(tdm-data-path, AS_HELP_STRING([--with-tdm-data-path=PATH], [tdm data dir]),
78                                 [ TDM_DATA_PATH="$withval" ],
79                                 [ TDM_DATA_PATH="${DEFAULT_TDM_DATA_PATH}" ])
80 AC_DEFINE_UNQUOTED(TDM_DATA_PATH, "${TDM_DATA_PATH}", [Directory for the data of tdm])
81 AC_SUBST(TDM_DATA_PATH)
82
83 AC_SUBST([TDM_MAJOR_VERSION], [tdm_major_version])
84 AC_SUBST([TDM_MINOR_VERSION], [tdm_minor_version])
85 AC_SUBST([TDM_MICRO_VERSION], [tdm_micro_version])
86 AC_SUBST([TDM_VERSION], [tdm_version])
87
88 AC_DEFINE([TDM_MAJOR_VERSION], [tdm_major_version], [tdm ABI major version])
89 AC_DEFINE([TDM_MINOR_VERSION], [tdm_minor_version], [tdm ABI minor version])
90 AC_DEFINE([TDM_MICRO_VERSION], [tdm_micro_version], [tdm ABI macro version])
91
92 # For enumerating devices in test case
93 AC_SUBST(WARN_CFLAGS)
94 AC_OUTPUT([
95         Makefile
96         libtdm.pc
97         include/Makefile
98         protocol/Makefile
99         common/Makefile
100         src/Makefile
101         backends/Makefile
102         backends/dummy/Makefile
103         backends/virtual/Makefile
104         client/libtdm-client.pc
105         client/Makefile
106         tools/Makefile
107         haltests/Makefile])
108
109 echo ""
110 echo "$PACKAGE_STRING will be compiled with:"
111 echo ""
112 echo "TDM_CFLAGS        : $TDM_CFLAGS"
113 echo "TDM_LIBS          : $TDM_LIBS"
114 echo "TDM_CLIENT_CFLAGS : $TDM_CLIENT_CFLAGS"
115 echo "TDM_CLIENT_LIBS   : $TDM_CLIENT_LIBS"
116 echo "TDM_MODULE_PATH   : $TDM_MODULE_PATH"
117 echo "TDM_DATA_PATH     : $TDM_DATA_PATH"
118 echo ""