configure.ac 20.8 KB
Newer Older
David Zeuthen's avatar
David Zeuthen committed
1 2 3
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59c)
4
AC_INIT([polkit], [0.116], [http://lists.freedesktop.org/mailman/listinfo/polkit-devel], , [http://www.freedesktop.org/wiki/Software/polkit])
5
AM_INIT_AUTOMAKE([])
6
AC_CONFIG_HEADERS(config.h)
7
AC_CONFIG_MACRO_DIR([buildutil])
David Zeuthen's avatar
David Zeuthen committed
8 9
AM_MAINTAINER_MODE

Michael Biebl's avatar
Michael Biebl committed
10 11
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

12 13 14
# Include external mocklibc tool for unit testing
AC_CONFIG_SUBDIRS([test/mocklibc])

David Zeuthen's avatar
David Zeuthen committed
15 16 17 18 19 20 21 22 23 24 25
# libtool versioning - this applies to all libraries in this package
#
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
#
LT_CURRENT=0
LT_REVISION=0
LT_AGE=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

26
AC_USE_SYSTEM_EXTENSIONS
David Zeuthen's avatar
David Zeuthen committed
27 28 29 30 31 32 33 34
AC_ISC_POSIX
AC_PROG_CC
AC_HEADER_STDC
AM_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_SYS_LARGEFILE
AM_PROG_CC_C_O
35 36
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11()
David Zeuthen's avatar
David Zeuthen committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

# Taken from dbus
AC_ARG_ENABLE(ansi,             [  --enable-ansi           enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
AC_ARG_ENABLE(man-pages,        [  --enable-man-pages      build manual pages],enable_man_pages=$enableval,enable_man_pages=yes)

if test "${enable_man_page}" != no; then
dnl
dnl Check for xsltproc
dnl
AC_PATH_PROG([XSLTPROC], [xsltproc])
  if test -z "$XSLTPROC"; then
    enable_man_pages=no
  fi
fi
AM_CONDITIONAL(MAN_PAGES_ENABLED, test x$enable_man_pages = xyes)

GTK_DOC_CHECK([1.3])

#### gcc warning flags

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\
        -pipe \
        -Wall \
	-Werror=empty-body \
	-Werror=strict-prototypes \
	-Werror=missing-prototypes \
	-Werror=implicit-function-declaration \
        "-Werror=format=2 -Werror=format-security -Werror=format-nonliteral" \
	-Werror=pointer-arith -Werror=init-self \
        -Werror=missing-declarations \
        -Werror=return-type \
        -Werror=overflow \
        -Werror=int-conversion \
        -Werror=parenthesis \
        -Werror=incompatible-pointer-types \
        -Werror=misleading-indentation \
	-Werror=missing-include-dirs -Werror=aggregate-return \
	-Werror=declaration-after-statement \
])
AC_SUBST(WARN_CFLAGS)
David Zeuthen's avatar
David Zeuthen committed
77

78
PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
David Zeuthen's avatar
David Zeuthen committed
79 80 81
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

82
PKG_CHECK_MODULES(LIBJS, [mozjs-52])
83

84
AC_SUBST(LIBJS_CFLAGS)
85
AC_SUBST(LIBJS_CXXFLAGS)
86 87
AC_SUBST(LIBJS_LIBS)

David Zeuthen's avatar
David Zeuthen committed
88 89 90 91 92 93 94 95 96 97 98 99 100 101
EXPAT_LIB=""
AC_ARG_WITH(expat, [  --with-expat=<dir>      Use expat from here],
                      [
                      expat=$withval
                      CPPFLAGS="$CPPFLAGS -I$withval/include"
                      LDFLAGS="$LDFLAGS -L$withval/lib"
                      ]
                      )
AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)], 
		 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
	     [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
AC_SUBST(EXPAT_LIBS)

102
AC_CHECK_FUNCS(clearenv fdatasync)
103

David Zeuthen's avatar
David Zeuthen committed
104 105 106 107
if test "x$GCC" = "xyes"; then
  LDFLAGS="-Wl,--as-needed $LDFLAGS"
fi

108 109 110
dnl ---------------------------------------------------------------------------
dnl - Check whether setnetgrent has a return value
dnl ---------------------------------------------------------------------------
111
AC_CHECK_HEADERS([netgroup.h])
112
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
113 114 115 116 117 118 119
    #include <stddef.h>
    #ifdef HAVE_NETGROUP_H
    #include <netgroup.h>
    #else
    #include <netdb.h>
    #endif
]], [[int r = setnetgrent (NULL);]])],
120 121 122 123 124 125 126 127 128 129 130
[AC_DEFINE([HAVE_SETNETGRENT_RETURN], 1, [Define to 1 if setnetgrent has return value])])

