2 # A bit of an evil hack but it post processes the file ../MINFO which
3 # is generated by `make files` in the top directory.
4 # This script outputs one mega makefile that has no shell stuff or any
5 # funny stuff (if the target is not "copy").
6 # If the target is "copy", then it tries to create a makefile that can be
7 # safely used with the -j flag and that is compatible with the top-level
8 # Makefile, in the sense that it uses the same options and assembler files etc.
12 $INSTALLTOP="/usr/local";
13 $OPENSSLDIR="/usr/local/ssl";
14 $ENGINESDIR="/usr/local/lib/engines";
17 $banner="\t\@echo Building OpenSSL";
19 my $no_static_engine = 1;
23 local $zlib_opt = 0; # 0 = no zlib, 1 = static, 2 = dynamic
25 local $perl_asm = 0; # 1 to autobuild asm files from perl scripts
27 local $fips_canister_path = "";
28 my $fips_premain_dso_exe_path = "";
29 my $fips_premain_c_path = "";
30 my $fips_sha1_exe_path = "";
32 local $fipscanisterbuild = 0;
34 my $fipscanisteronly = 0;
41 my $build_targets = "lib exe";
42 my $libs_dep = "\$(O_CRYPTO) \$(O_SSL)";
44 # Options to import from top level Makefile
47 VERSION => \$ssl_version,
49 INSTALLTOP => \$INSTALLTOP,
50 OPENSSLDIR => \$OPENSSLDIR,
51 ENGINESDIR => \$ENGINESDIR,
52 PLATFORM => \$mf_platform,
55 CFLAG_Q => \$mf_cflag_q,
56 SHARED_CFLAG => \$mf_shared_cflag,
57 DEPFLAG => \$mf_depflag,
58 CPUID_OBJ => \$mf_cpuid_asm,
59 BN_ASM => \$mf_bn_asm,
60 DES_ENC => \$mf_des_asm,
61 AES_ENC => \$mf_aes_asm,
62 BF_ENC => \$mf_bf_asm,
63 CAST_ENC => \$mf_cast_asm,
64 RC4_ENC => \$mf_rc4_asm,
65 RC5_ENC => \$mf_rc5_asm,
66 MD5_ASM_OBJ => \$mf_md5_asm,
67 SHA1_ASM_OBJ => \$mf_sha_asm,
68 RMD160_ASM_OBJ => \$mf_rmd_asm,
69 WP_ASM_OBJ => \$mf_wp_asm,
70 CMLL_ENC => \$mf_cm_asm,
71 MODES_ASM_OBJ => \$mf_modes_asm,
72 ENGINES_ASM_OBJ=> \$mf_engines_asm,
73 PERLASM_SCHEME => \$mf_perlasm_scheme,
74 FIPSCANISTERONLY => \$mf_fipscanisteronly,
75 FIPSCANISTERINTERNAL => \$mf_fipscanisterinternal,
76 EC_ASM => \$mf_ec_asm,
79 open(IN,"<Makefile") || die "unable to open Makefile!\n";
81 my ($mf_opt, $mf_ref);
82 while (($mf_opt, $mf_ref) = each %mf_import) {
83 if (/^$mf_opt\s*=\s*(.*)$/ && !defined($$mfref)) {
90 if ($mf_fipscanisterinternal eq "y") {
92 $fipscanisterbuild = 1;
93 $fipscanisteronly = 1;
97 die "Makefile is not the toplevel Makefile!\n" if $ssl_version eq "";
102 "Mingw32", "GNU C++ - Windows NT or 9x",
103 "Mingw32-files", "Create files with DOS copy ...",
104 "linux-elf","Linux elf",
105 "FreeBSD","FreeBSD distribution",
106 "default","cc under unix",
107 "auto", "auto detect from top level Makefile",
108 "copy", "copy from top level Makefile"
115 if (!&read_options && !defined($ops{$_}))
117 print STDERR "unknown option - $_\n";
118 print STDERR "usage: perl mk1mf.pl [options] [system]\n";
119 print STDERR "\nwhere [system] can be one of the following\n";
120 foreach $i (sort keys %ops)
121 { printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; }
122 print STDERR <<"EOF";
123 and [options] can be one of
124 no-md2 no-md4 no-md5 no-sha no-mdc2 - Skip this digest
126 no-blake2 - No blake2
127 no-rc2 no-rc4 no-rc5 no-idea no-des - Skip this symetric cipher
128 no-bf no-cast no-aes no-camellia no-seed
129 no-rsa no-dsa no-dh - Skip this public key cipher
130 no-ssl3 - Skip this version of SSL
131 just-ssl - remove all non-ssl keys/digest
135 no-engine - No engine
138 no-async - No Async (use NULL)
139 no-autoalginit - Don't auto load algorithms in libcrypto
140 no-autoerrinit - Don't auto load error strings for libcrypto or libssl
141 nasm - Use NASM for x86 asm
142 gaswin - Use GNU as with Mingw32
143 no-socks - No socket code
144 no-err - No error strings
145 dll/shlib - Build shared libraries (MS)
147 profile - Profiling build
150 Values that can be set
151 TMP=tmpdir OUT=outdir SRC=srcdir BIN=binpath INC=header-outdir CC=C-compiler
153 -L<ex_lib_path> -l<ex_lib> - extra library flags (unix)
154 -<ex_cc_flags> - extra 'cc' flags,
155 added (MS), or replace (unix)
161 foreach (grep(!/^$/, split(/ /, $OPTIONS)))
163 print STDERR "unknown option - $_\n" if !&read_options;
166 $no_mdc2=1 if ($no_des);
168 $no_ssl3=1 if ($no_md5);
169 $no_ssl3=1 if ($no_rsa && $no_dh);
175 $perl="perl" unless defined $perl;
176 $mkdir="-mkdir" unless defined $mkdir;
177 $mv="mv" unless defined $mv;
179 ($ssl,$crypto)=("ssl","crypto");
180 $ranlib="echo ranlib";
182 $cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc';
183 $src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}: $platform eq 'copy' ? getcwd() : '.';
184 $bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:'';
186 # $bin_dir.=$o causes a core dump on my sparc :-(
191 push(@INC,"util/pl","pl");
193 if ($platform eq "auto" || $platform eq 'copy') {
194 $orig_platform = $platform;
195 $platform = $mf_platform;
196 print STDERR "Imported platform $mf_platform\n";
199 if ($platform eq "Mingw32")
201 require 'Mingw32.pl';
203 elsif ($platform eq "Mingw32-files")
205 require 'Mingw32f.pl';
207 elsif ($platform eq "FreeBSD")
210 $cflags='-DTERMIO -D_ANSI_SOURCE -O2 -fomit-frame-pointer';
212 elsif ($platform eq "linux-elf")
223 $cflags.=' -DTERMIO';
226 $out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:$out_def.($debug?".dbg":"");
227 $tmp_dir=(defined($VARS{'TMP'}))?$VARS{'TMP'}:$tmp_def.($debug?".dbg":"");
228 $inc_dir=(defined($VARS{'INC'}))?$VARS{'INC'}:$inc_def;
230 $bin_dir=$bin_dir.$o unless ((substr($bin_dir,-1,1) eq $o) || ($bin_dir eq ''));
232 $cflags= "$xcflags$cflags" if $xcflags ne "";
234 $cflags.=" -DOPENSSL_NO_IDEA" if $no_idea;
235 $cflags.=" -DOPENSSL_NO_AES" if $no_aes;
236 $cflags.=" -DOPENSSL_NO_CAMELLIA" if $no_camellia;
237 $cflags.=" -DOPENSSL_NO_SEED" if $no_seed;
238 $cflags.=" -DOPENSSL_NO_RC2" if $no_rc2;
239 $cflags.=" -DOPENSSL_NO_RC4" if $no_rc4;
240 $cflags.=" -DOPENSSL_NO_RC5" if $no_rc5;
241 $cflags.=" -DOPENSSL_NO_MD2" if $no_md2;
242 $cflags.=" -DOPENSSL_NO_MD4" if $no_md4;
243 $cflags.=" -DOPENSSL_NO_MD5" if $no_md5;
244 $cflags.=" -DOPENSSL_NO_RMD160" if $no_ripemd;
245 $cflags.=" -DOPENSSL_NO_MDC2" if $no_mdc2;
246 $cflags.=" -DOPENSSL_NO_BF" if $no_bf;
247 $cflags.=" -DOPENSSL_NO_CAST" if $no_cast;
248 $cflags.=" -DOPENSSL_NO_DES" if $no_des;
249 $cflags.=" -DOPENSSL_NO_RSA" if $no_rsa;
250 $cflags.=" -DOPENSSL_NO_DSA" if $no_dsa;
251 $cflags.=" -DOPENSSL_NO_DH" if $no_dh;
252 $cflags.=" -DOPENSSL_NO_WHIRLPOOL" if $no_whirlpool;
253 $cflags.=" -DOPENSSL_NO_SOCK" if $no_sock;
254 $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3;
255 $cflags.=" -DOPENSSL_NO_SRP" if $no_srp;
256 $cflags.=" -DOPENSSL_NO_CMS" if $no_cms;
257 $cflags.=" -DOPENSSL_NO_ERR" if $no_err;
258 $cflags.=" -DOPENSSL_NO_EC" if $no_ec;
259 $cflags.=" -DOPENSSL_NO_GOST" if $no_gost;
260 $cflags.=" -DOPENSSL_NO_ENGINE" if $no_engine;
261 $cflags.=" -DOPENSSL_NO_HW" if $no_hw;
262 $cflags.=" -DOPENSSL_NO_ASYNC" if $no_async;
263 $cflags.=" -DOPENSSL_NO_AUTOALGINIT" if $no_autoalginit;
264 $cflags.=" -DOPENSSL_NO_AUTOERRINIT" if $no_autoerrinit;
265 $cflags.=" -DOPENSSL_FIPS" if $fips;
266 $cflags.=" -DOPENSSL_NO_EC2M" if $no_ec2m;
267 $cflags.=" -DZLIB" if $zlib_opt;
268 $cflags.=" -DZLIB_SHARED" if $zlib_opt == 2;
269 $cflags.=" -DOPENSSL_PIC";
270 $cflags.=" -DOPENSSL_NO_COMP" if $no_comp;
272 if ($no_static_engine)
274 $cflags .= " -DOPENSSL_NO_STATIC_ENGINE";
278 $cflags .= " -DOPENSSL_NO_DYNAMIC_ENGINE";
281 #$cflags.=" -DRSAref" if $rsaref ne "";
284 ## { $cflags="$c_flags" if ($c_flags ne ""); }
286 { $cflags="$c_flags$cflags" if ($c_flags ne ""); }
288 if ($orig_platform eq 'copy') {
289 $cflags = "$mf_cflag $mf_shared_cflag";
293 $ex_libs="$l_flags$ex_libs" if ($l_flags ne "");
296 %shlib_ex_cflags=("SSL" => " -DOPENSSL_BUILD_SHLIBSSL",
297 "CRYPTO" => " -DOPENSSL_BUILD_SHLIBCRYPTO");
301 $banner ="\t\@echo Make sure you have run 'perl Configure $platform' in the\n";
302 $banner.="\t\@echo top level directory, if you don't have perl, you will\n";
303 $banner.="\t\@echo need to probably edit crypto/bn/bn.h, check the\n";
304 $banner.="\t\@echo documentation for details.\n";
307 # have to do this to allow $(CC) under unix
308 $link="$bin_dir$link" if ($link !~ /^\$/);
310 $INSTALLTOP =~ s|/|$o|g;
311 $OPENSSLDIR =~ s|/|$o|g;
313 #############################################
314 # We parse in input file and 'store' info for later printing.
315 open(IN,"<$infile") || die "unable to open $infile:$!\n";
319 s/\s*$//; # was chop, didn't work in mixture of perls for Windows...
321 ($key,$val)=/^([^=]+)=(.*)/;
322 if ($key eq "RELATIVE_DIRECTORY")
326 if ($fips && $dir =~ /^fips/)
333 $uc =~ s/^lib(.*)\.a/$1/;
336 if (($uc ne "FIPS") || $fipscanisterbuild)
339 $lib_obj{$uc}.=$libobj." ";
342 last if ($val eq "FINISHED");
348 if ($key eq "ZLIB_INCLUDE")
349 { $cflags .= " $val" if $val ne "";}
351 if ($key eq "LIBZLIB")
352 { $zlib_lib = "$val" if $val ne "";}
354 if ($key eq "EX_LIBS")
355 { $ex_libs .= " $val" if $val ne "";}
357 # There was a condition here before:
358 # !$fipscanisteronly || $dir =~ /^fips/
359 # It currently fills no function and needs to be rewritten anyway, so
361 if ($dir eq "test" && $key eq "EXE")
363 foreach my $t (split /\s+/, $val) {
364 $test.=&var_add($dir,$t, 0) if $t; }
367 if ($key eq "EXE_OBJ")
368 { $e_exe.=&var_add($dir,$val, 0); }
373 $lib =~ s/^.*\/([^\/]+)$/$1/;
375 if ($key eq "LIBNAME" && $no_static_engine)
378 $lib =~ s/^.*\/([^\/]+)$/$1/;
379 $otherlibs .= " $lib";
382 if ($key eq "HEADER")
383 { $header.=&var_add($dir,$val, 1); }
385 if ($key eq "LIBOBJ")
387 if ($dir ne "engines" || !$no_static_engine)
388 { $libobj=&var_add($dir,$val, 0); }
390 { push(@engines_obj,split(/\s+/,&var_add($dir,$val,0))); }
392 if ($key eq "LIBNAMES" && $dir eq "engines" && $no_static_engine)
395 if ($key eq "FIPS_EX_OBJ")
397 $fips_ex_obj=&var_add("crypto",$val,0);
400 if ($key eq "FIPSLIBDIR")
403 $fipslibdir =~ s/\/$//;
404 $fipslibdir =~ s/\//$o/g;
407 if ($key eq "BASEADDR")
411 { $_="RELATIVE_DIRECTORY=FINISHED\n"; }
415 if ($orig_platform eq 'copy')
417 # Remove opensslconf.h so it doesn't get updated if we configure a
419 $header =~ s/[^ ]+\/opensslconf.h//;
425 foreach (split " ", $fips_ex_obj)
427 $fips_exclude_obj{$1} = 1 if (/\/([^\/]*)$/);
430 "$mf_cpuid_asm $mf_aes_asm $mf_sha_asm $mf_bn_asm " .
431 "$mf_des_asm $mf_modes_asm")
434 $fips_exclude_obj{$_} = 1;
436 my @ltmp = split " ", $lib_obj{"CRYPTO"};
439 $lib_obj{"CRYPTO"} = "";
443 if (/\/([^\/]*)$/ && exists $fips_exclude_obj{$1})
445 if ($fipscanisterbuild)
447 $lib_obj{"FIPS"} .= "$_ ";
450 elsif (!$fipscanisteronly)
452 $lib_obj{"CRYPTO"} .= "$_ ";
458 if ($fipscanisterbuild)
460 $fips_canister_path = "\$(LIB_D)${o}fipscanister.lib" if $fips_canister_path eq "";
461 $fips_premain_c_path = "\$(LIB_D)${o}fips_premain.c";
465 if ($fips_canister_path eq "")
467 $fips_canister_path = "\$(FIPSLIB_D)${o}fipscanister.lib";
470 if ($fips_premain_c_path eq "")
472 $fips_premain_c_path = "\$(FIPSLIB_D)${o}fips_premain.c";
478 if ($fips_sha1_exe_path eq "")
480 $fips_sha1_exe_path =
481 "\$(BIN_D)${o}fips_standalone_sha1$exep";
486 $fips_sha1_exe_path = "";
489 if ($fips_premain_dso_exe_path eq "")
491 $fips_premain_dso_exe_path = "\$(BIN_D)${o}fips_premain_dso$exep";
494 # $ex_build_targets .= "\$(BIN_D)${o}\$(E_PREMAIN_DSO)$exep" if ($fips);
500 $build_targets .= " \$(LIB_D)$o$crypto_compat \$(PREMAIN_DSO_EXE)";
501 $ex_l_libs .= " \$(O_FIPSCANISTER)";
502 $ex_libs_dep .= " \$(O_FIPSCANISTER)" if $fipscanisterbuild;
504 if ($fipscanisterbuild)
506 $fipslibdir = "\$(LIB_D)";
510 if ($fipslibdir eq "")
512 open (IN, "util/fipslib_path.txt") || fipslib_error();
515 $fipslibdir = "" unless defined($fipslibdir);
516 $fipslibdir =~ s{\R$}{};
517 fipslib_error() if ($fipslibdir eq "");
519 fips_check_files($fipslibdir,
520 "fipscanister.lib", "fipscanister.lib.sha1",
521 "fips_premain.c", "fips_premain.c.sha1");
525 if ($fipscanisteronly)
527 $build_targets = "\$(O_FIPSCANISTER) \$(T_EXE)";
531 $cp2 = $cp unless defined $cp2;
533 $extra_install= <<"EOF";
534 \$(CP) \"include${o}openssl${o}*.\[ch\]\" \"\$(INSTALLTOP)${o}include${o}openssl\"
535 \$(CP) \"\$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin\"
536 \$(MKDIR) \"\$(OPENSSLDIR)\"
537 \$(CP) apps${o}openssl.cnf \"\$(OPENSSLDIR)\"
540 if ($fipscanisteronly)
542 $extra_install = <<"EOF";
543 \$(CP) \"\$(O_FIPSCANISTER)\" \"\$(INSTALLTOP)${o}lib\"
544 \$(CP) \"\$(O_FIPSCANISTER).sha1\" \"\$(INSTALLTOP)${o}lib\"
545 \$(CP2) \"fips${o}fips_premain.c\" \"\$(INSTALLTOP)${o}lib\"
546 \$(CP) \"fips${o}fips_premain.c.sha1\" \"\$(INSTALLTOP)${o}lib\"
547 \$(CP) \"include${o}openssl${o}fips.h\" \"\$(INSTALLTOP)${o}include${o}openssl\"
548 \$(CP) \"include${o}openssl${o}fips_rand.h\" \"\$(INSTALLTOP)${o}include${o}openssl\"
549 \$(CP) "\$(BIN_D)${o}fips_standalone_sha1$exep" \"\$(INSTALLTOP)${o}bin\"
550 \$(CP) \"util${o}fipslink.pl\" \"\$(INSTALLTOP)${o}bin\"
555 $extra_install .= <<"EOF";
556 \$(CP) \"\$(O_SSL)\" \"\$(INSTALLTOP)${o}bin\"
557 \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}bin\"
558 \$(CP) \"\$(L_SSL)\" \"\$(INSTALLTOP)${o}lib\"
559 \$(CP) \"\$(L_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\"
561 if ($no_static_engine)
563 $extra_install .= <<"EOF"
564 \$(MKDIR) \"\$(INSTALLTOP)${o}lib${o}engines\"
565 \$(CP) \"\$(E_SHLIB)\" \"\$(INSTALLTOP)${o}lib${o}engines\"
571 $extra_install .= <<"EOF";
572 \$(CP) \"\$(O_SSL)\" \"\$(INSTALLTOP)${o}lib\"
573 \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\"
575 $ex_libs .= " $zlib_lib" if $zlib_opt == 1;
578 my $asm_def = $orig_platform eq 'copy' ? "" : "ASM=$bin_dir$asm";
580 $cflags =~ s/\((ENGINESDIR|OPENSSLDIR)\)/\(${1}_QQ\)/g;
581 (my $cflags_q = $cflags) =~ s/([\\"])/\\$1/g;
582 (my $INSTALLTOP_Q = $INSTALLTOP) =~ s/([\\"])/\\$1/g;
583 (my $INSTALLTOP_QQ = $INSTALLTOP_Q) =~ s/\\/\\\\/g;
584 (my $OPENSSLDIR_Q = $OPENSSLDIR) =~ s/([\\"])/\\$1/g;
585 (my $OPENSSLDIR_QQ = $OPENSSLDIR_Q) =~ s/\\/\\\\/g;
586 (my $ENGINESDIR_Q = $ENGINESDIR) =~ s/([\\"])/\\$1/g;
587 (my $ENGINESDIR_QQ = $ENGINESDIR_Q) =~ s/\\/\\\\/g;
590 # N.B. You MUST use -j on FreeBSD.
591 # This makefile has been automatically generated from the OpenSSL distribution.
592 # This single makefile will build the complete OpenSSL distribution and
593 # by default leave the 'interesting' output files in .${o}out and the stuff
594 # that needs deleting in .${o}tmp.
595 # The file was generated by running 'make makefile.one', which
596 # does a 'make files', which writes all the environment variables from all
597 # the makefiles to the file call MINFO. This file is used by
598 # util${o}mk1mf.pl to generate makefile.one.
599 # The 'makefile per directory' system suites me when developing this
600 # library and also so I can 'distribute' indervidual library sections.
601 # The one monster makefile better suits building in non-unix
606 $defs .= $preamble if defined $preamble;
609 INSTALLTOP=$INSTALLTOP
610 INSTALLTOP_QQ=$INSTALLTOP_QQ
611 OPENSSLDIR=$OPENSSLDIR
612 OPENSSLDIR_QQ=$OPENSSLDIR_QQ
613 ENGINESDIR=$ENGINESDIR
614 ENGINESDIR_QQ=$ENGINESDIR_QQ
616 # Set your compiler options
623 SHLIB_CFLAG=$shl_cflag
624 APP_EX_OBJ=$app_ex_obj
625 SHLIB_EX_OBJ=$shlib_ex_obj
626 # add extra libraries to this define, for solaris -lsocket -lnsl would
630 # The OpenSSL directory
636 FIPSLINK=\$(PERL) util${o}fipslink.pl
638 # The output directory for everything interesting
640 # The output directory for all the temporary muck
644 PERLASM_SCHEME=$mf_perlasm_scheme
655 # FIPS validated module and support file locations
657 E_PREMAIN_DSO=fips_premain_dso
659 FIPSLIB_D=$fipslibdir
661 FIPS_PREMAIN_SRC=$fips_premain_c_path
662 O_FIPSCANISTER=$fips_canister_path
663 FIPS_SHA1_EXE=$fips_sha1_exe_path
664 PREMAIN_DSO_EXE=$fips_premain_dso_exe_path
666 ######################################################
667 # You should not need to touch anything below this point
668 ######################################################
674 # BIN_D - Binary output directory
675 # TEST_D - Binary test file output directory
676 # LIB_D - library output directory
677 # ENG_D - dynamic engine output directory
678 # Note: if you change these point to different directories then uncomment out
679 # the lines around the 'NB' comment below.
686 # INCL_D - local library directory
687 # OBJ_D - temp object file directory
691 O_SSL= \$(LIB_D)$o$plib\$(SSL)$shlibp
692 O_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$shlibp
693 SO_SSL= $plib\$(SSL)$so_shlibp
694 SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp
695 L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp
696 L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp
698 L_LIBS= \$(L_SSL) \$(L_CRYPTO) $ex_l_libs
700 ######################################################
701 # Don't touch anything below this point
702 ######################################################
704 INC=-I\$(SRC_D)${o}include -I\$(INCL_D) -I\$(SRC_D)${o}crypto${o}include
705 APP_CFLAGS=\$(INC) \$(CFLAG) \$(APP_CFLAG)
706 LIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG)
707 SHLIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) \$(SHLIB_CFLAG)
710 #############################################
714 all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) headers \$(FIPS_SHA1_EXE) $build_targets
720 \$(MKDIR) \"\$(TMP_D)\"
721 # NB: uncomment out these lines if BIN_D, TEST_D and LIB_D are different
723 # \$(MKDIR) \$(BIN_D)
726 # \$(MKDIR) \$(TEST_D)
729 \$(MKDIR) \"\$(LIB_D)\"
731 # This needs to be invoked once, when the makefile is first constructed, or
733 init: \$(TMP_D) \$(LIB_D) \$(BIN_D) \$(TEST_D) headers
737 lib: \$(LIBS_DEP) \$(E_SHLIB)
739 exe: apps tools testapps
740 apps: \$(BIN_D)$o\$(E_EXE)$exep \$(BIN_D)${o}CA.pl
742 tools: \$(BIN_D)${o}c_rehash
745 \$(MKDIR) \"\$(INSTALLTOP)\"
746 \$(MKDIR) \"\$(INSTALLTOP)${o}bin\"
747 \$(MKDIR) \"\$(INSTALLTOP)${o}include\"
748 \$(MKDIR) \"\$(INSTALLTOP)${o}include${o}openssl\"
749 \$(MKDIR) \"\$(INSTALLTOP)${o}lib\"
750 \$(MKDIR) \"\$(INSTALLTOP)${o}lib${o}engines\"
754 \$(RM) \$(TMP_D)$o*.*
757 \$(RM) \$(TMP_D)$o*.*
758 \$(RM) \$(OUT_D)$o*.*
763 \$(RM) -rf \$(TEST_D)
768 $rules .= &do_rehash_rule("rehash.time", "apps tools");
769 $rules .= &do_test_rule("test", "rehash.time", "run_tests.pl");
772 crypto${o}buildinf.h : MINFO
773 \$(PERL) util${o}mkbuildinf.pl "\$(CC) \$(CFLAG_Q)" "\$(PLATFORM)" > crypto${o}buildinf.h
774 $(OBJ_D)${o}cversion${obj} : crypto${o}buildinf.h
777 # Strip off trailing ' '
778 foreach (keys %lib_obj) { $lib_obj{$_}=&clean_up_ws($lib_obj{$_}); }
779 $test=&clean_up_ws($test);
780 $e_exe=&clean_up_ws($e_exe);
781 $header=&clean_up_ws($header);
783 $defs.=&do_defs("HEADER",$header,"\$(INCL_D)","");
784 $rules.=&do_copy_rule("\$(INCL_D)",$header,"");
786 $defs.=&do_defs("T_OBJ",$test,"\$(OBJ_D)",$obj);
787 $rules.=&do_compile_rule("\$(OBJ_D)",$test,"\$(APP_CFLAGS)");
789 $defs.=&do_defs("E_OBJ",$e_exe,"\$(OBJ_D)",$obj);
790 $rules.=&do_compile_rule("\$(OBJ_D)",$e_exe,'-DMONOLITH $(APP_CFLAGS)');
792 # Special case rules for fips_start and fips_end fips_premain_dso
796 if ($fipscanisterbuild)
798 $rules.=&cc_compile_target("\$(OBJ_D)${o}fips_start$obj",
799 "fips${o}fips_canister.c",
800 "-DFIPS_START \$(SHLIB_CFLAGS)");
801 $rules.=&cc_compile_target("\$(OBJ_D)${o}fips_end$obj",
802 "fips${o}fips_canister.c", "\$(SHLIB_CFLAGS)");
804 $rules.=&cc_compile_target("\$(OBJ_D)${o}fips_standalone_sha1$obj",
805 "fips${o}sha${o}fips_standalone_sha1.c",
807 $rules.=&cc_compile_target("\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj",
808 "fips${o}fips_premain.c",
809 "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(APP_CFLAGS)");
817 $asm =~ s/\s+/ $dir\//g;
824 if ($orig_platform eq 'copy') {
825 $lib_obj{CRYPTO} .= fix_asm($mf_md5_asm, 'crypto/md5');
826 $lib_obj{CRYPTO} .= fix_asm($mf_bn_asm, 'crypto/bn');
827 # cpuid is included by the crypto dir
828 #$lib_obj{CRYPTO} .= fix_asm($mf_cpuid_asm, 'crypto');
829 # AES asm files end up included by the aes dir itself
830 #$lib_obj{CRYPTO} .= fix_asm($mf_aes_asm, 'crypto/aes');
831 $lib_obj{CRYPTO} .= fix_asm($mf_sha_asm, 'crypto/sha');
832 $lib_obj{CRYPTO} .= fix_asm($mf_engines_asm, 'engines');
833 $lib_obj{CRYPTO} .= fix_asm($mf_rc4_asm, 'crypto/rc4');
834 $lib_obj{CRYPTO} .= fix_asm($mf_modes_asm, 'crypto/modes');
835 $lib_obj{CRYPTO} .= fix_asm($mf_ec_asm, 'crypto/ec');
838 foreach (values %lib_nam)
840 $lib_obj=$lib_obj{$_};
843 $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj);
844 $lib=($slib)?" \$(SHLIB_CFLAGS)".$shlib_ex_cflags{$_}:" \$(LIB_CFLAGS)";
845 $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib);
848 $defs.=&do_defs("T_EXE",$test,"\$(TEST_D)",$exep);
849 foreach (split(/\s+/,$test))
854 # Check to see if test program is FIPS
857 # If fips perform static link to
859 $t_libs = "\$(O_FIPSCANISTER)";
864 $t_libs = "\$(L_LIBS)";
868 $tt="\$(OBJ_D)${o}$t${obj}";
869 $rules.=&do_link_rule("\$(TEST_D)$o$t$exep",$tt,"\$(LIBS_DEP)","$t_libs \$(EX_LIBS)", $ltype);
872 $defs.=&do_defs("E_SHLIB",$engines . $otherlibs,"\$(ENG_D)",$shlibp);
874 foreach (split(/\s+/,$engines))
877 my @objs = grep {/e_$engine/} @engines_obj;
878 $rules.=&do_compile_rule("\$(OBJ_D)",join(" ",@objs),$lib);
879 map {$_=~s/.*\/([^\/]+)$/\$(OBJ_D)${o}$1$obj/} @objs;
880 $rules.= &do_lib_rule(join(" ",@objs),"\$(ENG_D)$o$engine$shlibp","",$shlib,"");
885 $rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)");
886 #$rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)");
888 foreach (split(" ",$otherlibs))
892 $rules.= &do_lib_rule("\$(${uc}OBJ)","\$(ENG_D)$o$_$shlibp", "", $shlib, "");
900 $rules.= &do_lib_rule("\$(CRYPTOOBJ) \$(O_FIPSCANISTER)",
901 "\$(O_CRYPTO)", "$crypto",
902 $shlib, "\$(SO_CRYPTO)", "\$(BASEADDR)");
906 $rules.= &do_lib_rule("\$(CRYPTOOBJ)",
907 "\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)", "");
908 $rules.= &do_lib_rule("\$(CRYPTOOBJ) \$(O_FIPSCANISTER)",
909 "\$(LIB_D)$o$crypto_compat",$crypto,$shlib,"\$(SO_CRYPTO)", "");
914 $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,
920 if ($fipscanisterbuild)
922 $rules.= &do_rlink_rule("\$(O_FIPSCANISTER)",
923 "\$(OBJ_D)${o}fips_start$obj",
925 "\$(OBJ_D)${o}fips_end$obj",
926 "\$(FIPS_SHA1_EXE)", "");
928 $rules.=&do_link_rule("\$(FIPS_SHA1_EXE)",
929 "\$(OBJ_D)${o}fips_standalone_sha1$obj \$(OBJ_D)${o}sha1dgst$obj $sha1_asm_obj",
930 "","\$(EX_LIBS)", 1);
934 $rules.=&do_link_rule("\$(FIPS_SHA1_EXE)",
935 "\$(OBJ_D)${o}fips_standalone_sha1$obj \$(O_FIPSCANISTER)",
939 $rules.=&do_link_rule("\$(PREMAIN_DSO_EXE)","\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj \$(CRYPTOOBJ) \$(O_FIPSCANISTER)","","\$(EX_LIBS)", 1);
943 $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)", ($fips && !$shlib) ? 2 : 0);
945 $rules.=&do_dofile_rule("\$(BIN_D)","c_rehash","tools/c_rehash.in");
946 $rules.=&do_dofile_rule("\$(BIN_D)","CA.pl","apps/CA.pl.in");
950 if ($platform eq "linux-elf") {
952 # Generate perlasm output files
954 (cd \$(\@D)/..; PERL=perl make -f Makefile asm/\$(\@F))
957 print "###################################################################\n";
960 ###############################################
961 # strip off any trailing .[och] and append the relative directory
962 # also remembering to do nothing if we are in one of the dropped
966 local($dir,$val,$keepext)=@_;
969 return("") if $no_engine && $dir =~ /\/engine/;
970 return("") if $no_hw && $dir =~ /\/hw/;
971 return("") if $no_idea && $dir =~ /\/idea/;
972 return("") if $no_aes && $dir =~ /\/aes/;
973 return("") if $no_camellia && $dir =~ /\/camellia/;
974 return("") if $no_seed && $dir =~ /\/seed/;
975 return("") if $no_rc2 && $dir =~ /\/rc2/;
976 return("") if $no_rc4 && $dir =~ /\/rc4/;
977 return("") if $no_rc5 && $dir =~ /\/rc5/;
978 return("") if $no_rsa && $dir =~ /\/rsa/;
979 return("") if $no_rsa && $dir =~ /^rsaref/;
980 return("") if $no_dsa && $dir =~ /\/dsa/;
981 return("") if $no_dh && $dir =~ /\/dh/;
982 return("") if $no_ec && $dir =~ /\/ec/;
983 return("") if $no_cms && $dir =~ /\/cms/;
984 return("") if $no_comp && $dir =~ /\/comp/;
985 return("") if !$fips && $dir =~ /^fips/;
986 if ($no_des && $dir =~ /\/des/)
988 if ($val =~ /read_pwd/)
989 { return("$dir/read_pwd "); }
993 return("") if $no_mdc2 && $dir =~ /\/mdc2/;
994 return("") if $no_sock && $dir =~ /\/proxy/;
995 return("") if $no_bf && $dir =~ /\/bf/;
996 return("") if $no_cast && $dir =~ /\/cast/;
997 return("") if $no_whirlpool && $dir =~ /\/whrlpool/;
999 $val =~ s/^\s*(.*)\s*$/$1/;
1000 @a=split(/\s+/,$val);
1001 grep(s/\.[och]$//,@a) unless $keepext;
1003 @a=grep(!/^e_.*_3d$/,@a) if $no_des;
1004 @a=grep(!/^e_.*_d$/,@a) if $no_des;
1005 @a=grep(!/^e_.*_ae$/,@a) if $no_idea;
1006 @a=grep(!/^e_.*_i$/,@a) if $no_aes;
1007 @a=grep(!/^e_.*_r2$/,@a) if $no_rc2;
1008 @a=grep(!/^e_.*_r5$/,@a) if $no_rc5;
1009 @a=grep(!/^e_.*_bf$/,@a) if $no_bf;
1010 @a=grep(!/^e_.*_c$/,@a) if $no_cast;
1011 @a=grep(!/^e_rc4$/,@a) if $no_rc4;
1012 @a=grep(!/^e_camellia$/,@a) if $no_camellia;
1013 @a=grep(!/^e_seed$/,@a) if $no_seed;
1015 #@a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3;
1017 @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock;
1019 @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2;
1020 @a=grep(!/(^md4)|(_md4$)/,@a) if $no_md4;
1021 @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5;
1022 @a=grep(!/(rmd)|(ripemd)/,@a) if $no_ripemd;
1023 @a=grep(!/(^blake)/,@a) if $no_blake2;
1025 @a=grep(!/(^d2i_r_)|(^i2d_r_)/,@a) if $no_rsa;
1026 @a=grep(!/(^p_open$)/,@a) if $no_rsa;
1028 @a=grep(!/(m_dss$)|(m_dss1$)/,@a) if $no_dsa;
1029 @a=grep(!/(^d2i_s_)|(^i2d_s_)|(_dsap$)/,@a) if $no_dsa;
1031 @a=grep(!/^n_pkey$/,@a) if $no_rsa || $no_rc4;
1033 @a=grep(!/_dhp$/,@a) if $no_dh;
1035 @a=grep(!/_mdc2$/,@a) if $no_mdc2;
1037 @a=grep(!/(srp)/,@a) if $no_srp;
1039 @a=grep(!/^engine$/,@a) if $no_engine;
1040 @a=grep(!/^hw$/,@a) if $no_hw;
1041 @a=grep(!/(^rsa$)|(^genrsa$)/,@a) if $no_rsa;
1042 @a=grep(!/(^dsa$)|(^gendsa$)|(^dsaparam$)/,@a) if $no_dsa;
1043 @a=grep(!/(^dh$)|(^gendh$)/,@a) if $no_dh;
1045 grep($_="$dir/$_",@a);
1046 @a=grep(!/(^|\/)s_/,@a) if $no_sock;
1047 @a=grep(!/(^|\/)bio_sock/,@a) if $no_sock;
1048 $ret=join(' ',@a)." ";
1052 # change things so that each 'token' is only separated by one space
1057 $w =~ s/^\s*(.*)\s*$/$1/;
1064 local($var,$files,$location,$postfix)=@_;
1066 local(*OUT,$tmp,$t);
1068 $files =~ s/\//$o/g if $o ne '/';
1072 foreach (split(/ /,$files))
1075 $_=&bname($_) unless /^\$/;
1081 if (($_ =~ /bss_file/) && ($postfix eq ".h"))
1083 else { $pf=$postfix; }
1084 if ($_ =~ /BN_ASM/) { $t="$_ "; }
1085 elsif ($_ =~ /BNCO_ASM/){ $t="$_ "; }
1086 elsif ($_ =~ /AES_ASM/){ $t="$_ "; }
1087 elsif ($_ =~ /DES_ENC/) { $t="$_ "; }
1088 elsif ($_ =~ /BF_ENC/) { $t="$_ "; }
1089 elsif ($_ =~ /CAST_ENC/){ $t="$_ "; }
1090 elsif ($_ =~ /RC4_ENC/) { $t="$_ "; }
1091 elsif ($_ =~ /RC5_ENC/) { $t="$_ "; }
1092 elsif ($_ =~ /MD5_ASM/) { $t="$_ "; }
1093 elsif ($_ =~ /SHA1_ASM/){ $t="$_ "; }
1094 elsif ($_ =~ /RMD160_ASM/){ $t="$_ "; }
1095 elsif ($_ =~ /WHIRLPOOL_ASM/){ $t="$_ "; }
1096 elsif ($_ =~ /CPUID_ASM/){ $t="$_ "; }
1097 else { $t="$location${o}$_$pf "; }
1102 chomp($ret); # Does this actually do something? /RL
1107 # return the name with the leading path removed
1111 $ret =~ s/^.*[\\\/]([^\\\/]+)$/$1/;
1115 # return the leading path
1119 $ret =~ s/(^.*)[\\\/][^\\\/]+$/$1/;
1123 ##############################################################
1124 # do a rule for each file that says 'compile' to new direcory
1125 # compile the files in '$files' into $to
1128 local($to,$files,$ex)=@_;
1129 local($ret,$_,$n,$d,$s);
1131 $files =~ s/\//$o/g if $o ne '/';
1132 foreach (split(/\s+/,$files))
1138 $ret.=&cc_compile_target("$to${o}$n$obj","${_}.c",$ex)
1140 elsif (-f ($s="${d}${o}asm${o}${n}.pl") or
1141 ($s=~s/sha256/sha512/ and -f $s) or
1142 -f ($s="${d}${o}${n}.pl"))
1144 $ret.=&perlasm_compile_target("$to${o}$n$obj",$s,$n);
1146 elsif (-f ($s="${d}${o}asm${o}${n}.S") or
1147 -f ($s="${d}${o}${n}.S"))
1149 $ret.=&Sasm_compile_target("$to${o}$n$obj",$s,$n);
1151 elsif (defined &special_compile_target and
1152 ($s=special_compile_target($_)))
1156 else { die "no rule for $_"; }
1161 ##############################################################
1162 # do a rule for each file that says 'compile' to new direcory
1163 sub perlasm_compile_target
1165 my($target,$source,$bname)=@_;
1167 return platform_perlasm_compile_target($target, $source, $bname)
1168 if defined &platform_perlasm_compile_target;
1171 $bname =~ s/(.*)\.[^\.]$/$1/;
1172 $ret ="\$(TMP_D)$o$bname$asm_suffix: $source\n";
1173 $ret.="\t\$(PERL) $source $asmtype \$(CFLAG) \$\@\n";
1174 if ($fipscanisteronly)
1176 $ret .= "\t\$(PERL) util$o.pl . \$@ norunasm \$(CFLAG)\n";
1179 $ret.="$target: \$(TMP_D)$o$bname$asm_suffix\n";
1180 $ret.="\t\$(ASM) $afile\$\@ \$(TMP_D)$o$bname$asm_suffix\n\n";
1184 sub Sasm_compile_target
1186 my($target,$source,$bname)=@_;
1189 $bname =~ s/(.*)\.[^\.]$/$1/;
1190 $ret ="\$(TMP_D)$o$bname.asm: $source\n";
1191 $ret.="\t\$(CC) -E \$(CFLAG) $source >\$\@\n";
1192 $ret.="\t\$(PERL) util\\fipsas.pl . \$@ norunasm \$(CFLAG)\n" if $fipscanisteronly;
1194 $ret.="$target: \$(TMP_D)$o$bname.asm\n";
1195 $ret.="\t\$(ASM) $afile\$\@ \$(TMP_D)$o$bname.asm\n\n";
1199 sub cc_compile_target
1201 local($target,$source,$ex_flags)=@_;
1204 $target =~ s/\//$o/g if $o ne "/";
1205 $source =~ s/\//$o/g if $o ne "/";
1206 $ret ="$target: \$(SRC_D)$o$source\n\t";
1208 $ret.= " -MMD" if $orig_platform eq "copy";
1209 $ret.= " ${ofile}$target $ex_flags -c \$(SRC_D)$o$source\n\n";
1210 $target =~ s/\.o$/.d/;
1211 $ret.=".sinclude \"$target\"\n\n" if $orig_platform eq "copy";
1215 ##############################################################
1218 local($target,$src)=@_;
1219 local($ret,@s,@t,$i);
1221 $target =~ s/\//$o/g if $o ne "/";
1222 $src =~ s/\//$o/g if $o ne "/";
1224 @t=split(/\s+/,$target);
1225 @s=split(/\s+/,$src);
1228 for ($i=0; $i<=$#s; $i++)
1230 my $objfile = $t[$i];
1231 my $srcfile = $s[$i];
1235 my $plasm = $objfile;
1236 $plasm =~ s/${obj}/.pl/;
1237 $ret.="$srcfile: $plasm\n";
1238 $ret.="\t\$(PERL) $plasm $asmtype \$(CFLAG) $srcfile\n\n";
1241 $ret.="$objfile: $srcfile\n";
1242 $ret.="\t\$(ASM) $afile$objfile \$(SRC_D)$o$srcfile\n\n";
1253 ($nn=$n) =~ tr/a-z/A-Z/;
1254 $ret.="$n.dll: \$(${nn}OBJ)\n";
1257 $ret.="\t\$(MKSHLIB) $efile$n.dll $def @<<\n \$(${nn}OBJ_F)\n<<\n";
1263 # do a rule for each file that says 'copy' to new direcory on change
1266 local($to,$files,$p)=@_;
1267 local($ret,$_,$n,$pp);
1270 $files =~ s/\//$o/g if $o ne '/';
1271 foreach (split(/\s+/,$files))
1274 if ($n =~ /bss_file/)
1277 $ret.="$to${o}$n$pp: \$(SRC_D)$o$_$pp\n\t\$(PERL) \$(SRC_D)${o}util${o}copy-if-different.pl \"\$(SRC_D)$o$_$pp\" \"$to${o}$n$pp\"\n\n";
1284 (my $to, my $file, my $tmpl) = @_;
1286 $file =~ s|/|$o|g if $o ne '/';
1289 \$(PERL) "-I." "-Mconfigdata" util/dofile.pl "$tmpl" > "$to${o}$file.new"
1290 \$(MV) "$to${o}$file.new" "$to${o}$file"
1294 # Options picked up from the OPTIONS line in the top level Makefile
1295 # generated by Configure.
1299 # Many options are handled in a similar way. In particular
1300 # no-xxx sets zero or more scalars to 1.
1301 # Process these using the %valid_options hash containing the option
1302 # name and reference to the scalars to set. In some cases the option
1303 # needs no special handling and can be ignored: this is done by
1304 # setting the value to 0.
1306 my %valid_options = (
1307 "no-rc2" => \$no_rc2,
1308 "no-rc4" => \$no_rc4,
1309 "no-rc5" => \$no_rc5,
1310 "no-idea" => \$no_idea,
1311 "no-aes" => \$no_aes,
1312 "no-camellia" => \$no_camellia,
1313 "no-seed" => \$no_seed,
1314 "no-des" => \$no_des,
1316 "no-cast" => \$no_cast,
1317 "no-md2" => \$no_md2,
1318 "no-md4" => \$no_md4,
1319 "no-md5" => \$no_md5,
1320 "no-rmd160" => \$no_ripemd,
1321 "no-blake2" => \$no_blake2,
1322 "no-mdc2" => \$no_mdc2,
1323 "no-whirlpool" => \$no_whirlpool,
1325 [\$no_rc2, \$no_rc4, \$no_rc5, \$no_idea, \$no_rsa],
1326 "no-rsa" => \$no_rsa,
1327 "no-dsa" => \$no_dsa,
1329 "no-asm" => \$no_asm,
1331 "gaswin" => \$gaswin,
1332 "no-ssl3" => \$no_ssl3,
1333 "no-ssl3-method" => 0,
1334 "no-weak-ssl-ciphers" => 0,
1335 "no-srp" => \$no_srp,
1336 "no-cms" => \$no_cms,
1337 "no-ec2m" => \$no_ec2m,
1338 "no-ec_nistp_64_gcc_128" => 0,
1339 "no-err" => \$no_err,
1340 "no-sock" => \$no_sock,
1342 "no-gost" => \$no_gost,
1343 "no-engine" => \$no_engine,
1345 "no-heartbeats" => 0,
1347 "no-async" => \$no_async,
1348 "no-autoalginit" => \$no_autoalginit,
1349 "no-autoerrinit" => \$no_autoerrinit,
1351 [\$no_rc2, \$no_idea, \$no_des, \$no_bf, \$no_cast,
1352 \$no_md2, \$no_mdc2, \$no_dsa, \$no_dh,
1353 \$no_err, \$no_ripemd, \$no_rc5,
1354 \$no_aes, \$no_camellia, \$no_seed, \$no_srp],
1358 "--debug" => \$debug,
1360 "profile" => \$profile,
1372 "no-zlib-dynamic" => 0,
1373 "no-ssl-trace" => 0,
1374 "no-unit-test" => 0,
1375 "no-comp" => \$no_comp,
1376 "no-deprecated" => 0,
1378 "no-crypto-mdebug" => 0,
1379 "no-crypto-mdebug-backtrace" => 0,
1381 "fipscanisterbuild" => [\$fips, \$fipscanisterbuild],
1382 "fipscanisteronly" => [\$fips, \$fipscanisterbuild, \$fipscanisteronly],
1383 "fipscheck" => [\$fips, \$fipscanisterbuild, \$fipscanisteronly],
1386 if (exists $valid_options{$_})
1388 my $r = $valid_options{$_};
1389 if ( ref $r eq "SCALAR")
1391 elsif ( ref $r eq "ARRAY")
1400 elsif (/^enable-zlib$/) { $zlib_opt = 1 if $zlib_opt == 0 }
1401 elsif (/^enable-zlib-dynamic$/)
1405 elsif (/^no-static-engine/ or /^enable-dynamic-engine/)
1407 $no_static_engine = 1;
1409 elsif (/^no-dynamic-engine/ or /^enable-static-engine/)
1411 $no_static_engine = 0;
1413 # There are also enable-xxx options which correspond to
1414 # the no-xxx. Since the scalars are enabled by default
1415 # these can be ignored.
1419 $t =~ s/^enable/no/;
1420 if (exists $valid_options{$t})
1424 elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; }
1425 elsif (/^-[lL].*$/) { $l_flags.="$_ "; }
1426 elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/)
1427 { $c_flags.="$_ "; }
1434 print STDERR "***FIPS module directory sanity check failed***\n";
1435 print STDERR "FIPS module build failed, or was deleted\n";
1436 print STDERR "Please rebuild FIPS module.\n";
1440 sub fips_check_files
1446 print STDERR "FIPS module directory $dir does not exist\n";
1451 if (!-f "$dir${o}$_")
1453 print STDERR "FIPS module file $_ does not exist!\n";
1457 fipslib_error() if ($ret == 0);