X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=Configure;h=ce7c895ca0d19644f0ab7b11c29b13665e2f0254;hp=8ee0fbdb2586be67b8f82d401814266cd72e3e25;hb=1dc1ea182be183d8a393fdce4494360aee059cd2;hpb=c72fa2554f5adc03bcc3c6e4ebcd1929e70efed4 diff --git a/Configure b/Configure index 8ee0fbdb25..ce7c895ca0 100755 --- a/Configure +++ b/Configure @@ -1,6 +1,6 @@ #! /usr/bin/env perl # -*- mode: perl; -*- -# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -20,8 +20,9 @@ use File::Path qw/mkpath/; use OpenSSL::fallback "$FindBin::Bin/external/perl/MODULES.txt"; use OpenSSL::Glob; use OpenSSL::Template; +use OpenSSL::config; -# see INSTALL for instructions. +# see INSTALL.md for instructions. my $orig_death_handler = $SIG{__DIE__}; $SIG{__DIE__} = \&death_handler; @@ -204,6 +205,11 @@ my $apitable = { "0.9.8" => 908, }; +# For OpenSSL::config::get_platform +my %guess_opts = (); + +my $dryrun = 0; + our %table = (); our %config = (); our %withargs = (); @@ -232,12 +238,25 @@ sub resolve_config; # Unified build supports separate build dir my $srcdir = catdir(absolutedir(dirname($0))); # catdir ensures local syntax my $blddir = catdir(absolutedir(".")); # catdir ensures local syntax + +# File::Spec::Unix doesn't detect case insensitivity, so we make sure to +# check if the source and build directory are really the same, and make +# them so. This avoids all kinds of confusion later on. +# We must check @File::Spec::ISA rather than using File::Spec->isa() to +# know if File::Spec ended up loading File::Spec::Unix. +$srcdir = $blddir + if (grep(/::Unix$/, @File::Spec::ISA) + && samedir($srcdir, $blddir)); + my $dofile = abs2rel(catfile($srcdir, "util/dofile.pl")); my $local_config_envname = 'OPENSSL_LOCAL_CONFIG_DIR'; -$config{sourcedir} = abs2rel($srcdir); -$config{builddir} = abs2rel($blddir); +$config{sourcedir} = abs2rel($srcdir, $blddir); +$config{builddir} = abs2rel($blddir, $blddir); +# echo -n 'holy hand grenade of antioch' | openssl sha256 +$config{FIPSKEY} = + 'f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813'; # Collect reconfiguration information if needed my @argvcopy=@ARGV; @@ -265,18 +284,37 @@ if (grep /^reconf(igure)?$/, @argvcopy) { $config{perlargv} = [ @argvcopy ]; +# Historical: if known directories in crypto/ have been removed, it means +# that those sub-systems are disabled. +# (the other option would be to removed them from the SUBDIRS statement in +# crypto/build.info) +# We reverse the input list for cosmetic purely reasons, to compensate that +# 'unshift' adds at the front of the list (i.e. in reverse input order). +foreach ( reverse sort( 'aes', 'aria', 'bf', 'camellia', 'cast', 'des', 'dh', + 'dsa', 'ec', 'hmac', 'idea', 'md2', 'md5', 'mdc2', + 'rc2', 'rc4', 'rc5', 'ripemd', 'rsa', 'seed', 'sha', + 'sm2', 'sm3', 'sm4') ) { + unshift @argvcopy, "no-$_" if ! -d catdir($srcdir, 'crypto', $_); +} + # Collect version numbers my %version = (); collect_information( - collect_from_file(catfile($srcdir,'VERSION')), + collect_from_file(catfile($srcdir,'VERSION.dat')), qr/\s*(\w+)\s*=\s*(.*?)\s*$/ => sub { # Only define it if there is a value at all - $version{uc $1} = $2 if $2 ne ''; + if ($2 ne '') { + my $k = $1; + my $v = $2; + # Some values are quoted. Trim the quotes + $v = $1 if $v =~ /^"(.*)"$/; + $version{uc $k} = $v; + } }, "OTHERWISE" => - sub { die "Something wrong with this line:\n$_\nin $srcdir/VERSION" }, + sub { die "Something wrong with this line:\n$_\nin $srcdir/VERSION.dat" }, ); $config{major} = $version{MAJOR} // 'unknown'; @@ -292,7 +330,7 @@ $config{release_date} = $version{RELEASE_DATE} // 'xx XXX xxxx'; $config{version} = "$config{major}.$config{minor}.$config{patch}"; $config{full_version} = "$config{version}$config{prerelease}$config{build_metadata}"; -die "erroneous version information in VERSION: ", +die "erroneous version information in VERSION.dat: ", "$config{version}, $config{shlib_version}\n" unless (defined $version{MAJOR} && defined $version{MINOR} @@ -341,6 +379,7 @@ my @dtls = qw(dtls1 dtls1_2); # For developers: keep it sorted alphabetically my @disablables = ( + "acvp_tests", "afalgeng", "aria", "asan", @@ -412,6 +451,7 @@ my @disablables = ( "rmd160", "scrypt", "sctp", + "secure-memory", "seed", "shared", "siphash", @@ -504,7 +544,7 @@ my @disable_cascades = ( "ssl3-method" => [ "ssl3" ], "zlib" => [ "zlib-dynamic" ], "des" => [ "mdc2" ], - "ec" => [ "ecdsa", "ecdh", "sm2" ], + "ec" => [ "ecdsa", "ecdh", "sm2", "gost" ], sub { $disabled{"ec"} && $disabled{"dh"} } => [ "tls1_3" ], "dgram" => [ "dtls", "sctp" ], @@ -561,8 +601,7 @@ my @disable_cascades = ( "cmp" => [ "crmf" ], # Padlock engine uses low-level AES APIs which are deprecated - sub { $disabled{"deprecated"} - && (!defined $config{"api"} || $config{"api"} >= 30000) } + sub { $disabled{"deprecated-3.0"} } => [ "padlockeng" ] ); @@ -588,9 +627,7 @@ while ((my $first, my $second) = (shift @list, shift @list)) { # To remove something from %disabled, use "enable-foo". # For symmetry, "disable-foo" is a synonym for "no-foo". -&usage if ($#ARGV < 0); - -# For the "make variables" CINCLUDES and CDEFINES, we support lists with +# For the "make variables" CPPINCLUDES and CPPDEFINES, we support lists with # platform specific list separators. Users from those platforms should # recognise those separators from how you set up the PATH to find executables. # The default is the Unix like separator, :, but as an exception, we also @@ -815,6 +852,22 @@ while (@argvcopy) # No longer an automatic choice $auto_threads = 0 if ($1 eq "threads"); } + elsif (/^-d$/) # From older 'config' + { + $config{build_type} = "debug"; + } + elsif (/^-v$/) # From older 'config' + { + $guess_opts{verbose} = 1; + } + elsif (/^-w$/) # From older 'config' + { + $guess_opts{nowait} = 1; + } + elsif (/^-t$/) # From older 'config' + { + $dryrun = 1; + } elsif (/^--strict-warnings$/) { # Pretend that our strict flags is a C flag, and replace it @@ -894,6 +947,16 @@ while (@argvcopy) push @seed_sources, $x; } } + elsif (/^--fips-key=(.*)$/) + { + $user{FIPSKEY}=lc($1); + die "Non-hex character in FIPS key\n" + if $user{FIPSKEY} =~ /[^a-f0-9]/; + die "FIPS key must have even number of characters\n" + if length $1 & 1; + die "FIPS key too long (64 bytes max)\n" + if length $1 > 64; + } elsif (/^--cross-compile-prefix=(.*)$/) { $user{CROSS_COMPILE}=$1; @@ -1030,7 +1093,11 @@ foreach (keys %user) { if (defined $value) { if (ref $user{$_} eq 'ARRAY') { - $user{$_} = [ split /$list_separator_re/, $value ]; + if ($_ eq 'CPPDEFINES' || $_ eq 'CPPINCLUDES') { + $user{$_} = [ split /$list_separator_re/, $value ]; + } else { + $user{$_} = [ $value ]; + } } elsif (!defined $user{$_}) { $user{$_} = $value; } @@ -1044,6 +1111,23 @@ if (grep { /-rpath\b/ } ($user{LDFLAGS} ? @{$user{LDFLAGS}} : ()) "***** any of asan, msan or ubsan\n"; } +# If no target was given, try guessing. +unless ($target) { + my %system_config = OpenSSL::config::get_platform(%guess_opts, %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 { my $disable_type = shift; @@ -1101,6 +1185,9 @@ if (scalar(@seed_sources) == 0) { print "Using os-specific seed configuration\n"; push @seed_sources, 'os'; } +if (scalar(grep { $_ eq 'egd' } @seed_sources) > 0) { + delete $disabled{'egd'}; +} if (scalar(grep { $_ eq 'none' } @seed_sources) > 0) { die "Cannot seed with none and anything else" if scalar(@seed_sources) > 1; warn <<_____ if scalar(@seed_sources) == 1; @@ -1113,7 +1200,8 @@ will not work unless the random generator is seeded manually by the application. Please read the 'Note on random number generation' section in the -INSTALL instructions and the RAND_DRBG(7) manual page for more details. +INSTALL.md instructions and the RAND_DRBG(7) manual page for more +details. ============================== WARNING =============================== _____ @@ -1138,7 +1226,26 @@ if ($d) { } } -&usage if !$table{$target} || $table{$target}->{template}; +if ($target) { + # It's possible that we have different config targets for specific + # toolchains, so we try to detect them, and go for the plain config + # target if not. + my $found; + foreach ( ( "$target-$user{CC}", "$target", undef ) ) { + $found=$_ if $table{$_} && !$table{$_}->{template}; + last if $found; + } + $target = $found; +} else { + # If we don't have a config target now, we try the C compiler as we + # fallback + my $cc = $user{CC} // 'cc'; + $target = $cc if $table{$cc} && !$table{$cc}->{template}; +} + +&usage unless $target; + +exit 0 if $dryrun; # From older 'config' $config{target} = $target; my %target = resolve_config($target); @@ -1473,6 +1580,12 @@ die "Exactly one of SIXTY_FOUR_BIT|SIXTY_FOUR_BIT_LONG|THIRTY_TWO_BIT can be set $config{api} = $config{major} * 10000 + $config{minor} * 100 unless $config{api}; +foreach (keys %$apitable) { + $disabled{"deprecated-$_"} = "deprecation" + if $disabled{deprecated} && $config{api} >= $apitable->{$_}; +} + +disable(); # Run a cascade now # Hack cflags for better warnings (dev option) ####################### @@ -1484,7 +1597,7 @@ $config{cxxflags} = [ map { (my $x = $_) =~ s/([\\\"])/\\$1/g; $x } @{$config{cxxflags}} ] if $config{CXX}; $config{openssl_api_defines} = [ - "OPENSSL_CONFIGURED_API=".$config{api} + "OPENSSL_CONFIGURED_API=".$config{api}, ]; my @strict_warnings_collection=(); @@ -1509,7 +1622,7 @@ if ($strict_warnings) } } -if (grep { $_ eq '-static' } @{$config{LDFLAGS}}) { +if (grep { $_ =~ /(?:^|\s)-static(?:\s|$)/ } @{$config{LDFLAGS}}) { disable('static', 'pic', 'threads'); } @@ -1643,6 +1756,9 @@ foreach my $what (sort keys %disabled) { # There are deprecated disablables that translate to themselves. # They cause disabling cascades, but should otherwise not regiter. next if $deprecated_disablables{$what}; + # The generated $disabled{"deprecated-x.y"} entries are special + # and treated properly elsewhere + next if $what =~ m|^deprecated-|; $config{options} .= " no-$what"; @@ -1794,23 +1910,56 @@ if ($builder eq "unified") { # contains a dollar sign, it had better be escaped, or it will be # taken for a variable name prefix. my %variables = (); - my $variable_re = qr/\$(?P[[:alpha:]][[:alnum:]_]*)/; + # Variable name syntax + my $variable_name_re = qr/(?P[[:alpha:]][[:alnum:]_]*)/; + # Value modifier syntaxes + my $variable_subst_re = qr/\/(?P(?:\\\/|.)*?)\/(?P.*?)/; + # Variable reference + my $variable_simple_re = qr/(?(?:\\\/|.)*?)\}/; + # Tie it all together + my $variable_re = qr/${variable_simple_re}|${variable_w_mod_re}/; + my $expand_variables = sub { my $value = ''; my $value_rest = shift; if ($ENV{CONFIGURE_DEBUG_VARIABLE_EXPAND}) { print STDERR - "DEBUG[\$expand_variables] Parsed '$value_rest' into:\n" + "DEBUG[\$expand_variables] Parsed '$value_rest' ...\n" } - while ($value_rest =~ /(?{$_}}, @values; + if (defined $attrref) { + $handle_attributes->($attr_str, \$$attrref->{$_}, + @values); + } + } + } else { + push @$valueref, @values; + $handle_attributes->($attr_str, $attrref, @values) + if defined $attrref; + } + }; + # We want to detect configdata.pm in the source tree, so we # don't use it if the build tree is different. my $src_configdata = cleanfile($srcdir, "configdata.pm", $blddir); @@ -1924,88 +2101,64 @@ if ($builder eq "unified") { } }, qr/^\s* PROGRAMS ${attribs_re} \s* = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my @p = tokenize($expand_variables->($+{VALUE})); - push @programs, @p; - $handle_attributes->($+{ATTRIBS}, - \$attributes{programs}, - @p); - } - }, + => sub { $push_to->(\@programs, undef, + \$attributes{programs}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* LIBS ${attribs_re} \s* = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my @l = tokenize($expand_variables->($+{VALUE})); - push @libraries, @l; - $handle_attributes->($+{ATTRIBS}, - \$attributes{libraries}, - @l); - } - }, + => sub { $push_to->(\@libraries, undef, + \$attributes{libraries}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* MODULES ${attribs_re} \s* = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my @m = tokenize($expand_variables->($+{VALUE})); - push @modules, @m; - $handle_attributes->($+{ATTRIBS}, - \$attributes{modules}, - @m); - } - }, + => sub { $push_to->(\@modules, undef, + \$attributes{modules}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* SCRIPTS ${attribs_re} \s* = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my @s = tokenize($expand_variables->($+{VALUE})); - push @scripts, @s; - $handle_attributes->($+{ATTRIBS}, - \$attributes{scripts}, - @s); - } - }, + => sub { $push_to->(\@scripts, undef, + \$attributes{scripts}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* HTMLDOCS ${index_re} = ${value_re} $/x - => sub { push @{$htmldocs{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%htmldocs, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* MANDOCS ${index_re} = ${value_re} $/x - => sub { push @{$mandocs{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, - qr/^\s* ORDINALS ${index_re} = ${value_re} $/x - => sub { push @{$ordinals{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%mandocs, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* SOURCE ${index_re} = ${value_re} $/x - => sub { push @{$sources{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%sources, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* SHARED_SOURCE ${index_re} = ${value_re} $/x - => sub { push @{$shared_sources{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%shared_sources, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* INCLUDE ${index_re} = ${value_re} $/x - => sub { push @{$includes{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%includes, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* DEFINE ${index_re} = ${value_re} $/x - => sub { push @{$defines{$expand_variables->($+{INDEX})}}, - tokenize($expand_variables->($+{VALUE})) - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%defines, $expand_variables->($+{INDEX}), + undef, undef, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* DEPEND ${index_re} ${attribs_re} = ${value_re} $/x - => sub { - if (!@skip || $skip[$#skip] > 0) { - my $i = $expand_variables->($+{INDEX}); - my @d = tokenize($expand_variables->($+{VALUE})); - push @{$depends{$i}}, @d; - $handle_attributes->($+{ATTRIBS}, - \$attributes{depends}->{$i}, - @d); - } - }, + => sub { $push_to->(\%depends, $expand_variables->($+{INDEX}), + \$attributes{depends}, $+{ATTRIBS}, + tokenize($expand_variables->($+{VALUE}))) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* GENERATE ${index_re} = ${value_re} $/x - => sub { push @{$generate{$expand_variables->($+{INDEX})}}, - $+{VALUE} - if !@skip || $skip[$#skip] > 0 }, + => sub { $push_to->(\%generate, $expand_variables->($+{INDEX}), + undef, undef, $+{VALUE}) + if !@skip || $skip[$#skip] > 0; }, qr/^\s* (?:\#.*)? $/x => sub { }, "OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" }, "BEFORE" => sub { @@ -2065,9 +2218,9 @@ EOF foreach (@{$sources{$dest}}) { my $s = cleanfile($sourced, $_, $blddir); - # If it isn't in the source tree, we assume it's generated - # in the build tree - if ($s eq $src_configdata || ! -f $s || $generate{$_}) { + # If it's generated or we simply don't find it in the source + # tree, we assume it's in the build tree. + if ($s eq $src_configdata || $generate{$_} || ! -f $s) { $s = cleanfile($buildd, $_, $blddir); } # We recognise C++, C and asm files @@ -2097,9 +2250,9 @@ EOF foreach (@{$shared_sources{$dest}}) { my $s = cleanfile($sourced, $_, $blddir); - # If it isn't in the source tree, we assume it's generated - # in the build tree - if ($s eq $src_configdata || ! -f $s || $generate{$_}) { + # If it's generated or we simply don't find it in the source + # tree, we assume it's in the build tree. + if ($s eq $src_configdata || $generate{$_} || ! -f $s) { $s = cleanfile($buildd, $_, $blddir); } @@ -2139,8 +2292,7 @@ EOF my $gen = $generator[0]; $generator[0] = cleanfile($sourced, $gen, $blddir); - # If the generator isn't in the source tree, we assume it's - # generated in the build tree + # If the generator is itself generated, it's in the build tree if ($generate{$gen}) { $generator[0] = cleanfile($buildd, $gen, $blddir); } @@ -2162,23 +2314,14 @@ EOF # If we know it's generated, or assume it is because we can't # find it in the source tree, we set file we depend on to be - # in the build tree rather than the source tree, and assume - # and that there are lines to build it in a BEGINRAW..ENDRAW - # section or in the Makefile template. + # in the build tree rather than the source tree. if ($d eq $src_configdata - || ! -f $d || (grep { $d eq $_ } map { cleanfile($srcdir, $_, $blddir) } - grep { /\.h$/ } keys %{$unified_info{generate}})) { + grep { /\.h$/ } keys %{$unified_info{generate}}) + || ! -f $d) { $d = cleanfile($buildd, $_, $blddir); } - # Take note if the file to depend on is being renamed - # Take extra care with files ending with .a, they should - # be treated without that extension, and the extension - # should be added back after treatment. - $d =~ /(\.a)?$/; - my $e = $1 // ""; - $d = $`.$e; $unified_info{depends}->{$ddest}->{$d} = 1; # Fix up associated attributes @@ -2217,9 +2360,6 @@ EOF # be a generated file in the build tree. if (! -f $ddest) { $ddest = cleanfile($buildd, $dest, $blddir); - if ($unified_info{rename}->{$ddest}) { - $ddest = $unified_info{rename}->{$ddest}; - } } } foreach my $v (@{$defines{$dest}}) { @@ -2554,7 +2694,7 @@ print <<"EOF" if ($disabled{threads} eq "unavailable"); The library could not be configured for supporting multi-threaded applications as the compiler options required on this system are not known. -See file INSTALL for details if you need multi-threading. +See file INSTALL.md for details if you need multi-threading. EOF print <<"EOF" if ($no_shared_warn); @@ -2579,7 +2719,7 @@ print <<"EOF"; *** perl configdata.pm --dump *** *** *** *** (If you are new to OpenSSL, you might want to consult the *** -*** 'Troubleshooting' section in the INSTALL file first) *** +*** 'Troubleshooting' section in the INSTALL.md file first) *** *** *** ********************************************************************** EOF @@ -2599,8 +2739,8 @@ sub death_handler { my @message = ( <<"_____", @_ ); Failure! $build_file wasn't produced. -Please read INSTALL and associated NOTES files. You may also have to look over -your available compiler tool chain or change your configuration. +Please read INSTALL.md and associated NOTES-* files. You may also have to +look over your available compiler tool chain or change your configuration. _____ @@ -2933,7 +3073,6 @@ sub usage } print STDERR $i . " "; } - print STDERR "\n\nNOTE: If in doubt, on Unix-ish systems use './config'.\n"; exit(1); } @@ -3120,6 +3259,27 @@ sub absolutedir { return realpath($dir); } +# Check if all paths are one and the same, using stat. They must both exist +# We need this for the cases when File::Spec doesn't detect case insensitivity +# (File::Spec::Unix assumes case sensitivity) +sub samedir { + die "samedir expects two arguments\n" unless scalar @_ == 2; + + my @stat0 = stat($_[0]); # First argument + my @stat1 = stat($_[1]); # Second argument + + die "Couldn't stat $_[0]" unless @stat0; + die "Couldn't stat $_[1]" unless @stat1; + + # Compare device number + return 0 unless ($stat0[0] == $stat1[0]); + # Compare "inode". The perl manual recommends comparing as + # string rather than as number. + return 0 unless ($stat0[1] eq $stat1[1]); + + return 1; # All the same +} + sub quotify { my %processors = ( perl => sub { my $x = shift;