1
AC_INIT([AccountsService],[0.6.13])
2
AM_INIT_AUTOMAKE(no-dist-gzip dist-xz tar-ustar foreign)
4
GETTEXT_PACKAGE=accounts-service
5
AC_SUBST(GETTEXT_PACKAGE)
6
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
7
[the gettext translation domain])
9
# Support silent build rules, requires at least automake-1.11. Enable
10
# by either passing --enable-silent-rules to configure or passing V=0
12
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
17
IT_PROG_INTLTOOL([0.40.0])
18
AC_USE_SYSTEM_EXTENSIONS
28
PKG_CHECK_MODULES(GLIB, glib-2.0)
29
PKG_CHECK_MODULES(GIO, gio-2.0 gio-unix-2.0)
30
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1)
31
PKG_CHECK_MODULES(POLKIT, polkit-gobject-1)
33
AM_MAINTAINER_MODE([enable])
35
# client library dependencies
36
LIBACCOUNTSSERVICE_LIBS="$GLIB_LIBS $DBUS_GLIB_LIBS"
37
AC_SUBST(LIBACCOUNTSSERVICE_LIBS)
38
LIBACCOUNTSSERVICE_CFLAGS="$GLIB_CFLAGS $DBUS_GLIB_CFLAGS"
39
AC_SUBST(LIBACCOUNTSSERVICE_CFLAGS)
41
GOBJECT_INTROSPECTION_CHECK([0.9.12])
42
LIBACCOUNTSSERVICE_GIR_INCLUDES="GLib-2.0 GObject-2.0 DBusGLib-1.0"
43
AC_SUBST(LIBACCOUNTSSERVICE_GIR_INCLUDES)
46
AC_ARG_ENABLE(more-warnings,
47
AS_HELP_STRING([--enable-more-warnings],
48
[Maximum compiler warnings]),
49
set_more_warnings="$enableval",[
50
if test -d $srcdir/.git; then
56
AC_MSG_CHECKING(for more warnings)
57
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
61
-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
62
-Wwrite-strings -Wnested-externs -Wpointer-arith \
63
-Wswitch-enum -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
64
-Wno-missing-field-initializers -Wno-unused-parameter \
65
-Wcast-align -Wsign-compare -Wp,-D_FORTIFY_SOURCE=2"
66
elif test "$GCC" = "yes"; then
68
MAYBE_WARN="-Wall -Wno-sign-compare -Wno-deprecated-declarations"
73
# invalidate cached value if MAYBE_WARN has changed
74
if test "x$accountsservice_cv_warn_maybe" != "x$MAYBE_WARN"; then
75
unset accountsservice_cv_warn_cflags
78
AC_DEFUN([ACCOUNTSSERVICE_CC_TRY_FLAG], [
79
AC_MSG_CHECKING([whether $CC supports $1])
81
accountsservice_save_CFLAGS="$CFLAGS"
84
AC_COMPILE_IFELSE([ ], [accountsservice_cc_flag=yes], [accountsservice_cc_flag=no])
85
CFLAGS="$accountsservice_save_CFLAGS"
87
if test "x$accountsservice_cc_flag" = "xyes"; then
88
ifelse([$2], , :, [$2])
90
ifelse([$3], , :, [$3])
92
AC_MSG_RESULT([$accountsservice_cc_flag])
95
AC_CACHE_CHECK([for supported warning flags], accountsservice_cv_warn_cflags, [
99
# Some warning options are not supported by all versions of
100
# gcc, so test all desired options against the current
103
# Note that there are some order dependencies
104
# here. Specifically, an option that disables a warning will
105
# have no net effect if a later option then enables that
106
# warnings, (perhaps implicitly). So we put some grouped
107
# options (-Wall and -Wextra) up front and the -Wno options
110
for W in $MAYBE_WARN; do
111
ACCOUNTSSERVICE_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
114
accountsservice_cv_warn_cflags=$WARN_CFLAGS
115
accountsservice_cv_warn_maybe=$MAYBE_WARN
117
AC_MSG_CHECKING([which warning flags were supported])
120
WARN_CFLAGS="$accountsservice_cv_warn_cflags"
121
AC_SUBST(WARN_CFLAGS)
123
dnl ---------------------------------------------------------------------------
124
dnl - DocBook Documentation
125
dnl ---------------------------------------------------------------------------
127
AC_ARG_ENABLE(docbook-docs,
128
[AS_HELP_STRING([--enable-docbook-docs],[build documentation (requires xmlto)])],
129
enable_docbook_docs=$enableval,enable_docbook_docs=no)
130
AC_PATH_PROG(XMLTO, xmlto, no)
131
AC_MSG_CHECKING([whether to build DocBook documentation])
132
if test x$XMLTO = xno ; then
137
if test x$enable_docbook_docs = xauto ; then
138
if test x$have_docbook = xno ; then
139
enable_docbook_docs=no
141
enable_docbook_docs=yes
144
if test x$enable_docbook_docs = xyes; then
145
if test x$have_docbook = xno; then
146
AC_MSG_ERROR([Building DocBook docs explicitly required, but DocBook not found])
149
AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes)
151
AC_ARG_VAR([XMLTO],[Define/override the 'xmlto' location.])
152
AC_ARG_VAR([XMLTO_FLAGS],[Define/override 'xmlto' options, like '--skip-validation'.])
154
dnl ---------------------------------------------------------------------------
155
dnl Check for xsltproc
156
dnl ---------------------------------------------------------------------------
157
AC_PATH_PROG([XSLTPROC], [xsltproc])
161
AC_ARG_WITH([systemdsystemunitdir],
162
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
164
[with_systemdsystemunitdir=yes])
165
if test "x$with_systemdsystemunitdir" = "xyes"; then
166
with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
168
if test "x$with_systemdsystemunitdir" != "xno"; then
169
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
171
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != "xno" ])
173
AC_CONFIG_HEADERS([config.h])
179
src/libaccountsservice/Makefile
180
src/libaccountsservice/accountsservice.pc
183
doc/dbus/AccountsService.xml
188
AC_MSG_NOTICE([accountsservice was configured with the following options:])
189
if test "x$enable_docbook_docs" = "xyes"; then
190
AC_MSG_NOTICE([** DocBook documentation build enabled])
192
AC_MSG_NOTICE([** DocBook documentation build disabled])