Skip to content

Commit

Permalink
Fix build on MacOS.
Browse files Browse the repository at this point in the history
Reviewed-by: Andy Polyakov
  • Loading branch information
benlaurie committed May 1, 2015
1 parent 8b68b7e commit 190c8c6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
9 changes: 1 addition & 8 deletions Configurations/10-main.conf
Original file line number Diff line number Diff line change
Expand Up @@ -641,14 +641,7 @@
"linux-x86_64-clang" => {
inherit_from => [ "linux-x86_64" ],
cc => "clang",
# TODO(openssl-team): fix problems and investigate if (at least) the
# following warnings can also be enabled:
# -Wconditional-uninitialized, -Wswitch-enum, -Wunused-macros,
# -Wmissing-field-initializers, -Wmissing-variable-declarations,
# -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align,
# -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token
# -Wextended-offsetof
cflags => "-m64 -DL_ENDIAN -Wall -Wextra $clang_disabled_warnings -Qunused-arguments",
cflags => "-m64 -DL_ENDIAN -Wall -Wextra -Qunused-arguments",
},
"linux-x32" => {
inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
Expand Down
21 changes: 19 additions & 2 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,15 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta

my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Wtype-limits -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DDEBUG_UNUSED";

my $clang_disabled_warnings = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof";
# These are used in addition to $gcc_devteam_warn when the compiler is clang.
# TODO(openssl-team): fix problems and investigate if (at least) the
# following warnings can also be enabled: -Wconditional-uninitialized,
# -Wswitch-enum, -Wunused-macros, -Wmissing-field-initializers,
# -Wmissing-variable-declarations,
# -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align,
# -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token
# -Wextended-offsetof
my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof";

my $strict_warnings = 0;

Expand Down Expand Up @@ -1726,12 +1734,21 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)

if ($strict_warnings)
{
my $ecc = $cc;
$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
my $wopt;
die "ERROR --strict-warnings requires gcc or clang" unless ($cc =~ /gcc$/ or $cc =~ /clang$/);
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 =~ /$wopt/)
}
if ($ecc eq "clang")
{
foreach $wopt (split /\s+/, $clang_devteam_warn)
{
$cflags .= " $wopt" unless ($cflags =~ /$wopt/)
}
}
}

open(IN,"<Makefile.org") || die "unable to read Makefile.org:$!\n";
Expand Down
6 changes: 4 additions & 2 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,12 @@ case "$GUESSOS" in
ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null`
if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
echo "WARNING! If you wish to build 64-bit library, then you have to"
echo " invoke './Configure darwin64-x86_64-cc' *manually*."
echo " invoke './Configure darwin64-x86_64-cc $options' *manually*."
if [ "$TEST" = "false" -a -t 1 ]; then
echo " You have about 5 seconds to press Ctrl-C to abort."
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
# The stty technique used elsewhere doesn't work on
# MacOS. At least, right now on this Mac.
sleep 5
fi
fi
if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
Expand Down

0 comments on commit 190c8c6

Please sign in to comment.