patch-5609273-Xcode.in   [plain text]


--- bin/autoconf.as.orig	2006-10-24 06:13:29.000000000 -0700
+++ bin/autoconf.as	2008-08-20 03:25:53.000000000 -0700
@@ -77,7 +77,7 @@
 exit 1"
 
 # Variables.
-: ${AUTOM4TE='@bindir@/@autom4te-name@'}
+: ${AUTOM4TE="$(dirname $0)/@autom4te-name@"}
 autom4te_options=
 outfile=
 verbose=:
--- bin/autoheader.in.orig	2006-10-16 13:58:44.000000000 -0700
+++ bin/autoheader.in	2008-08-20 03:25:53.000000000 -0700
@@ -28,9 +28,13 @@
 # Written by Roland McGrath.
 # Rewritten in Perl by Akim Demaille.
 
+use File::Basename ();
+my $_bindir;
 BEGIN
 {
-  my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
+  $_bindir = File::Basename::dirname($0);
+  (my $_datadir = '@datadir@') =~ s,^/usr,$_bindir/..,;
+  my $datadir = $ENV{'autom4te_perllibdir'} || $_datadir;
   unshift @INC, "$datadir";
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
@@ -52,7 +56,7 @@
 use vars qw ($config_h %verbatim %symbol);
 
 # Lib files.
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autom4te = $ENV{'AUTOM4TE'} || "$_bindir/@autom4te-name@";
 local $config_h;
 my $config_h_in;
 my @prepend_include;
--- bin/autom4te.in.orig	2006-10-24 11:25:30.000000000 -0700
+++ bin/autom4te.in	2008-08-20 03:36:30.000000000 -0700
@@ -24,9 +24,13 @@
 # 02110-1301, USA.
 
 
+use File::Basename ();
+my($_bindir, $_datadir);
 BEGIN
 {
-  my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
+  $_bindir = File::Basename::dirname($0);
+  ($_datadir = '@datadir@') =~ s,^/usr,$_bindir/..,;
+  my $datadir = $ENV{'autom4te_perllibdir'} || $_datadir;
   unshift @INC, $datadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
@@ -46,7 +50,7 @@
 use strict;
 
 # Data directory.
-my $datadir = $ENV{'AC_MACRODIR'} || '@datadir@';
+my $datadir = $ENV{'AC_MACRODIR'} || $_datadir;
 
 # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
 my %language;
@@ -87,7 +91,8 @@
 my $freeze = 0;
 
 # $M4.
-my $m4 = $ENV{"M4"} || '@M4@';
+my $_m4 = "$_bindir/" . File::Basename::basename('@M4@');
+my $m4 = $ENV{"M4"} || ((-x $_m4) ? $_m4 : '@M4@');
 # Some non-GNU m4's don't reject the --help option, so give them /dev/null.
 fatal "need GNU m4 1.4 or later: $m4"
   if system "$m4 --help </dev/null 2>&1 | grep reload-state >/dev/null";
--- bin/autoreconf.in.orig	2008-08-20 03:25:36.000000000 -0700
+++ bin/autoreconf.in	2008-08-20 03:25:53.000000000 -0700
@@ -27,9 +27,13 @@
 # Written by David J. MacKenzie.
 # Extended and rewritten in Perl by Akim Demaille.
 
+use File::Basename ();
+my $_bindir;
 BEGIN
 {
-  my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
+  $_bindir = File::Basename::dirname($0);
+  (my $_datadir = '@datadir@') =~ s,^/usr,$_bindir/..,;
+  my $datadir = $ENV{'autom4te_perllibdir'} || $_datadir;
   unshift @INC, $datadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
@@ -106,8 +110,8 @@
 ";
 
 # Lib files.
-my $autoconf   = $ENV{'AUTOCONF'}   || '@bindir@/@autoconf-name@';
-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
+my $autoconf   = $ENV{'AUTOCONF'}   || "$_bindir/@autoconf-name@";
+my $autoheader = $ENV{'AUTOHEADER'} || "$_bindir/@autoheader-name@";
 my $automake   = $ENV{'AUTOMAKE'}   || 'automake';
 my $aclocal    = $ENV{'ACLOCAL'}    || 'aclocal';
 my $libtoolize = $ENV{'LIBTOOLIZE'} || 'glibtoolize';
--- bin/autoscan.in.orig	2006-10-16 13:58:44.000000000 -0700
+++ bin/autoscan.in	2008-08-20 03:25:53.000000000 -0700
@@ -26,9 +26,13 @@
 eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
     if 0;
 
+use File::Basename ();
+my($_bindir, $_datadir);
 BEGIN
 {
-  my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
+  $_bindir = File::Basename::dirname($0);
+  ($_datadir = '@datadir@') =~ s,^/usr,$_bindir/..,;
+  my $datadir = $ENV{'autom4te_perllibdir'} || $_datadir;
   unshift @INC, $datadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
@@ -94,10 +98,10 @@
 my $log;
 
 # Autoconf and lib files.
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autom4te = $ENV{'AUTOM4TE'} || "$_bindir/@autom4te-name@";
 my $autoconf = "$autom4te --language=autoconf";
 my @prepend_include;
-my @include = ('@datadir@');
+my @include = ($_datadir);
 
 # $help
 # -----
--- bin/autoupdate.in.orig	2006-10-16 13:58:44.000000000 -0700
+++ bin/autoupdate.in	2008-08-20 03:36:20.000000000 -0700
@@ -27,9 +27,13 @@
 eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
     if 0;
 
+use File::Basename ();
+my($_bindir, $_datadir);
 BEGIN
 {
-  my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
+  $_bindir = File::Basename::dirname($0);
+  ($_datadir = '@datadir@') =~ s,^/usr,$_bindir/..,;
+  my $datadir = $ENV{'autom4te_perllibdir'} || $_datadir;
   unshift @INC, $datadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
@@ -49,14 +53,15 @@
 use strict;
 
 # Lib files.
-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+my $autom4te = $ENV{'AUTOM4TE'} || "$_bindir/@autom4te-name@";
 my $autoconf = "$autom4te --language=autoconf";
 # We need to find m4sugar.
 my @prepend_include;
-my @include = ('@datadir@');
+my @include = ($_datadir);
 my $force = 0;
 # m4.
-my $m4 = $ENV{"M4"} || '@M4@';
+my $_m4 = "$_bindir/" . File::Basename::basename('@M4@');
+my $m4 = $ENV{"M4"} || ((-x $_m4) ? $_m4 : '@M4@');
 
 
 # $HELP
--- bin/ifnames.in.orig	2006-10-16 13:58:44.000000000 -0700
+++ bin/ifnames.in	2008-08-20 03:25:53.000000000 -0700
@@ -31,9 +31,12 @@
 # Written by David MacKenzie <djm@gnu.ai.mit.edu>
 # and Paul Eggert <eggert@twinsun.com>.
 
+use File::Basename ();
 BEGIN
 {
-  my $datadir = $ENV{'autom4te_perllibdir'} || '@datadir@';
+  my $_bindir = File::Basename::dirname($0);
+  (my $_datadir = '@datadir@') =~ s,^/usr,$_bindir/..,;
+  my $datadir = $ENV{'autom4te_perllibdir'} || $_datadir;
   unshift @INC, $datadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell