X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=util%2Fmk1mf.pl;h=1e72b9003b5f6050c531e57e9b3433d43b51090a;hb=498abff0ae907dce08f37a1353976755e8c8120e;hp=e83ef7d37df0d24cfd8fbb4b5c13970d9b784f19;hpb=45f55f6a5bdcec411ef08a6f8aae41d5d3d234ad;p=oweals%2Fopenssl.git diff --git a/util/mk1mf.pl b/util/mk1mf.pl index e83ef7d37d..1e72b9003b 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -9,7 +9,7 @@ use Cwd; -$INSTALLTOP="/usr/local/ssl"; +$INSTALLTOP="/usr/local"; $OPENSSLDIR="/usr/local/ssl"; $OPTIONS=""; $ssl_version=""; @@ -50,7 +50,7 @@ my %mf_import = ( PLATFORM => \$mf_platform, CC => \$mf_cc, CFLAG => \$mf_cflag, - DEPFLAG => \$mf_depflag, + DEPFLAG => \$mf_depflag, CPUID_OBJ => \$mf_cpuid_asm, BN_ASM => \$mf_bn_asm, DES_ENC => \$mf_des_asm, @@ -83,8 +83,6 @@ while() { } close(IN); -$debug = 1 if $mf_platform =~ /^debug-/; - if ($mf_fipscanisterinternal eq "y") { $fips = 1; $fipscanisterbuild = 1; @@ -139,13 +137,14 @@ and [options] can be one of no-ssl3 - Skip this version of SSL just-ssl - remove all non-ssl keys/digest no-asm - No x86 asm - no-krb5 - No KRB5 no-srp - No SRP no-ec - No EC - no-ecdsa - No ECDSA - no-ecdh - No ECDH no-engine - No engine + no-egd - No EGD no-hw - No hw + no-async - No Async (use NULL) + no-autoalginit - Don't auto load algorithms in libcrypto + no-autoerrinit - Don't auto load error strings for libcrypto or libssl nasm - Use NASM for x86 asm nw-nasm - Use NASM x86 asm for NetWare nw-mwasm - Use Metrowerks x86 asm for NetWare @@ -177,7 +176,7 @@ $no_static_engine = 0 if (!$shlib); $no_mdc2=1 if ($no_des); -$no_ssl3=1 if ($no_md5 || $no_sha); +$no_ssl3=1 if ($no_md5); $no_ssl3=1 if ($no_rsa && $no_dh); $out_def="out"; @@ -186,6 +185,7 @@ $tmp_def="tmp"; $perl="perl" unless defined $perl; $mkdir="-mkdir" unless defined $mkdir; +$mv="mv" unless defined $mv; ($ssl,$crypto)=("ssl","crypto"); $ranlib="echo ranlib"; @@ -281,9 +281,7 @@ $cflags.=" -DOPENSSL_NO_RC5" if $no_rc5; $cflags.=" -DOPENSSL_NO_MD2" if $no_md2; $cflags.=" -DOPENSSL_NO_MD4" if $no_md4; $cflags.=" -DOPENSSL_NO_MD5" if $no_md5; -$cflags.=" -DOPENSSL_NO_SHA" if $no_sha; -$cflags.=" -DOPENSSL_NO_SHA1" if $no_sha1; -$cflags.=" -DOPENSSL_NO_RIPEMD" if $no_ripemd; +$cflags.=" -DOPENSSL_NO_RMD160" if $no_ripemd; $cflags.=" -DOPENSSL_NO_MDC2" if $no_mdc2; $cflags.=" -DOPENSSL_NO_BF" if $no_bf; $cflags.=" -DOPENSSL_NO_CAST" if $no_cast; @@ -294,17 +292,16 @@ $cflags.=" -DOPENSSL_NO_DH" if $no_dh; $cflags.=" -DOPENSSL_NO_WHIRLPOOL" if $no_whirlpool; $cflags.=" -DOPENSSL_NO_SOCK" if $no_sock; $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3; -$cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext; $cflags.=" -DOPENSSL_NO_SRP" if $no_srp; $cflags.=" -DOPENSSL_NO_CMS" if $no_cms; $cflags.=" -DOPENSSL_NO_ERR" if $no_err; -$cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5; $cflags.=" -DOPENSSL_NO_EC" if $no_ec; -$cflags.=" -DOPENSSL_NO_ECDSA" if $no_ecdsa; -$cflags.=" -DOPENSSL_NO_ECDH" if $no_ecdh; $cflags.=" -DOPENSSL_NO_GOST" if $no_gost; $cflags.=" -DOPENSSL_NO_ENGINE" if $no_engine; $cflags.=" -DOPENSSL_NO_HW" if $no_hw; +$cflags.=" -DOPENSSL_NO_ASYNC" if $no_async; +$cflags.=" -DOPENSSL_NO_AUTOALGINIT" if $no_autoalginit; +$cflags.=" -DOPENSSL_NO_AUTOERRINIT" if $no_autoerrinit; $cflags.=" -DOPENSSL_FIPS" if $fips; $cflags.=" -DOPENSSL_NO_JPAKE" if $no_jpake; $cflags.=" -DOPENSSL_NO_EC2M" if $no_ec2m; @@ -387,22 +384,26 @@ for (;;) $dir=$val; } - if ($key eq "KRB5_INCLUDES") - { $cflags .= " $val";} - if ($key eq "ZLIB_INCLUDE") { $cflags .= " $val" if $val ne "";} if ($key eq "LIBZLIB") { $zlib_lib = "$val" if $val ne "";} - if ($key eq "LIBKRB5") + if ($key eq "EX_LIBS") { $ex_libs .= " $val" if $val ne "";} - if ($key eq "TEST" && (!$fipscanisteronly || $dir =~ /^fips/ )) - { $test.=&var_add($dir,$val, 0); } + # There was a condition here before: + # !$fipscanisteronly || $dir =~ /^fips/ + # It currently fills no function and needs to be rewritten anyway, so + # removed for now. + if ($dir eq "test" && $key eq "EXE") + { + foreach my $t (split /\s+/, $val) { + $test.=&var_add($dir,$t, 0) if $t; } + } - if (($key eq "PROGS") || ($key eq "E_OBJ")) + if ($key eq "EXE_OBJ") { $e_exe.=&var_add($dir,$val, 0); } if ($key eq "LIB") @@ -417,9 +418,6 @@ for (;;) $otherlibs .= " $lib"; } - if ($key eq "EXHEADER") - { $exheader.=&var_add($dir,$val, 1); } - if ($key eq "HEADER") { $header.=&var_add($dir,$val, 1); } @@ -457,7 +455,6 @@ if ($orig_platform eq 'copy') { # Remove opensslconf.h so it doesn't get updated if we configure a # different branch. - $exheader =~ s/[^ ]+\/opensslconf.h//; $header =~ s/[^ ]+\/opensslconf.h//; } @@ -571,7 +568,7 @@ if ($fipscanisteronly) $cp2 = $cp unless defined $cp2; $extra_install= <<"EOF"; - \$(CP) \"\$(INCO_D)${o}*.\[ch\]\" \"\$(INSTALLTOP)${o}include${o}openssl\" + \$(CP) \"include${o}openssl${o}*.\[ch\]\" \"\$(INSTALLTOP)${o}include${o}openssl\" \$(CP) \"\$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin\" \$(MKDIR) \"\$(OPENSSLDIR)\" \$(CP) apps${o}openssl.cnf \"\$(OPENSSLDIR)\" @@ -584,8 +581,8 @@ if ($fipscanisteronly) \$(CP) \"\$(O_FIPSCANISTER).sha1\" \"\$(INSTALLTOP)${o}lib\" \$(CP2) \"fips${o}fips_premain.c\" \"\$(INSTALLTOP)${o}lib\" \$(CP) \"fips${o}fips_premain.c.sha1\" \"\$(INSTALLTOP)${o}lib\" - \$(CP) \"\$(INCO_D)${o}fips.h\" \"\$(INSTALLTOP)${o}include${o}openssl\" - \$(CP) \"\$(INCO_D)${o}fips_rand.h\" \"\$(INSTALLTOP)${o}include${o}openssl\" + \$(CP) \"include${o}openssl${o}fips.h\" \"\$(INSTALLTOP)${o}include${o}openssl\" + \$(CP) \"include${o}openssl${o}fips_rand.h\" \"\$(INSTALLTOP)${o}include${o}openssl\" \$(CP) "\$(BIN_D)${o}fips_standalone_sha1$exep" \"\$(INSTALLTOP)${o}bin\" \$(CP) \"util${o}fipslink.pl\" \"\$(INSTALLTOP)${o}bin\" EOF @@ -621,7 +618,7 @@ $defs= <<"EOF"; # N.B. You MUST use -j on FreeBSD. # This makefile has been automatically generated from the OpenSSL distribution. # This single makefile will build the complete OpenSSL distribution and -# by default leave the 'intertesting' output files in .${o}out and the stuff +# by default leave the 'interesting' output files in .${o}out and the stuff # that needs deleting in .${o}tmp. # The file was generated by running 'make makefile.one', which # does a 'make files', which writes all the environment variables from all @@ -665,15 +662,13 @@ FIPSLINK=\$(PERL) util${o}fipslink.pl OUT_D=$out_dir # The output directory for all the temporary muck TMP_D=$tmp_dir -# The output directory for the header files -INC_D=$inc_dir -INCO_D=$inc_dir${o}openssl PERL=$perl PERLASM_SCHEME=$mf_perlasm_scheme CP=$cp CP2=$cp2 RM=$rm +MV=$mv RANLIB=$ranlib MKDIR=$mkdir MKLIB=$bin_dir$mklib @@ -729,7 +724,7 @@ L_LIBS= \$(L_SSL) \$(L_CRYPTO) $ex_l_libs # Don't touch anything below this point ###################################################### -INC=-I\$(INC_D) -I\$(INCL_D) +INC=-I\$(SRC_D)${o}include -I\$(INCL_D) -I\$(SRC_D)${o}crypto${o}include APP_CFLAGS=\$(INC) \$(CFLAG) \$(APP_CFLAG) LIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) SHLIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) \$(SHLIB_CFLAG) @@ -739,7 +734,7 @@ LIBS_DEP=$libs_dep EOF $rules=<<"EOF"; -all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INCO_D) headers \$(FIPS_SHA1_EXE) $build_targets +all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) headers \$(FIPS_SHA1_EXE) $build_targets banner: $banner @@ -756,22 +751,18 @@ $banner \$(LIB_D): \$(MKDIR) \"\$(LIB_D)\" -\$(INCO_D): \$(INC_D) - \$(MKDIR) \"\$(INCO_D)\" - -\$(INC_D): - \$(MKDIR) \"\$(INC_D)\" - # This needs to be invoked once, when the makefile is first constructed, or # after cleaning. -init: \$(TMP_D) \$(LIB_D) \$(INC_D) \$(INCO_D) \$(BIN_D) \$(TEST_D) headers - \$(PERL) \$(SRC_D)/util/copy-if-different.pl "\$(SRC_D)/crypto/opensslconf.h" "\$(INCO_D)/opensslconf.h" +init: \$(TMP_D) \$(LIB_D) \$(BIN_D) \$(TEST_D) headers -headers: \$(HEADER) \$(EXHEADER) +headers: \$(HEADER) lib: \$(LIBS_DEP) \$(E_SHLIB) -exe: \$(T_EXE) \$(BIN_D)$o\$(E_EXE)$exep +exe: apps tools testapps +apps: \$(BIN_D)$o\$(E_EXE)$exep \$(BIN_D)${o}CA.pl +testapps: \$(T_EXE) +tools: \$(BIN_D)${o}c_rehash install: all \$(MKDIR) \"\$(INSTALLTOP)\" @@ -793,19 +784,11 @@ reallyclean: \$(RM) -rf \$(BIN_D) \$(RM) -rf \$(TEST_D) \$(RM) -rf \$(LIB_D) - \$(RM) -rf \$(INC_D) EOF -if ($orig_platform ne 'copy') - { - $rules .= <<"EOF"; -test: \$(T_EXE) - cd \$(BIN_D) - ..${o}ms${o}test - -EOF - } +$rules .= &do_rehash_rule("rehash.time", "certs/demo apps tools"); +$rules .= &do_test_rule("test", "rehash.time", "run_tests.pl"); my $platform_cpp_symbol = "MK1MF_PLATFORM_$platform"; $platform_cpp_symbol =~ s/-/_/g; @@ -833,10 +816,10 @@ if (open(IN,"crypto/buildinf.h")) } open (OUT,">>crypto/buildinf.h") || die "Can't open buildinf.h"; -printf OUT < "$to${o}$file.new" + \$(MV) "$to${o}$file.new" "$to${o}$file" +EOF + } + # Options picked up from the OPTIONS line in the top level Makefile # generated by Configure. @@ -1409,8 +1390,6 @@ sub read_options "no-md2" => \$no_md2, "no-md4" => \$no_md4, "no-md5" => \$no_md5, - "no-sha" => \$no_sha, - "no-sha1" => \$no_sha1, "no-ripemd" => \$no_ripemd, "no-mdc2" => \$no_mdc2, "no-whirlpool" => \$no_whirlpool, @@ -1419,7 +1398,6 @@ sub read_options "no-rsa" => \$no_rsa, "no-dsa" => \$no_dsa, "no-dh" => \$no_dh, - "no-hmac" => \$no_hmac, "no-asm" => \$no_asm, "nasm" => \$nasm, "nw-nasm" => \$nw_nasm, @@ -1427,7 +1405,6 @@ sub read_options "gaswin" => \$gaswin, "no-ssl3" => \$no_ssl3, "no-ssl3-method" => 0, - "no-tlsext" => \$no_tlsext, "no-srp" => \$no_srp, "no-cms" => \$no_cms, "no-jpake" => \$no_jpake, @@ -1435,21 +1412,23 @@ sub read_options "no-ec_nistp_64_gcc_128" => 0, "no-err" => \$no_err, "no-sock" => \$no_sock, - "no-krb5" => \$no_krb5, "no-ec" => \$no_ec, - "no-ecdsa" => \$no_ecdsa, - "no-ecdh" => \$no_ecdh, "no-gost" => \$no_gost, "no-engine" => \$no_engine, + "no-egd" => 0, "no-hw" => \$no_hw, + "no-async" => \$no_async, + "no-autoalginit" => \$no_autoalginit, + "no-autoerrinit" => \$no_autoerrinit, "just-ssl" => [\$no_rc2, \$no_idea, \$no_des, \$no_bf, \$no_cast, - \$no_md2, \$no_sha, \$no_mdc2, \$no_dsa, \$no_dh, + \$no_md2, \$no_mdc2, \$no_dsa, \$no_dh, \$no_err, \$no_ripemd, \$no_rc5, \$no_aes, \$no_camellia, \$no_seed, \$no_srp], "rsaref" => 0, "gcc" => \$gcc, "debug" => \$debug, + "--debug" => \$debug, "profile" => \$profile, "shlib" => \$shlib, "dll" => \$shlib, @@ -1465,6 +1444,9 @@ sub read_options "no-zlib-dynamic" => 0, "no-ssl-trace" => 0, "no-unit-test" => 0, + "no-deprecated" => 0, + "no-ocb" => 0, + "no-crypto-mdebug" => 0, "fips" => \$fips, "fipscanisterbuild" => [\$fips, \$fipscanisterbuild], "fipscanisteronly" => [\$fips, \$fipscanisterbuild, \$fipscanisteronly], @@ -1522,22 +1504,6 @@ sub read_options $xcflags="-DOPENSSL_EXPERIMENTAL_$ALGO $xcflags"; } - elsif (/^--with-krb5-flavor=(.*)$/) - { - my $krb5_flavor = $1; - if ($krb5_flavor =~ /^force-[Hh]eimdal$/) - { - $xcflags="-DKRB5_HEIMDAL $xcflags"; - } - elsif ($krb5_flavor =~ /^MIT/i) - { - $xcflags="-DKRB5_MIT $xcflags"; - if ($krb5_flavor =~ /^MIT[._-]*1[._-]*[01]/i) - { - $xcflags="-DKRB5_MIT_OLD11 $xcflags" - } - } - } elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; } elsif (/^-[lL].*$/) { $l_flags.="$_ "; } elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/)