Always build library object files with shared library cflags
authorRichard Levitte <levitte@openssl.org>
Fri, 19 Feb 2016 21:02:41 +0000 (22:02 +0100)
committerRichard Levitte <levitte@openssl.org>
Sat, 20 Feb 2016 15:51:31 +0000 (16:51 +0100)
This takes us away from the idea that we know exactly how our static
libraries are going to get used.  Instead, we make them available to
build shareable things with, be it other shared libraries or DSOs.

On the other hand, we also have greater control of when the shared
library cflags.  They will never be used with object files meant got
binaries, such as apps/openssl or test/test*.

With unified, we take this a bit further and prepare for having to
deal with extra cflags specifically to be used with DSOs (dynamic
engines), libraries and binaries (applications).

Reviewed-by: Rich Salz <rsalz@openssl.org>
65 files changed:
Configurations/README
Configurations/README.design
Configurations/common.tmpl
Configurations/unix-Makefile.tmpl
Configure
Makefile.in
crypto/Makefile.in
crypto/aes/Makefile.in
crypto/asn1/Makefile.in
crypto/async/Makefile.in
crypto/bf/Makefile.in
crypto/bio/Makefile.in
crypto/bn/Makefile.in
crypto/buffer/Makefile.in
crypto/camellia/Makefile.in
crypto/cast/Makefile.in
crypto/chacha/Makefile.in
crypto/cmac/Makefile.in
crypto/cms/Makefile.in
crypto/comp/Makefile.in
crypto/conf/Makefile.in
crypto/ct/Makefile.in
crypto/des/Makefile.in
crypto/dh/Makefile.in
crypto/dsa/Makefile.in
crypto/dso/Makefile.in
crypto/ec/Makefile.in
crypto/engine/Makefile.in
crypto/err/Makefile.in
crypto/evp/Makefile.in
crypto/hmac/Makefile.in
crypto/idea/Makefile.in
crypto/kdf/Makefile.in
crypto/lhash/Makefile.in
crypto/md2/Makefile.in
crypto/md4/Makefile.in
crypto/md5/Makefile.in
crypto/mdc2/Makefile.in
crypto/modes/Makefile.in
crypto/objects/Makefile.in
crypto/ocsp/Makefile.in
crypto/pem/Makefile.in
crypto/pkcs12/Makefile.in
crypto/pkcs7/Makefile.in
crypto/poly1305/Makefile.in
crypto/rand/Makefile.in
crypto/rc2/Makefile.in
crypto/rc4/Makefile.in
crypto/rc5/Makefile.in
crypto/ripemd/Makefile.in
crypto/rsa/Makefile.in
crypto/seed/Makefile.in
crypto/sha/Makefile.in
crypto/srp/Makefile.in
crypto/stack/Makefile.in
crypto/ts/Makefile.in
crypto/txt_db/Makefile.in
crypto/ui/Makefile.in
crypto/whrlpool/Makefile.in
crypto/x509/Makefile.in
crypto/x509v3/Makefile.in
engines/Makefile.in
ssl/Makefile.in
util/mk1mf.pl
util/pl/VC-32.pl

index 58c4d96c6c2c062c2bb574d92ed3ef1efb959c12..454c8f375ea9352879b0deaf671d4dfb7c69ab78 100644 (file)
@@ -488,7 +488,8 @@ They are all expected to return a string with the lines they produce.
                         src2obj(obj => "PATH/TO/objectfile",
                                 srcs => [ "PATH/TO/sourcefile", ... ],
                                 deps => [ "dep1", ... ],
-                                incs => [ "INCL/PATH", ... ]);
+                                incs => [ "INCL/PATH", ... ]
+                                intent => one of "lib", "dso", "bin" );
 
                   'obj' has the intended object file *without*
                   extension, src2obj() is expected to add that.
@@ -496,7 +497,9 @@ They are all expected to return a string with the lines they produce.
                   object file, with the first item being the source
                   file that directly corresponds to the object file.
                   'deps' is a list of explicit dependencies.  'incs'
-                  is a list of include file directories.
+                  is a list of include file directories.  Finally,
+                  'intent' indicates what this object file is going
+                  to be used for.
 
     obj2lib     - function that produces build file lines to build a
                   static library file ("libfoo.a" in Unix terms) from
