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.
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
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
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);
}
}
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,
# 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)';
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
. ($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} -}
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
$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")
{
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
# 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)' \
PLIB_LDFLAG=
EX_LIBS=
-CFLAGS= $(INCLUDE) $(CFLAG)
+CFLAGS= $(INCLUDE) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDE) $(ASFLAG)
AFLAGS=$(ASFLAGS)
CPUID_OBJ=mem_clr.o
AES_ENC=aes_core.o aes_cbc.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
TEST=
BF_ENC= bf_enc.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
BN_ASM= bn_asm.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
CAST_ENC=c_enc.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
CHACHA_ENC=chacha_enc.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
RANLIB= ranlib
DES_ENC= des_enc.o fcrypt_b.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MD5_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MODES_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
AR= ar r
PERL= perl
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
PLIB_LDFLAG=
EX_LIBS=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
POLY1305_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
RC4_ENC=rc4_enc.o rc4_skey.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
RC5_ENC= rc5_enc.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
RIP_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
SHA1_ASM_OBJ=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
INSTALLTOP=/usr/local/ssl
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
PLIB_LDFLAG=
EX_LIBS=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL= Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile
WP_ASM_OBJ=wp_block.o
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README
PLIB_LDFLAG=
EX_LIBS=
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
MAKEFILE= Makefile
AR= ar r
-CFLAGS= $(INCLUDES) $(CFLAG)
+CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
GENERAL=Makefile README ssl-lib.com install.com
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,
$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)
{
{ $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;
}
# 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';
}
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';