Commit 3df61e0e authored by David Zeuthen's avatar David Zeuthen

get rid of AS_AC_EXPAND and use autoconf docdir

Inspired by recent patches to both HAL and ConsoleKit from Michael
Biebl <mbiebl@gmail.com>.
parent 6477d092
dnl as-ac-expand.m4 0.1.0
dnl autostars m4 macro for expanding directories using configure's prefix
dnl thomas@apestaart.org
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl
dnl example
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var"="x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])
dnl GTK_DOC_CHECK borrowed from cairo, thanks!
dnl Usage:
......
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_PREREQ(2.59c)
AC_INIT(PolicyKit, 0.3, david@fubar.dk)
AM_INIT_AUTOMAKE(PolicyKit, 0.3)
AM_CONFIG_HEADER(config.h)
......@@ -157,24 +157,6 @@ fi
AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes)
AC_MSG_RESULT(yes)
AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
AS_AC_EXPAND(DATADIR, $datadir)
AS_AC_EXPAND(BINDIR, $bindir)
AS_AC_EXPAND(SBINDIR, $sbindir)
AS_AC_EXPAND(LIBDIR, $libdir)
AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
# documentation target
AC_ARG_WITH(doc-dir, [ --with-doc-dir=[dirname] directory to install documentation])
if ! test -z "$with_doc_dir"; then
DOCDIR=$with_doc_dir
else
DOCDIR="$DATADIR/doc/PolicyKit-$VERSION"
fi
AC_SUBST(DOCDIR)
if test "x$GCC" = "xyes"; then
LDFLAGS="-Wl,--as-needed $LDFLAGS"
fi
......@@ -191,8 +173,6 @@ doc/api/libpolkit/version.xml
doc/spec/Makefile
doc/spec/polkit-spec.xml.in
doc/man/Makefile
doc/man/polkit-check-caller.1
doc/man/polkit-check-session.1
])
dnl ==========================================================================
......@@ -201,14 +181,14 @@ echo "
=================
prefix: ${prefix}
libdir: ${LIBDIR}
libexecdir: ${LIBEXECDIR}
bindir: ${BINDIR}
sbindir: ${SBINDIR}
datadir: ${DATADIR}
sysconfdir: ${SYSCONFDIR}
localstatedir: ${LOCALSTATEDIR}
docdir: ${DOCDIR}
libdir: ${libdir}
libexecdir: ${libexecdir}
bindir: ${bindir}
sbindir: ${sbindir}
datadir: ${datadir}
sysconfdir: ${sysconfdir}
localstatedir: ${localstatedir}
docdir: ${docdir}
compiler: ${CC}
cflags: ${CFLAGS}
......
......@@ -3,11 +3,19 @@ if MAN_PAGES_ENABLED
MAN_IN_FILES = polkit-check-caller.1.in polkit-check-session.1.in
man_MANS = polkit-check-caller.1 polkit-check-session.1
man_MANS = $(MAN_IN_FILES:.in=)
endif # MAN_PAGES_ENABLED
EXTRA_DIST=$(man_MANS) $(MAN_IN_FILES)
clean-local:
rm -f *~
rm -f *~ *.1
%: %.in Makefile
$(edit) $< >$@
edit = sed \
-e 's|@docdir[@]|$(docdir)|g' \
-e 's|@sbindir[@]|$(sbindir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g'
......@@ -16,7 +16,7 @@ polkit-check-caller \- check access
can access a given resource in a given way. For more information about
the big picture refer to the \fIPolicyKit spec\fP which can be found
in
.I "/usr/share/doc/PolicyKit-@VERSION@/spec/polkit-spec.html"
.I "@docdir@/spec/polkit-spec.html"
depending on the distribution.
.SH OPTIONS
......
......@@ -16,7 +16,7 @@ polkit-check-session \- check access
can access a given resource in a given way. For more information about
the big picture refer to the \fIPolicyKit spec\fP which can be found
in
.I "/usr/share/doc/PolicyKit-@VERSION@/spec/polkit-spec.html"
.I "@docdir@/spec/polkit-spec.html"
depending on the distribution.
.SH OPTIONS
......
......@@ -7,7 +7,7 @@ INCLUDES = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DPACKAGE_BIN_DIR=\""$(bindir)"\" \
-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
@GLIB_CFLAGS@ @DBUS_CFLAGS@
......
......@@ -120,10 +120,9 @@ libpolkit_can_session_access_resource (PolKitContext *pk_context,
*
* Determine if a given caller can access a given resource in a given way.
*
* Returns: TRUE if, and only if, the given caller can access the given interface
* of the given resource in the given way.
* Returns: TRUE if, and only if, the given caller can access the
* given resource in the given way.
*/
gboolean
libpolkit_can_caller_access_resource (PolKitContext *pk_context,
PolKitPrivilege *privilege,
......
......@@ -7,7 +7,7 @@ INCLUDES = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DPACKAGE_BIN_DIR=\""$(bindir)"\" \
-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
@GLIB_CFLAGS@ \
@DBUS_CFLAGS@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment