diff options
author | Rich Salz <rsalz@akamai.com> | 2016-01-29 19:50:28 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-02-01 09:42:10 -0500 |
commit | f1f07a2367e5381ff6e96a89b2512adfa3e14d0e (patch) | |
tree | 3f00c996ca28104948b5d4360241cbdf76fd1ada /Configure | |
parent | eb507efba8e2333a284a2a79638f729bdc35c502 (diff) |
Better check for gcc/clang
Iteratively improved with Richard and Andy.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -1072,11 +1072,19 @@ if (!$no_asm) { } } +# Is the compiler gcc or clang? $ecc is used below to see if error-checking +# can be turned on. my $ecc = $target{cc}; -$ecc = "clang" if `$target{cc} --version 2>&1` =~ /clang/; +my $ccpcc = "$config{cross_compile_prefix}$target{cc}"; +$config{makedepprog} = 'makedepend'; +open(PIPE, "$ccpcc --version 2>&1 | head -2 |"); +while ( <PIPE> ) { + $config{makedepprog} = $ccpcc if /clang|gcc/; + $ecc = "clang" if /clang/; + $ecc = "gcc" if /gcc/; +} +close(PIPE); -$config{makedepprog} = - $ecc eq "gcc" || $ecc eq "clang" ? $target{cc} : "makedepend"; $config{depflags} =~ s/^\s*//; @@ -1121,7 +1129,8 @@ if (defined($config{api})) { if ($strict_warnings) { my $wopt; - die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc(-\d(\.\d)*)?$/ or $ecc =~ /clang$/); + die "ERROR --strict-warnings requires gcc or clang" + unless $ecc eq 'gcc' || $ecc eq 'clang'; foreach $wopt (split /\s+/, $gcc_devteam_warn) { $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(^|\s)$wopt(\s|$)/) |