Configure 104 KB
Newer Older
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 0x4b0
    END
END
EOF
	close(OUT);
  }
  
print <<EOF;

Configured for $target.
EOF

print <<\EOF if (!$no_threads && !$threads);

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.
EOF

print <<\EOF if ($no_shared_warn);

You gave the option 'shared'.  Normally, that would give you shared libraries.
Unfortunately, the OpenSSL configuration doesn't include shared library support
for this platform yet, so it will pretend you gave the option 'no-shared'.  If
you can inform the developpers (openssl-dev\@openssl.org) how to support shared
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

exit(0);

sub usage
	{
	print STDERR $usage;
	print STDERR "\npick os/compiler from:\n";
	my $j=0;
	my $i;
        my $k=0;
	foreach $i (sort keys %table)
		{
		next if $i =~ /^debug/;
		$k += length($i) + 1;
		if ($k > 78)
			{
			print STDERR "\n";
			$k=length($i);
			}
		print STDERR $i . " ";
		}
	foreach $i (sort keys %table)
		{
		next if $i !~ /^debug/;
		$k += length($i) + 1;
		if ($k > 78)
			{
			print STDERR "\n";
			$k=length($i);
			}
		print STDERR $i . " ";
		}
	print STDERR "\n\nNOTE: If in doubt, on Unix-ish systems use './config'.\n";
	exit(1);
	}

sub which
	{
	my($name)=@_;
	my $path;
	foreach $path (split /:/, $ENV{PATH})
		{
		if (-f "$path/$name$exe_ext" and -x _)
			{
			return "$path/$name$exe_ext" unless ($name eq "perl" and
			 system("$path/$name$exe_ext -e " . '\'exit($]<5.0);\''));
			}
		}
	}

sub dofile
	{
	my $f; my $p; my %m; my @a; my $k; my $ff;
	($f,$p,%m)=@_;

	open(IN,"<$f.in") || open(IN,"<$f") || die "unable to open $f:$!\n";
	@a=<IN>;
	close(IN);
	foreach $k (keys %m)
		{
		grep(/$k/ && ($_=sprintf($m{$k}."\n",$p)),@a);
		}
	open(OUT,">$f.new") || die "unable to open $f.new:$!\n";
	print OUT @a;
	close(OUT);
	rename($f,"$f.bak") || die "unable to rename $f\n" if -e $f;
	rename("$f.new",$f) || die "unable to rename $f.new\n";
	}

sub print_table_entry
	{
	my $target = shift;

	(my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags,
	my $bn_ops,my $cpuid_obj,my $bn_obj,my $des_obj,my $aes_obj, my $bf_obj,
	my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
	my $rc5_obj,my $wp_obj,my $cmll_obj,my $modes_obj, my $engines_obj,
	my $perlasm_scheme,my $dso_scheme,my $shared_target,my $shared_cflag,
	my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags,my $multilib)=
	split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
			
	print <<EOF

*** $target
\$cc           = $cc
\$cflags       = $cflags
\$unistd       = $unistd
\$thread_cflag = $thread_cflag
\$sys_id       = $sys_id
\$lflags       = $lflags
\$bn_ops       = $bn_ops
\$cpuid_obj    = $cpuid_obj
\$bn_obj       = $bn_obj
\$des_obj      = $des_obj
\$aes_obj      = $aes_obj
\$bf_obj       = $bf_obj
\$md5_obj      = $md5_obj
\$sha1_obj     = $sha1_obj
\$cast_obj     = $cast_obj
\$rc4_obj      = $rc4_obj
\$rmd160_obj   = $rmd160_obj
\$rc5_obj      = $rc5_obj
\$wp_obj       = $wp_obj
\$cmll_obj     = $cmll_obj
\$modes_obj    = $modes_obj
\$engines_obj  = $engines_obj
\$perlasm_scheme = $perlasm_scheme
\$dso_scheme   = $dso_scheme
\$shared_target= $shared_target
\$shared_cflag = $shared_cflag
\$shared_ldflag = $shared_ldflag
\$shared_extension = $shared_extension
\$ranlib       = $ranlib
\$arflags      = $arflags
\$multilib     = $multilib
EOF
	}

sub test_sanity
	{
	my $errorcnt = 0;

	print STDERR "=" x 70, "\n";
	print STDERR "=== SANITY TESTING!\n";
	print STDERR "=== No configuration will be done, all other arguments will be ignored!\n";
	print STDERR "=" x 70, "\n";

	foreach $target (sort keys %table)
		{
		@fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);

		if ($fields[$idx_dso_scheme-1] =~ /^(beos|dl|dlfcn|win32|vms)$/)
			{
			$errorcnt++;
			print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
			print STDERR "              in the previous field\n";
			}
		elsif ($fields[$idx_dso_scheme+1] =~ /^(beos|dl|dlfcn|win32|vms)$/)
			{
			$errorcnt++;
			print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
			print STDERR "              in the following field\n";
			}
		elsif ($fields[$idx_dso_scheme] !~ /^(beos|dl|dlfcn|win32|vms|)$/)
			{
			$errorcnt++;
			print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] field = ",$fields[$idx_dso_scheme],"\n";
			print STDERR "              valid values are 'beos', 'dl', 'dlfcn', 'win32' and 'vms'\n";
			}
		}
	print STDERR "No sanity errors detected!\n" if $errorcnt == 0;
	return $errorcnt;
	}