index 80839faa6da4bf023618591ae63c504f8f26499f..362b967f17f04862c2319ec19521aaf417cf8959 100644 (file)
@@ -392,15 +392,18 @@ etc.
                         src2obj(obj => "PATH/TO/objectfile",
                                 srcs => [ "PATH/TO/sourcefile", ... ],
                                 deps => [ "dep1", ... ],
-                                incs => [ "INCL/PATH", ... ]);
+                                incs => [ "INCL/PATH", ... ]
+                                intent => one of "lib", "dso", "bin" );
 
                   'obj' has the intended object file *without*
                   extension, src2obj() is expected to add that.
                   'srcs' has the list of source files to build the
                   object file, with the first item being the source
                   file that directly corresponds to the object file.
-                  'deps' is a list of dependencies.  'incs' is a list
-                  of include file directories.
+                  'deps' is a list of explicit dependencies.  'incs'
+                  is a list of include file directories.  Finally,
+                  'intent' indicates what this object file is going
+                  to be used for.
 
     obj2lib     - function that produces build file lines to build a
                   static library file ("libfoo.a" in Unix terms) from
index f0860dd7814128c9b7136680ad5c8397cefd7b47..196441c2678b60dc7ca6521426def6fe48ab745a 100644 (file)
      my $obj = shift;
      (my $obj_no_o = $obj) =~ s|\.o$||;
      my $bin = shift;
+     my %opts = @_;
      if (@{$unified_info{sources}->{$obj}}) {
          $OUT .= src2obj(obj => $obj_no_o,
                          srcs => $unified_info{sources}->{$obj},
                          deps => [ reducedepends(resolvedepends($obj)) ],
                          incs => [ @{$unified_info{includes}->{$bin}},
-                                   @{$unified_info{includes}->{$obj}} ]);
+                                   @{$unified_info{includes}->{$obj}} ],
+                         %opts);
      }
  }
 
@@ -78,7 +80,7 @@
                      objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
                                @{$unified_info{sources}->{$lib}} ],
                      deps => [ resolvedepends($lib) ]);
-     map { doobj($_, $lib, intent => "lib") } @{$unified_info{sources}->{$lib}};
+     map { doobj($_, $lib, intent => "dso") } @{$unified_info{sources}->{$lib}};
  }
 
  # dobin is responsible for building programs.  It will call obj2bin,
