summaryrefslogtreecommitdiffstats
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-01-08 12:28:08 +0100
committerRichard Levitte <levitte@openssl.org>2018-01-08 14:38:29 +0100
commit47eeaf45b510d056efcd5382550ed73e4d1af377 (patch)
treeeb7114d7c5d857f4d67c495e7c31113247d7e31f /Configure
parentf720194cbc174806fe1ce9c349edd249d8076c02 (diff)
Separate general linking flags from extra libraries
So far, we've placed all extra library related flags together, ending up in the make variable EX_LIBS. This turns out to be problematic, as for example, some compilers don't quite agree with something like this: cc -o foo foo.o -L/whatever -lsomething They prefer this: cc -L/whatever -o foo foo.o -lsomething IBM's compiler on OS/390 is such a compiler that we know of, and we have previously handled that as a previous case. The answer here is to make a more general solution, where linking options are divided in two parts, where one ends up in LDFLAGS and the other in EX_LIBS (they corresponds to what is called LDFLAGS and LDLIBS in the GNU world) Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5033)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure10
1 files changed, 9 insertions, 1 deletions
diff --git a/Configure b/Configure
index b66e2513f5..b172595ece 100755
--- a/Configure
+++ b/Configure
@@ -526,6 +526,7 @@ $config{openssl_algorithm_defines}=[];
$config{openssl_thread_defines}=[];
$config{openssl_sys_defines}=[];
$config{openssl_other_defines}=[];
+my $ldflags="";
my $libs="";
my $target="";
$config{options}="";
@@ -729,7 +730,11 @@ while (@argvcopy)
{
read_config $1;
}
- elsif (/^-[lL](.*)$/ or /^-Wl,/)
+ elsif (/^-L(.*)$/)
+ {
+ $ldflags.=$_." ";
+ }
+ elsif (/^-l(.*)$/ or /^-Wl,/)
{
$libs.=$_." ";
}
@@ -1050,6 +1055,7 @@ $config{build_file} = $target{build_file};
$config{defines} = [];
$config{cflags} = "";
$config{cxxflags} = "";
+$config{lflags} = "";
$config{ex_libs} = "";
$config{shared_ldflag} = "";
@@ -1121,6 +1127,7 @@ if (!$disabled{dso} && $target{dso_scheme} ne "")
}
$config{ex_libs}="$libs$config{ex_libs}" if ($libs ne "");
+$config{lflags}="$config{lflags}$ldflags" if ($ldflags ne "");
# If threads aren't disabled, check how possible they are
unless ($disabled{threads}) {
@@ -2176,6 +2183,7 @@ print "DEFINES =",join(" ", @{$target{defines}}, @{$config{defines}}),"\n"
#print "RANLIB =", $target{ranlib} eq '$(CROSS_COMPILE)ranlib' ?
# "$config{cross_compile_prefix}ranlib" :
# "$target{ranlib}", "\n";
+print "LDFLAGS =$config{lflags} $target{lflags}\n";
print "EX_LIBS =$target{ex_libs} $config{ex_libs}\n";
my %builders = (