summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 8750512fefe00d18b5870596b3d3bb6048ff15b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Autojunk script for libdbus++

AC_PREREQ(2.59)
AC_INIT([libdbus-c++], 0.3.0, [shackan@gmail.com])

AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER([include/dbus-c++/config.h])

AC_CANONICAL_HOST


# Set configuration options

AC_ARG_ENABLE(doxygen-docs,
	AS_HELP_STRING([--enable-doxygen-docs],
		[build DOXYGEN documentation (requires Doxygen)]),
	enable_doxygen_docs=$enableval,enable_doxygen_docs=auto
)


# Check for programs

AC_LANG_CPLUSPLUS

AC_PROG_CC
AC_PROG_CXX

#AM_ENABLE_STATIC
#AM_DISABLE_SHARED
AM_PROG_LIBTOOL

PKG_PROG_PKG_CONFIG


# Check for dependencies

DBUS_REQUIRED_VERSION=0.60
PKG_CHECK_MODULES([dbus], dbus-1 >= $DBUS_REQUIRED_VERSION,,
	AC_MSG_ERROR([You need the DBus libraries (version 0.6 or better)]
	[http://www.freedesktop.org/wiki/Software_2fdbus])
)
AC_SUBST(dbus_CFLAGS)
AC_SUBST(dbus_LIBS)

AC_CHECK_LIB([expat], XML_ParserCreate_MM,
    [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
	have_expat=false)

if ! $have_expat; then
	AC_MSG_ERROR([You need the eXpat xml parser]
		[http://expat.sourceforge.net/])
fi

xml_CFLAGS=
xml_LIBS=-lexpat

AC_SUBST(xml_CFLAGS)
AC_SUBST(xml_LIBS)

CXXFLAGS="-ggdb -O0 -DDEBUG -Wall"
#CXXFLAGS="-O3 -DDEBUG -Wall"

AC_SUBST(DEBUG_FLAGS)


# Doxygen Documentation

AC_PATH_PROG(DOXYGEN, doxygen, no)

AC_MSG_CHECKING([whether to build Doxygen documentation])

if test x$DOXYGEN = xno ; then
    have_doxygen=no
else
    have_doxygen=yes
fi

if test x$enable_doxygen_docs = xauto ; then
    enable_doxygen_docs=no
fi

if test x$enable_doxygen_docs = xyes; then
    if test x$have_doxygen = xno; then
	AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
    fi
fi

AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
AC_MSG_RESULT(yes)

# Save processed files

AC_OUTPUT(
	Makefile
	src/Makefile
	tools/Makefile
	data/Makefile
	doc/Makefile
	doc/Doxyfile
	doc/html/Makefile
	examples/Makefile
	examples/properties/Makefile
	examples/echo/Makefile
	dbus-c++-0.3.pc
)