Don't define platform-dependent preprocessor symbols for OPENSSL_THREAD_DEFINES.
[openssl.git] / Configure
index 884893f1792017718b99b34e748fdaf2eb9cc036..5a46712da81620b892b4e6ac88acb95ff352184e 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -103,7 +103,7 @@ my %table=(
 "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
 "debug-bodo",  "gcc:-DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
 "debug-ulf",   "gcc:-DL_ENDIAN -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::$x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
-"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -pedantic -Wall -Wshadow -pipe::-D_REENTRANT::$x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
+"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::$x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
 "debug-levitte-linux-elf","gcc:-DRL_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:::",
 "dist",                "cc:-O::(unknown):::::",
 
@@ -410,7 +410,7 @@ $perl=$ENV{'PERL'} or $perl=&which("perl5") or $perl=&which("perl")
 
 my $flags="";
 my $depflags="";
-my $openssl_exclude_defines="";
+my $openssl_algorithm_defines="";
 my $openssl_thread_defines="";
 my $openssl_other_defines="";
 my $libs="";
@@ -422,7 +422,7 @@ foreach (@ARGV)
                {
                $no_asm=1;
                $flags .= "-DNO_ASM ";
-               $openssl_exclude_defines .= "#define NO_ASM\n";
+               $openssl_other_defines .= "#define NO_ASM\n";
                }
        elsif (/^no-threads$/)
                { $no_threads=1; }
@@ -435,14 +435,14 @@ foreach (@ARGV)
                $algo =~ tr/[a-z]/[A-Z]/;
                $flags .= "-DNO_$algo ";
                $depflags .= "-DNO_$algo ";
-               $openssl_exclude_defines .= "#define NO_$algo\n";
+               $openssl_algorithm_defines .= "#define NO_$algo\n";
                if ($algo eq "DES")
                        {
                        push @skip, "mdc2";
                        $options .= " no-mdc2";
                        $flags .= "-DNO_MDC2 ";
                        $depflags .= "-DNO_MDC2 ";
-                       $openssl_exclude_defines .= "#define NO_MDC2\n";
+                       $openssl_algorithm_defines .= "#define NO_MDC2\n";
                        }
                }
        elsif (/^386$/)
@@ -507,6 +507,14 @@ if ($target eq "TABLE") {
        exit 0;
 }
 
+if ($target eq "LIST") {
+       foreach (sort keys %table) {
+               print;
+               print "\n";
+       }
+       exit 0;
+}
+
 &usage if (!defined($table{$target}));
 
 my $IsWindows=scalar grep /^$target$/,@WinTargets;
@@ -546,14 +554,14 @@ else
        {
        $thread_cflags="-DTHREADS $thread_cflag $cflags";
        $thread_defines .= "#define THREADS\n";
-       my $def;
-       foreach $def (split ' ',$thread_cflag)
-               {
-               if ($def =~ s/^-D//)
-                       {
-                       $thread_defines .= "#define $def\n";
-                       }
-               }
+#      my $def;
+#      foreach $def (split ' ',$thread_cflag)
+#              {
+#              if ($def =~ s/^-D// && $def !~ /^_/)
+#                      {
+#                      $thread_defines .= "#define $def\n";
+#                      }
+#              }
        }       
 
 $lflags="$libs$lflags"if ($libs ne "");
@@ -727,10 +735,11 @@ print OUT "/* opensslconf.h */\n";
 print OUT "/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n";
 
 print OUT "/* OpenSSL was configured with the following options: */\n";
-$openssl_exclude_defines =~ s/^\s*#\s*define\s+(.*)/# ifndef $1\n#  define $1\n# endif/mg;
+$openssl_algorithm_defines =~ s/^\s*#\s*define\s+(.*)/# ifndef $1\n#  define $1\n# endif/mg;
+$openssl_algorithm_defines = "   /* no ciphers excluded */\n" if $openssl_algorithm_defines eq "";
 $openssl_thread_defines =~ s/^\s*#\s*define\s+(.*)/# ifndef $1\n#  define $1\n# endif/mg;
 $openssl_other_defines =~ s/^\s*#\s*define\s+(.*)/# ifndef $1\n#  define $1\n# endif/mg;
-print OUT "#ifdef OPENSSL_EXCLUDE_DEFINES\n$openssl_exclude_defines#endif\n";
+print OUT "#ifdef OPENSSL_ALGORITHM_DEFINES\n$openssl_algorithm_defines#endif\n";
 print OUT "#ifdef OPENSSL_THREAD_DEFINES\n$openssl_thread_defines#endif\n";
 print OUT "#ifdef OPENSSL_OTHER_DEFINES\n$openssl_other_defines#endif\n\n";
 
@@ -870,22 +879,33 @@ exit(0);
 sub usage
        {
        print STDERR $usage;
-       print STDERR "pick os/compiler from:";
+       print STDERR "\npick os/compiler from:\n";
        my $j=0;
        my $i;
+        my $k=0;
        foreach $i (sort keys %table)
                {
                next if $i =~ /^debug/;
-               print STDERR "\n" if ($j++ % 4) == 0;
-               printf(STDERR "%-18s ",$i);
+               $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/;
-               print STDERR "\n" if ($j++ % 4) == 0;
-               printf(STDERR "%-18s ",$i);
+               $k += length($i) + 1;
+               if ($k > 78)
+                       {
+                       print STDERR "\n";
+                       $k=length($i);
+                       }
+               print STDERR $i . " ";
                }
-       print STDERR "\n";
+       print STDERR "\n\nNOTE: If in doubt, on Unix-ish systems use './config'.\n";
        exit(1);
        }