aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-08-17 10:23:45 +0000
committerRichard Levitte <levitte@openssl.org>2000-08-17 10:23:45 +0000
commitc59cb511f3d405ea2793202c97b1c035688dc44b (patch)
treeed97a39609461a2b703f9e1ea11c7a30f5df2c9a
parentfa1194d30a430544fa8c5554854efbeca9e59683 (diff)
downloadopenssl-c59cb511f3d405ea2793202c97b1c035688dc44b.tar.gz
Allow reconfiguration. This can be useful if some source update
requires that you configure again, but you don't want to reenter all those configuration arguments again.
-rwxr-xr-xConfigure212
-rw-r--r--Makefile.org1
-rwxr-xr-xconfig2
3 files changed, 132 insertions, 83 deletions
diff --git a/Configure b/Configure
index 741df34981..893540d64d 100755
--- a/Configure
+++ b/Configure
@@ -429,104 +429,149 @@ $perl=$ENV{'PERL'} or $perl=&which("perl5") or $perl=&which("perl")
&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 .= " ".$_;
}
}
}
@@ -546,6 +591,8 @@ if ($target eq "LIST") {
exit 0;
}
+print "Configuring for $target\n";
+
&usage if (!defined($table{$target}));
my $IsWindows=scalar grep /^$target$/,@WinTargets;
@@ -736,6 +783,7 @@ while (<IN>)
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/;
diff --git a/Makefile.org b/Makefile.org
index f85f478b81..f93913f2af 100644
--- a/Makefile.org
+++ b/Makefile.org
@@ -11,6 +11,7 @@ SHLIB_MAJOR=
SHLIB_MINOR=
PLATFORM=dist
OPTIONS=
+CONFIGURE_ARGS=
SHLIB_TARGET=
# INSTALL_PREFIX is for package builders so that they can configure
diff --git a/config b/config
index cf48abc6d1..b972c1fe29 100755
--- a/config
+++ b/config
@@ -559,7 +559,7 @@ OUT="$PREFIX$OUT"
$PERL ./Configure LIST | grep "$OUT" > /dev/null
if [ $? = "0" ]; then
- echo Configuring for $OUT
+ #echo Configuring for $OUT
if [ "$TEST" = "true" ]; then
echo $PERL ./Configure $OUT $options