~ubuntu-branches/ubuntu/quantal/colord/quantal-proposed

1 by Christopher James Halse Rogers
Import upstream version 0.1.11
1
# Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
2
AC_PREREQ(2.63)
3
4
m4_define([cd_major_version], [0])
5
m4_define([cd_minor_version], [1])
1.2.5 by Christopher James Halse Rogers
Import upstream version 0.1.21
6
m4_define([cd_micro_version], [21])
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
7
m4_define([cd_version],
8
          [cd_major_version.cd_minor_version.cd_micro_version])
9
10
AC_INIT([colord],[cd_version],[http://hughsie.com])
11
AC_CONFIG_SRCDIR(src)
12
AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-xz tar-ustar])
13
AC_CONFIG_HEADERS([config.h])
14
AC_CONFIG_MACRO_DIR([m4])
15
AC_PROG_LIBTOOL
16
17
GOBJECT_INTROSPECTION_CHECK([0.9.8])
18
19
# set up gtk-doc
20
GTK_DOC_CHECK(1.9)
21
22
# use this in cd-version.h
23
CD_MAJOR_VERSION=cd_major_version
24
CD_MINOR_VERSION=cd_minor_version
25
CD_MICRO_VERSION=cd_micro_version
26
AC_SUBST(VERSION)
27
AC_SUBST(CD_MAJOR_VERSION)
28
AC_SUBST(CD_MINOR_VERSION)
29
AC_SUBST(CD_MICRO_VERSION)
30
31
# libtool versioning - this applies to libcolord
32
#
33
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
34
#
35
# increment;
36
# CURRENT	If the API or ABI interface has changed (reset REVISION to 0)
37
# REVISION	If the API and ABI remains the same, but bugs are fixed.
38
# AGE		Don't use.
39
LT_CURRENT=1
1.2.5 by Christopher James Halse Rogers
Import upstream version 0.1.21
40
LT_REVISION=11
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
41
LT_AGE=0
42
AC_SUBST(LT_CURRENT)
43
AC_SUBST(LT_REVISION)
44
AC_SUBST(LT_AGE)
45
46
# enable nice build output on automake1.11
47
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
48
1.2.4 by Christopher James Halse Rogers
Import upstream version 0.1.18
49
AS_ALL_LINGUAS
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
50
AC_PROG_CC
51
AC_PROG_INSTALL
52
LT_INIT
53
AM_PROG_CC_C_O
54
IT_PROG_INTLTOOL([0.35.0])
55
AC_PATH_PROG(XSLTPROC, xsltproc)
56
57
dnl ---------------------------------------------------------------------------
58
dnl - Use strict options (default enabled for devs, disabled in releases)
59
dnl ---------------------------------------------------------------------------
60
if test -d ".git"; then
61
	default_strict=yes
62
else
63
	default_strict=no
64
fi
65
66
AC_ARG_ENABLE(strict, AS_HELP_STRING([--enable-strict],
67
				     [Enable strict compilation options]),
68
				     enable_strict=$enableval,
69
				     enable_strict=$default_strict)
70
if test x$enable_strict != xno; then
71
	CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
72
	CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED"
73
	CPPFLAGS="$CPPFLAGS -DGSEAL_ENABLE"
74
	if test "$GCC" = "yes"; then
75
		CPPFLAGS="$CPPFLAGS -Werror"
76
	fi
77
fi
78
79
dnl ---------------------------------------------------------------------------
80
dnl - Extra verbose warning switches
81
dnl ---------------------------------------------------------------------------
82
83
if test "$GCC" = "yes"; then
84
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wall"
85
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align -Wno-uninitialized"
86
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-declarations"
87
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wpointer-arith"
88
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align"
89
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wwrite-strings"
90
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Winit-self"
91
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wreturn-type"
92
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-nonliteral"
93
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-security"
94
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-include-dirs"
95
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-format-attribute"
96
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wclobbered"
97
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wempty-body"
98
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wignored-qualifiers"
99
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wsign-compare"
100
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wtype-limits"
101
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wuninitialized"
102
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Waggregate-return"
103
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wdeclaration-after-statement"
104
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wshadow"
105
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wno-strict-aliasing"
106
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Winline"
107
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-parameter-type"
108
	WARNINGFLAGS_C="$WARNINGFLAGS_C -Woverride-init"
109
else
110
	WARNINGFLAGS_C=""
