# [no-]threads [don't] try to create a library that is suitable for
# multithreaded applications (default is "threads" if we
# know how to do it)
-# [no-]shared [don't] try to create shared libraries instead of static
-# ones when possible.
+# [no-]shared [don't] try to create shared libraries when supported.
# no-asm do not use assembler
# no-dso do not compile in any native shared-library methods. This
# will ensure that all methods just return NULL.
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
# IBM's AIX.
-"aix-cc", "cc:-O -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR:::",
+"aix-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR:::",
"aix-gcc", "gcc:-O3 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR:::",
#
&usage if ($#ARGV < 0);
-my $flags="";
-my $depflags="";
-my $openssl_algorithm_defines="";
-my $openssl_thread_defines="";
-my $openssl_other_defines="";
-my $libs="";
-my $target="";
-my $options="";
-my $symlink=1;
-foreach (@ARGV)
+my $flags;
+my $depflags;
+my $openssl_algorithm_defines;
+my $openssl_thread_defines;
+my $openssl_other_defines;
+my $libs;
+my $target;
+my $options;
+my $symlink;
+
+my @argvcopy=@ARGV;
+my $argvstring="";
+my $argv_unprocessed=1;
+
+while($argv_unprocessed)
{
- s /^-no-/no-/; # some people just can't read the instructions
- if (/^no-asm$/)
- {
- $no_asm=1;
- $flags .= "-DNO_ASM ";
- $openssl_other_defines .= "#define NO_ASM\n";
- }
- elsif (/^no-dso$/)
- { $no_dso=1; }
- elsif (/^no-threads$/)
- { $no_threads=1; }
- elsif (/^threads$/)
- { $threads=1; }
- elsif (/^no-shared$/)
- { $no_shared=1; }
- elsif (/^shared$/)
- { $no_shared=0; }
- elsif (/^no-symlinks$/)
- { $symlink=0; }
- elsif (/^no-(.+)$/)
+ $flags="";
+ $depflags="";
+ $openssl_algorithm_defines="";
+ $openssl_thread_defines="";
+ $openssl_other_defines="";
+ $libs="";
+ $target="";
+ $options="";
+ $symlink=1;
+
+ $argv_unprocessed=0;
+ $argvstring=join(' ',@argvcopy);
+
+PROCESS_ARGS:
+ foreach (@argvcopy)
{
- my $algo=$1;
- push @skip,$algo;
- $algo =~ tr/[a-z]/[A-Z]/;
- $flags .= "-DNO_$algo ";
- $depflags .= "-DNO_$algo ";
- $openssl_algorithm_defines .= "#define NO_$algo\n";
- if ($algo eq "DES")
- {
- push @skip, "mdc2";
- $options .= " no-mdc2";
- $flags .= "-DNO_MDC2 ";
- $depflags .= "-DNO_MDC2 ";
- $openssl_algorithm_defines .= "#define NO_MDC2\n";
+ s /^-no-/no-/; # some people just can't read the instructions
+ if (/^no-asm$/)
+ {
+ $no_asm=1;
+ $flags .= "-DNO_ASM ";
+ $openssl_other_defines .= "#define NO_ASM\n";
}
- }
- elsif (/^386$/)
- { $processor=386; }
- elsif (/^rsaref$/)
- {
- $libs.= "-lRSAglue -lrsaref ";
- $flags.= "-DRSAref ";
- $openssl_other_defines .= "#define RSAref\n";
- }
- elsif (/^[-+]/)
- {
- if (/^-[lL](.*)$/)
+ elsif (/^no-dso$/)
+ { $no_dso=1; }
+ elsif (/^no-threads$/)
+ { $no_threads=1; }
+ elsif (/^threads$/)
+ { $threads=1; }
+ elsif (/^no-shared$/)
+ { $no_shared=1; }
+ elsif (/^shared$/)
+ { $no_shared=0; }
+ elsif (/^no-symlinks$/)
+ { $symlink=0; }
+ elsif (/^no-(.+)$/)
{
- $libs.=$_." ";
+ my $algo=$1;
+ push @skip,$algo;
+ $algo =~ tr/[a-z]/[A-Z]/;
+ $flags .= "-DNO_$algo ";
+ $depflags .= "-DNO_$algo ";
+ $openssl_algorithm_defines .= "#define NO_$algo\n";
+ if ($algo eq "DES")
+ {
+ push @skip, "mdc2";
+ $options .= " no-mdc2";
+ $flags .= "-DNO_MDC2 ";
+ $depflags .= "-DNO_MDC2 ";
+ $openssl_algorithm_defines .= "#define NO_MDC2\n";
+ }
}
- elsif (/^-[^-]/ or /^\+/)
+ elsif (/^reconfigure/ || /^reconf/)
{
- $flags.=$_." ";
+ if (open(IN,"<$Makefile"))
+ {
+ while (<IN>)
+ {
+ chop;
+ if (/^CONFIGURE_ARGS=(.*)/)
+ {
+ $argvstring=$1;
+ @argvcopy=split(' ',$argvstring);
+ die "Incorrect data to reconfigure, please do a normal configuration\n"
+ if (grep(/^reconf/,@argvcopy));
+ print "Reconfiguring with: $argvstring\n";
+ $argv_unprocessed=1;
+ close(IN);
+ last PROCESS_ARGS;
+ }
+ }
+ close(IN);
+ }
+ die "Insufficient data to reconfigure, please do a normal configuration\n";
}
- elsif (/^--prefix=(.*)$/)
+ elsif (/^386$/)
+ { $processor=386; }
+ elsif (/^rsaref$/)
{
- $prefix=$1;
+ $libs.= "-lRSAglue -lrsaref ";
+ $flags.= "-DRSAref ";
+ $openssl_other_defines .= "#define RSAref\n";
}
- elsif (/^--openssldir=(.*)$/)
+ elsif (/^[-+]/)
{
- $openssldir=$1;
+ if (/^-[lL](.*)$/)
+ {
+ $libs.=$_." ";
+ }
+ elsif (/^-[^-]/ or /^\+/)
+ {
+ $flags.=$_." ";
+ }
+ elsif (/^--prefix=(.*)$/)
+ {
+ $prefix=$1;
+ }
+ elsif (/^--openssldir=(.*)$/)
+ {
+ $openssldir=$1;
+ }
+ elsif (/^--install.prefix=(.*)$/)
+ {
+ $install_prefix=$1;
+ }
+ else
+ {
+ print STDERR $usage;
+ exit(1);
+ }
}
- elsif (/^--install.prefix=(.*)$/)
+ elsif ($_ =~ /^([^:]+):(.+)$/)
{
- $install_prefix=$1;
+ eval "\$table{\$1} = \"$2\""; # allow $xxx constructs in the string
+ $target=$1;
}
else
{
- print STDERR $usage;
- exit(1);
+ die "target already defined - $target\n" if ($target ne "");
+ $target=$_;
+ }
+ unless ($_ eq $target) {
+ if ($options eq "") {
+ $options = $_;
+ } else {
+ $options .= " ".$_;
}
- }
- elsif ($_ =~ /^([^:]+):(.+)$/)
- {
- eval "\$table{\$1} = \"$2\""; # allow $xxx constructs in the string
- $target=$1;
- }
- else
- {
- die "target already defined - $target\n" if ($target ne "");
- $target=$_;
- }
- unless ($_ eq $target) {
- if ($options eq "") {
- $options = $_;
- } else {
- $options .= " ".$_;
}
}
}
exit 0;
}
+print "Configuring for $target\n";
+
&usage if (!defined($table{$target}));
my $IsWindows=scalar grep /^$target$/,@WinTargets;
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $lflags,my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
$md5_obj,$sha1_obj,my $cast_obj,my $rc4_obj,$rmd160_obj,my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag)=
- split(/\s*:\s*/,$table{$target} . ":" x 21 , -1);
+ split(/\s*:\s*/,$table{$target} . ":" x 22 , -1);
$cflags="$flags$cflags" if ($flags ne "");
# The DSO code currently always implements all functions so that no
s/^INSTALL_PREFIX=.*$/INSTALL_PREFIX=$install_prefix/;
s/^PLATFORM=.*$/PLATFORM=$target/;
s/^OPTIONS=.*$/OPTIONS=$options/;
+ s/^CONFIGURE_ARGS=.*$/CONFIGURE_ARGS=$argvstring/;
s/^CC=.*$/CC= $cc/;
s/^CFLAG=.*$/CFLAG= $cflags/;
s/^DEPFLAG=.*$/DEPFLAG= $depflags/;
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $lflags,my $bn_ops,
my $bn_obj,my $des_obj,my $bf_obj,
- $md5_obj,$sha1_obj,my $cast_obj,my $rc4_obj,$rmd160_obj,my $rc5_obj,
- $dso_scheme)=
- split(/\s*:\s*/,$table{$target} . ":" x 20 , -1);
+ my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
+ my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag)=
+ split(/\s*:\s*/,$table{$target} . ":" x 22 , -1);
print <<EOF