dnl ---------------------------------------------------------------------------
dnl - Check whether we want to build test
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([test],
              [AS_HELP_STRING([--disable-test], [Do not build tests])],
              [enable_test=$enableval], [enable_test=yes])

AM_CONDITIONAL(BUILD_TEST, [test "x$enable_test" = "xyes"])

131
dnl ---------------------------------------------------------------------------
132
dnl - Select wether to use libsystemd-login, libelogind or ConsoleKit for session tracking
133 134
dnl ---------------------------------------------------------------------------

135
have_libsystemd=no
136
have_libelogind=no
137 138
SESSION_TRACKING=ConsoleKit

139
AC_ARG_ENABLE([libsystemd-login],
140
              [AS_HELP_STRING([--enable-libsystemd-login[=@<:@auto/yes/no@:>@]], [Use libsystemd (auto/yes/no)])],
141 142 143
              [enable_libsystemd_login=$enableval],
              [enable_libsystemd_login=auto])
if test "$enable_libsystemd_login" != "no"; then
144 145 146 147 148 149 150 151 152 153 154 155 156
  PKG_CHECK_MODULES([LIBSYSTEMD],
    [libsystemd],
    [have_libsystemd=yes],
    dnl if libsystemd is not available, fall back to the older libsystemd-login
    [PKG_CHECK_MODULES([LIBSYSTEMD_LOGIN],
      [libsystemd-login],
      [
        have_libsystemd=yes
        LIBSYSTEMD_CFLAGS="$LIBSYSTEMD_LOGIN_CFLAGS"
        LIBSYSTEMD_LIBS="$LIBSYSTEMD_LOGIN_LIBS"
      ],
      [have_libsystemd=no])])
  if test "$have_libsystemd" = "yes"; then
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
      SESSION_TRACKING=libsystemd-login
  fi
fi

AC_ARG_ENABLE([libelogind],
              [AS_HELP_STRING([--enable-libelogind[=@<:@auto/yes/no@:>@]], [Use libelogind (auto/yes/no)])],
              [enable_libelogind=$enableval],
              [enable_libelogind=auto])
dnl Using libelogind makes no sense when libsystemd-login is already in use
if test "$have_libsystemd" = "yes"; then
  enable_libelogind=no
fi
if test "$enable_libelogind" != "no"; then
  PKG_CHECK_MODULES([LIBELOGIND],
    [libelogind],
    [have_libelogind=yes])
  if test "$have_libelogind" = "yes"; then
      SESSION_TRACKING=libelogind
  fi
fi

dnl libelogind is a drop-in replacement for libsystemd-login, so using it does
dnl not need any different actions than using libsystemd-login.
if test "$SESSION_TRACKING" != "ConsoleKit"; then
  AC_DEFINE([HAVE_LIBSYSTEMD], 1, [Define to 1 if libsystemd or libelogind is available])
  save_LIBS=$LIBS
  if test "$have_libelogind" = "yes"; then
    LIBS=$LIBELOGIND_LIBS
    dnl We have to act like this was libsystemd-login
    LIBSYSTEMD_CFLAGS=$LIBELOGIND_CFLAGS
    LIBSYSTEMD_LIBS=$LIBELOGIND_LIBS
188
  else
189 190 191 192 193 194 195 196 197 198
    LIBS=$LIBSYSTEMD_LIBS
  fi
  AC_CHECK_FUNCS(sd_uid_get_display)
  LIBS=$save_LIBS
else
  if test "$enable_libsystemd_login" = "yes"; then
    AC_MSG_ERROR([libsystemd support requested but libsystemd or libsystemd-login library not found])
  fi
  if test "$enable_libelogind" = "yes"; then
    AC_MSG_ERROR([libelogind support requested but libelogind library not found])
