"\n"
if $verbose;
-exec {$autom4te_command[0]} @autom4te_command;
+exec {$autom4te_command[0]} @autom4te_command
+ or fatal "$autom4te_command[0]: $!\n";
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
}
update_file ("$tmp/config.hin", "$config_h_in", $force);
+exit 0;
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
{
print "$_ ", join (' ', sort keys %{$occurrence{$_}}), "\n";
}
+exit 0;
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
msg 'note', "'$to' is unchanged";
unlink ($from)
or fatal "cannot remove $from: $!";
- return
+ return;
}
if (-f "$to")
AT_CHECK(["$SHELL_N" -n $1], [], [], [ignore])])
m4_define([AT_CHECK_PERL_SYNTAX],
-[AT_CHECK([autom4te_perllibdir=$abs_top_srcdir/lib $PERL -c "$abs_top_builddir"/bin/$1],
+[AT_CHECK([autom4te_perllibdir=$abs_top_srcdir/lib $PERL -c "$abs_top_builddir/$1"],
0, [], [ignore])])
## ------------------ ##
tests/local.at \
tests/mktests.pl \
tests/atlocal.in \
- tests/wrapper.as \
+ tests/wrapper.in \
tests/statesave.m4
# Running the uninstalled scripts. Build them upon 'all', for the manpages.
CLEANFILES += \
tests/package.m4 \
- tests/wrapper.in \
$(wrappers)
-tests/wrapper.in: $(srcdir)/tests/wrapper.as $(m4sh_m4f_dependencies)
- $(MY_AUTOM4TE) --language=M4sh $(srcdir)/tests/wrapper.as -o $@
-
edit_wrapper = sed \
+ -e 's|@PERL[@]|$(PERL)|g' \
-e 's|@wrap_program[@]|$(@F)|g' \
-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
-e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
$(wrappers): tests/wrapper.in
rm -f $@ $@.tmp
input=tests/wrapper.in \
- && $(edit_wrapper) tests/wrapper.in >$@.tmp
+ && $(edit_wrapper) $(srcdir)/tests/wrapper.in >$@.tmp
chmod +x $@.tmp
chmod a-w $@.tmp
mv -f $@.tmp $@
# Specify the absolute name of the tool, as some shells don't honor PATH when
# running 'sh PROG'.
-AT_CHECK_SHELL_SYNTAX(["$abs_top_builddir/tests/autoconf"])
AT_CHECK_SHELL_SYNTAX(["$abs_top_builddir/tests/testsuite"])
# These are not built, they are in the src tree.
AT_SETUP([Syntax of the Perl scripts])
-AT_CHECK_PERL_SYNTAX([autoconf])
-AT_CHECK_PERL_SYNTAX([autoheader])
-AT_CHECK_PERL_SYNTAX([autom4te])
-AT_CHECK_PERL_SYNTAX([autoreconf])
-AT_CHECK_PERL_SYNTAX([autoscan])
-AT_CHECK_PERL_SYNTAX([autoupdate])
-AT_CHECK_PERL_SYNTAX([ifnames])
+AT_CHECK_PERL_SYNTAX([bin/autoconf])
+AT_CHECK_PERL_SYNTAX([bin/autoheader])
+AT_CHECK_PERL_SYNTAX([bin/autom4te])
+AT_CHECK_PERL_SYNTAX([bin/autoreconf])
+AT_CHECK_PERL_SYNTAX([bin/autoscan])
+AT_CHECK_PERL_SYNTAX([bin/autoupdate])
+AT_CHECK_PERL_SYNTAX([bin/ifnames])
+
+AT_CHECK_PERL_SYNTAX([tests/autoconf])
+AT_CHECK_PERL_SYNTAX([tests/autoheader])
+AT_CHECK_PERL_SYNTAX([tests/autom4te])
+AT_CHECK_PERL_SYNTAX([tests/autoreconf])
+AT_CHECK_PERL_SYNTAX([tests/autoscan])
+AT_CHECK_PERL_SYNTAX([tests/autoupdate])
+AT_CHECK_PERL_SYNTAX([tests/ifnames])
AT_CLEANUP
+++ /dev/null
-AS_INIT[]dnl -*- shell-script -*-
-# wrapper.as -- running '@wrap_program@' as if it were installed.
-# @configure_input@
-# Copyright (C) 2003-2004, 2007, 2009-2017, 2020-2023 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-testdir='@abs_top_builddir@/tests'
-PATH=$testdir$PATH_SEPARATOR$PATH
-AUTOCONF=autoconf
-AUTOHEADER=autoheader
-AUTOM4TE=autom4te
-AUTOM4TE_CFG='@abs_top_builddir@/lib/autom4te.cfg'
-autom4te_buildauxdir='@abs_top_srcdir@/build-aux'
-autom4te_perllibdir='@abs_top_srcdir@/lib'
-trailer_m4='@abs_top_srcdir@/lib/autoconf/trailer.m4'
-export AUTOCONF AUTOHEADER AUTOM4TE AUTOM4TE_CFG
-export autom4te_buildauxdir autom4te_perllibdir trailer_m4
-
-case '@wrap_program@' in
- ifnames)
- # Does not have lib files.
- exec '@abs_top_builddir@/bin/@wrap_program@' ${1+"$@"}
- ;;
- *)
- # We might need files from the build tree (frozen files), in
- # addition of src files.
- exec '@abs_top_builddir@/bin/@wrap_program@' \
- -B '@abs_top_builddir@'/lib \
- -B '@abs_top_srcdir@'/lib ${1+"$@"}
-esac
-exit 1
--- /dev/null
+#! @PERL@
+# wrapper.in -- running '@wrap_program@' as if it were installed.
+# @configure_input@
+# Copyright (C) 2003-2004, 2007, 2009-2017, 2020-2023 Free Software
+# Foundation, Inc.
+
+eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
+ if 0;
+
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use 5.006;
+use strict;
+use warnings FATAL => 'all';
+
+my $src_libdir = '@abs_top_srcdir@/lib';
+$ENV{'autom4te_perllibdir'} = $src_libdir;
+$ENV{'autom4te_buildauxdir'} = '@abs_top_srcdir@/build-aux';
+$ENV{'trailer_m4'} = '@abs_top_srcdir@/lib/autoconf/trailer.m4';
+
+my $wrapped_program = '@wrap_program@';
+my $abs_wrapped_program = '@abs_top_builddir@/bin/@wrap_program@';
+my $build_testdir = '@abs_top_builddir@/tests';
+my $build_libdir = '@abs_top_builddir@/lib';
+$ENV{'AUTOM4TE_CFG'} = '@abs_top_builddir@/lib/autom4te.cfg';
+
+$ENV{'AUTOCONF'} = 'autoconf';
+$ENV{'AUTOHEADER'} = 'autoheader';
+$ENV{'AUTOM4TE'} = 'autom4te';
+
+# Prepend $build_testdir to the path if it isn't there already.
+if (!defined $ENV{'PATH'} || $ENV{'PATH'} eq '')
+{
+ $ENV{'PATH'} = $build_testdir;
+}
+elsif ($ENV{'PATH'} !~ /^\Q$build_testdir\E[\\\/]?(?:[:;]|$)/)
+{
+ no warnings 'once';
+ require Config;
+ $ENV{'PATH'} = $build_testdir . $Config::Config{'path_sep'} . $ENV{'PATH'};
+}
+
+# All the wrapped programs *except* ifnames might need to load
+# .m4 and .m4f files from both the build and source libdirs.
+unshift (@ARGV, '-B', $build_libdir, '-B', $src_libdir)
+ if $wrapped_program ne 'ifnames';
+
+my $status = do $abs_wrapped_program;
+exit $status if defined $status;
+die "couldn't parse ${wrapped_program}: $@\n" if $@;
+die "error reading ${wrapped_program}: $!\n";
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## mode: perl
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End: