* bin/Makefile.am (edit): Substitute pkgdatadir, not datadir.
* lib/Makefile.am (edit): Likewise.
* lib/autom4te.in (Autoconf-without-aclocal-m4, Autotest, M4sh)
(M4sugar): Use @pkgdatadir@, not @datadir@.
* bin/autoheader.in ($datadir): Likewise.
* bin/autom4te.in ($datadir): Likewise.
* bin/autoreconf.in ($datadir): Likewise.
* bin/autoscan.in ($datadir): Likewise.
* bin/autoupdate.in ($datadir): Likewise.
* bin/ifnames.in ($datadir): Likewise.
* doc/autoconf.texi (Installation Directory Variables): Update
example to be consistent; focus on $(bindir) as an autoconf
variable, and mention that $(pkgdatadir) comes from automake.
Reported by Reuben Thomas.
Signed-off-by: Eric Blake <ebb9@byu.net>
+2009-02-24 Eric Blake <ebb9@byu.net>
+
+ Use pkgdatadir consistently.
+ * bin/Makefile.am (edit): Substitute pkgdatadir, not datadir.
+ * lib/Makefile.am (edit): Likewise.
+ * lib/autom4te.in (Autoconf-without-aclocal-m4, Autotest, M4sh)
+ (M4sugar): Use @pkgdatadir@, not @datadir@.
+ * bin/autoheader.in ($datadir): Likewise.
+ * bin/autom4te.in ($datadir): Likewise.
+ * bin/autoreconf.in ($datadir): Likewise.
+ * bin/autoscan.in ($datadir): Likewise.
+ * bin/autoupdate.in ($datadir): Likewise.
+ * bin/ifnames.in ($datadir): Likewise.
+ * doc/autoconf.texi (Installation Directory Variables): Update
+ example to be consistent; focus on $(bindir) as an autoconf
+ variable, and mention that $(pkgdatadir) comes from automake.
+ Reported by Reuben Thomas.
+
2009-02-19 Eric Blake <ebb9@byu.net>
Use m4_translit more efficiently in AS_ESCAPE.
# Make Autoconf commands.
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+# 2009 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-e 's|@SHELL[@]|$(SHELL)|g' \
-e 's|@PERL[@]|$(PERL)|g' \
-e 's|@bindir[@]|$(bindir)|g' \
- -e 's|@datadir[@]|$(pkgdatadir)|g' \
+ -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
-e 's|@prefix[@]|$(prefix)|g' \
-e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
-e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
BEGIN
{
- my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
- unshift @INC, "$datadir";
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ unshift @INC, "$pkgdatadir";
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
BEGIN
{
- my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
- unshift @INC, $datadir;
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
use strict;
# Data directory.
-my $datadir = $ENV{'AC_MACRODIR'} || '@datadir@';
+my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
# $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
my %language;
## -------------- ##
mktmpdir ('am4t');
-load_configuration ($ENV{'AUTOM4TE_CFG'} || "$datadir/autom4te.cfg");
+load_configuration ($ENV{'AUTOM4TE_CFG'} || "$pkgdatadir/autom4te.cfg");
load_configuration ("$ENV{'HOME'}/.autom4te.cfg")
if exists $ENV{'HOME'} && -f "$ENV{'HOME'}/.autom4te.cfg";
load_configuration (".autom4te.cfg")
BEGIN
{
- my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
- unshift @INC, $datadir;
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
BEGIN
{
- my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
- unshift @INC, $datadir;
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
my $autoconf = "$autom4te --language=autoconf";
my @prepend_include;
-my @include = ('@datadir@');
+my @include = ('@pkgdatadir@');
# $help
# -----
BEGIN
{
- my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
- unshift @INC, $datadir;
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
my $autoconf = "$autom4te --language=autoconf";
# We need to find m4sugar.
my @prepend_include;
-my @include = ('@datadir@');
+my @include = ('@pkgdatadir@');
my $force = 0;
# m4.
my $m4 = $ENV{"M4"} || '@M4@';
BEGIN
{
- my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
- unshift @INC, $datadir;
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+ unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
@code{CPPFLAGS} (@code{AM_CPPFLAGS} if you are also using Automake).
Similarly, you should not rely on @code{AC_CONFIG_FILES} to replace
-@code{datadir} and friends in your shell scripts and other files; instead,
+@code{bindir} and friends in your shell scripts and other files; instead,
let @command{make} manage their replacement. For instance Autoconf
ships templates of its shell scripts ending with @samp{.in}, and uses a
makefile snippet similar to the following to build scripts like
@example
@group
edit = sed \
- -e 's|@@datadir[@@]|$(pkgdatadir)|g' \
+ -e 's|@@bindir[@@]|$(bindir)|g' \
+ -e 's|@@pkgdatadir[@@]|$(pkgdatadir)|g' \
-e 's|@@prefix[@@]|$(prefix)|g'
@end group
@group
autoheader autom4te: Makefile
rm -f $@@ $@@.tmp
- $(edit) '$(srcdir)/$@@.in' >$@@.tmp
+ srcdir=''; \
+ test -f ./$@@.in || srcdir=$(srcdir)/; \
+ $(edit) $$@{srcdir@}$@@.in >$@@.tmp
chmod +x $@@.tmp
chmod a-w $@@.tmp
mv $@@.tmp $@@
Some details are noteworthy:
@table @asis
-@item @samp{@@datadir[@@]}
+@item @samp{@@bindir[@@]}
The brackets prevent @command{configure} from replacing
-@samp{@@datadir@@} in the Sed expression itself.
+@samp{@@bindir@@} in the Sed expression itself.
Brackets are preferable to a backslash here, since
Posix says @samp{\@@} is not portable.
-@item @samp{$(pkgdatadir)}
-Don't use @samp{@@pkgdatadir@@}! Use the matching makefile variable
+@item @samp{$(bindir)}
+Don't use @samp{@@bindir@@}! Use the matching makefile variable
instead.
+@item @samp{$(pkgdatadir)}
+The example takes advantage of the variable @samp{$(pkgdatadir)}
+provided by Automake; it is equivalent to @samp{$(datadir)/$(PACKAGE)}.
+
@item @samp{/}
Don't use @samp{/} in the Sed expressions that replace file names since
most likely the
-variables you use, such as @samp{$(pkgdatadir)}, contain @samp{/}.
+variables you use, such as @samp{$(bindir)}, contain @samp{/}.
Use a shell metacharacter instead, such as @samp{|}.
@item special characters
# Make Autoconf-related libraries.
-# Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software
+# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-e 's|@SHELL[@]|$(SHELL)|g' \
-e 's|@PERL[@]|$(PERL)|g' \
-e 's|@bindir[@]|$(bindir)|g' \
- -e 's|@datadir[@]|$(pkgdatadir)|g' \
+ -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
-e 's|@prefix[@]|$(prefix)|g' \
-e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
-e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
# Definition of Autom4te option sets. -*- Makefile -*-
#
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
-# Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
#
# This file is part of GNU Autoconf.
#
# This intermediate language is used by aclocal to build aclocal.m4.
begin-language: "Autoconf-without-aclocal-m4"
-args: --prepend-include '@datadir@'
+args: --prepend-include '@pkgdatadir@'
args: --cache=autom4te.cache
args: autoconf/autoconf.m4f
args: acsite.m4?
## -------- ##
begin-language: "Autotest"
-args: --prepend-include '@datadir@'
+args: --prepend-include '@pkgdatadir@'
args: autotest/autotest.m4f
args: package.m4?
args: local.at?
## ---- ##
begin-language: "M4sh"
-args: --prepend-include '@datadir@'
+args: --prepend-include '@pkgdatadir@'
args: m4sugar/m4sh.m4f
args: --mode 777
args: --language M4sugar
## ------- ##
begin-language: "M4sugar"
-args: --prepend-include '@datadir@'
+args: --prepend-include '@pkgdatadir@'
args: m4sugar/m4sugar.m4f
args: --warnings syntax
end-language: "M4sugar"