76 lines
2.6 KiB
Diff
76 lines
2.6 KiB
Diff
|
From 2a33b07d56c7e30a18dda5760111af267271c236 Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= <aklitzing@gmail.com>
|
||
|
Date: Tue, 24 Apr 2018 16:13:56 +0200
|
||
|
Subject: [PATCH] Revert "Configure: use a better method to identify gcc and
|
||
|
derivates"
|
||
|
|
||
|
This reverts commit 78e9e3f945935c91d8dfe0e832a95d6ea8d05f34.
|
||
|
---
|
||
|
Configure | 22 ++++++++--------------
|
||
|
1 file changed, 8 insertions(+), 14 deletions(-)
|
||
|
|
||
|
diff --git x/Configure y/Configure
|
||
|
index 744b493b96..fe7565ebd9 100755
|
||
|
--- x/Configure
|
||
|
+++ y/Configure
|
||
|
@@ -1269,7 +1269,7 @@ my ($prelflags,$postlflags)=split('%',$lflags);
|
||
|
if (defined($postlflags)) { $lflags=$postlflags; }
|
||
|
else { $lflags=$prelflags; undef $prelflags; }
|
||
|
|
||
|
-if ($target =~ /^mingw/ && `$cross_compile_prefix$cc --target-help 2>&1` !~ m/\-mno\-cygwin/m)
|
||
|
+if ($target =~ /^mingw/ && `$cc --target-help 2>&1` !~ m/\-mno\-cygwin/m)
|
||
|
{
|
||
|
$cflags =~ s/\-mno\-cygwin\s*//;
|
||
|
$shared_ldflag =~ s/\-mno\-cygwin\s*//;
|
||
|
@@ -1661,25 +1661,18 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
|
||
|
$shlib_minor=$2;
|
||
|
}
|
||
|
|
||
|
-my %predefined;
|
||
|
-
|
||
|
-# collect compiler pre-defines from gcc or gcc-alike...
|
||
|
-open(PIPE, "$cross_compile_prefix$cc -dM -E -x c /dev/null 2>&1 |");
|
||
|
-while (<PIPE>) {
|
||
|
- m/^#define\s+(\w+(?:\(\w+\))?)(?:\s+(.+))?/ or last;
|
||
|
- $predefined{$1} = defined($2) ? $2 : "";
|
||
|
-}
|
||
|
-close(PIPE);
|
||
|
+my $ecc = $cc;
|
||
|
+$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
|
||
|
|
||
|
if ($strict_warnings)
|
||
|
{
|
||
|
my $wopt;
|
||
|
- die "ERROR --strict-warnings requires gcc or clang" unless defined($predefined{__GNUC__});
|
||
|
+ die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/);
|
||
|
foreach $wopt (split /\s+/, $gcc_devteam_warn)
|
||
|
{
|
||
|
$cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
|
||
|
}
|
||
|
- if (defined($predefined{__clang__}))
|
||
|
+ if ($ecc eq "clang")
|
||
|
{
|
||
|
foreach $wopt (split /\s+/, $clang_devteam_warn)
|
||
|
{
|
||
|
@@ -1730,14 +1723,15 @@ while (<IN>)
|
||
|
s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/;
|
||
|
s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/;
|
||
|
s/^RC=\s*/RC= \$\(CROSS_COMPILE\)/;
|
||
|
- s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $predefined{__GNUC__} >= 3;
|
||
|
+ s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc eq "gcc";
|
||
|
}
|
||
|
else {
|
||
|
s/^CC=.*$/CC= $cc/;
|
||
|
s/^AR=\s*ar/AR= $ar/;
|
||
|
s/^RANLIB=.*/RANLIB= $ranlib/;
|
||
|
s/^RC=.*/RC= $windres/;
|
||
|
- s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $predefined{__GNUC__} >= 3;
|
||
|
+ s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
|
||
|
+ s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
|
||
|
}
|
||
|
s/^CFLAG=.*$/CFLAG= $cflags/;
|
||
|
s/^DEPFLAG=.*$/DEPFLAG=$depflags/;
|
||
|
--
|
||
|
2.17.0
|
||
|
|