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
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
|
AC_PREREQ(2.52)
AC_INIT(PackageKit, 0.1.11)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
# Should we enable extra stuff automatically?
# set no for release builds, yes for development builds
DEVELOPMENT_RELEASE=yes
# 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=3
LT_REVISION=0
LT_AGE=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_PROG_CC
AC_PROG_INSTALL
AC_ISC_POSIX
AC_HEADER_STDC
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
# Internationalisation
IT_PROG_INTLTOOL([0.35.0])
GETTEXT_PACKAGE=PackageKit
AC_SUBST([GETTEXT_PACKAGE])
AM_GLIB_GNU_GETTEXT
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
# set up gtk-doc
GTK_DOC_CHECK(1.9)
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 -Wformat-security"
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
GIO_REQUIRED=2.16.1
DBUS_REQUIRED=1.1.1
DBUS_GLIB_REQUIRED=0.73
LIBNM_GLIB_REQUIRED=0.6.4
POLKIT_DBUS_REQUIRED=0.7
POLKIT_GRANT_REQUIRED=0.7
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)
dnl ---------------------------------------------------------------------------
dnl - Is GIO available?
dnl ---------------------------------------------------------------------------
PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED, PK_BUILD_GIO="yes", PK_BUILD_GIO="no")
if test "x$PK_BUILD_GIO" = "xyes"; then
with_gio="yes"
AC_DEFINE(PK_BUILD_GIO, 1, [define if GIO is installed])
else
with_gio="no"
PK_BUILD_GIO=no
fi
AM_CONDITIONAL(PK_BUILD_GIO, test x$PK_BUILD_GIO = xyes)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
dnl ---------------------------------------------------------------------------
dnl - Is NetworkManager available?
dnl ---------------------------------------------------------------------------
PKG_CHECK_MODULES(LIBNM, libnm_glib >= $LIBNM_GLIB_REQUIRED, PK_BUILD_NETWORKMANAGER="yes", PK_BUILD_NETWORKMANAGER="no")
if test "x$PK_BUILD_NETWORKMANAGER" = "xyes"; then
with_networking_stack="NetworkManager"
AC_DEFINE(PK_BUILD_NETWORKMANAGER, 1, [define if NetworkManager is installed])
else
with_networking_stack="dummy"
PK_BUILD_NETWORKMANAGER=no
fi
AM_CONDITIONAL(PK_BUILD_NETWORKMANAGER, test x$PK_BUILD_NETWORKMANAGER = xyes)
AC_SUBST(LIBNM_CFLAGS)
AC_SUBST(LIBNM_LIBS)
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(LIBDIR, $libdir)
AC_SUBST(LIBEXECDIR, $libexecdir)
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])
AC_ARG_WITH([backend_user],
AS_HELP_STRING([--with-backend-user=<user>],
[Alternative user for running the PackageKit backend]))
if test -z "$with_backend_user" ; then
PK_BACKEND_USER=$PACKAGEKIT_USER
else
PK_BACKEND_USER=$with_backend_user
fi
AC_SUBST(PK_BACKEND_USER)
AC_DEFINE_UNQUOTED(PK_BACKEND_USER,"$PK_BACKEND_USER", [Alternative user for running the PackageKit backend])
dnl ---------------------------------------------------------------------------
dnl - Build self tests
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),
enable_tests=$enableval,enable_tests=$DEVELOPMENT_RELEASE)
AM_CONDITIONAL(PK_BUILD_TESTS, test x$enable_tests = xyes)
if test x$enable_tests = xyes; then
AC_DEFINE(PK_BUILD_TESTS,1,[Build test code])
fi
dnl ---------------------------------------------------------------------------
dnl - Display DAEMON messages?
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(developer, AS_HELP_STRING([--enable-developer],[enable daemon debug messages]),
enable_developer=$enableval,enable_developer=$DEVELOPMENT_RELEASE)
AM_CONDITIONAL(PK_IS_DEVELOPER, test x$enable_developer = xyes)
if test x$enable_developer = xyes; then
AC_DEFINE(PK_IS_DEVELOPER,1,[Build developer code])
fi
dnl ---------------------------------------------------------------------------
dnl - Able to run from a checkout?
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(local, AS_HELP_STRING([--enable-local],[enable running in local checkout]),
enable_local=$enableval,enable_local=$DEVELOPMENT_RELEASE)
AM_CONDITIONAL(PK_BUILD_LOCAL, test x$enable_local = xyes)
if test x$enable_local = xyes; then
AC_DEFINE(PK_BUILD_LOCAL,1,[Build local code])
fi
dnl ---------------------------------------------------------------------------
dnl - Other tests
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),
enable_gcov=$enableval,enable_gcov=no)
AC_ARG_ENABLE(gprof, AS_HELP_STRING([--enable-gprof],[compile with gprof support (gcc only)]),
enable_gprof=$enableval,enable_gprof=no)
# backends
AC_ARG_ENABLE(alpm, AS_HELP_STRING([--enable-alpm],[use the ALPM backend]),enable_alpm=$enableval,enable_alpm=no)
AC_ARG_ENABLE(apt, AS_HELP_STRING([--enable-apt],[use the APT backend]),enable_apt=$enableval,enable_apt=no)
AC_ARG_ENABLE(apt2, AS_HELP_STRING([--enable-apt2],[use the DBus based APT backend]),enable_apt2=$enableval,enable_apt2=no)
AC_ARG_ENABLE(box, AS_HELP_STRING([--enable-box],[use the BOX backend]),enable_box=$enableval,enable_box=no)
AC_ARG_ENABLE(conary, AS_HELP_STRING([--enable-conary],[use the CONARY backend]),enable_conary=$enableval,enable_conary=no)
AC_ARG_ENABLE(dummy, AS_HELP_STRING([--enable-dummy],[use the dummy backend]),enable_dummy=$enableval,enable_dummy=yes)
AC_ARG_ENABLE(opkg, AS_HELP_STRING([--enable-opkg],[use the OPKG backend]),enable_opkg=$enableval,enable_opkg=no)
AC_ARG_ENABLE(pisi, AS_HELP_STRING([--enable-pisi],[use the PiSi backend]),enable_pisi=$enableval,enable_pisi=no)
AC_ARG_ENABLE(poldek, AS_HELP_STRING([--enable-poldek],[use the poldek backend]),enable_poldek=$enableval,enable_poldek=no)
AC_ARG_ENABLE(smart, AS_HELP_STRING([--enable-smart],[use the SMART backend]),enable_smart=$enableval,enable_smart=no)
AC_ARG_ENABLE(yum, AS_HELP_STRING([--enable-yum],[use the YUM backend]),enable_yum=$enableval,enable_yum=no)
AC_ARG_ENABLE(yum2, AS_HELP_STRING([--enable-yum2],[use the YUM DBUS backend]),enable_yum2=$enableval,enable_yum2=no)
AC_ARG_ENABLE(zypp, AS_HELP_STRING([--enable-zypp],[use the Zypp backend]),enable_zypp=$enableval,enable_zypp=no)
# export to Makefile.am's
AM_CONDITIONAL(BACKEND_TYPE_ALPM, [test x$enable_alpm = xyes], [using ALPM backend])
AM_CONDITIONAL(BACKEND_TYPE_APT, [test x$enable_apt = xyes], [using APT backend])
AM_CONDITIONAL(BACKEND_TYPE_APT_DBUS, [test x$enable_apt2 = xyes], [using DBus based APT backend])
AM_CONDITIONAL(BACKEND_TYPE_BOX, [test x$enable_box = xyes], [using BOX backend])
AM_CONDITIONAL(BACKEND_TYPE_CONARY, [test x$enable_conary = xyes], [using CONARY backend])
AM_CONDITIONAL(BACKEND_TYPE_DUMMY, [test x$enable_dummy = xyes], [using dummy backend])
AM_CONDITIONAL(BACKEND_TYPE_OPKG, [test x$enable_opkg = xyes], [using OPKG backend])
AM_CONDITIONAL(BACKEND_TYPE_PISI, [test x$enable_pisi = xyes], [using PiSi backend])
AM_CONDITIONAL(BACKEND_TYPE_POLDEK, [test x$enable_poldek = xyes], [using poldek backend])
AM_CONDITIONAL(BACKEND_TYPE_SMART, [test x$enable_smart = xyes], [using SMART backend])
AM_CONDITIONAL(BACKEND_TYPE_YUM, [test x$enable_yum = xyes], [using YUM backend])
AM_CONDITIONAL(BACKEND_TYPE_YUM2, [test x$enable_yum2 = xyes], [using YUM DBUS backend])
AM_CONDITIONAL(BACKEND_TYPE_ZYPP, [test x$enable_zypp = xyes], [using Zypp backend])
if test x$enable_gcov = xyes; then
## so that config.h changes when you toggle gcov support
AC_DEFINE_UNQUOTED(PK_BUILD_GCOV, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
have_gcc33_gcov=no
AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
have_gcc33_gcov=yes)
if test x$have_gcc33_gcov = xyes ; then
AC_DEFINE_UNQUOTED(PK_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
fi
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
AC_MSG_RESULT($have_gcc33_gcov)
fi
AM_CONDITIONAL(PK_BUILD_GCOV, test x$enable_gcov = xyes)
if test x$enable_gprof = xyes; then
## so that config.h changes when you toggle gprof support
AC_DEFINE_UNQUOTED(PK_BUILD_GPROF, 1, [Defined if gprof is enabled to force a rebuild due to config.h changing])
CPPFLAGS="$CPPFLAGS -pg"
LDFLAGS="$LDFLAGS -pg"
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
AC_MSG_RESULT($enable_gprof)
fi
AM_CONDITIONAL(PK_BUILD_GPROF, test x$enable_gprof = xyes)
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 security framework
dnl ---------------------------------------------------------------------------
AC_ARG_WITH([security_framework],
AS_HELP_STRING([--with-security-framework=<option>],
[Default security framework to use polkit,dummy]))
# try and guess this if nothing is listed
if test x$with_security_framework = x; then
if test -f /usr/bin/polkit-action ; then
with_security_framework=polkit
else
AC_MSG_ERROR([--with-security-framework explicitly required when not using PolicyKit or RBAC])
fi
fi
AC_DEFINE_UNQUOTED(security_framework, "$with_security_framework", [default security framework])
AC_SUBST(security_framework, "$with_security_framework")
if test x$with_security_framework = xpolkit; then
PKG_CHECK_MODULES(POLKIT, \
polkit-dbus >= $POLKIT_DBUS_REQUIRED \
polkit-grant >= $POLKIT_GRANT_REQUIRED)
AC_SUBST(POLKIT_CFLAGS)
AC_SUBST(POLKIT_LIBS)
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
AC_DEFINE(USE_SECURITY_POLKIT, 1, [if we should use PolicyKit])
elif test x$with_security_framework = xdummy; then
AC_DEFINE(USE_SECURITY_DUMMY, 1, [if we should use a dummy security framework])
else
AC_MSG_ERROR([No valid security framework specified])
fi
AM_CONDITIONAL(SECURITY_TYPE_DUMMY, [test x$with_security_framework = xdummy], [using dummy security framework])
AM_CONDITIONAL(SECURITY_TYPE_POLKIT, [test x$with_security_framework = xpolkit], [using PolicyKit security framework])
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,apt2,box,conary,dummy,smart,yum,pisi,zypp,opkg (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
elif test -f /usr/bin/smart ; then
with_default_backend=smart
elif test -f /usr/bin/pisi ; then
with_default_backend=pisi
elif test -f /usr/bin/poldek ; then
with_default_backend=poldek
elif test -f /usr/bin/zypper ; then
with_default_backend=zypp
else
with_default_backend=dummy
fi
fi
AC_DEFINE_UNQUOTED(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$enable_apt = xyes; then
PY_CHECK_MOD([apt_pkg],,,AC_MSG_ERROR([Apt backend needs python-apt]))
AC_ARG_WITH([apt_search],
AS_HELP_STRING([--with-apt-search=<option>],
[Apt search type to use - plain,sqlite (plain)]))
if test x$with_apt_search = x; then
with_apt_search=plain
fi
AC_MSG_NOTICE([using $with_apt_search for apt searching])
AC_DEFINE_UNQUOTED(APT_SEARCH, "$with_apt_search", [apt search type])
AC_SUBST(APT_SEARCH, $with_apt_search)
AM_CONDITIONAL(APT_SEARCH_PLAIN, [test x$with_apt_search = xplain], [using plain apt search])
AM_CONDITIONAL(APT_SEARCH_SQLITE, [test x$with_apt_search = xsqlite], [using sqlite apt search])
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)
else
AM_CONDITIONAL(APT_SEARCH_PLAIN, [false])
AM_CONDITIONAL(APT_SEARCH_SQLITE, [false])
fi
if test x$enable_apt2 = xyes; then
PY_CHECK_MOD([apt_pkg],,,AC_MSG_ERROR([Apt backend needs python-apt]))
fi
if test x$enable_box = xyes; then
PKG_CHECK_MODULES(BOX, libbox >= 0.1.4 )
AC_SUBST(BOX_CFLAGS)
AC_SUBST(BOX_LIBS)
fi
if test x$enable_opkg = xyes; then
PKG_CHECK_MODULES(OPKG, libopkg)
AC_SUBST(OPKG_CFLAGS)
AC_SUBST(OPKG_LIBS)
fi
if test x$enable_alpm = xyes; 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
if test x$enable_poldek = xyes; then
POLDEK_CFLAGS="-I/usr/include/poldek"
POLDEK_LIBS="-lpoclidek -lpoldek"
AC_SUBST(POLDEK_CFLAGS)
AC_SUBST(POLDEK_LIBS)
fi
if test x$enable_zypp = xyes; then
PKG_CHECK_MODULES(ZYPP, libzypp >= 4.7.0)
AC_SUBST(ZYPP_CFLAGS)
AC_SUBST(ZYPP_LIBS)
fi
AC_SUBST(PK_CONF_DIR, "\$(sysconfdir)/PackageKit")
AC_SUBST(PK_YUM_PLUGIN_DIR, "\$(prefix)/lib/yum-plugins")
AC_SUBST(PK_DB_DIR, "\$(localstatedir)/lib/PackageKit")
AC_SUBST(PK_LOG_DIR, "\$(localstatedir)/log")
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")
if test x$with_default_backend = xapt; then
# now we've done the conditionals, rename for searching backend
with_default_backend="apt (with $with_apt_search searching)"
fi
dnl ---------------------------------------------------------------------------
dnl - Makefiles, etc.
dnl ---------------------------------------------------------------------------
AC_OUTPUT([
Makefile
etc/Makefile
man/Makefile
docs/Makefile
docs/html/Makefile
docs/html/img/Makefile
docs/spec/Makefile
docs/api/Makefile
docs/api/version.xml
contrib/Makefile
contrib/yum-packagekit/Makefile
backends/Makefile
backends/alpm/Makefile
backends/apt/Makefile
backends/apt/helpers/Makefile
backends/apt2/Makefile
backends/box/Makefile
backends/conary/Makefile
backends/conary/helpers/Makefile
backends/dummy/Makefile
backends/opkg/Makefile
backends/smart/Makefile
backends/smart/helpers/Makefile
backends/test/Makefile
backends/test/helpers/Makefile
backends/yum/Makefile
backends/yum/helpers/Makefile
backends/yum2/Makefile
backends/yum2/helpers/Makefile
backends/pisi/Makefile
backends/pisi/helpers/Makefile
backends/poldek/Makefile
backends/zypp/Makefile
data/Makefile
data/packagekit.pc
data/org.freedesktop.PackageKit.conf
data/org.freedesktop.PackageKitTestBackend.conf
data/org.freedesktop.PackageKitYumBackend.conf
data/org.freedesktop.PackageKitAptBackend.conf
data/tests/Makefile
libselftest/Makefile
libgbus/Makefile
libpackagekit/Makefile
policy/Makefile
src/Makefile
client/Makefile
python/Makefile
python/packagekit/Makefile
po/Makefile.in
])
dnl ==========================================================================
echo "
PackageKit $VERSION
====================
prefix: ${prefix}
datadir: ${datadir}
compiler: ${CC}
cflags: ${CFLAGS}
Building unit tests: ${enable_tests}
Able to run locally: ${enable_local}
Developer warnings: ${enable_developer}
GCC coverage profiling: ${enable_gcov}
GCC time profiling: ${enable_gprof}
Security framework: ${with_security_framework}
Networking stack: ${with_networking_stack}
GIO support: ${with_gio}
Backends:
ALPM backend: ${enable_alpm}
APT backend: ${enable_apt}
APT DBus backend: ${enable_apt2}
BOX backend: ${enable_box}
CONARY backend: ${enable_conary}
dummy backend: ${enable_dummy}
OPKG backend: ${enable_opkg}
PiSi backend: ${enable_pisi}
poldek backend: ${enable_poldek}
SMART backend: ${enable_smart}
YUM backend: ${enable_yum}
YUM2 backend: ${enable_yum2}
Zypp backend: ${enable_zypp}
Default backend: ${with_default_backend}
"
# warn that dummy is basically broken
if test x$with_security_framework = xdummy; then
echo "*******************************************************************"
echo "** YOU ARE NOT USING A SECURE DAEMON. ALL USERS CAN DO ANYTHING! **"
echo "*******************************************************************"
fi
|