111
fi
112
AC_SUBST(WARNINGFLAGS_C)
113
114
dnl ---------------------------------------------------------------------------
115
dnl - gettext stuff
116
dnl ---------------------------------------------------------------------------
117
AM_GNU_GETTEXT_VERSION([0.17])
118
AM_GNU_GETTEXT([external])
119
120
GETTEXT_PACKAGE=AC_PACKAGE_NAME
121
AC_SUBST(GETTEXT_PACKAGE)
122
AC_DEFINE(GETTEXT_PACKAGE, "AC_PACKAGE_NAME", [foo])
123
124
GLIB_GSETTINGS
125
126
dnl ---------------------------------------------------------------------------
127
dnl - Check library dependencies
128
dnl ---------------------------------------------------------------------------
129
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28.0 gobject-2.0 gthread-2.0 gio-2.0 >= 2.25.9 gio-unix-2.0 gmodule-2.0)
1.2.2 by Christopher James Halse Rogers
Import upstream version 0.1.15
130
PKG_CHECK_MODULES(GUSB, gusb >= 0.1.1, have_gusb=yes, have_gusb=no)
13 by Christopher James Halse Rogers
* Parallel upload of 0.1.21-2 to quantal
131
PKG_CHECK_MODULES(DBUS, dbus-1)
132
1.2.2 by Christopher James Halse Rogers
Import upstream version 0.1.15
133
if test x$have_gusb = xyes; then
134
	AC_DEFINE(HAVE_GUSB,1,[whether gusb is available])
135
fi
136
AM_CONDITIONAL(HAVE_GUSB, test x$have_gusb = xyes)
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
137
1.2.4 by Christopher James Halse Rogers
Import upstream version 0.1.18
138
PKG_CHECK_MODULES(LCMS, lcms2 >= 2.2)
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
139
PKG_CHECK_MODULES(SQLITE, sqlite3)
140
141
dnl **** Check for GUDEV ****
142
AC_ARG_ENABLE(gudev, AS_HELP_STRING([--enable-gudev],[Enable GUDEV support]),
143
	      enable_gudev=$enableval, enable_gudev=yes)
144
if test x$enable_gudev != xno; then
145
	PKG_CHECK_MODULES(GUDEV, gudev-1.0)
146
	AC_DEFINE(HAVE_GUDEV,1,[Use GUDEV support for hardware])
147
fi
148
AM_CONDITIONAL(HAVE_GUDEV, test x$enable_gudev = xyes)
149
150
dnl ---------------------------------------------------------------------------
151
dnl - Is docbook2man available?
152
dnl ---------------------------------------------------------------------------
153
AC_PATH_PROG(DOCBOOK2MAN, docbook2man, no)
154
if test "$DOCBOOK2MAN" = "no" ; then
155
	AC_MSG_WARN([docbook2man not found, will not be able to build man documentation (if tarball, pre-generated documentation will be installed)])
156
fi
157
AM_CONDITIONAL(HAVE_DOCBOOK2MAN, [test "$DOCBOOK2MAN" != "no"])
158
159
dnl ---------------------------------------------------------------------------
160
dnl - Build PolicyKit code
161
dnl ---------------------------------------------------------------------------
162
AC_ARG_ENABLE(polkit, AS_HELP_STRING([--enable-polkit],[enable PolicyKit]),
163
	      enable_polkit=$enableval,enable_polkit=yes)
164
AM_CONDITIONAL(CD_BUILD_POLKIT, test x$enable_polkit = xyes)
165
if test x$enable_polkit = xyes; then
2.1.2 by Christopher James Halse Rogers
* New upstream release.
166
	PKG_CHECK_MODULES(POLKIT, polkit-gobject-1 >= 0.103)
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
167
	AC_DEFINE(USE_POLKIT, 1, [if we should use PolicyKit])
168
fi
169
170
dnl ---------------------------------------------------------------------------
1.2.3 by Christopher James Halse Rogers
Import upstream version 0.1.16
171
dnl - Select whether and where to install systemd system service files
172
dnl ---------------------------------------------------------------------------
173
174
AC_ARG_WITH([systemdsystemunitdir],
175
            AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
176
            [],
177
            [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
1.2.5 by Christopher James Halse Rogers
Import upstream version 0.1.21
178
if test "x$with_systemdsystemunitdir" != "xno"; then
179
	AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
180
fi
181
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$systemdsystemunitdir"])
1.2.3 by Christopher James Halse Rogers
Import upstream version 0.1.16
182
183
dnl ---------------------------------------------------------------------------
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
184
dnl - Build DBus examples
185
dnl ---------------------------------------------------------------------------
186
AC_ARG_ENABLE(examples, AS_HELP_STRING([--enable-examples],[enable DBus example code]),
187
	      enable_examples=$enableval,enable_examples=yes)
188
AM_CONDITIONAL(CD_BUILD_EXAMPLES, test x$enable_examples = xyes)
189
190
dnl ---------------------------------------------------------------------------
191
dnl - Build reverse engineering
192
dnl ---------------------------------------------------------------------------
193
AC_ARG_ENABLE(reverse, AS_HELP_STRING([--enable-reverse],[enable reverse engineering tools]),
194
	      enable_reverse=$enableval,enable_reverse=no)
195
AM_CONDITIONAL(CD_BUILD_REVERSE, test x$enable_reverse = xyes)
196
197
dnl **** Check for SANE ****
198
AC_ARG_ENABLE(sane, AS_HELP_STRING([--enable-sane],[Enable SANE support]),
199
	      enable_sane=$enableval)
200
has_sane=no
201
if test x$enable_sane != xno; then
202
	PKG_CHECK_MODULES(SANE, sane-backends, has_sane=yes, has_sane=no)
203
	if test $has_sane = "no"; then
204
		# fall back to detecting the header for some distros
205
		AC_CHECK_HEADER(sane/sane.h, has_sane=yes, has_sane=no)
206
		if test $has_sane = "yes"; then
207
			SANE_CFLAGS=""
208
			SANE_LIBS="-lsane"
209
			AC_SUBST(SANE_CFLAGS)
210
			AC_SUBST(SANE_LIBS)
211
		fi
1.2.1 by Sjoerd Simons
Import upstream version 0.1.13
212
		if test x$enable_sane = xyes -a $has_sane = "no"; then
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
213
			AC_MSG_ERROR([--enable-sane was specified and SANE was not found])
214
		fi
215
216
	fi
217
fi
218
AM_CONDITIONAL(HAVE_SANE, test x$has_sane = xyes)
219
if test x$has_sane = xyes; then
220
	AC_DEFINE(HAVE_SANE,1,[Use SANE support for detecting scanners])
221
fi
222
1.1.1 by Rodrigo Moya
Import upstream version 0.1.12
223
dnl **** Daemon is allowed to do FD fallback  ****
224
AC_ARG_ENABLE(fd_fallback, AS_HELP_STRING([--enable-fd-fallback],[Enable file descriptor fallback]),
225
	      enable_fd_fallback=$enableval, enable_fd_fallback=yes)
226
if test x$enable_fd_fallback != xno; then
227
	AC_DEFINE(HAVE_FD_FALLBACK,1,[Use FD fallback])
228
fi
229
3 by Christopher James Halse Rogers
* debian/patches/02_add_enable_volume_search.diff
230
dnl **** Daemon is allowed to do search external volumes for profiles ****
231
AC_ARG_ENABLE(volume_search, AS_HELP_STRING([--enable-volume-search],[Enable profile volume search]),
232
	      enable_volume_search=$enableval, enable_volume_search=yes)
233
tmp="false"
234
if test x$enable_volume_search != xno; then
235
	tmp="true"
236
fi
237
AC_DEFINE_UNQUOTED(ENABLE_VOLUME_SEARCH, "$tmp", [enable volume search])
238
AC_SUBST(ENABLE_VOLUME_SEARCH, "$tmp")
239
240
# custom daemon user
241
AC_ARG_WITH(
242
    [daemon_user],
243
    AC_HELP_STRING([--with-daemon-user],
244
                   [User for running the colord daemon (root)]),
245
    [daemon_user=$withval],
246
    [daemon_user=root]
247
)
248
AC_SUBST(daemon_user)
249
AC_DEFINE_UNQUOTED([DAEMON_USER], ["$daemon_user"], [Daemon user])
250
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
251
dnl ---------------------------------------------------------------------------
252
dnl - Build VALA support
253
dnl ---------------------------------------------------------------------------
254
if test x$found_introspection != xno; then
255
	AC_PATH_PROG([VAPIGEN], [vapigen], [])
256
	if test "x$VAPIGEN" = "x"; then
257
		has_vapigen="no"
258
		AC_MSG_WARN([vapigen not found, will not build Vala binding])
259
	else
260
		has_vapigen="yes"
261
	fi
262
else
263
	has_vapigen="no"
264
	AC_MSG_WARN([Not introspection found, will not build Vala binding])
265
fi
266
AM_CONDITIONAL(HAVE_VAPIGEN, [test "x$has_vapigen" = "xyes"])
267
268
# udev rules go in /lib, not /usr/lib
269
if test "$prefix" = "/usr" -o "$prefix" = "/usr/local" ; then
270
  slashlibdir=/lib
271
else
272
  slashlibdir=$prefix/lib
273
fi
274
AC_SUBST(slashlibdir)
275
1.2.5 by Christopher James Halse Rogers
Import upstream version 0.1.21
276
dnl **** Check for GTK ****
277
AC_ARG_ENABLE(gtk, AS_HELP_STRING([--enable-gtk],[Enable GTK support]),
278
	      enable_gtk=$enableval)
279
has_gtk=no
280
if test x$enable_gtk != xno; then
281
	PKG_CHECK_MODULES(GTK, gtk+-3.0, has_gtk=yes, has_gtk=no)
282
	if test $has_gtk = "no"; then
283
		if test x$enable_gtk = xyes -a $has_gtk = "no"; then
284
			AC_MSG_ERROR([--enable-gtk was specified and GTK was not found])
285
		fi
286
	fi
287
fi
288
AM_CONDITIONAL(HAVE_GTK, test x$has_gtk = xyes)
289
if test x$has_gtk = xyes; then
290
	AC_DEFINE(HAVE_GTK,1,[Use GTK support])
291
fi
292
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
293
# per-machine directory
1.2.4 by Christopher James Halse Rogers
Import upstream version 0.1.18
294
AC_SUBST(CD_SYSTEM_PROFILES_DIR, "\$(localstatedir)/lib/colord/icc")
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
295
296
dnl ---------------------------------------------------------------------------
297
dnl - Makefiles, etc.
298
dnl ---------------------------------------------------------------------------
299
AC_CONFIG_FILES([
300
Makefile
301
etc/Makefile
1.2.4 by Christopher James Halse Rogers
Import upstream version 0.1.18
302
contrib/Makefile
303
contrib/colord-sane/Makefile
304
contrib/colord-sane/org.freedesktop.colord-sane.conf
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
305
examples/Makefile
306
man/Makefile
307
doc/Makefile
308
doc/api/Makefile
309
doc/api/dbus/Makefile
310
doc/api/version.xml
311
data/Makefile
3 by Christopher James Halse Rogers
* debian/patches/02_add_enable_volume_search.diff
312
data/org.freedesktop.ColorManager.conf
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
313
data/tests/Makefile
314
policy/Makefile
315
rules/Makefile
3 by Christopher James Halse Rogers
* debian/patches/02_add_enable_volume_search.diff
316
rules/69-cd-sensors.rules
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
317
po/Makefile.in
318
src/Makefile
1.2.2 by Christopher James Halse Rogers
Import upstream version 0.1.15
319
src/sensors/Makefile
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
320
client/Makefile
321
libcolord/cd-version.h
322
libcolord/colord.pc
323
libcolord/Makefile
1.2.5 by Christopher James Halse Rogers
Import upstream version 0.1.21
324
libcolord-gtk/colord-gtk.pc
325
libcolord-gtk/Makefile
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
326
])
327
AC_OUTPUT
328
329
dnl ==========================================================================
330
echo "
331
                    colord $VERSION
332
                  ===================
333
334
        prefix:                    ${prefix}
335
        datadir:                   ${datadir}
336
        compiler:                  ${CC}
337
        cflags:                    ${CFLAGS}
338
        cppflags:                  ${CPPFLAGS}
339
        gobject-introspection:     ${found_introspection}
340
        PolicyKit support:         ${enable_polkit}
341
        Reverse engineering tools: ${enable_reverse}
1.1.1 by Rodrigo Moya
Import upstream version 0.1.12
342
        File descriptor fallback:  ${enable_fd_fallback}
3 by Christopher James Halse Rogers
* debian/patches/02_add_enable_volume_search.diff
343
        External volume searching: ${enable_volume_search}
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
344
        SANE support:              ${has_sane}
1.2.5 by Christopher James Halse Rogers
Import upstream version 0.1.21
345
        GTK support:               ${has_gtk}
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
346
        GUDEV support:             ${enable_gudev}
347
        Vala API generator:        ${has_vapigen}
3 by Christopher James Halse Rogers
* debian/patches/02_add_enable_volume_search.diff
348
        Daemon user:               ${daemon_user}
1 by Christopher James Halse Rogers
Import upstream version 0.1.11
349
"
350
351
352
# warn that dummy is basically broken
353
if test x$enable_polkit = xno; then
354
	echo "*******************************************************************"
355
	echo "** YOU ARE NOT USING A SECURE DAEMON. ALL USERS CAN DO ANYTHING! **"
356
	echo "*******************************************************************"
357
fi