199
  fi
200 201
fi

202
AS_IF([test "x$cross_compiling" != "xyes" ], [
203
  AS_IF([test "$have_libsystemd" = "yes"], [
204
    AS_IF([test ! -d /sys/fs/cgroup/systemd/ -a ! -d /sys/fs/cgroup/init.scope ], [
205
      AS_IF([test "$enable_libsystemd_login" = "yes"], [
206
        AC_MSG_WARN([libsystemd requested but system does not appear to be using systemd])
207
      ], [
208
        AC_MSG_ERROR([libsystemd autoconfigured, but system does not appear to use systemd])
209 210 211 212 213 214 215
      ])
    ])
  ], [
    AS_IF([test -d /sys/fs/cgroup/systemd/ ], [
      AS_IF([test "$enable_libsystemd_login" = "no" ], [
        AC_MSG_WARN([ConsoleKit requested but system appears to use systemd])
      ], [
216
        AC_MSG_ERROR([ConsoleKit autoconfigured, but systemd is in use (missing libsystemd or libsystemd-login pkg-config?)])
217 218 219 220 221
      ])
    ])
  ])
])

222 223 224
AC_SUBST(LIBSYSTEMD_CFLAGS)
AC_SUBST(LIBSYSTEMD_LIBS)
AM_CONDITIONAL(HAVE_LIBSYSTEMD, [test "$have_libsystemd" = "yes"], [Using libsystemd])
225

226 227 228 229 230 231 232 233 234 235 236 237 238
dnl ---------------------------------------------------------------------------
dnl - systemd unit / service files
dnl ---------------------------------------------------------------------------

AC_ARG_WITH([systemdsystemunitdir],
            AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
            [],
            [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
if test "x$with_systemdsystemunitdir" != "xno"; then
  AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$systemdsystemunitdir"])

239 240 241 242 243 244 245 246 247 248 249 250 251 252
dnl ---------------------------------------------------------------------------
dnl - User for running polkitd
dnl ---------------------------------------------------------------------------

AC_ARG_WITH(polkitd_user, AS_HELP_STRING([--with-polkitd-user=<user>],[User for running polkitd (polkitd)]))

if test -z "$with_polkitd_user" ; then
    POLKITD_USER=polkitd
else
    POLKITD_USER=$with_polkitd_user
fi
AC_SUBST(POLKITD_USER)
AC_DEFINE_UNQUOTED(POLKITD_USER,"$POLKITD_USER", [User for running polkitd])

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
dnl ---------------------------------------------------------------------------
dnl - Select which authentication framework to use
dnl ---------------------------------------------------------------------------

AC_ARG_WITH([authfw],
	    AS_HELP_STRING([--with-authfw=<name>], 
                           [Authentication framework (none/pam/shadow)]))
if ! test -z "$with_authfw" ; then
  if test x$with_authdb = xdummy ; then
    if ! test x$with_authfw = xnone ; then
      AC_MSG_ERROR([Only 'none' is a valid authentication framework for the dummy authorization database])
    fi
  else
      if test x$with_authfw = xnone ; then
        AC_MSG_ERROR(['none' is only a valid authentication framework for the dummy authorization database])
      fi
  fi
  POLKIT_AUTHFW=$with_authfw
else
  if test x$with_authdb = xdummy ; then
    POLKIT_AUTHFW=none
  else
    POLKIT_AUTHFW=pam
  fi
fi

AC_SUBST(POLKIT_AUTHFW)
AC_DEFINE_UNQUOTED(POLKIT_AUTHFW,"$POLKIT_AUTHFW", [Authentication Framework to use])

case $POLKIT_AUTHFW in
  none)
    need_pam=no
    AC_DEFINE(POLKIT_AUTHFW_NONE, 1, [If using no authentication framework])
    ;;

  pam)
    need_pam=yes
    AC_DEFINE(POLKIT_AUTHFW_PAM, 1, [If using the PAM authentication framework])
    ;;

  shadow)
    need_pam=no
    AUTH_LIBS="${AUTH_LIBS} -lcrypt"
    AC_DEFINE(POLKIT_AUTHFW_SHADOW, 1, [If using the Shadow authentication framework])
    ;;

