hal: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Thu Mar 22 14:27:34 PDT 2007
acinclude.m4 | 97 -----------------------------------------------------------
configure.in | 13 +------
2 files changed, 3 insertions(+), 107 deletions(-)
New commits:
diff-tree 58917de0ae967c0fb7c52513521090de18599c24 (from 5964f3f626d746fa832b65437423b75c315f29c5)
Author: Andreas Hanke <andreas.hanke at gmx-topmail.de>
Date: Thu Mar 22 17:27:23 2007 -0400
really fix path expansion in hal-info
this patch for hal-info really fixes configure path expansion in
hal-info by simply removing it, because it plain and simple doesn't
work. A ./configure invocation without arguments and with autoconf >=
2.60 currently prints the following:
hal-info 20070313
========================
prefix: /usr/local
datadir: ${prefix}/share
sysconfdir: /usr/local/etc
hardware recall data: yes
video suspend data: yes
As you can easily see, sysconfdir is expanded, but datadir is not.
That's because AS_AC_EXPAND messes around with autoconf internals that
have changed in autoconf 2.60.
It pretends to expand things, but doesn't actually do it. The proper fix
for that is to stop messing around with autoconf internals, i.e. to not
use AS_AC_EXPAND any more.
With the attached patch, configure prints all variables unexpanded and
as derived from each other, which is the truth. With autoconf 2.60 it
looks like this:
hal-info 20070313
========================
prefix: /usr/local
datarootdir: ${prefix}/share
datadir: ${datarootdir}
sysconfdir: ${prefix}/etc
hardware recall data: yes
video suspend data: yes
With autoconf 2.59 it looks a little different because it does not have
datarootdir yet:
hal-info 20070313
========================
prefix: /usr/local
datarootdir: unused
datadir: ${prefix}/share
sysconfdir: ${prefix}/etc
hardware recall data: yes
video suspend data: yes
There is no need to worry about unexpanded variables in output files
because hal-info does not have any. It has only Makefiles as output
files and in Makefiles, variables don't need to be expanded. In fact
they must not be expanded because that would prevent users from
redefining them while running make. This is the reason why stock
autoconf without AS_AC_EXPAND-style hacks does not offer any way to
expand them. If it had any output files where variables have to be
expanded, dedicated make rules would have to be written for them. See:
http://www.gnu.org/software/autoconf/manual/html_node/Installation-Directory-Variables.html#Installation-Directory-Variables
http://www.gnu.org/software/autoconf/manual/html_node/Defining-Directories.html
Other than the hal patch I submitted via bugzilla some time ago, which
was just a sample that somehow went in, this one is a distcheck tested
patch that can be applied as-is. It also removes two incorrect and
superfluous AC_SUBST usages as well as the GTK_DOC_CHECK which hal-info
never actually used at all.
hal itself needs more changes to entirely get rid of AS_AC_EXPAND and
comply with autotools coding rules. The good news is that in *most*
places it already does the right thing, but not everywhere. I can work
on a patch for that as well, if desired.
diff --git a/acinclude.m4 b/acinclude.m4
index 81ee816..e69de29 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,97 +0,0 @@
-
-dnl as-ac-expand.m4 0.1.0
-dnl autostars m4 macro for expanding directories using configure's prefix
-dnl thomas at 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 GTK_DOC_CHECK([minimum-gtk-doc-version])
-AC_DEFUN([GTK_DOC_CHECK],
-[
- AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
- AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
- dnl for overriding the documentation installation directory
- AC_ARG_WITH(html-dir,
- AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
- [with_html_dir='${datadir}/gtk-doc/html'])
- HTML_DIR="$with_html_dir"
- AC_SUBST(HTML_DIR)
-
- dnl enable/disable documentation building
- AC_ARG_ENABLE(gtk-doc,
- AC_HELP_STRING([--enable-gtk-doc],
- [use gtk-doc to build documentation [default=yes]]),,
- enable_gtk_doc=yes)
-
- have_gtk_doc=no
- if test x$enable_gtk_doc = xyes; then
- if test -z "$PKG_CONFIG"; then
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- fi
- if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
- have_gtk_doc=yes
- fi
-
- dnl do we want to do a version check?
-ifelse([$1],[],,
- [gtk_doc_min_version=$1
- if test "$have_gtk_doc" = yes; then
- AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
- if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- have_gtk_doc=no
- fi
- fi
-])
- if test "$have_gtk_doc" != yes; then
- enable_gtk_doc=no
- fi
- fi
-
- AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
- AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
-])
diff --git a/configure.in b/configure.in
index d57f37a..a064ed9 100644
--- a/configure.in
+++ b/configure.in
@@ -12,20 +12,12 @@ dnl - Should we ship the recall data
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(recall, [ --enable-recall include recall data],enable_recall=$enableval,enable_recall=yes)
AM_CONDITIONAL(BUILD_RECALL, test x$enable_recall == xyes)
-AC_SUBST(BUILD_RECALL, $enable_recall)
dnl ---------------------------------------------------------------------------
dnl - Should we ship the video suspend data
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(video, [ --enable-video include video suspend data],enable_video=$enableval,enable_video=yes)
AM_CONDITIONAL(BUILD_VIDEO, test x$enable_video == xyes)
-AC_SUBST(BUILD_VIDEO, $enable_video)
-
-dnl ---------------------------------------------------------------------------
-dnl - Make paths available for source files
-dnl ---------------------------------------------------------------------------
-AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
-AS_AC_EXPAND(DATADIR, $datadir)
AC_OUTPUT([
Makefile
@@ -46,8 +38,9 @@ echo "
========================
prefix: ${prefix}
- datadir: ${DATADIR}
- sysconfdir: ${SYSCONFDIR}
+ datarootdir: ${datarootdir:-unused}
+ datadir: ${datadir}
+ sysconfdir: ${sysconfdir}
hardware recall data: ${enable_recall}
video suspend data: ${enable_video}
"
More information about the hal-commit
mailing list