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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
|
AC_PREREQ(2.52)
AC_INIT(PackageKit, 0.1.1)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
# libtool versioning - this applies to libpackagekit
#
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
#
# increment;
# CURRENT If the API or ABI interface has changed (reset REVISION to 0)
# REVISION If the API and ABI remains the same, but bugs are fixed.
# AGE If libpackagekit can be linked into executables which can be
# built with previous versions of this library. Don't use.
LT_CURRENT=2
LT_REVISION=0
LT_AGE=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_CC_C_O
AM_PROG_LIBTOOL
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AM_PATH_PYTHON
PYTHON_PACKAGE_DIR=${pythondir}/packagekit
AC_SUBST(PYTHON_PACKAGE_DIR)
dnl ---------------------------------------------------------------------------
dnl - Extra verbose warning switches
dnl ---------------------------------------------------------------------------
if test "$GCC" = "yes"; then
CPPFLAGS="$CPPFLAGS -Werror -Wcast-align -Wno-uninitialized"
CPPFLAGS="$CPPFLAGS -Wall"
fi
dnl ---------------------------------------------------------------------------
dnl - gettext stuff
dnl ---------------------------------------------------------------------------
GETTEXT_PACKAGE=PackageKit
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain])
AM_GLIB_GNU_GETTEXT
dnl ---------------------------------------------------------------------------
dnl - Library dependencies
dnl ---------------------------------------------------------------------------
GLIB_REQUIRED=2.14.0
DBUS_REQUIRED=1.1.1
DBUS_GLIB_REQUIRED=0.73
LIBNM_REQUIRED=0.6.4
POLKIT_DBUS_REQUIRED=0.5
POLKIT_GRANT_REQUIRED=0.5
dnl ---------------------------------------------------------------------------
dnl - Make above strings available for packaging files (e.g. rpm spec files)
dnl ---------------------------------------------------------------------------
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(DBUS_REQUIRED)
AC_SUBST(DBUS_GLIB_REQUIRED)
dnl ---------------------------------------------------------------------------
dnl - Check library dependencies
dnl ---------------------------------------------------------------------------
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(GMODULE, gmodule-2.0)
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
PKG_CHECK_MODULES(SQLITE, sqlite3)
AC_SUBST(SQLITE_CFLAGS)
AC_SUBST(SQLITE_LIBS)
PKG_CHECK_MODULES(DBUS, \
dbus-glib-1 >= $DBUS_GLIB_REQUIRED \
dbus-1 >= $DBUS_REQUIRED \
gthread-2.0)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
PKG_CHECK_MODULES(LIBNM, \
libnm_glib >= $LIBNM_REQUIRED)
AC_SUBST(LIBNM_CFLAGS)
AC_SUBST(LIBNM_LIBS)
PKG_CHECK_MODULES(POLKIT, \
polkit-dbus >= $POLKIT_DBUS_REQUIRED \
polkit-grant >= $POLKIT_GRANT_REQUIRED)
AC_CHECK_PROG([POLKIT_POLICY_FILE_VALIDATE],
[polkit-policy-file-validate], [polkit-policy-file-validate])
if test -z "$POLKIT_POLICY_FILE_VALIDATE"; then
AC_MSG_ERROR([polkit-policy-file-validate not found])
fi
dnl ---------------------------------------------------------------------------
dnl - Is docbook2man available?
dnl ---------------------------------------------------------------------------
AC_PATH_PROG(DOCBOOK2MAN, docbook2man, no)
if test "$DOCBOOK2MAN" = "no" ; then
AC_MSG_WARN([docbook2man not found, will not be able to build man documentation])
fi
AM_CONDITIONAL(HAVE_DOCBOOK2MAN, [test "$DOCBOOK2MAN" != "no"])
dnl ---------------------------------------------------------------------------
dnl - Make paths available for source files
dnl ---------------------------------------------------------------------------
AC_SUBST(SYSCONFDIR, $sysconfdir)
AC_SUBST(DATADIR, $datadir)
AC_SUBST(BINDIR, $bindir)
AC_SUBST(SBINDIR, $sbindir)
AC_SUBST(LOCALSTATEDIR, $localstatedir)
AC_ARG_WITH([packagekit_user],
AS_HELP_STRING([--with-packagekit-user=<user>],
[User for running the PackageKit daemon (root)]))
if test -z "$with_packagekit_user" ; then
PACKAGEKIT_USER=root
else
PACKAGEKIT_USER=$with_packagekit_user
fi
AC_SUBST(PACKAGEKIT_USER)
AC_DEFINE_UNQUOTED(PACKAGEKIT_USER,"$PACKAGEKIT_USER", [User for running the PackageKit daemon])
dnl ---------------------------------------------------------------------------
dnl - Build self tests
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(tests, [ --enable-tests Build self tests],enable_tests=$enableval,enable_tests=no)
AC_MSG_CHECKING([whether to support tests])
have_tests=no
if test x$enable_tests = xyes ; then
have_tests=yes
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_TESTS, 1, [Define if we want to use the self tests])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HAVE_TESTS], [test $have_tests = yes])
dnl ---------------------------------------------------------------------------
dnl - Are we specifying a different dbus root ?
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(dbus-sys,
[AC_HELP_STRING([--with-dbus-sys=<dir>],
[where D-BUS system.d directory is])])
AC_ARG_WITH(dbus-services,
[AC_HELP_STRING([--with-dbus-services=<dir>],
[where D-BUS system-services directory is])])
if ! test -z "$with_dbus_sys" ; then
DBUS_SYS_DIR="$with_dbus_sys"
else
DBUS_SYS_DIR="$SYSCONFDIR/dbus-1/system.d"
fi
if ! test -z "$with_dbus_services" ; then
DBUS_SERVICES_DIR="$with_dbus_services"
else
DBUS_SERVICES_DIR="$DATADIR/dbus-1/system-services"
fi
AC_SUBST(DBUS_SYS_DIR)
AC_SUBST(DBUS_SERVICES_DIR)
dnl ---------------------------------------------------------------------------
dnl - DocBook Documentation
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(docbook-docs, [ --enable-docbook-docs build documentation (requires xmlto)],enable_docbook_docs=$enableval,enable_docbook_docs=auto)
AC_PATH_PROG(XMLTO, xmlto, no)
AC_MSG_CHECKING([whether to build DocBook documentation])
if test x$XMLTO = xno ; then
have_docbook=no
else
have_docbook=yes
fi
if test x$enable_docbook_docs = xauto ; then
if test x$have_docbook = xno ; then
enable_docbook_docs=no
else
enable_docbook_docs=yes
fi
fi
if test x$enable_docbook_docs = xyes; then
if test x$have_docbook = xno; then
AC_MSG_ERROR([Building DocBook docs explicitly required, but DocBook not found])
fi
fi
AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes)
AC_MSG_RESULT(yes)
dnl ---------------------------------------------------------------------------
dnl - Compile time default choice of backend
dnl ---------------------------------------------------------------------------
AC_ARG_WITH([default_backend],
AS_HELP_STRING([--with-default-backend=<option>],
[Default backend to use alpm,apt,box,conary,dummy,yum (dummy)]))
# default to a sane option for the installed tool
if test x$with_default_backend = x; then
if test -f /usr/bin/yum ; then
with_default_backend=yum
elif test -f /usr/lib/libalpm.so; then
with_default_backend=alpm
elif test -f /usr/bin/apt-get ; then
with_default_backend=apt
elif test -f /usr/bin/conary ; then
with_default_backend=conary
elif test -f /usr/bin/box-repos ; then
with_default_backend=box
else
with_default_backend=dummy
AC_DEFINE(IGNORE_POLKIT, "err...", [if we should disable polkit])
fi
fi
AC_DEFINE(DEFAULT_BACKEND, "$with_default_backend", [default backend prefix])
AC_SUBST(DEFAULT_BACKEND, "$with_default_backend")
AC_DEFUN([APT_BACKEND],
[
if test "$APT_PKG_TYPE" == "" ; then
AC_LANG_PUSH(C++)
_libaptpkg_save_cppflags=$CPPFLAGS
CPPFLAGS="$APT_CFLAGS $CPPFLAGS"
_APT_save_libs=$LIBS
LIBS="$APT_LIBS $LIBS"
AC_MSG_CHECKING([for apt support for $1 packages])
AC_RUN_IFELSE(AC_LANG_PROGRAM([
#include <apt-pkg/configuration.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/init.h>
#include <stdio.h>
],[
if (pkgInitConfig(*_config) == false)
{
fprintf(stderr,"pkginitconfig was false");
return -1;
}
if (pkgInitSystem(*_config, _system) == false)
{
fprintf(stderr,"pkginitsystem was false");
return -1;
}
if (_system->ArchiveSupported("$1"))
return 0;
else
return 1;
]),[
APT_PKG_TYPE=$1
AC_MSG_RESULT([yes])
AC_DEFINE(APT_PKG_$2,1,[apt-pkg support files of type $1])
],)
AC_LANG_POP(C++)
CPPFLAGS=$_libaptpkg_save_cppflags
LIBS=$_libaptpkg_save_libs
unset _libaptpkg_save_cppflags
unset _libaptpkg_save_libs
fi
])
if test x$with_default_backend = xapt; then
AC_ARG_WITH(libapt-pkg-lib,
AC_HELP_STRING([--with-libapt-pkg-lib=DIR],[look for the libapt-pkg library in DIR]),
[_libaptpkg_with_lib=$withval],[_libaptpkg_with_lib=no])
if test "$_libaptpkg_with_lib" == "no" ; then
APT_LIBS="-lapt-pkg"
else
APT_LIBS="-L$withval -lapt-pkg"
fi
AC_ARG_WITH(libapt-pkg-includes,
AC_HELP_STRING([--with-libapt-pkg-includes=DIR],[look for the libapt-pkg includes in DIR]),
[_libaptpkg_with_inc=$withval],[_libaptpkg_with_inc=no])
if test "$_libaptpkg_with_inc" == "no" ; then
APT_CFLAGS="-I/usr/include/apt-pkg"
else
APT_CFLAGS="-I$withval"
fi
AC_CACHE_CHECK([whether libapt-pkg is usable],
[libaptpkg_usable],
[
_libaptpkg_save_cppflags=$CPPFLAGS
CPPFLAGS="$APT_CFLAGS $CPPFLAGS"
_APT_save_libs=$LIBS
LIBS="$APT_LIBS $LIBS"
AC_LANG_PUSH(C++)
AC_LINK_IFELSE(AC_LANG_PROGRAM([
#include <apt-pkg/configuration.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/init.h>
#include <stdio.h>
],[
if (pkgInitConfig(*_config) == false)
{
fprintf(stderr,"pkginitconfig was false");
return -1;
}
if (pkgInitSystem(*_config, _system) == false)
{
fprintf(stderr,"pkginitsystem was false");
return -1;
}
return 0;
]),libaptpkg_usable=yes,AC_MSG_ERROR([libapt-pkg not found]))
CPPFLAGS=$_libaptpkg_save_cppflags
LIBS=$_libaptpkg_save_libs
unset _libaptpkg_save_cppflags
unset _libaptpkg_save_libs
])
AC_LANG_POP(C++)
APT_BACKEND(deb,DEB)
APT_BACKEND(rpm,RPM)
if test "$APT_PKG_TYPE" == "" ; then
AC_MSG_ERROR([Couldn't find support for any type of packages that we know about for Apt!])
fi
AC_SUBST(APT_CFLAGS)
AC_SUBST(APT_LIBS)
AC_SUBST(APT_PKG_TYPE)
fi
if test x$with_default_backend = xbox; then
PKG_CHECK_MODULES(BOX, libbox)
AC_SUBST(BOX_CFLAGS)
AC_SUBST(BOX_LIBS)
fi
if test x$with_default_backend = xalpm; then
with_default_backend=dummy
AC_MSG_WARN([The alpm backend doesn't work at all!])
AC_CHECK_HEADER([alpm.h],
[with_default_backend=alpm],
[AC_MSG_WARN([No alpm headers found - falling back to dummy backend])])
fi
AC_SUBST(PK_CONF_DIR, "\$(sysconfdir)/PackageKit")
AC_SUBST(PK_DB_DIR, "\$(localstatedir)/lib/PackageKit")
AC_SUBST(PK_PLUGIN_DIR, "\$(libdir)/packagekit-backend")
AC_SUBST(PK_PLUGIN_CFLAGS, "-I\$(top_srcdir)/src -I\$(top_srcdir)/libpackagekit $GLIB_CFLAGS $DBUS_CFLAGS $GMODULE_CFLAGS")
AC_SUBST(PK_PLUGIN_LIBS, "$GLIB_LIBS $DBUS_LIBS $GMODULE_LIBS")
AM_CONDITIONAL(BACKEND_TYPE_DUMMY, [test x$with_default_backend = xdummy], [using dummy backend])
AM_CONDITIONAL(BACKEND_TYPE_APT, [test x$with_default_backend = xapt], [using APT backend])
AM_CONDITIONAL(BACKEND_TYPE_YUM, [test x$with_default_backend = xyum], [using YUM backend])
AM_CONDITIONAL(BACKEND_TYPE_CONARY, [test x$with_default_backend = xconary], [using CONARY backend])
AM_CONDITIONAL(BACKEND_TYPE_BOX, [test x$with_default_backend = xbox], [using BOX backend])
AM_CONDITIONAL(BACKEND_TYPE_ALPM, [test x$with_default_backend = xalpm], [using ALPM backend])
dnl ---------------------------------------------------------------------------
dnl - Makefiles, etc.
dnl ---------------------------------------------------------------------------
AC_OUTPUT([
packagekit.pc
Makefile
etc/Makefile
man/Makefile
docs/Makefile
html/Makefile
html/img/Makefile
backends/Makefile
backends/alpm/Makefile
backends/apt/Makefile
backends/apt/helpers/Makefile
backends/box/Makefile
backends/box/helpers/Makefile
backends/conary/Makefile
backends/conary/helpers/Makefile
backends/dummy/Makefile
backends/test/Makefile
backends/test/helpers/Makefile
backends/yum/Makefile
backends/yum/helpers/Makefile
data/Makefile
libselftest/Makefile
libgbus/Makefile
libpackagekit/Makefile
policy/Makefile
src/Makefile
client/Makefile
PackageKit.conf
])
dnl ==========================================================================
echo "
PackageKit $VERSION
====================
prefix: ${prefix}
datadir: ${datadir}
compiler: ${CC}
cflags: ${CFLAGS}
Default backend: ${with_default_backend}
"
|