summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 6cbf4078d795d418186b9e4e0f4e1568214eb78e (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
AC_PREREQ(2.53)
AC_INIT(rygel, 0.1, http://live.gnome.org/Rygel)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR(src/rygel/rygel-media-server.vala)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

# Disable generation of static libraries
AC_DISABLE_STATIC

AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_LIBTOOL
AC_FUNC_MMAP

VALA_REQUIRED=0.5.6
GUPNP_REQUIRED=0.12.5
GUPNP_AV_REQUIRED=0.3.1
GCONF_REQUIRED=2.22
DBUS_GLIB_REQUIRED=0.74
GSTREAMER_REQUIRED=0.10.18
GIO_REQUIRED=2.16
GEE_REQUIRED=0.1.3

PKG_CHECK_MODULES(VALA, [vala-1.0 >= $VALA_REQUIRED])
PKG_CHECK_MODULES(LIBGUPNP, gupnp-1.0 >= $GUPNP_REQUIRED)
PKG_CHECK_MODULES(LIBGUPNP_AV, gupnp-av-1.0 >= $GUPNP_AV_REQUIRED)
PKG_CHECK_MODULES(LIBGCONF, gconf-2.0 >= $GCONF_REQUIRED)
PKG_CHECK_MODULES(LIBDBUS_GLIB, dbus-glib-1 >= $DBUS_GLIB_REQUIRED)
PKG_CHECK_MODULES(LIBGSTREAMER, gstreamer-0.10 >= $GSTREAMER_REQUIRED)
PKG_CHECK_MODULES(LIBGIO, gio-2.0 >= $GIO_REQUIRED)
PKG_CHECK_MODULES(GEE, gee-1.0 >= $GEE_REQUIRED)

# Vala compiler
# This is more to get the path of the compiler since the pkg-config check
# should covers check for compiler as well.
AC_PATH_PROG(VALAC, valac, no)
if test "x$VALAC" = "xno"; then
	AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
fi

VAPIDIR=`pkg-config --variable=vapidir vala-1.0`
AC_SUBST(VAPIDIR)

# FIXME: Whats the proper way for checking for particular Vala bindings
AC_CHECK_FILE("${VAPIDIR}/gupnp-1.0.vapi",
        true,
        [AC_MSG_ERROR("Unable to find Vala bindings for gupnp-1.0")])

AC_CHECK_FILE("${VAPIDIR}/gupnp-av-1.0.vapi",
        true,
        [AC_MSG_ERROR("Unable to find Vala bindings for gupnp-av-1.0")])

AC_CHECK_FILE("${VAPIDIR}/dbus-glib-1.vapi",
        true,
        [AC_MSG_ERROR("Unable to find Vala bindings for dbus-glib-1")])

AC_CHECK_FILE("${VAPIDIR}/gconf-2.0.vapi",
        true,
        [AC_MSG_ERROR("Unable to find Vala bindings for gconf-2.0")])

AC_CHECK_FILE("${VAPIDIR}/gstreamer-0.10.vapi",
        true,
        [AC_MSG_ERROR("Unable to find Vala bindings for gstreamer-0.10")])

AC_CHECK_FILE("${VAPIDIR}/gio-2.0.vapi",
        true,
        [AC_MSG_ERROR("Unable to find Vala bindings for gio-2.0")])

AC_CHECK_FILE("${VAPIDIR}/gee-1.0.vapi",
        true,
        [AC_MSG_ERROR("Unable to find Vala bindings for gee-1.0")])

# glib-genmarshal
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)

# Debugging
AC_ARG_ENABLE(debug,
	[  --enable-debug          enable debugging],,
        enable_debug=no)
if test "x$enable_debug" = "xyes"; then
        CFLAGS="$CFLAGS -g"
fi

# Strict compiler
AC_ARG_ENABLE(strict-cc,
	[  --enable-strict-cc          enable strict C compiler],,
        enable_strict_cc=no)
if test "x$enable_strict_cc" = "xyes"; then
        CFLAGS="$CFLAGS -Wall -Werror"
fi

# Run uninstalled
AC_ARG_ENABLE(uninstalled,
	[  --enable-uninstalled          run uninstalled],,
        enable_uninstalled=no)
if test "x$enable_uninstalled" = "xyes"; then
        AC_MSG_WARN("You want to run the tools uninstalled only? Fine!")
fi

# Build test plugin
AC_ARG_ENABLE(test-plugin,
	[  --enable-test-plugin          build test plugin],,
        enable_test_plugin=no)

# Build Tracker plugin
AC_ARG_ENABLE(tracker-plugin,
	[  --enable-tracker-plugin      build tracker plugin],,
        enable_tracker_plugin=yes)

# Build DVB plugin
AC_ARG_ENABLE(dvb-plugin,
	[  --enable-dvb-plugin          build DVB plugin],,
        enable_dvb_plugin=yes)

AC_SUBST(abs_top_builddir)

AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])
AM_CONDITIONAL([BUILD_TEST_PLUGIN], [test "x$enable_test_plugin" = "xyes"])
AM_CONDITIONAL([BUILD_TRACKER_PLUGIN],
               [test "x$enable_tracker_plugin" = "xyes"])
AM_CONDITIONAL([BUILD_DVB_PLUGIN], [test "x$enable_dvb_plugin" = "xyes"])

# Gettext
GETTEXT_PACKAGE=rygel
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
  [Define the gettext package to be used])

ALL_LINGUAS=""
AM_GLIB_GNU_GETTEXT
AM_GLIB_DEFINE_LOCALEDIR([LOCALEDIR])

AC_OUTPUT([
Makefile
src/Makefile
src/rygel/Makefile
src/plugins/Makefile
src/plugins/dvb/Makefile
src/plugins/tracker/Makefile
src/plugins/test/Makefile
data/Makefile
data/xml/Makefile
])