From 1a2f5ed9c13975ab21aef2d6f626f4970f79791d Mon Sep 17 00:00:00 2001 From: Bernhard Schmalhofer Date: Thu, 2 Jun 2005 17:38:48 +0000 Subject: [PATCH] Assume that there is no GNU m4 on FreeBSP, because calling 'm4 --version' hangs on FreeBSD. Thanks to link@redbrick.dcu.ie for pointing this out, http://rt.perl.org/rt3/Ticket/Display.html?id=36087 git-svn-id: https://svn.parrot.org/parrot/trunk@8255 d31e2699-5ff4-0310-a27c-f18f2fbe73fe --- config/auto/m4.pl | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/config/auto/m4.pl b/config/auto/m4.pl index 11efd90a79..b75297541d 100644 --- a/config/auto/m4.pl +++ b/config/auto/m4.pl @@ -24,12 +24,27 @@ package Configure::Step; @args = qw(verbose); sub runstep { - # This seems to work for GNU m4 1.4.2 - my $a = capture_output( 'm4', '--version' ) || ''; - my $has_gnu_m4 = ( $a =~ m/^GNU [mM]4 / ) ? 1 : 0; + my $archname = $Config{archname}; + my ($cpuarch, $osname) = split('-', $archname); + if (!defined $osname) { + ($osname, $cpuarch) = ($cpuarch, ""); + } + + my $has_gnu_m4; + + # Calling 'm4 --version' hangs under FreeBSD + my %m4_hangs = ( freebsd => 1 + ); + + if ( $m4_hangs{$osname} ) { + $has_gnu_m4 = 0; + } else { + # This seems to work for GNU m4 1.4.2 + my $output = capture_output( 'm4', '--version' ) || ''; + $has_gnu_m4 = ( $output =~ m/^GNU [mM]4 / ) ? 1 : 0; + } Configure::Data->set(has_gnu_m4 => $has_gnu_m4); - $Configure::Step::result = $has_gnu_m4 ? 'yes' : 'no'; }