299 300 301 302 303
  bsdauth)
    need_pam=no
    AC_DEFINE(POLKIT_AUTHFW_BSDAUTH, 1, [If using the bsd_auth(3) authentication framework])
    ;;

304 305 306 307 308 309 310 311
  *)
    AC_MSG_ERROR([Unknown Authentication Framework: $POLKIT_AUTHFW])
    ;;
esac

AM_CONDITIONAL(POLKIT_AUTHFW_NONE, [test x$POLKIT_AUTHFW = xnone], [Using no authfw])
AM_CONDITIONAL(POLKIT_AUTHFW_PAM, [test x$POLKIT_AUTHFW = xpam], [Using PAM authfw])
AM_CONDITIONAL(POLKIT_AUTHFW_SHADOW, [test x$POLKIT_AUTHFW = xshadow], [Using Shadow authfw])
312
AM_CONDITIONAL(POLKIT_AUTHFW_BSDAUTH, [test x$POLKIT_AUTHFW = xbsdauth], [Using bsd_auth(3) authfw])
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


dnl ---------------------------------------------------------------------------
dnl - Check for PAM
dnl ---------------------------------------------------------------------------

withval=""
AC_ARG_WITH(pam-prefix,
[  --with-pam-prefix=<prefix> specify where pam files go],[
if test x$withval != x; then
   AC_MSG_RESULT("PAM files will be installed in prefix ${withval}.")
fi])
if test x$withval != x; then
	PAM_PREFIX_UNEXPANDED="$withval"
else
	PAM_PREFIX_UNEXPANDED="$sysconfdir"
fi
PAM_PREFIX=`eval echo $PAM_PREFIX_UNEXPANDED`
AC_SUBST(PAM_PREFIX)

have_pam=no
if test "$need_pam" = yes ; then
  AC_CHECK_LIB(pam, pam_start, have_pam=yes)
fi

if test x$have_pam = xno; then
    if test "$need_pam" = yes ; then
      AC_ERROR([Could not find pam/pam-devel, please install the needed packages.])
    fi
