mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-21 13:59:40 +00:00
util/perl/OpenSSL/config.pm: refactor map_guess()
map_guess() is now table driven, just like get_system(). Additionally, it now takes a config hash table and returns one of its own. This way, 'Configure' can pass whatever it has already found to OpenSSL::config::get_platform(), and easily merge the returned hash table into its %config. This also gets rid of variables that we no longer need. That includes $PERL and all the $__CNF_ environment variables. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
This commit is contained in:
parent
081436bf73
commit
e39795af0a
20
Configure
20
Configure
@ -20,6 +20,7 @@ use File::Path qw/mkpath/;
|
|||||||
use OpenSSL::fallback "$FindBin::Bin/external/perl/MODULES.txt";
|
use OpenSSL::fallback "$FindBin::Bin/external/perl/MODULES.txt";
|
||||||
use OpenSSL::Glob;
|
use OpenSSL::Glob;
|
||||||
use OpenSSL::Template;
|
use OpenSSL::Template;
|
||||||
|
use OpenSSL::config;
|
||||||
|
|
||||||
# see INSTALL.md for instructions.
|
# see INSTALL.md for instructions.
|
||||||
|
|
||||||
@ -608,8 +609,6 @@ while ((my $first, my $second) = (shift @list, shift @list)) {
|
|||||||
# To remove something from %disabled, use "enable-foo".
|
# To remove something from %disabled, use "enable-foo".
|
||||||
# For symmetry, "disable-foo" is a synonym for "no-foo".
|
# For symmetry, "disable-foo" is a synonym for "no-foo".
|
||||||
|
|
||||||
&usage if ($#ARGV < 0);
|
|
||||||
|
|
||||||
# For the "make variables" CPPINCLUDES and CPPDEFINES, we support lists with
|
# For the "make variables" CPPINCLUDES and CPPDEFINES, we support lists with
|
||||||
# platform specific list separators. Users from those platforms should
|
# platform specific list separators. Users from those platforms should
|
||||||
# recognise those separators from how you set up the PATH to find executables.
|
# recognise those separators from how you set up the PATH to find executables.
|
||||||
@ -1068,6 +1067,23 @@ if (grep { /-rpath\b/ } ($user{LDFLAGS} ? @{$user{LDFLAGS}} : ())
|
|||||||
"***** any of asan, msan or ubsan\n";
|
"***** any of asan, msan or ubsan\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If no target was given, try guessing.
|
||||||
|
unless ($target) {
|
||||||
|
my %system_config = OpenSSL::config::get_platform(%config, %user);
|
||||||
|
|
||||||
|
# The $system_config{disable} is used to populate %disabled with
|
||||||
|
# entries that aren't already there.
|
||||||
|
foreach ( @{$system_config{disable} // []} ) {
|
||||||
|
$disabled{$_} = 'system' unless defined $disabled{$_};
|
||||||
|
}
|
||||||
|
delete $system_config{disable};
|
||||||
|
|
||||||
|
# Override config entries with stuff from the guesser.
|
||||||
|
# It's assumed that this really is nothing new.
|
||||||
|
%config = ( %config, %system_config );
|
||||||
|
$target = $system_config{target};
|
||||||
|
}
|
||||||
|
|
||||||
sub disable {
|
sub disable {
|
||||||
my $disable_type = shift;
|
my $disable_type = shift;
|
||||||
|
|
||||||
|
@ -36,11 +36,9 @@ my $GCC_BITS;
|
|||||||
my $GCC_ARCH;
|
my $GCC_ARCH;
|
||||||
|
|
||||||
# Some environment variables; they will affect Configure
|
# Some environment variables; they will affect Configure
|
||||||
my $PERL = $ENV{PERL} // $^X // 'perl';
|
|
||||||
my $CONFIG_OPTIONS = $ENV{CONFIG_OPTIONS} // '';
|
my $CONFIG_OPTIONS = $ENV{CONFIG_OPTIONS} // '';
|
||||||
my $CC = $ENV{CC} // '';
|
my $CC;
|
||||||
my $CROSS_COMPILE = $ENV{CROSS_COMPILE} // "";
|
my $CROSS_COMPILE;
|
||||||
my $KERNEL_BITS = $ENV{KERNEL_BITS} // '';
|
|
||||||
|
|
||||||
# For determine_compiler_settings, the list of known compilers
|
# For determine_compiler_settings, the list of known compilers
|
||||||
my @c_compilers = qw(clang gcc cc);
|
my @c_compilers = qw(clang gcc cc);
|
||||||
@ -67,15 +65,6 @@ my @cc_version =
|
|||||||
# This is what we will set as the target for calling Configure.
|
# This is what we will set as the target for calling Configure.
|
||||||
my $options = '';
|
my $options = '';
|
||||||
|
|
||||||
# Environment that will be passed to Configure
|
|
||||||
my $__CNF_CPPDEFINES = '';
|
|
||||||
my $__CNF_CPPINCLUDES = '';
|
|
||||||
my $__CNF_CPPFLAGS = '';
|
|
||||||
my $__CNF_CFLAGS = '';
|
|
||||||
my $__CNF_CXXFLAGS = '';
|
|
||||||
my $__CNF_LDFLAGS = '';
|
|
||||||
my $__CNF_LDLIBS = '';
|
|
||||||
|
|
||||||
# Pattern matches against "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}"
|
# Pattern matches against "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}"
|
||||||
my $simple_guess_patterns = [
|
my $simple_guess_patterns = [
|
||||||
[ 'A\/UX:', 'm68k-apple-aux3' ],
|
[ 'A\/UX:', 'm68k-apple-aux3' ],
|
||||||
@ -450,26 +439,24 @@ EOF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Map GUESSOS into OpenSSL terminology. Also sets some of variables
|
my $map_patterns =
|
||||||
# like $options, $__CNX_xxx. And uses some, like the KERNEL flags
|
[ [ 'uClinux.*64.*', { target => 'uClinux-dist64' } ],
|
||||||
# and MACHINE.
|
[ 'uClinux.*', { target => 'uClinux-dist' } ],
|
||||||
# It would be nice to fix this so that this weren't necessary. :( XXX
|
[ 'mips3-sgi-irix', { target => 'irix-mips3' } ],
|
||||||
sub map_guess {
|
[ 'mips4-sgi-irix64',
|
||||||
my $GUESSOS = shift;
|
sub {
|
||||||
my $OUT;
|
|
||||||
return 'uClinux-dist64' if $GUESSOS =~ 'uClinux.*64.*';
|
|
||||||
return 'uClinux-dist' if $GUESSOS =~ 'uClinux.*';
|
|
||||||
return "irix-mips3-$CC" if $GUESSOS =~ 'mips3-sgi-irix';
|
|
||||||
if ( $GUESSOS =~ 'mips4-sgi-irix64' ) {
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
WARNING! To build 64-bit package, do this:
|
WARNING! To build 64-bit package, do this:
|
||||||
$WHERE/Configure irix64-mips4-$CC
|
$WHERE/Configure irix64-mips4-$CC
|
||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
return "irix-mips3-$CC";
|
return { target => "irix-mips3" };
|
||||||
}
|
}
|
||||||
return "rhapsody-ppc-cc" if $GUESSOS =~ 'ppc-apple-rhapsody';
|
],
|
||||||
if ( $GUESSOS =~ 'ppc-apple-darwin' ) {
|
[ 'ppc-apple-rhapsody', { target => "rhapsody-ppc" } ],
|
||||||
|
[ 'ppc-apple-darwin.*',
|
||||||
|
sub {
|
||||||
|
my $KERNEL_BITS = $ENV{KERNEL_BITS};
|
||||||
my $ISA64 = `sysctl -n hw.optional.64bitops 2>/dev/null`;
|
my $ISA64 = `sysctl -n hw.optional.64bitops 2>/dev/null`;
|
||||||
if ( $ISA64 == 1 && $KERNEL_BITS eq '' ) {
|
if ( $ISA64 == 1 && $KERNEL_BITS eq '' ) {
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
@ -478,60 +465,77 @@ WARNING! To build 64-bit package, do this:
|
|||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
}
|
}
|
||||||
return "darwin64-ppc-cc" if $ISA64 == 1 && $KERNEL_BITS eq '64';
|
return { target => "darwin64-ppc" }
|
||||||
return "darwin-ppc-cc";
|
if $ISA64 == 1 && $KERNEL_BITS eq '64';
|
||||||
|
return { target => "darwin-ppc" };
|
||||||
}
|
}
|
||||||
if ( $GUESSOS =~ 'i.86-apple-darwin' ) {
|
],
|
||||||
|
[ 'i.86-apple-darwin.*',
|
||||||
|
sub {
|
||||||
|
my $KERNEL_BITS = $ENV{KERNEL_BITS};
|
||||||
my $ISA64 = `sysctl -n hw.optional.x86_64 2>/dev/null`;
|
my $ISA64 = `sysctl -n hw.optional.x86_64 2>/dev/null`;
|
||||||
if ( $ISA64 == 1 && $KERNEL_BITS eq '' ) {
|
if ( $ISA64 == 1 && $KERNEL_BITS eq '' ) {
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
WARNING! To build 64-bit package, do this:
|
WARNING! To build 64-bit package, do this:
|
||||||
KERNEL_BITS=64 $WHERE/config $options
|
KERNEL_BITS=64 $WHERE/Configure \[\[ options \]\]
|
||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
}
|
}
|
||||||
return "darwin64-x86_64-cc" if $ISA64 == 1 && $KERNEL_BITS eq '64';
|
return { target => "darwin64-x86_64" }
|
||||||
return "darwin-i386-cc";
|
if $ISA64 == 1 && $KERNEL_BITS eq '64';
|
||||||
|
return { target => "darwin-i386" };
|
||||||
}
|
}
|
||||||
if ( $GUESSOS =~ 'x86_64-apple-darwin' ) {
|
],
|
||||||
return "darwin-i386-cc" if $KERNEL_BITS eq '32';
|
[ 'x86_64-apple-darwin.*',
|
||||||
|
sub {
|
||||||
|
my $KERNEL_BITS = $ENV{KERNEL_BITS};
|
||||||
|
return { target => "darwin-i386" } if $KERNEL_BITS eq '32';
|
||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
WARNING! To build 32-bit package, do this:
|
WARNING! To build 32-bit package, do this:
|
||||||
KERNEL_BITS=32 $WHERE/config $options
|
KERNEL_BITS=32 $WHERE/Configure \[\[ options \]\]
|
||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
return "darwin64-x86_64-cc"
|
return { target => "darwin64-x86_64" };
|
||||||
}
|
}
|
||||||
if ( $GUESSOS =~ 'armv6+7-.*-iphoneos' ) {
|
],
|
||||||
$__CNF_CFLAGS .= " -arch armv6 -arch armv7";
|
[ 'armv6\+7-.*-iphoneos',
|
||||||
$__CNF_CXXFLAGS .= " -arch armv6 -arch armv7";
|
{ target => "iphoneos-cross",
|
||||||
return "iphoneos-cross";
|
cflags => [ qw(-arch armv6 -arch armv7) ],
|
||||||
}
|
cxxflags => [ qw(-arch armv6 -arch armv7) ] }
|
||||||
if ( $GUESSOS =~ '.*-.*-iphoneos' ) {
|
],
|
||||||
$__CNF_CFLAGS .= " -arch ${MACHINE}";
|
[ 'arm64-.*-iphoneos|.*-.*-ios64',
|
||||||
$__CNF_CXXFLAGS .= " -arch ${MACHINE}";
|
{ target => "ios64-cross" }
|
||||||
return "iphoneos-cross";
|
],
|
||||||
}
|
[ '.*-.*-iphoneos',
|
||||||
return "ios64-cross" if $GUESSOS =~ 'arm64-.*-iphoneos|.*-.*-ios64';
|
sub { return { target => "iphoneos-cross",
|
||||||
if ( $GUESSOS =~ 'alpha-.*-linux2' ) {
|
cflags => [ "-arch ${MACHINE}" ],
|
||||||
|
cxxflags => [ "-arch ${MACHINE}" ] }; }
|
||||||
|
],
|
||||||
|
[ 'alpha-.*-linux2.*',
|
||||||
|
sub {
|
||||||
my $ISA = `awk '/cpu model/{print \$4;exit(0);}' /proc/cpuinfo`;
|
my $ISA = `awk '/cpu model/{print \$4;exit(0);}' /proc/cpuinfo`;
|
||||||
$ISA //= 'generic';
|
$ISA //= 'generic';
|
||||||
|
my %config = ();
|
||||||
if ( $CCVENDOR eq "gnu" ) {
|
if ( $CCVENDOR eq "gnu" ) {
|
||||||
if ( $ISA =~ 'EV5|EV45' ) {
|
if ( $ISA =~ 'EV5|EV45' ) {
|
||||||
$__CNF_CFLAGS .= " -mcpu=ev5";
|
%config = ( cflags => [ '-mcpu=ev5' ],
|
||||||
$__CNF_CFLAGS .= " -mcpu=ev5";
|
cxxflags => [ '-mcpu=ev5' ] );
|
||||||
} elsif ( $ISA =~ 'EV56|PCA56' ) {
|
} elsif ( $ISA =~ 'EV56|PCA56' ) {
|
||||||
$__CNF_CFLAGS .= " -mcpu=ev56";
|
%config = ( cflags => [ '-mcpu=ev56' ],
|
||||||
$__CNF_CXXFLAGS .= " -mcpu=ev56";
|
cxxflags => [ '-mcpu=ev56' ] );
|
||||||
} else {
|
} else {
|
||||||
$__CNF_CFLAGS .= "-mcpu=ev6";
|
%config = ( cflags => [ '-mcpu=ev6' ],
|
||||||
$__CNF_CXXFLAGS .= "-mcpu=ev6";
|
cxxflags => [ '-mcpu=ev6' ] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "linux-alpha-$CC";
|
return { target => "linux-alpha",
|
||||||
|
%config };
|
||||||
}
|
}
|
||||||
if ( $GUESSOS =~ 'ppc64-.*-linux2' ) {
|
],
|
||||||
|
[ 'ppc64-.*-linux2',
|
||||||
|
sub {
|
||||||
|
my $KERNEL_BITS = $ENV{KERNEL_BITS};
|
||||||
if ( $KERNEL_BITS eq '' ) {
|
if ( $KERNEL_BITS eq '' ) {
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
WARNING! To build 64-bit package, do this:
|
WARNING! To build 64-bit package, do this:
|
||||||
@ -539,51 +543,63 @@ WARNING! To build 64-bit package, do this:
|
|||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
}
|
}
|
||||||
return "linux-ppc64" if $KERNEL_BITS eq '64';
|
return { target => "linux-ppc64" } if $KERNEL_BITS eq '64';
|
||||||
|
|
||||||
|
my %config = ();
|
||||||
if (!okrun('echo __LP64__',
|
if (!okrun('echo __LP64__',
|
||||||
'gcc -E -x c - 2>/dev/null',
|
'gcc -E -x c - 2>/dev/null',
|
||||||
'grep "^__LP64__" 2>&1 >/dev/null') ) {
|
'grep "^__LP64__" 2>&1 >/dev/null') ) {
|
||||||
$__CNF_CFLAGS .= " -m32";
|
%config = ( cflags => [ '-m32' ],
|
||||||
$__CNF_CXXFLAGS .= " -m32";
|
cxxflags => [ '-m32' ] );
|
||||||
}
|
}
|
||||||
return "linux-ppc";
|
return { target => "linux-ppc",
|
||||||
|
%config };
|
||||||
}
|
}
|
||||||
return "linux-ppc64le" if $GUESSOS =~ 'ppc64le-.*-linux2';
|
],
|
||||||
return "linux-ppc" if $GUESSOS =~ 'ppc-.*-linux2';
|
[ 'ppc64le-.*-linux2', { target => "linux-ppc64le" } ],
|
||||||
if ( $GUESSOS =~ 'mips64.*-*-linux2' ) {
|
[ 'ppc-.*-linux2', { target => "linux-ppc" } ],
|
||||||
|
[ 'mips64.*-*-linux2',
|
||||||
|
sub {
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
WARNING! To build 64-bit package, do this:
|
WARNING! To build 64-bit package, do this:
|
||||||
$WHERE/Configure linux64-mips64
|
$WHERE/Configure linux64-mips64
|
||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
return "linux-mips64";
|
return { target => "linux-mips64" };
|
||||||
}
|
}
|
||||||
return "linux-mips32" if $GUESSOS =~ 'mips.*-.*-linux2';
|
],
|
||||||
return "vxworks-ppc60x" if $GUESSOS =~ 'ppc60x-.*-vxworks*';
|
[ 'mips.*-.*-linux2', { target => "linux-mips32" } ],
|
||||||
return "vxworks-ppcgen" if $GUESSOS =~ 'ppcgen-.*-vxworks*';
|
[ 'ppc60x-.*-vxworks.*', { target => "vxworks-ppc60x" } ],
|
||||||
return "vxworks-pentium" if $GUESSOS =~ 'pentium-.*-vxworks*';
|
[ 'ppcgen-.*-vxworks.*', { target => "vxworks-ppcgen" } ],
|
||||||
return "vxworks-simlinux" if $GUESSOS =~ 'simlinux-.*-vxworks*';
|
[ 'pentium-.*-vxworks.*', { target => "vxworks-pentium" } ],
|
||||||
return "vxworks-mips" if $GUESSOS =~ 'mips-.*-vxworks*';
|
[ 'simlinux-.*-vxworks.*', { target => "vxworks-simlinux" } ],
|
||||||
return "linux-generic64 -DL_ENDIAN" if $GUESSOS =~ 'e2k-.*-linux*';
|
[ 'mips-.*-vxworks.*', { target => "vxworks-mips" } ],
|
||||||
return "linux-ia64" if $GUESSOS =~ 'ia64-.*-linux.';
|
[ 'e2k-.*-linux.*', { target => "linux-generic64",
|
||||||
if ( $GUESSOS =~ 'sparc64-.*-linux2' ) {
|
defines => [ 'L_ENDIAN' ] } ],
|
||||||
|
[ 'ia64-.*-linux.', { target => "linux-ia64" } ],
|
||||||
|
[ 'sparc64-.*-linux2',
|
||||||
|
sub {
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI and you
|
WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI and you
|
||||||
want to build 64-bit library, do this:
|
want to build 64-bit library, do this:
|
||||||
$WHERE/Configure linux64-sparcv9
|
$WHERE/Configure linux64-sparcv9
|
||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
return "linux-sparcv9";
|
return { target => "linux-sparcv9" };
|
||||||
}
|
}
|
||||||
if ( $GUESSOS =~ 'sparc-.*-linux2' ) {
|
],
|
||||||
|
[ 'sparc-.*-linux2',
|
||||||
|
sub {
|
||||||
my $KARCH = `awk '/^type/{print \$3;exit(0);}' /proc/cpuinfo`;
|
my $KARCH = `awk '/^type/{print \$3;exit(0);}' /proc/cpuinfo`;
|
||||||
$KARCH //= "sun4";
|
$KARCH //= "sun4";
|
||||||
return "linux-sparcv9" if $KARCH =~ 'sun4u*';
|
return { target => "linux-sparcv9" } if $KARCH =~ 'sun4u.*';
|
||||||
return "linux-sparcv8" if $KARCH =~ 'sun4[md]';
|
return { target => "linux-sparcv8" } if $KARCH =~ 'sun4[md]';
|
||||||
$__CNF_CPPFLAGS .= " -DB_ENDIAN";
|
return { target => "linux-generic32",
|
||||||
return "linux-generic32";
|
defines => [ 'L_ENDIAN' ] };
|
||||||
}
|
}
|
||||||
if ( $GUESSOS =~ 'parisc.*-.*-linux2' ) {
|
],
|
||||||
|
[ 'parisc.*-.*-linux2',
|
||||||
|
sub {
|
||||||
# 64-bit builds under parisc64 linux are not supported and
|
# 64-bit builds under parisc64 linux are not supported and
|
||||||
# compiler is expected to generate 32-bit objects...
|
# compiler is expected to generate 32-bit objects...
|
||||||
my $CPUARCH =
|
my $CPUARCH =
|
||||||
@ -591,11 +607,11 @@ EOF
|
|||||||
my $CPUSCHEDULE =
|
my $CPUSCHEDULE =
|
||||||
`awk '/^cpu.[ ]*: PA/{print substr(\$3,3); exit(0);}' /proc/cpuinfo`;
|
`awk '/^cpu.[ ]*: PA/{print substr(\$3,3); exit(0);}' /proc/cpuinfo`;
|
||||||
# TODO XXX Model transformations
|
# TODO XXX Model transformations
|
||||||
# 0. CPU Architecture for the 1.1 processor has letter suffixes. We
|
# 0. CPU Architecture for the 1.1 processor has letter suffixes.
|
||||||
# strip that off assuming no further arch. identification will ever
|
# We strip that off assuming no further arch. identification
|
||||||
# be used by GCC.
|
# will ever be used by GCC.
|
||||||
# 1. I'm most concerned about whether is a 7300LC is closer to a 7100
|
# 1. I'm most concerned about whether is a 7300LC is closer to a
|
||||||
# versus a 7100LC.
|
# 7100 versus a 7100LC.
|
||||||
# 2. The variant 64-bit processors cause concern should GCC support
|
# 2. The variant 64-bit processors cause concern should GCC support
|
||||||
# explicit schedulers for these chips in the future.
|
# explicit schedulers for these chips in the future.
|
||||||
# PA7300LC -> 7100LC (1.1)
|
# PA7300LC -> 7100LC (1.1)
|
||||||
@ -604,36 +620,34 @@ EOF
|
|||||||
# PA8600 -> 8000 (2.0)
|
# PA8600 -> 8000 (2.0)
|
||||||
$CPUSCHEDULE =~ s/7300LC/7100LC/;
|
$CPUSCHEDULE =~ s/7300LC/7100LC/;
|
||||||
$CPUSCHEDULE =~ s/8.00/8000/;
|
$CPUSCHEDULE =~ s/8.00/8000/;
|
||||||
# Finish Model transformations
|
return
|
||||||
$__CNF_CPPFLAGS .= " -DB_ENDIAN";
|
{ target => "linux-generic32",
|
||||||
$__CNF_CFLAGS .= " -mschedule=$CPUSCHEDULE -march=$CPUARCH";
|
defines => [ 'B_ENDIAN' ],
|
||||||
$__CNF_CXXFLAGS .= " -mschedule=$CPUSCHEDULE -march=$CPUARCH";
|
cflags => [ "-mschedule=$CPUSCHEDULE", "-march=$CPUARCH" ],
|
||||||
return "linux-generic32";
|
cxxflags => [ "-mschedule=$CPUSCHEDULE", "-march=$CPUARCH" ]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return "linux-generic32" if $GUESSOS =~ 'armv[1-3].*-.*-linux2';
|
],
|
||||||
if ( $GUESSOS =~ 'armv[7-9].*-.*-linux2' ) {
|
[ 'armv[1-3].*-.*-linux2', { target => "linux-generic32" } ],
|
||||||
$__CNF_CFLAGS .= " -march=armv7-a";
|
[ 'armv[7-9].*-.*-linux2', { target => "linux-armv4",
|
||||||
$__CNF_CXXFLAGS .= " -march=armv7-a";
|
defines => [ 'B_ENDIAN' ],
|
||||||
return "linux-armv4";
|
cflags => [ '-march=armv7-a' ],
|
||||||
}
|
cxxflags => [ '-march=armv7-a' ] } ],
|
||||||
return "linux-armv4" if $GUESSOS =~ 'arm.*-.*-linux2';
|
[ 'arm.*-.*-linux2', { target => "linux-armv4" } ],
|
||||||
return "linux-aarch64" if $GUESSOS =~ 'aarch64-.*-linux2';
|
[ 'aarch64-.*-linux2', { target => "linux-aarch64" } ],
|
||||||
if ( $GUESSOS =~ 'sh.*b-.*-linux2' ) {
|
[ 'sh.*b-.*-linux2', { target => "linux-generic32",
|
||||||
$__CNF_CPPFLAGS .= " -DB_ENDIAN";
|
defines => [ 'B_ENDIAN' ] } ],
|
||||||
return "linux-generic32";
|
[ 'sh.*-.*-linux2', { target => "linux-generic32",
|
||||||
}
|
defines => [ 'L_ENDIAN' ] } ],
|
||||||
if ( $GUESSOS =~ 'sh.*-.*-linux2' ) {
|
[ 'm68k.*-.*-linux2', { target => "linux-generic32",
|
||||||
$__CNF_CPPFLAGS .= " -DL_ENDIAN";
|
defines => [ 'B_ENDIAN' ] } ],
|
||||||
return "linux-generic32";
|
[ 's390-.*-linux2', { target => "linux-generic32",
|
||||||
}
|
defines => [ 'B_ENDIAN' ] } ],
|
||||||
if ( $GUESSOS =~ 'm68k.*-.*-linux2' || $GUESSOS =~ 's390-.*-linux2' ) {
|
[ 's390x-.*-linux2',
|
||||||
$__CNF_CPPFLAGS .= " -DB_ENDIAN";
|
sub {
|
||||||
return "linux-generic32";
|
|
||||||
}
|
|
||||||
if ( $GUESSOS =~ 's390x-.*-linux2' ) {
|
|
||||||
# Disabled until a glibc bug is fixed; see Configure.
|
# Disabled until a glibc bug is fixed; see Configure.
|
||||||
if (0 || okrun(
|
if (0
|
||||||
'egrep -e \'^features.* highgprs\' /proc/cpuinfo >/dev/null') )
|
|| okrun('egrep -e \'^features.* highgprs\' /proc/cpuinfo >/dev/null') )
|
||||||
{
|
{
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
WARNING! To build "highgprs" 32-bit package, do this:
|
WARNING! To build "highgprs" 32-bit package, do this:
|
||||||
@ -641,24 +655,31 @@ WARNING! To build "highgprs" 32-bit package, do this:
|
|||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
}
|
}
|
||||||
return "linux64-s390x";
|
return { target => "linux64-s390x" };
|
||||||
}
|
}
|
||||||
if ( $GUESSOS =~ 'x86_64-.*-linux.' ) {
|
],
|
||||||
return "linux-x32"
|
[ 'x86_64-.*-linux.',
|
||||||
|
sub {
|
||||||
|
return { target => "linux-x32" }
|
||||||
if okrun("$CC -dM -E -x c /dev/null 2>&1",
|
if okrun("$CC -dM -E -x c /dev/null 2>&1",
|
||||||
'grep -q ILP32 >/dev/null');
|
'grep -q ILP32 >/dev/null');
|
||||||
return "linux-x86_64";
|
return { target => "linux-x86_64" };
|
||||||
}
|
}
|
||||||
if ( $GUESSOS =~ '.*86-.*-linux2' ) {
|
],
|
||||||
|
[ '.*86-.*-linux2',
|
||||||
|
sub {
|
||||||
# On machines where the compiler understands -m32, prefer a
|
# On machines where the compiler understands -m32, prefer a
|
||||||
# config target that uses it
|
# config target that uses it
|
||||||
return "linux-x86"
|
return { target => "linux-x86" }
|
||||||
if okrun("$CC -m32 -E -x c /dev/null >/dev/null 2>&1");
|
if okrun("$CC -m32 -E -x c /dev/null >/dev/null 2>&1");
|
||||||
return "linux-elf"
|
return { target => "linux-elf" };
|
||||||
}
|
}
|
||||||
return "linux-aout" if $GUESSOS =~ '.*86-.*-linux1';
|
],
|
||||||
return "linux-generic32" if $GUESSOS =~ '.*-.*-linux.';
|
[ '.*86-.*-linux1', { target => "linux-aout" } ],
|
||||||
if ( $GUESSOS =~ 'sun4[uv].*-.*-solaris2' ) {
|
[ '.*-.*-linux.', { target => "linux-generic32" } ],
|
||||||
|
[ 'sun4[uv].*-.*-solaris2',
|
||||||
|
sub {
|
||||||
|
my $KERNEL_BITS = $ENV{KERNEL_BITS};
|
||||||
my $ISA64 = `isainfo 2>/dev/null | grep sparcv9`;
|
my $ISA64 = `isainfo 2>/dev/null | grep sparcv9`;
|
||||||
if ( $ISA64 ne "" && $KERNEL_BITS eq '' ) {
|
if ( $ISA64 ne "" && $KERNEL_BITS eq '' ) {
|
||||||
if ( $CCVENDOR eq "sun" && $CCVER >= 500 ) {
|
if ( $CCVENDOR eq "sun" && $CCVER >= 500 ) {
|
||||||
@ -677,7 +698,7 @@ WARNING! To build 32-bit package, do this:
|
|||||||
$WHERE/Configure solaris-sparcv9-gcc
|
$WHERE/Configure solaris-sparcv9-gcc
|
||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
return "solaris64-sparcv9-gcc";
|
return { target => "solaris64-sparcv9" };
|
||||||
} elsif ( $GCC_ARCH eq "-m32" ) {
|
} elsif ( $GCC_ARCH eq "-m32" ) {
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI and you wish
|
NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI and you wish
|
||||||
@ -687,40 +708,44 @@ EOF
|
|||||||
maybe_abort();
|
maybe_abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "solaris64-sparcv9-$CC" if $ISA64 ne "" && $KERNEL_BITS eq '64';
|
return { target => "solaris64-sparcv9" }
|
||||||
return "solaris-sparcv9-$CC";
|
if $ISA64 ne "" && $KERNEL_BITS eq '64';
|
||||||
|
return { target => "solaris-sparcv9" };
|
||||||
}
|
}
|
||||||
return "solaris-sparcv8-$CC" if $GUESSOS =~ 'sun4m-.*-solaris2';
|
],
|
||||||
return "solaris-sparcv8-$CC" if $GUESSOS =~ 'sun4d-.*-solaris2';
|
[ 'sun4m-.*-solaris2', { target => "solaris-sparcv8" } ],
|
||||||
return "solaris-sparcv7-$CC" if $GUESSOS =~ 'sun4.*-.*-solaris2';
|
[ 'sun4d-.*-solaris2', { target => "solaris-sparcv8" } ],
|
||||||
if ( $GUESSOS =~ '.*86.*-.*-solaris2' ) {
|
[ 'sun4.*-.*-solaris2', { target => "solaris-sparcv7" } ],
|
||||||
|
[ '.*86.*-.*-solaris2',
|
||||||
|
sub {
|
||||||
|
my $KERNEL_BITS = $ENV{KERNEL_BITS};
|
||||||
my $ISA64 = `isainfo 2>/dev/null | grep amd64`;
|
my $ISA64 = `isainfo 2>/dev/null | grep amd64`;
|
||||||
my $KB = $KERNEL_BITS // '64';
|
my $KB = $KERNEL_BITS // '64';
|
||||||
return "solaris64-x86_64-$CC" if $ISA64 ne "" && $KB eq '64';
|
return { target => "solaris64-x86_64" }
|
||||||
|
if $ISA64 ne "" && $KB eq '64';
|
||||||
my $REL = uname('-r');
|
my $REL = uname('-r');
|
||||||
$REL =~ s/5\.//;
|
$REL =~ s/5\.//;
|
||||||
$options .= " no-sse2" if int($REL) < 10;
|
my @tmp_disable = ();
|
||||||
return "solaris-x86-$CC";
|
push @tmp_disable, 'sse2' if int($REL) < 10;
|
||||||
|
return { target => "solaris-x86",
|
||||||
|
disable => [ @tmp_disable ] };
|
||||||
}
|
}
|
||||||
return "sunos-$CC" if $GUESSOS =~ '.*-.*-sunos4';
|
],
|
||||||
if ( $GUESSOS =~ '.*86.*-.*-bsdi4' ) {
|
# We don't have any sunos target in Configurations/*.conf, so why here?
|
||||||
$options .= " no-sse2";
|
[ '.*-.*-sunos4', { target => "sunos" } ],
|
||||||
$__CNF_LDFLAGS .= " -ldl";
|
[ '.*86.*-.*-bsdi4', { target => "BSD-x86-elf",
|
||||||
return "BSD-x86-elf";
|
lflags => [ '-ldl' ],
|
||||||
}
|
disable => [ 'sse2' ] } ],
|
||||||
if ( $GUESSOS =~ 'alpha.*-.*-.*bsd.*' ) {
|
[ 'alpha.*-.*-.*bsd.*', { target => "BSD-generic64",
|
||||||
$__CNF_CPPFLAGS .= " -DL_ENDIAN";
|
defines => [ 'L_ENDIAN' ] } ],
|
||||||
return "BSD-generic64";
|
[ 'powerpc64-.*-.*bsd.*', { target => "BSD-generic64",
|
||||||
}
|
defines => [ 'B_ENDIAN' ] } ],
|
||||||
if ( $GUESSOS =~ 'powerpc64-.*-.*bsd.*' ) {
|
[ 'sparc64-.*-.*bsd.*', { target => "BSD-sparc64" } ],
|
||||||
$__CNF_CPPFLAGS .= " -DB_ENDIAN";
|
[ 'ia64-.*-.*bsd.*', { target => "BSD-ia64" } ],
|
||||||
return "BSD-generic64";
|
[ 'x86_64-.*-dragonfly.*', { target => "BSD-x86_64" } ],
|
||||||
}
|
[ 'amd64-.*-.*bsd.*', { target => "BSD-x86_64" } ],
|
||||||
return "BSD-sparc64" if $GUESSOS =~ 'sparc64-.*-.*bsd.*';
|
[ '.*86.*-.*-.*bsd.*',
|
||||||
return "BSD-ia64" if $GUESSOS =~ 'ia64-.*-.*bsd.*';
|
sub {
|
||||||
return "BSD-x86_64" if $GUESSOS =~ 'x86_64-.*-dragonfly.*';
|
|
||||||
return "BSD-x86_64" if $GUESSOS =~ 'amd64-.*-.*bsd.*';
|
|
||||||
if ( $GUESSOS =~ '.*86.*-.*-.*bsd.*' ) {
|
|
||||||
# mimic ld behaviour when it's looking for libc...
|
# mimic ld behaviour when it's looking for libc...
|
||||||
my $libc;
|
my $libc;
|
||||||
if ( -l "/usr/lib/libc.so" ) {
|
if ( -l "/usr/lib/libc.so" ) {
|
||||||
@ -731,53 +756,54 @@ EOF
|
|||||||
`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`;
|
`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`;
|
||||||
}
|
}
|
||||||
my $what = `file -L $libc 2>/dev/null`;
|
my $what = `file -L $libc 2>/dev/null`;
|
||||||
return "BSD-x86-elf" if $what =~ /ELF/;
|
return { target => "BSD-x86-elf" } if $what =~ /ELF/;
|
||||||
$options .= " no-sse2";
|
return { target => "BSD-x86",
|
||||||
return "BSD-x86";
|
disable => [ 'sse2' ] };
|
||||||
}
|
}
|
||||||
return "BSD-generic32" if $GUESSOS =~ '.*-.*-.*bsd.*';
|
],
|
||||||
return "haiku-x86_64" if $GUESSOS =~ 'x86_64-.*-haiku';
|
[ '.*-.*-.*bsd.*', { target => "BSD-generic32" } ],
|
||||||
return "haiku-x86" if $GUESSOS =~ '.*-.*-haiku';
|
[ 'x86_64-.*-haiku', { target => "haiku-x86_64" } ],
|
||||||
return "osf1-alpha-cc" if $GUESSOS =~ '.*-.*-osf';
|
[ '.*-.*-haiku', { target => "haiku-x86" } ],
|
||||||
return "tru64-alpha-cc" if $GUESSOS =~ '.*-.*-tru64';
|
[ '.*-.*-osf', { target => "osf1-alpha" } ],
|
||||||
if ( $GUESSOS =~ '.*-.*-[Uu]nix[Ww]are7' ) {
|
[ '.*-.*-tru64', { target => "tru64-alpha" } ],
|
||||||
$options .= "no-sse2";
|
[ '.*-.*-[Uu]nix[Ww]are7',
|
||||||
return "unixware-7-gcc" if $CCVENDOR eq "gnu";
|
sub {
|
||||||
$__CNF_CPPFLAGS .= " -D__i386__";
|
return { target => "unixware-7",
|
||||||
return "unixware-7";
|
disable => [ 'sse2' ] } if $CCVENDOR eq "gnu";
|
||||||
|
return { target => "unixware-7",
|
||||||
|
defines => [ '__i386__' ] };
|
||||||
}
|
}
|
||||||
if ( $GUESSOS =~ '.*-.*-[Uu]nix[Ww]are20*' ) {
|
],
|
||||||
$options .= " no-sse2 no-sha512";
|
[ '.*-.*-[Uu]nix[Ww]are20.*', { target => "unixware-2.0",
|
||||||
return "unixware-2.0";
|
disable => [ 'sse2', 'sha512' ] } ],
|
||||||
}
|
[ '.*-.*-[Uu]nix[Ww]are21.*', { target => "unixware-2.1",
|
||||||
if ( $GUESSOS =~ '.*-.*-[Uu]nix[Ww]are21*' ) {
|
disable => [ 'sse2', 'sha512' ] } ],
|
||||||
$options .= " no-sse2 no-sha512";
|
[ '.*-.*-vos', { target => "vos",
|
||||||
return "unixware-2.1";
|
disable => [ 'threads', 'shared', 'asm',
|
||||||
}
|
'dso' ] } ],
|
||||||
if ( $GUESSOS =~ '.*-.*-vos' ) {
|
[ 'BS2000-siemens-sysv4', { target => "BS2000-OSD" } ],
|
||||||
$options .= " no-threads no-shared no-asm no-dso";
|
[ 'i[3456]86-.*-cygwin', { target => "Cygwin-x86" } ],
|
||||||
return "vos-$CC";
|
[ '.*-.*-cygwin',
|
||||||
}
|
sub { return { target => "Cygwin-${MACHINE}" } } ],
|
||||||
return "BS2000-OSD" if $GUESSOS =~ 'BS2000-siemens-sysv4';
|
[ 'x86-.*-android|i.86-.*-android', { target => "android-x86" } ],
|
||||||
return "Cygwin-x86" if $GUESSOS =~ 'i[3456]86-.*-cygwin';
|
[ 'armv[7-9].*-.*-android', { target => "android-armeabi",
|
||||||
return "Cygwin-${MACHINE}" if $GUESSOS =~ '.*-.*-cygwin';
|
cflags => [ '-march=armv7-a' ],
|
||||||
return "android-x86" if $GUESSOS =~ 'x86-.*-android|i.86-.*-android';
|
cxxflags => [ '-march=armv7-a' ] } ],
|
||||||
if ( $GUESSOS =~ 'armv[7-9].*-.*-android' ) {
|
[ 'arm.*-.*-android', { target => "android-armeabi" } ],
|
||||||
$__CNF_CFLAGS .= " -march=armv7-a";
|
[ '.*-hpux1.*',
|
||||||
$__CNF_CXXFLAGS .= " -march=armv7-a";
|
sub {
|
||||||
return "android-armeabi";
|
my $KERNEL_BITS = $ENV{KERNEL_BITS};
|
||||||
}
|
my %common_return = ( defines => [ '_REENTRANT' ] );
|
||||||
return "android-armeabi" if $GUESSOS =~ 'arm.*-.*-android';
|
$KERNEL_BITS ||= `getconf KERNEL_BITS 2>/dev/null` // '32';
|
||||||
if ( $GUESSOS =~ '.*-hpux1.*' ) {
|
|
||||||
$OUT = "hpux64-parisc2-gcc" if $CCVENDOR eq "gnu" && $GCC_BITS eq '64';
|
|
||||||
$KERNEL_BITS //= `getconf KERNEL_BITS 2>/dev/null` // '32';
|
|
||||||
# See <sys/unistd.h> for further info on CPU_VERSION.
|
# See <sys/unistd.h> for further info on CPU_VERSION.
|
||||||
my $CPU_VERSION = `getconf CPU_VERSION 2>/dev/null` // 0;
|
my $CPU_VERSION = `getconf CPU_VERSION 2>/dev/null` // 0;
|
||||||
$__CNF_CPPFLAGS .= " -D_REENTRANT";
|
|
||||||
if ( $CPU_VERSION >= 768 ) {
|
if ( $CPU_VERSION >= 768 ) {
|
||||||
# IA-64 CPU
|
# IA-64 CPU
|
||||||
return "hpux64-ia64-cc" if $KERNEL_BITS eq '64' && ! $CCVENDOR;
|
return { target => "hpux64-ia64",
|
||||||
return "hpux-ia64-cc"
|
%common_return }
|
||||||
|
if $KERNEL_BITS eq '64' && ! $CCVENDOR;
|
||||||
|
return { target => "hpux-ia64",
|
||||||
|
%common_return };
|
||||||
}
|
}
|
||||||
if ( $CPU_VERSION >= 532 ) {
|
if ( $CPU_VERSION >= 532 ) {
|
||||||
# PA-RISC 2.x CPU
|
# PA-RISC 2.x CPU
|
||||||
@ -785,7 +811,9 @@ EOF
|
|||||||
# target. This is compensated for by run-time detection
|
# target. This is compensated for by run-time detection
|
||||||
# in most critical assembly modules and taking advantage
|
# in most critical assembly modules and taking advantage
|
||||||
# of 2.0 architecture in PA-RISC 1.1 build.
|
# of 2.0 architecture in PA-RISC 1.1 build.
|
||||||
$OUT //= "hpux-parisc1_1-${CC}";
|
my $target = ($CCVENDOR eq "gnu" && $GCC_BITS eq '64')
|
||||||
|
? "hpux64-parisc2"
|
||||||
|
: "hpux-parisc1_1";
|
||||||
if ( $KERNEL_BITS eq '64' && ! $CCVENDOR ) {
|
if ( $KERNEL_BITS eq '64' && ! $CCVENDOR ) {
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
WARNING! To build 64-bit package, do this:
|
WARNING! To build 64-bit package, do this:
|
||||||
@ -793,33 +821,35 @@ WARNING! To build 64-bit package, do this:
|
|||||||
EOF
|
EOF
|
||||||
maybe_abort();
|
maybe_abort();
|
||||||
}
|
}
|
||||||
return $OUT;
|
return { target => $target,
|
||||||
|
%common_return };
|
||||||
}
|
}
|
||||||
# PA-RISC 1.1+ CPU?
|
# PA-RISC 1.1+ CPU?
|
||||||
return "hpux-parisc1_1-${CC}" if $CPU_VERSION >= 528;
|
return { target => "hpux-parisc1_1",
|
||||||
|
%common_return } if $CPU_VERSION >= 528;
|
||||||
# PA-RISC 1.0 CPU
|
# PA-RISC 1.0 CPU
|
||||||
return "hpux-parisc-${CC}" if $CPU_VERSION >= 523;
|
return { target => "hpux-parisc",
|
||||||
|
%common_return } if $CPU_VERSION >= 523;
|
||||||
# Motorola(?) CPU
|
# Motorola(?) CPU
|
||||||
return "hpux-$CC";
|
return { target => "hpux",
|
||||||
return $OUT;
|
%common_return };
|
||||||
}
|
}
|
||||||
return "hpux-parisc-$CC" if $GUESSOS =~ '.*-hpux';
|
],
|
||||||
if ( $GUESSOS =~ '.*-aix' ) {
|
[ '.*-hpux', { target => "hpux-parisc" } ],
|
||||||
$KERNEL_BITS //= `getconf KERNEL_BITMODE 2>/dev/null`;
|
[ '.*-aix',
|
||||||
$KERNEL_BITS //= '32';
|
sub {
|
||||||
my $OBJECT_MODE //= 32;
|
my %config = ();
|
||||||
if ( $CCVENDOR eq "gcc" ) {
|
my $KERNEL_BITS = $ENV{KERNEL_BITS};
|
||||||
$OUT = "aix-gcc";
|
$KERNEL_BITS ||= `getconf KERNEL_BITMODE 2>/dev/null`;
|
||||||
|
$KERNEL_BITS ||= '32';
|
||||||
|
my $OBJECT_MODE = $ENV{OBJECT_MODE};
|
||||||
|
$OBJECT_MODE ||= 32;
|
||||||
|
$config{target} = "aix";
|
||||||
if ( $OBJECT_MODE == 64 ) {
|
if ( $OBJECT_MODE == 64 ) {
|
||||||
print 'Your $OBJECT_MODE was found to be set to 64';
|
print 'Your $OBJECT_MODE was found to be set to 64';
|
||||||
$OUT = "aix64-gcc"
|
$config{target} = "aix64";
|
||||||
}
|
|
||||||
} elsif ( $OBJECT_MODE == 64 ) {
|
|
||||||
print 'Your $OBJECT_MODE was found to be set to 64';
|
|
||||||
$OUT = "aix64-cc";
|
|
||||||
} else {
|
} else {
|
||||||
$OUT = "aix-cc";
|
if ( $CCVENDOR ne 'gnu' && $KERNEL_BITS eq '64' ) {
|
||||||
if ( $KERNEL_BITS eq '64' ) {
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
WARNING! To build 64-bit package, do this:
|
WARNING! To build 64-bit package, do this:
|
||||||
$WHERE/Configure aix64-cc
|
$WHERE/Configure aix64-cc
|
||||||
@ -837,6 +867,24 @@ EOF
|
|||||||
}
|
}
|
||||||
return %config;
|
return %config;
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
# Map GUESSOS into OpenSSL terminology.
|
||||||
|
# Returns a hash table with diverse entries, most importantly 'target',
|
||||||
|
# but also other entries that are fitting for Configure's %config
|
||||||
|
# and MACHINE.
|
||||||
|
# It would be nice to fix this so that this weren't necessary. :( XXX
|
||||||
|
sub map_guess {
|
||||||
|
my $GUESSOS = shift;
|
||||||
|
|
||||||
|
foreach my $tuple ( @$map_patterns ) {
|
||||||
|
my $pat = @$tuple[0];
|
||||||
|
next if $GUESSOS !~ /^${pat}$/;
|
||||||
|
my $result = @$tuple[1];
|
||||||
|
$result = $result->() if ref $result eq 'CODE';
|
||||||
|
return %$result;
|
||||||
|
}
|
||||||
|
|
||||||
# Last case, return "z" from x-y-z
|
# Last case, return "z" from x-y-z
|
||||||
my @fields = split(/-/, $GUESSOS);
|
my @fields = split(/-/, $GUESSOS);
|
||||||
@ -871,50 +919,20 @@ EOF
|
|||||||
### MAIN PROCESSING
|
### MAIN PROCESSING
|
||||||
###
|
###
|
||||||
|
|
||||||
# Common part, does all the real work.
|
|
||||||
sub common {
|
|
||||||
my $showguess = shift;
|
|
||||||
|
|
||||||
get_machine_etc();
|
|
||||||
my $GUESSOS = guess_system();
|
|
||||||
print "Operating system: $GUESSOS\n" if $VERBOSE || $showguess;
|
|
||||||
$options .= " 386" if $GUESSOS =~ /i386-/;
|
|
||||||
remove_removed_crypto_directories();
|
|
||||||
determine_compiler_settings();
|
|
||||||
my $TARGET = map_guess($GUESSOS) // $CC;
|
|
||||||
$TARGET = check_solaris_sparc8($TARGET);
|
|
||||||
$TARGET = check_target_exists($TARGET);
|
|
||||||
$options .= " $CONFIG_OPTIONS" if $CONFIG_OPTIONS ne '';
|
|
||||||
return $TARGET;
|
|
||||||
}
|
|
||||||
|
|
||||||
## If called from Configure
|
|
||||||
sub get_platform {
|
sub get_platform {
|
||||||
my $ref = shift;
|
my %options = @_;
|
||||||
my %options = %{$ref};
|
|
||||||
$VERBOSE = 1 if defined $options{verbose};
|
$VERBOSE = 1 if defined $options{verbose};
|
||||||
$options .= " --debug" if defined $options{debug};
|
|
||||||
$WAIT = 0 if defined $options{nowait};
|
$WAIT = 0 if defined $options{nowait};
|
||||||
|
$CC = $options{CC};
|
||||||
|
$CROSS_COMPILE = $options{CROSS_COMPILE} // '';
|
||||||
|
|
||||||
my $TARGET = common(0);
|
my $GUESSOS = guess_system();
|
||||||
|
determine_compiler_settings();
|
||||||
|
|
||||||
# Populate the environment settings.
|
my %ret = map_guess($GUESSOS);
|
||||||
my %env;
|
$ret{target} = check_solaris_sparc8($ret{target});
|
||||||
$env{__CNF_CPPDEFINES} = $__CNF_CPPDEFINES;
|
|
||||||
$env{__CNF_CPPINCLUDES} = $__CNF_CPPINCLUDES;
|
|
||||||
$env{__CNF_CPPFLAGS} = $__CNF_CPPFLAGS;
|
|
||||||
$env{__CNF_CFLAGS} = $__CNF_CFLAGS;
|
|
||||||
$env{__CNF_CXXFLAGS} = $__CNF_CXXFLAGS;
|
|
||||||
|
|
||||||
# Prepare results and return them
|
|
||||||
my %ret = {
|
|
||||||
'target' => $TARGET,
|
|
||||||
'options' => $options,
|
|
||||||
'envvars' => %env,
|
|
||||||
};
|
|
||||||
return %ret;
|
return %ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user