summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Configurations/README7
-rw-r--r--Configurations/README.design9
-rw-r--r--Configurations/common.tmpl6
-rw-r--r--Configurations/unix-Makefile.tmpl17
-rwxr-xr-xConfigure8
-rw-r--r--Makefile.in4
-rw-r--r--crypto/Makefile.in2
-rw-r--r--crypto/aes/Makefile.in2
-rw-r--r--crypto/asn1/Makefile.in2
-rw-r--r--crypto/async/Makefile.in2
-rw-r--r--crypto/bf/Makefile.in2
-rw-r--r--crypto/bio/Makefile.in2
-rw-r--r--crypto/bn/Makefile.in2
-rw-r--r--crypto/buffer/Makefile.in2
-rw-r--r--crypto/camellia/Makefile.in2
-rw-r--r--crypto/cast/Makefile.in2
-rw-r--r--crypto/chacha/Makefile.in2
-rw-r--r--crypto/cmac/Makefile.in2
-rw-r--r--crypto/cms/Makefile.in2
-rw-r--r--crypto/comp/Makefile.in2
-rw-r--r--crypto/conf/Makefile.in2
-rw-r--r--crypto/ct/Makefile.in2
-rw-r--r--crypto/des/Makefile.in2
-rw-r--r--crypto/dh/Makefile.in2
-rw-r--r--crypto/dsa/Makefile.in2
-rw-r--r--crypto/dso/Makefile.in2
-rw-r--r--crypto/ec/Makefile.in2
-rw-r--r--crypto/engine/Makefile.in2
-rw-r--r--crypto/err/Makefile.in2
-rw-r--r--crypto/evp/Makefile.in2
-rw-r--r--crypto/hmac/Makefile.in2
-rw-r--r--crypto/idea/Makefile.in2
-rw-r--r--crypto/kdf/Makefile.in2
-rw-r--r--crypto/lhash/Makefile.in2
-rw-r--r--crypto/md2/Makefile.in2
-rw-r--r--crypto/md4/Makefile.in2
-rw-r--r--crypto/md5/Makefile.in2
-rw-r--r--crypto/mdc2/Makefile.in2
-rw-r--r--crypto/modes/Makefile.in2
-rw-r--r--crypto/objects/Makefile.in2
-rw-r--r--crypto/ocsp/Makefile.in2
-rw-r--r--crypto/pem/Makefile.in2
-rw-r--r--crypto/pkcs12/Makefile.in2
-rw-r--r--crypto/pkcs7/Makefile.in2
-rw-r--r--crypto/poly1305/Makefile.in2
-rw-r--r--crypto/rand/Makefile.in2
-rw-r--r--crypto/rc2/Makefile.in2
-rw-r--r--crypto/rc4/Makefile.in2
-rw-r--r--crypto/rc5/Makefile.in2
-rw-r--r--crypto/ripemd/Makefile.in2
-rw-r--r--crypto/rsa/Makefile.in2
-rw-r--r--crypto/seed/Makefile.in2
-rw-r--r--crypto/sha/Makefile.in2
-rw-r--r--crypto/srp/Makefile.in2
-rw-r--r--crypto/stack/Makefile.in2
-rw-r--r--crypto/ts/Makefile.in2
-rw-r--r--crypto/txt_db/Makefile.in2
-rw-r--r--crypto/ui/Makefile.in2
-rw-r--r--crypto/whrlpool/Makefile.in2
-rw-r--r--crypto/x509/Makefile.in2
-rw-r--r--crypto/x509v3/Makefile.in2
-rw-r--r--engines/Makefile.in2
-rw-r--r--ssl/Makefile.in2
-rwxr-xr-xutil/mk1mf.pl5
-rw-r--r--util/pl/VC-32.pl4
65 files changed, 91 insertions, 83 deletions
diff --git a/Configurations/README b/Configurations/README
index 58c4d96c6c..454c8f375e 100644
--- a/Configurations/README
+++ b/Configurations/README
@@ -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
diff --git a/Configurations/README.design b/Configurations/README.design
index 80839faa6d..362b967f17 100644
--- a/Configurations/README.design
+++ b/Configurations/README.design
@@ -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
diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl
index f0860dd781..196441c267 100644
--- a/Configurations/common.tmpl
+++ b/Configurations/common.tmpl
@@ -37,12 +37,14 @@
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,
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 9dc6d7dfe8..61ee7a6ab0 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -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
diff --git a/Configure b/Configure
index 4136673bcd..e8786b020a 100755
--- 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")
{
diff --git a/Makefile.in b/Makefile.in
index a7cd7570a9..c269a6d20a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -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)' \
diff --git a/crypto/Makefile.in b/crypto/Makefile.in
index d04f75c3bc..c8184e5a5c 100644
--- a/crypto/Makefile.in
+++ b/crypto/Makefile.in
@@ -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
diff --git a/crypto/aes/Makefile.in b/crypto/aes/Makefile.in
index 98bfb0a61a..938ad3c404 100644
--- a/crypto/aes/Makefile.in
+++ b/crypto/aes/Makefile.in
@@ -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)
diff --git a/crypto/asn1/Makefile.in b/crypto/asn1/Makefile.in
index b6c44e7dc7..86f805bc6f 100644
--- a/crypto/asn1/Makefile.in
+++ b/crypto/asn1/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
diff --git a/crypto/async/Makefile.in b/crypto/async/Makefile.in
index 6e9f4653f6..277aa9ec32 100644
--- a/crypto/async/Makefile.in
+++ b/crypto/async/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
TEST=
diff --git a/crypto/bf/Makefile.in b/crypto/bf/Makefile.in
index 14e2fe2229..ee5c259923 100644
--- a/crypto/bf/Makefile.in
+++ b/crypto/bf/Makefile.in
@@ -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)
diff --git a/crypto/bio/Makefile.in b/crypto/bio/Makefile.in
index ff35cfb214..2bf8601ee8 100644
--- a/crypto/bio/Makefile.in
+++ b/crypto/bio/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/bn/Makefile.in b/crypto/bn/Makefile.in
index 7574585cb7..b14301aa0e 100644
--- a/crypto/bn/Makefile.in
+++ b/crypto/bn/Makefile.in
@@ -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)
diff --git a/crypto/buffer/Makefile.in b/crypto/buffer/Makefile.in
index 79eeac1540..09b3488f04 100644
--- a/crypto/buffer/Makefile.in
+++ b/crypto/buffer/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/camellia/Makefile.in b/crypto/camellia/Makefile.in
index ac3ffdaa17..10c5a75341 100644
--- a/crypto/camellia/Makefile.in
+++ b/crypto/camellia/Makefile.in
@@ -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)
diff --git a/crypto/cast/Makefile.in b/crypto/cast/Makefile.in
index cd62408f35..06f65e21aa 100644
--- a/crypto/cast/Makefile.in
+++ b/crypto/cast/Makefile.in
@@ -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)
diff --git a/crypto/chacha/Makefile.in b/crypto/chacha/Makefile.in
index de80ba4fd0..33e41d5940 100644
--- a/crypto/chacha/Makefile.in
+++ b/crypto/chacha/Makefile.in
@@ -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)
diff --git a/crypto/cmac/Makefile.in b/crypto/cmac/Makefile.in
index 44888657c8..5abc139068 100644
--- a/crypto/cmac/Makefile.in
+++ b/crypto/cmac/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/cms/Makefile.in b/crypto/cms/Makefile.in
index 5e5db74ccc..cf074eaa81 100644
--- a/crypto/cms/Makefile.in
+++ b/crypto/cms/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/comp/Makefile.in b/crypto/comp/Makefile.in
index 6db134982b..24c1231fcc 100644
--- a/crypto/comp/Makefile.in
+++ b/crypto/comp/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/conf/Makefile.in b/crypto/conf/Makefile.in
index c0c8cd8982..e1bae369c2 100644
--- a/crypto/conf/Makefile.in
+++ b/crypto/conf/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/ct/Makefile.in b/crypto/ct/Makefile.in
index 5d186b8fd9..100179ddfa 100644
--- a/crypto/ct/Makefile.in
+++ b/crypto/ct/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/des/Makefile.in b/crypto/des/Makefile.in
index c65c05b110..248b53d700 100644
--- a/crypto/des/Makefile.in
+++ b/crypto/des/Makefile.in
@@ -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)
diff --git a/crypto/dh/Makefile.in b/crypto/dh/Makefile.in
index 473ad3576a..9ac52eb1b4 100644
--- a/crypto/dh/Makefile.in
+++ b/crypto/dh/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/dsa/Makefile.in b/crypto/dsa/Makefile.in
index dd5bdbef25..a22dfa32b5 100644
--- a/crypto/dsa/Makefile.in
+++ b/crypto/dsa/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/dso/Makefile.in b/crypto/dso/Makefile.in
index 1f74735fd5..58d0974507 100644
--- a/crypto/dso/Makefile.in
+++ b/crypto/dso/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/ec/Makefile.in b/crypto/ec/Makefile.in
index eb68dcd4b7..1aa22d4962 100644
--- a/crypto/ec/Makefile.in
+++ b/crypto/ec/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
diff --git a/crypto/engine/Makefile.in b/crypto/engine/Makefile.in
index 01dad47eaa..8435e7576c 100644
--- a/crypto/engine/Makefile.in
+++ b/crypto/engine/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/err/Makefile.in b/crypto/err/Makefile.in
index b2ff21806e..9329e9138e 100644
--- a/crypto/err/Makefile.in
+++ b/crypto/err/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/evp/Makefile.in b/crypto/evp/Makefile.in
index 100de31047..5b24ae5909 100644
--- a/crypto/evp/Makefile.in
+++ b/crypto/evp/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/hmac/Makefile.in b/crypto/hmac/Makefile.in
index ffb80b557e..ab8acab143 100644
--- a/crypto/hmac/Makefile.in
+++ b/crypto/hmac/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/idea/Makefile.in b/crypto/idea/Makefile.in
index c0f12e2944..b3aafcad79 100644
--- a/crypto/idea/Makefile.in
+++ b/crypto/idea/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/kdf/Makefile.in b/crypto/kdf/Makefile.in
index f7ddfe07c7..be4e08c1a0 100644
--- a/crypto/kdf/Makefile.in
+++ b/crypto/kdf/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/lhash/Makefile.in b/crypto/lhash/Makefile.in
index a9dc3dfea9..ff9000102c 100644
--- a/crypto/lhash/Makefile.in
+++ b/crypto/lhash/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/md2/Makefile.in b/crypto/md2/Makefile.in
index 29eeb33f0f..2692884a24 100644
--- a/crypto/md2/Makefile.in
+++ b/crypto/md2/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/md4/Makefile.in b/crypto/md4/Makefile.in
index ff5a2c15f0..b45b6ce64f 100644
--- a/crypto/md4/Makefile.in
+++ b/crypto/md4/Makefile.in
@@ -11,7 +11,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/md5/Makefile.in b/crypto/md5/Makefile.in
index b1d98e15ae..aec94b6d6b 100644
--- a/crypto/md5/Makefile.in
+++ b/crypto/md5/Makefile.in
@@ -13,7 +13,7 @@ AR= ar r
MD5_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
diff --git a/crypto/mdc2/Makefile.in b/crypto/mdc2/Makefile.in
index 8930d0277e..3c2275b581 100644
--- a/crypto/mdc2/Makefile.in
+++ b/crypto/mdc2/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/modes/Makefile.in b/crypto/modes/Makefile.in
index 4d3c0b090a..5e4415c431 100644
--- a/crypto/modes/Makefile.in
+++ b/crypto/modes/Makefile.in
@@ -12,7 +12,7 @@ AR= ar r
MODES_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
diff --git a/crypto/objects/Makefile.in b/crypto/objects/Makefile.in
index 394da3b0ed..64d138b2cf 100644
--- a/crypto/objects/Makefile.in
+++ b/crypto/objects/Makefile.in
@@ -11,7 +11,7 @@ MAKEFILE= Makefile
AR= ar r
PERL= perl
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
diff --git a/crypto/ocsp/Makefile.in b/crypto/ocsp/Makefile.in
index 26d977412f..5ce7d88e02 100644
--- a/crypto/ocsp/Makefile.in
+++ b/crypto/ocsp/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
diff --git a/crypto/pem/Makefile.in b/crypto/pem/Makefile.in
index 8a23ef684c..a5222975ba 100644
--- a/crypto/pem/Makefile.in
+++ b/crypto/pem/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/pkcs12/Makefile.in b/crypto/pkcs12/Makefile.in
index 651f13fef4..165ca2d5e0 100644
--- a/crypto/pkcs12/Makefile.in
+++ b/crypto/pkcs12/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/pkcs7/Makefile.in b/crypto/pkcs7/Makefile.in
index a58e323b56..49b78c58a2 100644
--- a/crypto/pkcs7/Makefile.in
+++ b/crypto/pkcs7/Makefile.in
@@ -13,7 +13,7 @@ AR= ar r
PLIB_LDFLAG=
EX_LIBS=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
diff --git a/crypto/poly1305/Makefile.in b/crypto/poly1305/Makefile.in
index 8735b79308..10f009ffec 100644
--- a/crypto/poly1305/Makefile.in
+++ b/crypto/poly1305/Makefile.in
@@ -12,7 +12,7 @@ AR= ar r
POLY1305_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
diff --git a/crypto/rand/Makefile.in b/crypto/rand/Makefile.in
index bf9ff3edff..8796faf895 100644
--- a/crypto/rand/Makefile.in
+++ b/crypto/rand/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/rc2/Makefile.in b/crypto/rc2/Makefile.in
index 3eaf4e3fb1..d124d0ba59 100644
--- a/crypto/rc2/Makefile.in
+++ b/crypto/rc2/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/rc4/Makefile.in b/crypto/rc4/Makefile.in
index f0f72d1a57..fe2ef7d6c5 100644
--- a/crypto/rc4/Makefile.in
+++ b/crypto/rc4/Makefile.in
@@ -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)
diff --git a/crypto/rc5/Makefile.in b/crypto/rc5/Makefile.in
index 9efe7f9335..bd7a1c6613 100644
--- a/crypto/rc5/Makefile.in
+++ b/crypto/rc5/Makefile.in
@@ -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)
diff --git a/crypto/ripemd/Makefile.in b/crypto/ripemd/Makefile.in
index 3aed997ed1..8158a7303a 100644
--- a/crypto/ripemd/Makefile.in
+++ b/crypto/ripemd/Makefile.in
@@ -13,7 +13,7 @@ AR= ar r
RIP_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
diff --git a/crypto/rsa/Makefile.in b/crypto/rsa/Makefile.in
index 8779cc7781..0e2e2bf77e 100644
--- a/crypto/rsa/Makefile.in
+++ b/crypto/rsa/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/seed/Makefile.in b/crypto/seed/Makefile.in
index a6c85afc56..fe55942ca2 100644
--- a/crypto/seed/Makefile.in
+++ b/crypto/seed/Makefile.in
@@ -11,7 +11,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/sha/Makefile.in b/crypto/sha/Makefile.in
index 267586971b..afb161be9e 100644
--- a/crypto/sha/Makefile.in
+++ b/crypto/sha/Makefile.in
@@ -13,7 +13,7 @@ AR= ar r
SHA1_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
diff --git a/crypto/srp/Makefile.in b/crypto/srp/Makefile.in
index 8b0c9c7318..8aa422a8e3 100644
--- a/crypto/srp/Makefile.in
+++ b/crypto/srp/Makefile.in
@@ -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
diff --git a/crypto/stack/Makefile.in b/crypto/stack/Makefile.in
index 22630c2a8a..fbce5a57bc 100644
--- a/crypto/stack/Makefile.in
+++ b/crypto/stack/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/ts/Makefile.in b/crypto/ts/Makefile.in
index f5d40b9acf..7f8648a8f8 100644
--- a/crypto/ts/Makefile.in
+++ b/crypto/ts/Makefile.in
@@ -14,7 +14,7 @@ AR= ar r
PLIB_LDFLAG=
EX_LIBS=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL= Makefile
diff --git a/crypto/txt_db/Makefile.in b/crypto/txt_db/Makefile.in
index 3229d521c4..e3810fa244 100644
--- a/crypto/txt_db/Makefile.in
+++ b/crypto/txt_db/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/ui/Makefile.in b/crypto/ui/Makefile.in
index c8f327a3c5..46ae052b4a 100644
--- a/crypto/ui/Makefile.in
+++ b/crypto/ui/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
diff --git a/crypto/whrlpool/Makefile.in b/crypto/whrlpool/Makefile.in
index 60278834bb..a1be9fef93 100644
--- a/crypto/whrlpool/Makefile.in
+++ b/crypto/whrlpool/Makefile.in
@@ -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)
diff --git a/crypto/x509/Makefile.in b/crypto/x509/Makefile.in
index 440ff72858..4932622411 100644
--- a/crypto/x509/Makefile.in
+++ b/crypto/x509/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
diff --git a/crypto/x509v3/Makefile.in b/crypto/x509v3/Makefile.in
index 6dec02b1f6..243d5c5ab9 100644
--- a/crypto/x509v3/Makefile.in
+++ b/crypto/x509v3/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
diff --git a/engines/Makefile.in b/engines/Makefile.in
index 99ba822fb2..ea2ae2cd1b 100644
--- a/engines/Makefile.in
+++ b/engines/Makefile.in
@@ -18,7 +18,7 @@ PADLOCK_ASM_OBJ=
PLIB_LDFLAG=
EX_LIBS=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
diff --git a/ssl/Makefile.in b/ssl/Makefile.in
index e56ffa0281..28c427c282 100644
--- a/ssl/Makefile.in
+++ b/ssl/Makefile.in
@@ -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
diff --git a/util/mk1mf.pl b/util/mk1mf.pl
index 41aa0ecab6..08999bfe72 100755
--- a/util/mk1mf.pl
+++ b/util/mk1mf.pl
@@ -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;
}
diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl
index 2c11184ad8..03dee98a84 100644
--- a/util/pl/VC-32.pl
+++ b/util/pl/VC-32.pl
@@ -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';