else
    AUTH_LIBS="${AUTH_LIBS} -lpam"
    AC_DEFINE(HAVE_PAM, 1, [Define if PAM support is included])

    # On Linux, sigtimedwait() is in libc; on Solaris, it's in librt.
    have_timedwait=no
    AC_CHECK_LIB(c, sigtimedwait, [have_timedwait=yes])
    if test "$have_timedwait" = no ; then
      AC_CHECK_LIB(rt, sigtimedwait, [AUTH_LIBS="${AUTH_LIBS} -lrt"])
    fi

    AC_MSG_CHECKING(how to call pam_strerror)
    AC_CACHE_VAL(ac_cv_pam_strerror_args,
     [AC_TRY_COMPILE([#include <stdio.h>
                      #include <stdlib.h>
                      #include <security/pam_appl.h>],
                     [pam_handle_t *pamh = 0;
                      char *s = pam_strerror(pamh, PAM_SUCCESS);],
                     [ac_pam_strerror_args=2],
                     [AC_TRY_COMPILE([#include <stdio.h>
                                      #include <stdlib.h>
                                      #include <security/pam_appl.h>],
                                     [char *s =
                                       pam_strerror(PAM_SUCCESS);],
                                     [ac_pam_strerror_args=1],
                                     [ac_pam_strerror_args=0])])
      ac_cv_pam_strerror_args=$ac_pam_strerror_args])
    ac_pam_strerror_args=$ac_cv_pam_strerror_args
    if test "$ac_pam_strerror_args" = 1 ; then
      AC_MSG_RESULT(one argument)
    elif test "$ac_pam_strerror_args" = 2 ; then
      AC_DEFINE(PAM_STRERROR_TWO_ARGS, 1, [Define if pam_strerror takes two arguments])
      AC_MSG_RESULT(two arguments)
    else
      AC_MSG_RESULT(unknown)
    fi
 
fi

AM_CONDITIONAL(HAVE_PAM, test x$have_pam = xyes)
AC_SUBST(HAVE_PAM)
AC_SUBST(AUTH_LIBS)

AC_CHECK_HEADER(security/pam_modutil.h, [AC_DEFINE(HAVE_PAM_MODUTIL_H, [], "Have pam_modutil.h")])
AC_CHECK_HEADER(security/pam_ext.h, [AC_DEFINE(HAVE_PAM_EXT_H, [], "Have pam_ext.h")])
AC_CHECK_LIB(pam, pam_vsyslog, [AC_DEFINE(HAVE_PAM_VSYSLOG, [], "Have pam_vsyslog")])

AC_ARG_WITH(pam-module-dir, [  --with-pam-module-dir=[dirname]  directory to install PAM security module])
if ! test -z "$with_pam_module_dir"; then
    PAM_MODULE_DIR=$with_pam_module_dir
else
    PAM_MODULE_DIR="/lib/security"
fi

AC_SUBST(PAM_MODULE_DIR)

OBATA Akio's avatar
OBATA Akio committed
398
AC_ARG_WITH(os-type,     [  --with-os-type=<os>        distribution or OS (redhat/suse/gentoo/pardus/solaris/netbsd)])
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

#### Check our operating system (distro-tweaks required)
if test "z$with_os_type" = "z"; then
	AC_CHECK_FILE(/etc/redhat-release,distro_type="redhat")
	AC_CHECK_FILE(/etc/SuSE-release,distro_type="suse")
	AC_CHECK_FILE(/etc/gentoo-release,distro_type="gentoo")
	AC_CHECK_FILE(/etc/pardus-release,distro_type="pardus")
	if test "z$distro_type" = "z"; then
		echo "Linux distribution autodetection failed, specify the distribution to target using --with-os-type="
	else
		operating_system=`echo ${distro_type} | tr '[[:upper:]]' '[[:lower:]]' `
	fi
fi

#### Sort out OS (distro-tweaks required)
if test x$with_os_type = x; then
    if test x$operating_system = xredhat ; then
        with_os_type=redhat
    elif test x$operating_system = xsuse ; then
        with_os_type=suse
    elif test x$operating_system = xgentoo ; then
        with_os_type=gentoo
    elif test x$operating_system = xpardus ; then
        with_os_type=pardus
    elif test x$operating_system = xsolaris ; then
	with_os_type=solaris
425 426
    elif test x$operating_system = xfreebsd ; then
	with_os_type=freebsd
OBATA Akio's avatar
OBATA Akio committed
427 428
    elif test x$operating_system = xnetbsd ; then
	with_os_type=netbsd
429
    else
OBATA Akio's avatar
OBATA Akio committed
430 431 432 433 434 435 436 437
	case "$host_os" in
	  *netbsd*)
		with_os_type=netbsd
		;;
	  *)
		with_os_type=unknown
		::
	esac
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
    fi
fi

