AC_PREREQ(2.52) dnl ============================================================== dnl Process this file with autoconf to produce a configure script. dnl ============================================================== AC_INIT(system-tools-backends,2.10.2) AC_CONFIG_AUX_DIR(.) AC_CONFIG_HEADERS(config.h) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AC_PROG_LIBTOOL IT_PROG_INTLTOOL([0.40.0]) DBUS_REQUIRED=1.1.2 DBUS_GLIB_REQUIRED=0.74 GLIB_REQUIRED=2.4.0 POLICYKIT_REQUIRED=0.94 GIO_REQUIRED=2.15.2 dnl get prefix in $prefix, yes, this sucks if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix; fi # This macro expands DIR and assigns it to RET. # If DIR is NONE, then it's replaced by DEFAULT. # # Based on AC_DEFINE_DIR # # Examples: # # AC_EXPAND(prefix, "/usr/local", expanded_prefix) AC_DEFUN([AC_EXPAND], [ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' ac_expand=[$]$1 test "x$ac_expand" = xNONE && ac_expand="[$]$2" ac_expand=`eval echo [$]ac_expand` $3=`eval echo [$]ac_expand` ]) dnl get expanded paths AC_EXPAND(datadir,"NONE",EXPANDED_DATADIR) AC_SUBST(EXPANDED_DATADIR) AC_EXPAND(sysconfdir,"NONE",EXPANDED_SYSCONFDIR) AC_SUBST(EXPANDED_SYSCONFDIR) AC_EXPAND(sbindir,"NONE",sbindir) AC_SUBST(sbindir) AC_EXPAND(localstatedir, "NONE", localstatedir) AC_DEFINE_UNQUOTED(LOCALSTATEDIR, "${localstatedir}", [localstatedir]) AC_SUBST(localstatedir) dnl scriptsdir & filesdir scriptsdir="${EXPANDED_DATADIR}/system-tools-backends-2.0/scripts" filesdir="${EXPANDED_DATADIR}/system-tools-backends-2.0/files" modulesdir="${EXPANDED_DATADIR}/system-tools-backends-2.0/modules" AC_SUBST(scriptsdir) AC_SUBST(filesdir) AC_SUBST(modulesdir) dnl DBus services dir DBUS_SERVICES_DIR="${prefix}/share/dbus-1/system-services" AC_SUBST(DBUS_SERVICES_DIR) dnl PolicyKit policy files dir POLKIT_POLICY_DIR="${datadir}/polkit-1/actions/" AC_SUBST(POLKIT_POLICY_DIR) dnl where is DBus system.d directory? AC_ARG_WITH(dbus_sys, [ --with-dbus-sys= where D-BUS system.d directory is]) if ! test -z "$with_dbus_sys" ; then DBUS_SYSTEMD_DIR="$with_dbus_sys" else DBUS_SYSTEMD_DIR="${EXPANDED_SYSCONFDIR}/dbus-1/system.d" fi AC_SUBST(DBUS_SYSTEMD_DIR) dnl where is Net::DBus? AC_ARG_WITH(net_dbus, [ --with-net-dbus= where Net::DBus perl library is (/usr/lib/perl)]) if ! test -z "$with_net_dbus" ; then netdbusdir="$with_net_dbus" else dnl hack to avoid an empty path in netdbusdir netdbusdir=$modulesdir fi AC_SUBST(netdbusdir) dnl system-tools-backends admin group AC_ARG_WITH(stb_group,[ --with-stb-group= Group for system-tools-backends (stb-admin)]) if test -z "$with_stb_group" ; then STB_GROUP=stb-admin else STB_GROUP=$with_stb_group fi AC_SUBST(STB_GROUP) dnl check for perl AC_PATH_PROG(PERL_PATH, perl) if test -z "$PERL_PATH"; then AC_MSG_ERROR([perl not found, required for SystemToolsBackends]) fi dnl check for DBus PKG_CHECK_MODULES([DBUS], [dbus-1 >= $DBUS_REQUIRED]) AC_SUBST([DBUS_CFLAGS]) AC_SUBST([DBUS_LIBS]) dnl check for the dispatcher deps PKG_CHECK_MODULES(DISPATCHER, [ polkit-gobject-1 >= $POLICYKIT_REQUIRED dbus-glib-1 >= $DBUS_GLIB_REQUIRED glib-2.0 >= $GLIB_REQUIRED ]) DISPATCHER_CFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE $DISPATCHER_CFLAGS" AC_SUBST(DISPATCHER_LIBS) AC_SUBST(DISPATCHER_CFLAGS) dnl check for Gio PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED, have_gio=yes, have_gio=no) if test "$have_gio" = "yes"; then AC_DEFINE(HAVE_GIO, [1], [whether Gio was found]) fi AC_SUBST(GIO_LIBS) AC_SUBST(GIO_CFLAGS) AM_CONDITIONAL(HAVE_GIO, test x$have_gio = xyes) dnl check for Net::DBus AC_MSG_CHECKING([for Net::DBus]) if `$PERL_PATH -e "use lib '$netdbusdir'; require Net::DBus" 2>/dev/null`; then AC_MSG_RESULT([ok]) internalnetdbus=no else AC_MSG_RESULT([missing, going for internal copy]) netdbusdir="${modulesdir}/lib/perl" AC_SUBST(netdbusdir) internalnetdbus=yes fi AM_CONDITIONAL(INTERNAL_NET_DBUS, test x$internalnetdbus = xyes) GETTEXT_PACKAGE=system-tools-backends AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) AC_OUTPUT([ Makefile system-tools-backends-2.0.pc dispatcher/Makefile files/Makefile Init/Makefile Network/Makefile Shares/Makefile Time/Makefile Users/Makefile Utils/Makefile SystemToolsBackends.pl test-backends services/Makefile services/org.freedesktop.SystemToolsBackends.GroupConfig2.service services/org.freedesktop.SystemToolsBackends.GroupsConfig2.service services/org.freedesktop.SystemToolsBackends.HostsConfig.service services/org.freedesktop.SystemToolsBackends.IfacesConfig.service services/org.freedesktop.SystemToolsBackends.NFSConfig.service services/org.freedesktop.SystemToolsBackends.NTPConfig.service services/org.freedesktop.SystemToolsBackends.Platform.service services/org.freedesktop.SystemToolsBackends.SelfConfig2.service services/org.freedesktop.SystemToolsBackends.ServiceConfig2.service services/org.freedesktop.SystemToolsBackends.ServicesConfig.service services/org.freedesktop.SystemToolsBackends.SMBConfig.service services/org.freedesktop.SystemToolsBackends.TimeConfig.service services/org.freedesktop.SystemToolsBackends.UserConfig2.service services/org.freedesktop.SystemToolsBackends.UsersConfig2.service org.freedesktop.SystemToolsBackends.service Net-DBus/Makefile Net-DBus/lib/Makefile Net-DBus/lib/Net/Makefile Net-DBus/lib/Net/DBus/Makefile Net-DBus/lib/Net/DBus/Binding/Makefile Net-DBus/lib/Net/DBus/Binding/Message/Makefile po/Makefile.in ]) echo " Configuration (BACKENDS): Prefix : ${prefix} The backends will be installed in : ${scriptsdir} The files will be installed in : ${filesdir} Using internal copy of Net::Dbus : ${internalnetdbus} File notification : ${have_gio} DBus system.d directory : ${DBUS_SYSTEMD_DIR} System tools backends admin group : ${STB_GROUP} "