From 3b98fdf9f3967a455d101b2ff76ec62c089a3cbf Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 14 Jan 2007 00:15:09 +0000 Subject: Make the rpath() macro handle lines with multiple -L in them git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6309 e03df62e-2008-0410-955e-edbf42e46eb7 --- make/utilities.pm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'make') diff --git a/make/utilities.pm b/make/utilities.pm index 2470e1b44..a4133de06 100644 --- a/make/utilities.pm +++ b/make/utilities.pm @@ -14,14 +14,20 @@ sub make_rpath($) { my ($executable) = @_; chomp($data = `$executable`); - $data =~ /-L(\S+)\s/; - $libpath = $1; - if (!exists $already_added{$libpath}) + my $output = ""; + while ($data =~ /-L(\S+)/) { - print "Adding extra library path \033[1;32m$libpath\033[0m ...\n"; - $already_added{$libpath} = 1; + $libpath = $1; + chomp($libpath); + if (!exists $already_added{$libpath}) + { + print "Adding extra library path \033[1;32m$libpath\033[0m ...\n"; + $already_added{$libpath} = 1; + } + $output .= "-Wl,--rpath -Wl,$libpath -L$libpath "; + $data =~ s/-L(\S+)//; } - return "-Wl,--rpath -Wl,$libpath -L$libpath"; + return $output; } sub extend_pkg_path() -- cgit v1.2.3