index 9dc6d7dfe89097592ae846aca2b1791db491a299..61ee7a6ab075b85c3ac28cd30f1688cc76cadcde 100644 (file)
@@ -43,7 +43,6 @@
      # given libname with the simple shared extension (possible SO version
      # removed).  This differs from shlib_simple() by being unconditional.
      sub dso {
-         return () if $config{no_shared};
          my $engine = shift;
 
          return $engine . '$(DSO_EXT)';
@@ -149,6 +148,7 @@ CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
 LDFLAGS= {- $config{lflags} -}
 PLIB_LDFLAGS= {- $config{plib_lflags} -}
 EX_LIBS= {- $config{ex_libs} -}
+SHARED_CFLAGS={- $target{shared_cflag} || "" -}
 SHARED_LDFLAGS={- $target{shared_ldflag}
                   # Unlike other OSes (like Solaris, Linux, Tru64,
                   # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
@@ -164,6 +164,8 @@ SHARED_LDFLAGS={- $target{shared_ldflag}
                   . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
                      ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
 SHARED_RCFLAGS={- $target{shared_rcflag} -}
+DSO_CFLAGS={- $target{shared_cflag} || "" -}
+BIN_CFLAGS={- "" -}
 
 PERL={- $config{perl} -}
 
@@ -823,25 +825,28 @@ configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configure $(SRCDIR)/
       my $obj = $args{obj};
       my $srcs = join(" ", @{$args{srcs}});
       my $deps = join(" ", @{$args{srcs}}, @{$args{deps}});
-      my $incs = join(" ", map { " -I".$_ } @{$args{incs}});
+      my $incs = join("", map { " -I".$_ } @{$args{incs}});
+      my $ecflags = { lib => '$(SHARED_CFLAGS)',
+                      dso => '$(DSO_CFLAGS)',
+                      bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
       my $makedepprog = $config{makedepprog};
       if ($makedepprog eq "makedepend") {
           return <<"EOF";
 $obj\$(DEP_EXT): $deps
        rm -f \$\@.tmp; touch \$\@.tmp
-       \$(MAKEDEPEND) -f\$\@.tmp -o"|$obj" -- \$(CFLAGS)$incs -- $srcs \\
+       \$(MAKEDEPEND) -f\$\@.tmp -o"|$obj" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
            2>/dev/null
        sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp > \$\@
        rm \$\@.tmp
 $obj\$(OBJ_EXT): $obj\$(DEP_EXT)
-       \$(CC) \$(CFLAGS)$incs -c -o \$\@ $srcs
+       \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
 EOF
       }
       return <<"EOF";
 $obj\$(DEP_EXT): $deps
-       \$(CC) \$(CFLAGS)$incs -MM -MF \$\@ -MQ $obj $srcs
+       \$(CC) \$(CFLAGS) $ecflags$incs -MM -MF \$\@ -MQ $obj $srcs
 $obj\$(OBJ_EXT): $obj\$(DEP_EXT)
-       \$(CC) \$(CFLAGS)$incs -c -o \$\@ $srcs
+       \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
 EOF
   }
   # On Unix, we build shlibs from static libs, so we're ignoring the
index 4136673bcda9c83a1a7edf780d9bd09d908caecd..e8786b020a1ae2ea0d1b258d4e4db55e0447e875 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -983,14 +983,6 @@ if ($target{shared_target} eq "")
        $no_shared_warn = 1 if !$config{no_shared} && !$config{fips};
        $config{no_shared} = 1;
        }
-if (!$config{no_shared})
-       {
-       if ($target{shared_cflag} ne "")
-               {
-               push @{$config{defines}}, "OPENSSL_PIC";
-               $config{cflags} = "$target{shared_cflag} $config{cflags}";
-               }
-       }
 
 if ($builder ne "mk1mf")
        {
index a7cd7570a9d6cde36c36b0e4cd3efd73cfa4e19a..c269a6d20a785c14bb9cbbfb80466780e58ebbc6 100644 (file)
@@ -194,6 +194,7 @@ LIBS=   libcrypto.a libssl.a
 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
 SHARED_SSL=libssl$(SHLIB_EXT)
 SHARED_LIBS={- '$(SHARED_CRYPTO) $(SHARED_SSL)' if (!$config{no_shared}) -}
+SHARED_CFLAG={- $target{shared_cflag} -}
 SHARED_LDFLAG={- $target{shared_ldflag}
                  # Unlike other OSes (like Solaris, Linux, Tru64,
                  # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
@@ -249,9 +250,10 @@ CLEARENV=  TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS}     \
 # same language for uniform treatment.
 BUILDENV=      LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
                CC='$(CC)' CFLAG='$(CFLAG)' CFLAG_Q='$(CFLAG_Q)'        \
+               SHARED_CFLAG='$(SHARED_CFLAG)'                          \
                AS='$(CC)' ASFLAG='$(CFLAG) -c'                 \
                AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)'        \
-               CROSS_COMPILE='$(CROSS_COMPILE)'        \
+               CROSS_COMPILE='$(CROSS_COMPILE)'                \
                PERL='$(PERL)'  \
                SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)'     \
                DESTDIR='$(DESTDIR)'            \
index d04f75c3bcc2a6f6379f1f1e6a87f85a7077ef4e..c8184e5a5c07d907d9c9af247fb64fdbfeb05e51 100644 (file)
@@ -21,7 +21,7 @@ RECURSIVE_MAKE=       [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
 PLIB_LDFLAG=
 EX_LIBS=
 
-CFLAGS= $(INCLUDE) $(CFLAG)
+CFLAGS= $(INCLUDE) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDE) $(ASFLAG)
 AFLAGS=$(ASFLAGS)
 CPUID_OBJ=mem_clr.o
index 98bfb0a61a8195b33ea5642aac5204a0b4d46cc4..938ad3c4049caa4a75992d994bf4a1d15189096d 100644 (file)
@@ -13,7 +13,7 @@ AR=           ar r
 
 AES_ENC=aes_core.o aes_cbc.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index b6c44e7dc7cb9c0fd8897e88eafad35d51dbc407..86f805bc6f4a6e21ac017d235a3c99696cc10e4b 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile README
 
index 6e9f4653f69e764b0301d39fb5522b78a4865a74..277aa9ec3268b298a20a65118f4c985761965605 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 TEST=
index 14e2fe22299c091423df30853cd50bdc0cd68cc8..ee5c2599239c46dc7cf5bb06b8c92a55a51e9cbe 100644 (file)
@@ -13,7 +13,7 @@ AR=           ar r
 
 BF_ENC=                bf_enc.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index ff35cfb21403a2ec50e2834595daceb387f3dc36..2bf8601ee8c314d9ae8901210ca9d7c3b48dd5d8 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 7574585cb7586a02f41e3d629d0d07d62c6ca10f..b14301aa0e40ee010981d51b65202b5b5bc3dca7 100644 (file)
@@ -13,7 +13,7 @@ AR=           ar r
 
 BN_ASM=                bn_asm.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 79eeac15400655d08e61f1645958c3006ea7e413..09b3488f04388164b7675c5fd257afb2140a4498 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index ac3ffdaa17e59e49a61de1ce132c1ab4ebe32daa..10c5a753414b48218c9de0848e8e810ac4683670 100644 (file)
@@ -13,7 +13,7 @@ AR=           ar r
 
 CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index cd62408f35694ff09d3f5e52932a9f2346a7fb98..06f65e21aa423e5d54356d509086e8c828bc6118 100644 (file)
@@ -13,7 +13,7 @@ AR=           ar r
 
 CAST_ENC=c_enc.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index de80ba4fd0ddfe7a06a8a001cdd5ac23dbab2177..33e41d5940d60f1049efe44d96979c87fba3f502 100644 (file)
@@ -12,7 +12,7 @@ AR=           ar r
 
 CHACHA_ENC=chacha_enc.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 44888657c8b24627a2fa1e79c229609211c94e26..5abc13906861ecf5f46c1f44e52f06e2eafaee88 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 5e5db74cccb0973a9aaabb617ad7899f2bb97ff5..cf074eaa81f4491234ccee09d2c81a36ed549f5d 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 6db134982bfa16aebebb17ce195871ba8f0d85fc..24c1231fcc31c7efcc1faa933fa2a76c8d4ef170 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index c0c8cd8982a349aa9bc921efdc13179bf906028f..e1bae369c24552e5d41426b76b66dcb40741f2e8 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 5d186b8fd96418377dd9e389a873c77de3aef42e..100179ddfa9401fb484f6b53b1ad36ba693d2f64 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index c65c05b1105ff65bdf3796cbc8566ed9b1a662a4..248b53d70044b9bc997da9700b554baa28a6c3cc 100644 (file)
@@ -13,7 +13,7 @@ AR=           ar r
 RANLIB=                ranlib
 DES_ENC=       des_enc.o fcrypt_b.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 473ad3576a08a5080ccd0b0c001cf18f22ef471e..9ac52eb1b42d7f5e16ceb42cf0296182c947f6ef 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index dd5bdbef2569e808c5c1f45d33a2086e8d964a20..a22dfa32b5e34d446cdc6492f64469b7ac93e9d6 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 1f74735fd5d09f0151afd538d3d0d1ef77a985d7..58d097450734addc4847e471c8d057a6e9124d7c 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index eb68dcd4b77d72c3f00d8abcba425eb3fed720a5..1aa22d49624338f985553077606c90dcdfd6107e 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 01dad47eaa5f97e84d36080d6e1ff69d1d4dc618..8435e7576c0dbf64e2253bd3b19767c921928803 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index b2ff21806e99128d6ad2d128c3e77053fab1cc51..9329e9138e585875e69930592eb4d7941fa0a5a7 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 100de31047484b8038ecc7bd66905c33f7522d8a..5b24ae5909a2dc20934c006c4be45195ce95fcc2 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index ffb80b557e3610bc4fadc03a3ea8d4de37e05e6f..ab8acab14326bfea20f8d9c77c14d0d3d1853023 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index c0f12e2944cb55ddf3b43fce2e1893a993fc56b3..b3aafcad791a549f6699f21d0761dcd59f368193 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index f7ddfe07c7a4f60b331373323f188e5241becc37..be4e08c1a0b250f1708710dc993e00845e544b5f 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index a9dc3dfea99f9d07eccce276b2e7b6dbd1d59b00..ff9000102cc51443374a5f415248fa7cf99c1009 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 29eeb33f0f5e00bc36b6d0270e76b01feade5fa8..2692884a241c0963c4a2fc0fe8db3374a0be6624 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index ff5a2c15f0f28d9514d6125a0b8d6d8713527c35..b45b6ce64fa955cfbf17864b01cdc46f190c19c4 100644 (file)
@@ -11,7 +11,7 @@ CFLAG=-g
 MAKEFILE=       Makefile
 AR=             ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index b1d98e15ae685c82e0eee60b0da237ef6c71c471..aec94b6d6b12b037717c6d735156b8b08d7d8198 100644 (file)
@@ -13,7 +13,7 @@ AR=             ar r
 
 MD5_ASM_OBJ=
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 8930d0277e8a25e81e4046d59b1b8fe65c9747b8..3c2275b5815ba6add5cc76745c6da61745d87e42 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 4d3c0b090a89250c746ba3971881dbc926a99bd4..5e4415c4314ea061d15bbfd4c135307cf8c2e5e0 100644 (file)
@@ -12,7 +12,7 @@ AR=           ar r
 
 MODES_ASM_OBJ=
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 394da3b0edf38f7961a3d376f95fa416a3eb841c..64d138b2cf31db1c088f4e485e365dc855350266 100644 (file)
@@ -11,7 +11,7 @@ MAKEFILE=     Makefile
 AR=            ar r
 PERL=          perl
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile README
 
index 26d977412f1f5147b4ff1b9140b6c8a55454fa5c..5ce7d88e02ca451eac3a12286894630d7ed60b93 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile README
 
index 8a23ef684c21f9c4b4b28ae139b18bd218f46ead..a5222975ba50983b6e712a3d8b73a23df3da3c48 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 651f13fef463f9333b90f83370c5efc57ab91c1d..165ca2d5e054e9d3744fead9464b362de6ebcccc 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index a58e323b56d6874f33abb1e537cd23478437e6f8..49b78c58a2625a7e7cf014f92690ca51c5159e8d 100644 (file)
@@ -13,7 +13,7 @@ AR=           ar r
 PLIB_LDFLAG=
 EX_LIBS=
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile README
 
index 8735b79308c31fac59e1b5a1503b84887591ef9a..10f009ffec406160273b9306aae21ba8d71314bd 100644 (file)
@@ -12,7 +12,7 @@ AR=           ar r
 
 POLY1305_ASM_OBJ=
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index bf9ff3edff7ccbe0acebe6ffcfefc5f942dc20c0..8796faf8958a004a857f1c810991c757127fa420 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 3eaf4e3fb176721bcbc015ce6b7d0f4e3cd3c631..d124d0ba5989fbe0c16bfe87a6667e2781764650 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index f0f72d1a57dfdceb6dfd5cbc440500dc415c7f02..fe2ef7d6c564d92f63a0e2dec4e2ca469b176ecf 100644 (file)
@@ -12,7 +12,7 @@ AR=           ar r
 
 RC4_ENC=rc4_enc.o rc4_skey.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 9efe7f9335fc3d0ff74120b4381dc0baacc20c5e..bd7a1c66135b2cae77442f2f230cfa926e1d3d82 100644 (file)
@@ -13,7 +13,7 @@ AR=           ar r
 
 RC5_ENC=               rc5_enc.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 3aed997ed1afe7266dd361e1fb6c7722f1633d9e..8158a7303a0f1a5f8c2c70ccf0e8a99a0446e9ce 100644 (file)
@@ -13,7 +13,7 @@ AR=             ar r
 
 RIP_ASM_OBJ=
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 8779cc7781153775730c9951a0b74e3208d51e6a..0e2e2bf77edae1cf86f8fc09191b34177a675948 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index a6c85afc562fc37417004207216f8b42aa01cbda..fe55942ca2270a60db2151bb4b5987dd65e6e2f7 100644 (file)
@@ -11,7 +11,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 267586971bbcfe2c0d7ea380466280af3fa6a074..afb161be9e6e24ab66e1f1b72e83b7cca0e4a008 100644 (file)
@@ -13,7 +13,7 @@ AR=             ar r
 
 SHA1_ASM_OBJ=
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 8b0c9c7318a4dcac381e32289d60d915030723c9..8aa422a8e3b619080f9133e35a73d4d66c9f69c1 100644 (file)
@@ -8,7 +8,7 @@ OPENSSLDIR=     /usr/local/ssl
 INSTALLTOP=/usr/local/ssl
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 22630c2a8ad6ce1adb5f9f85ac15598a73f926f5..fbce5a57bc90554715445873f7e051690c1d60fc 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index f5d40b9acf6f647d3d62ced50c6bddbf47f5cd67..7f8648a8f8e9cba4021017461e3f6d949e1776a0 100644 (file)
@@ -14,7 +14,7 @@ AR=           ar r
 PLIB_LDFLAG=
 EX_LIBS=
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL= Makefile
 
index 3229d521c4ff6a5021606648192ee7222cad6726..e3810fa244afd17877e04a4b1412ceaab7190784 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index c8f327a3c5a7203bc6e872ea981ba9e28d701008..46ae052b4aa3237399131d79b5fd166da9d50bc7 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile
 
index 60278834bb74d5e510a29bd0aace82fbc025e0ca..a1be9fef93ed18eb3c94142e480add52acb16133 100644 (file)
@@ -13,7 +13,7 @@ AR=           ar r
 
 WP_ASM_OBJ=wp_block.o
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index 440ff72858877544d1224a3e65c4f4bd3c9263de..4932622411d3dc3bd0ba16306b43d47c22ed3400 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile README
 
index 6dec02b1f6134922140fa353cd07f74673029bc9..243d5c5ab9897b017805c460ff4a02f012f3e98f 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile README
 
index 99ba822fb2fce56f37b57e10e7613e74df9ae80e..ea2ae2cd1bacde6c72d3c11f50be3fa86261550f 100644 (file)
@@ -18,7 +18,7 @@ PADLOCK_ASM_OBJ=
 PLIB_LDFLAG=
 EX_LIBS=
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 ASFLAGS= $(INCLUDES) $(ASFLAG)
 AFLAGS= $(ASFLAGS)
 
index e56ffa0281eb43f6fc2d6db77add42a1c9399e66..28c427c2826fc8985b2f5e682c202ef4a69aee33 100644 (file)
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=      Makefile
 AR=            ar r
 
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
 
 GENERAL=Makefile README ssl-lib.com install.com
 
index 41aa0ecab6e64c3cf02b45e9ed6e580bd11aebd0..08999bfe728b65b0740c91cac3d2558bcfd5f391 100755 (executable)
@@ -53,6 +53,7 @@ my %mf_import = (
        CC             => \$mf_cc,
        CFLAG          => \$mf_cflag,
        CFLAG_Q        => \$mf_cflag_q,
+       SHARED_CFLAG   => \$mf_shared_cflag,
         DEPFLAG        => \$mf_depflag,
        CPUID_OBJ      => \$mf_cpuid_asm,
        BN_ASM         => \$mf_bn_asm,
@@ -309,7 +310,7 @@ $cflags.=" -DOPENSSL_FIPS"    if $fips;
 $cflags.=" -DOPENSSL_NO_EC2M"    if $no_ec2m;
 $cflags.= " -DZLIB" if $zlib_opt;
 $cflags.= " -DZLIB_SHARED" if $zlib_opt == 2;
-$cflags.=" -DOPENSSL_PIC" if $shlib;
+$cflags.=" -DOPENSSL_PIC";
 
 if ($no_static_engine)
        {
@@ -328,7 +329,7 @@ else
        { $cflags="$c_flags$cflags" if ($c_flags ne ""); }
 
 if ($orig_platform eq 'copy') {
-    $cflags = $mf_cflag;
+    $cflags = "$mf_cflag $mf_shared_cflag";
     $cc = $mf_cc;
 }
 
index 2c11184ad8a3a4a7c8ad9794f6f2956441670ea8..03dee98a848c0dd1a34d6a556e48c0835b345670 100644 (file)
@@ -49,7 +49,7 @@ if ($FLAVOR =~ /WIN64/)
     # per 0.9.8 release remaining warnings were explicitly examined and
     # considered safe to ignore.
     # 
-    $base_cflags= " $mf_cflag";
+    $base_cflags= " $mf_cflag" . ($mf_shared_cflag ? " $mf_shared_cflag" : "");
     my $f = ($shlib and !$fipscanisterbuild)?' /MD':' /MT';
     $opt_cflags=$f.' /Ox';
     $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
@@ -138,7 +138,7 @@ elsif ($FLAVOR =~ /CE/)
     }
 else   # Win32
     {
-    $base_cflags= " $mf_cflag";
+    $base_cflags= " $mf_cflag" . ($mf_shared_cflag ? " $mf_shared_cflag" : "");
     my $f = ($shlib and !$fipscanisterbuild)?' /MD':' /MT';
     $opt_cflags=$f.' /Ox /O2 /Ob2';
     $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';