From bec920d5ebe010b75f2332a9291aff041c30fae2 Mon Sep 17 00:00:00 2001 From: steven Date: Tue, 28 Oct 2008 10:00:22 +0000 Subject: [PATCH] try to use pic objects if no non-pic objects can be found throw some warnings --- infrastructure/build/libtool | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/infrastructure/build/libtool b/infrastructure/build/libtool index aa4c294a44d..aa5a36246f5 100755 --- a/infrastructure/build/libtool +++ b/infrastructure/build/libtool @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $OpenBSD: libtool,v 1.28 2008/10/28 09:58:55 steven Exp $ +# $OpenBSD: libtool,v 1.29 2008/10/28 10:00:22 steven Exp $ # Copyright (c) 2007-2008 Steven Mestdagh # @@ -388,7 +388,17 @@ if ($mode eq 'compile') { if ($linkmode == PROGRAM) { # XXX give higher priority to dirs of not installed libs # XXX no static linking yet here - my @tmpcmd = linkcmds($ofile, $ofile, $odir, PROGRAM, 1, \@objs); + my $objlist = \@objs; + if (@objs == 0) { + if (@sobjs > 0) { + warn "no non-pic libtool objects found, trying pic objects...\n"; + $objlist = \@sobjs; + } elsif (@sobjs == 0) { + warn "no libtool objects of any kind found\n"; + warn "hoping for real objects in ARGV...\n"; + } + } + my @tmpcmd = linkcmds($ofile, $ofile, $odir, PROGRAM, 1, $objlist); $cmd = $tmpcmd[0]; perform($cmd); write_prog_wrapper($outfile);