# (distro-tweaks required)
AM_CONDITIONAL(OS_TYPE_UNKNOWN, test x$with_os_type = xunknown, [Running on unknown OS])
AM_CONDITIONAL(OS_TYPE_RED_HAT, test x$with_os_type = xredhat, [Running on Red Hat OS'es])
AM_CONDITIONAL(OS_TYPE_SUSE, test x$with_os_type = xsuse, [Running on SUSE OS'es])
AM_CONDITIONAL(OS_TYPE_GENTOO, test x$with_os_type = xgentoo, [Running on Gentoo OS'es])
AM_CONDITIONAL(OS_TYPE_PARDUS, test x$with_os_type = xpardus, [Running on Pardus OS'es])
AM_CONDITIONAL(OS_TYPE_SOLARIS, test x$with_os_type = xsolaris, [Running os Solaris OS'es])
AM_CONDITIONAL(OS_TYPE_FREEBSD, test x$with_os_type = xfreebsd, [Running on FreeBSD OS'es])

AC_ARG_WITH(pam-include, [  --with-pam-include=<file>  pam file to include])

#### Set up pam file to include (distro-tweaks required)
if ! test -z "$with_pam_include"; then
   PAM_FILE_INCLUDE_AUTH=$with_pam_include
   PAM_FILE_INCLUDE_ACCOUNT=$with_pam_include
   PAM_FILE_INCLUDE_PASSWORD=$with_pam_include
   PAM_FILE_INCLUDE_SESSION=$with_pam_include
elif test x$with_os_type = xredhat -o x$with_os_type = xgentoo -o x$with_os_type = xpardus ; then
   PAM_FILE_INCLUDE_AUTH=system-auth
   PAM_FILE_INCLUDE_ACCOUNT=system-auth
   PAM_FILE_INCLUDE_PASSWORD=system-auth
   PAM_FILE_INCLUDE_SESSION=system-auth
elif test x$with_os_type = xsuse -o x$with_os_type = xsolaris ; then
   PAM_FILE_INCLUDE_AUTH=common-auth
   PAM_FILE_INCLUDE_ACCOUNT=common-account
   PAM_FILE_INCLUDE_PASSWORD=common-password
   PAM_FILE_INCLUDE_SESSION=common-session
OBATA Akio's avatar
OBATA Akio committed
468
elif test x$with_os_type = xfreebsd -o x$with_os_type = xnetbsd; then
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
    PAM_FILE_INCLUDE_AUTH=system
    PAM_FILE_INCLUDE_ACCOUNT=system
    PAM_FILE_INCLUDE_PASSWORD=system
    PAM_FILE_INCLUDE_SESSION=system
else
   PAM_FILE_INCLUDE_AUTH=system-auth
   PAM_FILE_INCLUDE_ACCOUNT=system-auth
   PAM_FILE_INCLUDE_PASSWORD=system-auth
   PAM_FILE_INCLUDE_SESSION=system-auth
fi

AC_SUBST(PAM_FILE_INCLUDE_AUTH)
AC_SUBST(PAM_FILE_INCLUDE_ACCOUNT)
AC_SUBST(PAM_FILE_INCLUDE_PASSWORD)
AC_SUBST(PAM_FILE_INCLUDE_SESSION)
AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_AUTH, "$PAM_FILE_INCLUDE_AUTH", [pam file auth])
AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_ACCOUNT, "$PAM_FILE_INCLUDE_ACCOUNT", [pam file account])
AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_PASSWORD, "$PAM_FILE_INCLUDE_PASSWORD", [pam file password])
AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_SESSION, "$PAM_FILE_INCLUDE_SESSION", [pam file session])

dnl ---------------------------------------------------------------------------
490
dnl - check OS
491 492 493 494 495 496 497 498 499 500
dnl ---------------------------------------------------------------------------
case "$host_os" in
  *linux*)
	;;
  *solaris*)
	AC_DEFINE([HAVE_SOLARIS], 1, [Is this a Solaris system?])
	;;
  *freebsd*)
  	AC_DEFINE([HAVE_FREEBSD], 1, [Is this a FreeBSD system?])
	;;
OBATA Akio's avatar
OBATA Akio committed
501 502 503
  *netbsd*)
	AC_DEFINE([HAVE_NETBSD], 1, [Is this an NetBSD system?])
	;;
504 505 506
  *openbsd*)
	AC_DEFINE([HAVE_OPENBSD], 1, [Is this an OpenBSD system?])
	;;
507 508
esac

509
GOBJECT_INTROSPECTION_CHECK([0.6.2])
510

Michael Biebl's avatar
Michael Biebl committed
511 512
AC_ARG_ENABLE([examples],
              AS_HELP_STRING([--enable-examples], [Build the example programs]),,
513
              [enable_examples=yes])
Michael Biebl's avatar
Michael Biebl committed
514 515

AM_CONDITIONAL(BUILD_EXAMPLES, test "x$enable_examples" = "xyes")
516

David Zeuthen's avatar
David Zeuthen committed
517
# ********************
518
# Internationalization
David Zeuthen's avatar
David Zeuthen committed
519 520 521
# ********************

IT_PROG_INTLTOOL([0.40.0])
522
GETTEXT_PACKAGE=polkit-1
David Zeuthen's avatar
David Zeuthen committed
523 524 525 526
AC_SUBST([GETTEXT_PACKAGE])
AM_GLIB_GNU_GETTEXT
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])

527 528 529 530 531
AC_ARG_VAR([SUID_CFLAGS],
           [CFLAGS used for binaries which are usually with the suid bit])
AC_ARG_VAR([SUID_LDFLAGS],
           [LDFLAGS used for binaries which are usually with the suid bit])

David Zeuthen's avatar
David Zeuthen committed
532 533
AC_OUTPUT([
Makefile
David Zeuthen's avatar
David Zeuthen committed
534
actions/Makefile
David Zeuthen's avatar
David Zeuthen committed
535
data/Makefile
536
data/polkit-1
David Zeuthen's avatar
David Zeuthen committed
537 538
data/polkit-gobject-1.pc
data/polkit-agent-1.pc
David Zeuthen's avatar
David Zeuthen committed
539 540
src/Makefile
src/polkit/Makefile
David Zeuthen's avatar
David Zeuthen committed
541
src/polkitbackend/Makefile
David Zeuthen's avatar
David Zeuthen committed
542
src/polkitagent/Makefile
David Zeuthen's avatar
David Zeuthen committed
543
src/programs/Makefile
544
src/examples/Makefile
David Zeuthen's avatar
David Zeuthen committed
545
docs/version.xml
546
docs/extensiondir.xml
David Zeuthen's avatar
David Zeuthen committed
547
docs/Makefile
David Zeuthen's avatar
David Zeuthen committed
548
docs/polkit/Makefile
David Zeuthen's avatar
David Zeuthen committed
549 550
docs/man/Makefile
po/Makefile.in
551 552 553
test/Makefile
test/polkit/Makefile
test/polkitbackend/Makefile
David Zeuthen's avatar
David Zeuthen committed
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
])

dnl ==========================================================================
echo "
                  polkit $VERSION
                =================

        prefix:                     ${prefix}
        libdir:                     ${libdir}
        libexecdir:                 ${libexecdir}
        bindir:                     ${bindir}
        sbindir:                    ${sbindir}
        datadir:                    ${datadir}
        sysconfdir:                 ${sysconfdir}
        localstatedir:              ${localstatedir}
        docdir:                     ${docdir}

        compiler:                   ${CC}
        cflags:                     ${CFLAGS}
        cppflags:                   ${CPPFLAGS}
        xsltproc:                   ${XSLTPROC}
575
	introspection:		    ${found_introspection}
David Zeuthen's avatar
David Zeuthen committed
576

577
        Distribution/OS:            ${with_os_type}
578 579
        Authentication framework:   ${POLKIT_AUTHFW}
        Session tracking:           ${SESSION_TRACKING}
580
        PAM support:                ${have_pam}
581 582
        systemdsystemunitdir:       ${systemdsystemunitdir}
        polkitd user:               ${POLKITD_USER}"
583 584 585 586 587 588 589 590 591

if test "$have_pam" = yes ; then
echo "
        PAM file auth:              ${PAM_FILE_INCLUDE_AUTH}
        PAM file account:           ${PAM_FILE_INCLUDE_ACCOUNT}
        PAM file password:          ${PAM_FILE_INCLUDE_PASSWORD}
        PAM file session:           ${PAM_FILE_INCLUDE_SESSION}"
fi
echo "
David Zeuthen's avatar
David Zeuthen committed
592 593 594
        Maintainer mode:            ${USE_MAINTAINER_MODE}
        Building api docs:          ${enable_gtk_doc}
        Building man pages:         ${enable_man_pages}
595
        Building examples:          ${enable_examples}
596

David Zeuthen's avatar
David Zeuthen committed
597
"
598

599
echo "NOTE: The file ${prefix}/lib/polkit-1/polkit-agent-helper-1 must be owned"
600
echo "      by root and have mode 4755 (setuid root binary)"
601 602
echo

603 604 605 606
echo "NOTE: The file ${bindir}/pkexec must be owned by root and"
echo "      have mode 4755 (setuid root binary)"
echo

607 608
echo "NOTE: The directory ${sysconfdir}/polkit-1/rules.d must be owned"
echo "      by user '$POLKITD_USER' and have mode 700"
609 610
echo

611 612
echo "NOTE: The directory ${datadir}/polkit-1/rules.d must be owned"
echo "      by user '$POLKITD_USER' and have mode 700"
613
echo