Avoid loops, and make sure that it's possible to still build shared
authorRichard Levitte <levitte@openssl.org>
Mon, 24 Jul 2000 20:36:46 +0000 (20:36 +0000)
committerRichard Levitte <levitte@openssl.org>
Mon, 24 Jul 2000 20:36:46 +0000 (20:36 +0000)
libraries even if the "shared" configuration option wasn't chosen.

Configure
Makefile.org

index cf5fe20..6286cad 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -639,14 +639,17 @@ if ($threads)
                $openssl_thread_defines .= $thread_defines;
        }
 
-if ($no_shared)
-       {
-       $shared_target = "";
-       $shared_cflag = "";
-       }
-else
+# You will find shlib_mark1 and shlib_mark2 explained in Makefile.org
+my $shared_mark1 = "";
+my $shared_mark2 = "";
+if ($shared_cflag ne "")
        {
        $cflags = "$shared_cflag $cflags";
+       if (!$no_shared)
+               {
+               $shared_mark1 = ".shlib-clean.";
+               $shared_mark2 = ".shlib.";
+               }
        }
 
 #my ($bn1)=split(/\s+/,$bn_obj);
@@ -751,6 +754,8 @@ while (<IN>)
        s/^RANLIB=.*/RANLIB= $ranlib/;
        s/^PERL=.*/PERL= $perl/;
        s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
+       s/^SHLIB_MARK1=.*/SHLIB_MARK1=$shared_mark1/;
+       s/^SHLIB_MARK2=.*/SHLIB_MARK2=$shared_mark2/;
        s/^LIBS=.*/LIBS=libcrypto\.so\* libssl\.so\*/ if (!$no_shared);
        print OUT $_."\n";
        }
index 3d718c0..e2c818c 100644 (file)
@@ -207,7 +207,7 @@ all: Makefile.ssl
                $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' SDIRS='${SDIRS}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' all ) || exit 1; \
        fi; \
        done; \
-       if $$need_shlib && [ "$(SHLIB_TARGET)" != "" ]; then :; else \
+       if $$need_shlib && [ "$(SHLIB_MARK1)" != "" -o "$(SHLIB_MARK1)" != "" ]; then \
                $(MAKE) $(SHARED_LIBS); \
        fi
 
@@ -229,14 +229,22 @@ sub_all:
                $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' all ) || exit 1; \
        fi; \
        done; \
-       if $$need_shlib && [ "$(SHLIB_TARGET)" != "" ]; then :; else \
+       if $$need_shlib && [ "$(SHLIB_MARK1)" != "" -o "$(SHLIB_MARK1)" != "" ]; then \
                $(MAKE) $(SHARED_LIBS); \
        fi
 
 libcrypto.so: libcrypto.a
-       $(MAKE) $(SHLIB_TARGET)
+       @if [ "$(SHLIB_TARGET)" != "" ]; then \
+               $(MAKE) SHLIBDIRS=crypto $(SHLIB_TARGET); \
+       else \
+               echo "There's no support for shared libraries on this platform" >&2; \
+       fi
 libssl.so: libcrypto.so libssl.a
-       $(MAKE) $(SHLIB_TARGET)
+       @if [ "$(SHLIB_TARGET)" != "" ]; then \
+               $(MAKE) SHLIBDIRS=ssl $(SHLIB_TARGET); \
+       else \
+               echo "There's no support for shared libraries on this platform" >&2; \
+       fi
 
 clean-shared:
        for i in ${SHLIBDIRS}; do \