$NetBSD: patch-aa,v 1.3.20.1 2013/01/13 17:56:06 tron Exp $

Use both the LDFLAGS from Perl and the directory passed from the
pkgsrc makefile to find libidn.

--- Makefile.PL.orig	2009-02-26 12:09:45.000000000 +0000
+++ Makefile.PL
@@ -47,15 +47,12 @@ sub InitMakeParams
 		"disable-tld" => \$disable_tld
 	);
 
-	if ($libdir)
-	{
-		$Params{LIBS} = "-L$libdir -lidn";
-	}
-	else
-	{
-		$Params{LIBS} = $Config{ldflags} . ' -lidn';
-	}
-
+	$Params{LIBS} = "";
+	$Params{LIBS} .= "-L$libdir " if ($libdir);
+	$Params{LIBS} .= "-Wl,-R$libdir " if ($libdir);
+	$Params{LIBS} .= $Config{ldflags};
+	$Params{LIBS} .= " -lidn";
+	
 	if ($incdir)
 	{
 		$Params{INC} = "-I$incdir";
