From aca356ff26f11cf4c29bf18c1cc0ec8f479938da Mon Sep 17 00:00:00 2001 From: Bernd Waibel Date: Wed, 16 Jun 2021 10:17:46 +0200 Subject: [PATCH] use proper AR Signed-off-by: Bernd Waibel --- conflib.pl | 85 ++++++++++++++++++++++++--------------------- intl/dummy/Makefile | 2 +- 2 files changed, 47 insertions(+), 40 deletions(-) diff --git a/conflib.pl b/conflib.pl index 0abd33d..93954c4 100644 --- a/conflib.pl +++ b/conflib.pl @@ -1386,56 +1386,63 @@ sub LookForGNUMake sub LookForGNUar { - my $test; - print 'Looking for GNU ar: '; + my ($myar,$test); - if ($conf{'GNU_AR'}) + print 'Looking for GNU ar: '; + $myar=@conf{'GNU_AR'}; + if ($myar) { print "$conf{'GNU_AR'} (cached)\n"; - return $conf{'GNU_AR'}; + return $myar; } + $myar=$ENV{'AR'}; $conf{'UseRanLib'}=0; - $test=RunRedirect('ar --version',$ErrorLog); - if (($test=~/GNU ar/) || ($test=~/BSD ar/)) - { - $conf{'GNU_AR'}='ar'; - print "ar\n"; - return 'ar'; - } - $test=RunRedirect('gar --version',$ErrorLog); - if ($test=~/GNU ar/) - { - $conf{'GNU_AR'}='gar'; - print "gar\n"; - return 'gar'; - } - if (!LookForFileInPath('ar')) + if (!length($myar)) { + $test=RunRedirect('ar --version',$ErrorLog); + if (($test=~/GNU ar/) || ($test=~/BSD ar/)) + { + $conf{'GNU_AR'}='ar'; + print "ar\n"; + return 'ar'; + } + $test=RunRedirect('gar --version',$ErrorLog); + if ($test=~/GNU ar/) + { + $conf{'GNU_AR'}='gar'; + print "gar\n"; + return 'gar'; + } + if (!LookForFileInPath('ar')) + { + print "Unable to find GNU ar on this system.\n"; + print "Please install it and be sure it's in your path.\n"; + print "Also use `ar' or `gar' name for the binary.\n"; + die; + } + # I think all ar tools are usable but ... + if (($OSf eq 'Darwin') || ($OSf eq 'HP-UX') || ($OSf eq 'Tru64') || + ($OSf eq 'Solaris')) + { + $conf{'GNU_AR'}='ar'; + $conf{'UseRanLib'}=1; + print "ar (not GNU but usable!)\n"; + return 'ar'; + } + if ($OSf eq 'QNX4') + { + $conf{'GNU_AR'}='ar'; + $conf{'UseRanLib'}=1; + print "ar (WATCOM)\n"; + return 'ar'; + } print "Unable to find GNU ar on this system.\n"; print "Please install it and be sure it's in your path.\n"; print "Also use `ar' or `gar' name for the binary.\n"; die; } - # I think all ar tools are usable but ... - if (($OSf eq 'Darwin') || ($OSf eq 'HP-UX') || ($OSf eq 'Tru64') || - ($OSf eq 'Solaris')) - { - $conf{'GNU_AR'}='ar'; - $conf{'UseRanLib'}=1; - print "ar (not GNU but usable!)\n"; - return 'ar'; - } - if ($OSf eq 'QNX4') - { - $conf{'GNU_AR'}='ar'; - $conf{'UseRanLib'}=1; - print "ar (WATCOM)\n"; - return 'ar'; - } - print "Unable to find GNU ar on this system.\n"; - print "Please install it and be sure it's in your path.\n"; - print "Also use `ar' or `gar' name for the binary.\n"; - die; + $conf{'GNU_AR'}=$myar; + $myar; } sub LookForGNUinstall diff --git a/intl/dummy/Makefile b/intl/dummy/Makefile index c32b0a8..d47e185 100644 --- a/intl/dummy/Makefile +++ b/intl/dummy/Makefile @@ -2,4 +2,4 @@ RHIDE_GCC=gcc CC=$(RHIDE_GCC) libtvfintl.a: intldummy.o - ar -rv libtvfintl.a intldummy.o + $(AR) -rv libtvfintl.a intldummy.o -- 2.32.0