Reorganise to remove redundant folder
[profile/ivi/common-api-dbus-runtime.git] / configure.ac
1 AC_PREREQ(2.61)
2 AC_INIT([GENIVI Common API DBus C++ Library],
3         [0.7],
4         [],
5         [CommonAPI-DBus])
6
7 AC_CONFIG_MACRO_DIR([m4])
8 AC_CONFIG_AUX_DIR([build-aux])
9 AC_CONFIG_HEADERS([build-aux/config.h])
10 AC_CONFIG_FILES([
11                 Makefile
12                 CommonAPI-DBus.pc
13         CommonAPI-DBus-uninstalled.pc])
14
15 AC_CANONICAL_SYSTEM
16
17 AM_INIT_AUTOMAKE([foreign 1.11 silent-rules subdir-objects color-tests -Wall -Werror])
18 AM_SILENT_RULES
19 AM_MAINTAINER_MODE
20
21 AC_PROG_CXX
22 AC_LANG([C++])
23 AX_CXX_COMPILE_STDCXX_11([noext])
24
25 AC_ARG_VAR([GTEST_CONFIG], [The exact path of Google Test's 'gtest-config' script.])
26
27 LT_PREREQ(2.2)
28 LT_INIT
29
30 PKG_PROG_PKG_CONFIG
31 PKG_CHECK_MODULES(COMMONAPI, [CommonAPI >= 0.7])
32 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.4.6])
33
34 GTEST_MIN_VERSION="1.6.0"
35 GTEST_URL="http://code.google.com/p/googletest"
36
37
38 AC_ARG_VAR([GTEST_CONFIG], [The exact path of Google Test's 'gtest-config' script.])
39 AC_ARG_VAR([GTEST_CPPFLAGS], [C-like preprocessor flags for Google Test.])
40 AC_ARG_VAR([GTEST_CXXFLAGS], [C++ compile flags for Google Test.])
41 AC_ARG_VAR([GTEST_LDFLAGS], [Linker path and option flags for Google Test.])
42 AC_ARG_VAR([GTEST_LIBS], [Library linking flags for Google Test.])
43 AC_ARG_VAR([GTEST_VERSION], [The available version of Google Test.])
44
45 AS_IF([test -f "${GTEST_CONFIG}"],
46       [AS_IF([${GTEST_CONFIG} --min-version=${GTEST_MIN_VERSION}],
47              [],
48              [AC_MSG_ERROR([dnl
49                             Found Google Test Version ${GTEST_VERSION}. However ${GTEST_MIN_VERSION} is
50                             required. Please refer to ${GTEST_URL} for a more recent version.])])
51        [GTEST_CPPFLAGS=`${GTEST_CONFIG} --cppflags`]
52        [GTEST_CXXFLAGS=`${GTEST_CONFIG} --cxxflags`]
53        [GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`]
54        [GTEST_LIBS=`${GTEST_CONFIG} --libs`]
55        [GTEST_VERSION=`${GTEST_CONFIG} --version`]
56       ]
57       []
58 )
59
60 AM_CONDITIONAL(ENABLE_TESTS, [test -f "${GTEST_CONFIG}"])
61
62
63 # Doxygen support
64 DX_HTML_FEATURE(ON)
65 DX_CHM_FEATURE(OFF)
66 DX_CHI_FEATURE(OFF)
67 DX_MAN_FEATURE(OFF)
68 DX_RTF_FEATURE(OFF)
69 DX_XML_FEATURE(OFF)
70 DX_PDF_FEATURE(OFF)
71 DX_PS_FEATURE(OFF)
72 DX_INIT_DOXYGEN(${PACKAGE_NAME}, doxygen.cfg, doc)
73     
74 AC_MSG_RESULT([
75         $PACKAGE_NAME v$VERSION
76
77         enable docs:       ${ENABLE_DOCS}
78
79                 COMMONAPI_CFLAGS:  ${COMMONAPI_CFLAGS}
80                 COMMONAPI_LIBS:    ${COMMONAPI_LIBS}
81
82                 DBUS_CFLAGS:       ${DBUS_CFLAGS}
83                 DBUS_LIBS:         ${DBUS_LIBS}
84
85         GTEST_CONFIG:      ${GTEST_CONFIG}
86         GTEST_CPPFLAGS:    ${GTEST_CPPFLAGS}
87         GTEST_CXXFLAGS:    ${GTEST_CXXFLAGS}
88         GTEST_LDFLAGS:     ${GTEST_LDFLAGS}
89         GTEST_LIBS:        ${GTEST_LIBS}
90         GTEST_VERSION:     ${GTEST_VERSION}
91
92         prefix:            ${prefix}
93         CXXFLAGS:          ${CXXFLAGS}
94         LDFLAGS:           ${LDFLAGS}
95 ])
96
97 AC_OUTPUT