mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-04-30 03:34:39 +00:00
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>
This commit is contained in:
parent
eb507efba8
commit
f1f07a2367
17
Configure
17
Configure
@ -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};
|
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*//;
|
$config{depflags} =~ s/^\s*//;
|
||||||
|
|
||||||
|
|
||||||
@ -1121,7 +1129,8 @@ if (defined($config{api})) {
|
|||||||
if ($strict_warnings)
|
if ($strict_warnings)
|
||||||
{
|
{
|
||||||
my $wopt;
|
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)
|
foreach $wopt (split /\s+/, $gcc_devteam_warn)
|
||||||
{
|
{
|
||||||
$config{cflags} .= " $wopt" unless ($config{cflags} =~ /(^|\s)$wopt(\s|$)/)
|
$config{cflags} .= " $wopt" unless ($config{cflags} =~ /(^|\s)$wopt(\s|$)/)
|
||||||
|
11
util/domd.in
11
util/domd.in
@ -6,20 +6,21 @@
|
|||||||
{- "MAKEDEPEND=" . quotify1($config{makedepprog}) -}
|
{- "MAKEDEPEND=" . quotify1($config{makedepprog}) -}
|
||||||
|
|
||||||
case "${MAKEDEPEND}" in
|
case "${MAKEDEPEND}" in
|
||||||
|
cat)
|
||||||
|
;;
|
||||||
makedepend)
|
makedepend)
|
||||||
cp Makefile.in Makefile
|
|
||||||
${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $@ || exit 1
|
${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $@ || exit 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
args="-Werror -M"
|
args="-Werror -MM"
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
if [ "$1" != '--' ] ; then
|
if [ "$1" != '--' ] ; then
|
||||||
args="$args $1"
|
args="$args $1"
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $args >Makefile.tmp || exit 1
|
sed -e '/DO NOT DELETE THIS LINE/q' Makefile >Makefile.tmp
|
||||||
cat Makefile.in Makefile.tmp >Makefile
|
${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $args >>Makefile.tmp || exit 1
|
||||||
rm Makefile.tmp
|
mv Makefile.tmp Makefile
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user