Fix yet anoither 'make clean' breakage.
[openssl.git] / Configure
index 0bbb4777558bff4b6caf2bb9d63afbf0346a0c80..b59f807fbcc8cbfe3743ee217b18f969382c2b22 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -203,6 +203,8 @@ my %table=(
 "debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 "debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 "dist",                "cc:-O::(unknown)::::::",
+"debug-test-64-clang", "clang:$gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Wno-error=language-extension-token -Wno-error=unused-const-variable -Wstrict-overflow -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"darwin64-debug-test-64-clang",  "clang:-arch x86_64 -DL_ENDIAN $gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Wno-error=language-extension-token -Wno-error=unused-const-variable -Wstrict-overflow -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:MACOSX::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 
 # Basic configs that should work on any (32 and less bit) box
 "gcc",         "gcc:-O3::(unknown):::BN_LLONG:::",
@@ -604,7 +606,22 @@ my %table=(
 "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 # iPhoneOS/iOS
-"iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+#
+# It takes three prior-set environment variables to make it work:
+#
+# CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
+# CROSS_TOP=/where/SDKs/are
+# CROSS_SDK=iPhoneOSx.y.sdk
+#
+# Exact paths vary with Xcode releases, but for couple of last ones
+# they would look like this:
+#
+# CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
+# CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
+# CROSS_SDK=iPhoneOS7.0.sdk
+#
+"iphoneos-cross","cc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+"ios64-cross","cc:-O3 -arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR -RC4_CHUNK DES_INT DES_UNROLL -BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 
 ##### A/UX
 "aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
@@ -686,8 +703,6 @@ my $install_prefix= "$ENV{'INSTALL_PREFIX'}";
 my $cross_compile_prefix="";
 my $fipslibdir="/usr/local/ssl/fips-2.0/lib/";
 my $nofipscanistercheck=0;
-my $fipscanisterinternal="n";
-my $fipscanisteronly = 0;
 my $baseaddr="0xFB00000";
 my $no_threads=0;
 my $threads=0;
@@ -744,21 +759,6 @@ my %disabled = ( # "what"         => "comment" [or special keyword "experimental
               );
 my @experimental = ();
 
-# If ssl directory missing assume truncated FIPS tarball
-if (!-d "ssl")
-       {
-       print STDERR "Auto Configuring fipsonly\n";
-       $fips = 1;
-       $nofipscanistercheck = 1;
-       $fipslibdir="";
-       $fipscanisterinternal="y";
-       $fipscanisteronly = 2;
-       if (! -f "crypto/bn/bn_gf2m.c" )
-               {
-               $disabled{ec2m} = "forced";
-               }
-       }
-
 # This is what $depflags will look like with the above defaults
 # (we need this to see if we should advise the user to run "make depend"):
 my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST";
@@ -830,13 +830,17 @@ PROCESS_ARGS:
                                {
                                if ($1 eq "ssl")
                                        {
-                                       $disabled{"ssl2"} = "option(ssl)";
                                        $disabled{"ssl3"} = "option(ssl)";
                                        }
                                elsif ($1 eq "tls")
                                        {
                                        $disabled{"tls1"} = "option(tls)"
                                        }
+                               elsif ($1 eq "ssl3-method")
+                                       {
+                                       $disabled{"ssl3-method"} = "option(ssl)";
+                                       $disabled{"ssl3"} = "option(ssl)";
+                                       }
                                else
                                        {
                                        $disabled{$1} = "option";
@@ -904,32 +908,6 @@ PROCESS_ARGS:
                        $fips = 1;
                        $nofipscanistercheck = 1;
                        }
-               elsif (/^fipscheck$/)
-                       {
-                       if ($fipscanisteronly != 2)
-                               {
-                               print STDERR <<"EOF";
-ERROR: FIPS not autodetected. Not running from restricted tarball??
-EOF
-                               exit(1);
-                               }
-                       }
-               elsif (/^fipscanisteronly$/)
-                       {
-                       $fips = 1;
-                       $nofipscanistercheck = 1;
-                       $fipslibdir="";
-                       $fipscanisterinternal="y";
-                       $fipscanisteronly = 1;
-                       }
-               elsif (/^fipscanisterbuild$/)
-                       {
-                       $fips = 1;
-                       $nofipscanistercheck = 1;
-                       $fipslibdir="";
-                       $fipscanisterinternal="y";
-                       $fipscanisteronly = 1;
-                       }
                elsif (/^[-+]/)
                        {
                        if (/^--prefix=(.*)$/)
@@ -1040,12 +1018,6 @@ if (defined($disabled{"ec"}))
        $disabled{"ecdh"} = "forced";
        }
 
-# SSL 2.0 requires MD5 and RSA
-if (defined($disabled{"md5"}) || defined($disabled{"rsa"}))
-       {
-       $disabled{"ssl2"} = "forced";
-       }
-
 # SSL 3.0 and TLS requires MD5 and SHA and either RSA or DSA+DH
 if (defined($disabled{"md5"}) || defined($disabled{"sha"})
     || (defined($disabled{"rsa"})
@@ -1559,11 +1531,6 @@ $cflags.=" -DOPENSSL_BN_ASM_GF2m" if ($bn_obj =~ /-gf2m/);
 if ($fips)
        {
        $openssl_other_defines.="#define OPENSSL_FIPS\n";
-       if ($fipscanisterinternal eq "y")
-               {
-               $openssl_other_defines.="#define OPENSSL_FIPSCANISTER\n";
-               $cflags = "-DOPENSSL_FIPSCANISTER $cflags";
-               }
        }
 
 $cpuid_obj="mem_clr.o" unless ($cpuid_obj =~ /\.o$/);
@@ -1604,7 +1571,6 @@ if ($aes_obj =~ /\.o$/)
        # aes-xts.o indicates presence of AES_xts_[en|de]crypt...
        $cflags.=" -DAES_XTS_ASM" if ($aes_obj =~ s/\s*aes\-xts\.o//);
        $aes_obj =~ s/\s*(vpaes|aesni)\-x86\.o//g if ($no_sse2);
-       $aes_obj =~ s/\s*(vp|bs)aes-\w*\.o//g if ($fipscanisterinternal eq "y");
        $cflags.=" -DVPAES_ASM" if ($aes_obj =~ m/vpaes/);
        $cflags.=" -DBSAES_ASM" if ($aes_obj =~ m/bsaes/);
        }
@@ -1675,35 +1641,12 @@ if ($strict_warnings)
                }
        }
 
-if ($fipscanisterinternal eq "y")
-       {
-       open(IN,"<fips/fips_auth.in") || die "can't open fips_auth.in";
-       open(OUT,">fips/fips_auth.h") || die "can't open fips_auth.h";
-       while(<IN>)
-               {
-               s/FIPS_AUTH_KEY.*$/FIPS_AUTH_KEY $fips_auth_key/ if defined $fips_auth_key;
-               s/FIPS_AUTH_CRYPTO_OFFICER.*$/FIPS_AUTH_CRYPTO_OFFICER $fips_auth_officer/ if defined $fips_auth_officer;
-               s/FIPS_AUTH_CRYPTO_USER.*$/FIPS_AUTH_CRYPTO_USER $fips_auth_user/ if defined $fips_auth_user;
-               print OUT $_;
-               }
-       close IN;
-       close OUT;
-       }
-
-my $mforg = $fipscanisteronly ? "Makefile.fips" : "Makefile.org";
-
-open(IN,"<$mforg") || die "unable to read $mforg:$!\n";
+open(IN,"<Makefile.org") || die "unable to read Makefile.org:$!\n";
 unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new";
 open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n";
-print OUT "### Generated automatically from $mforg by Configure.\n\n";
+print OUT "### Generated automatically from Makefile.org by Configure.\n\n";
 my $sdirs=0;
 
-if ($fipscanisteronly)
-       {
-       $aes_obj =~ s/aesni-sha1-x86_64.o//;
-       $bn_obj =~ s/modexp512-x86_64.o//;
-       }
-
 while (<IN>)
        {
        chomp;
@@ -1782,7 +1725,6 @@ while (<IN>)
        s/^FIPSCANLIB=.*/FIPSCANLIB=libcrypto/ if $fips;
        s/^SHARED_FIPS=.*/SHARED_FIPS=/;
        s/^SHLIBDIRS=.*/SHLIBDIRS= crypto ssl/;
-       s/^FIPSCANISTERINTERNAL=.*/FIPSCANISTERINTERNAL=$fipscanisterinternal/;
        s/^BASEADDR=.*/BASEADDR=$baseaddr/;
        s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
        s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
@@ -1806,10 +1748,6 @@ while (<IN>)
                s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.\$(SHLIB_MAJOR).dylib .dylib/;
                }
        s/^SHARED_LDFLAGS=.*/SHARED_LDFLAGS=$shared_ldflag/;
-       if ($fipscanisteronly && exists $disabled{"ec2m"})
-               {
-               next if (/ec2_/ || /bn_gf2m/);
-               }
        print OUT $_."\n";
        }
 close(IN);
@@ -2055,9 +1993,7 @@ EOF
        $make_targets .= " gentests" if $symlink;
        (system $make_command.$make_targets) == 0 or die "make $make_targets failed"
                if $make_targets ne "";
-       if ( $fipscanisteronly )
-               {}
-       elsif ( $perl =~ m@^/@) {
+       if ( $perl =~ m@^/@) {
            &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
            &dofile("apps/CA.pl",$perl,'^#!/', '#!%s');
        } else {
@@ -2065,7 +2001,7 @@ EOF
            &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";',  '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
            &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
        }
-       if ($depflags ne $default_depflags && !$make_depend && !$fipscanisteronly) {
+       if ($depflags ne $default_depflags && !$make_depend) {
                print <<EOF;
 
 Since you've disabled or enabled at least one algorithm, you need to do
@@ -2170,21 +2106,6 @@ libraries on this platform, they will at least look at it and try their best
 (but please first make sure you have tried with a current version of OpenSSL).
 EOF
 
-print <<\EOF if ($fipscanisterinternal eq "y");
-
-WARNING: OpenSSL has been configured using unsupported option(s) to internally
-generate a fipscanister.o object module for TESTING PURPOSES ONLY; that
-compiled module is NOT FIPS 140-2 validated and CANNOT be used to replace the
-OpenSSL FIPS Object Module as identified by the CMVP
-(http://csrc.nist.gov/cryptval/) in any application requiring the use of FIPS
-140-2 validated software.
-
-This is a test OpenSSL 2.0 FIPS module.
-
-See the file README.FIPS for details of how to build a test library.
-
-EOF
-
 exit(0);
 
 sub usage