Package: postfix
Version: 2.8.1-1
Severity: normal
Tags: patch
User: vor...@debian.org
Usertags: multiarch

Hi LaMont,

I've uploaded a change to postfix in Ubuntu to fix a build failure
introduced when libc6 was converted to multiarch:

  https://launchpad.net/ubuntu/+archive/test-rebuild-20110329/+buildjob/2407653

The best way to fix this reliably and for all time without breaking
backwards compatibility and backportability is, IMHO, to ask the compiler
directly.  Since postfix isn't using autoconf which would have already asked
the compiler ;), I think gcc -print-search-dirs is the quickest way to do
this.

So this is what I've implemented, uploading with the following changelog
entry:

  * makedefs: search all directories known by the compiler for our libraries,
    not just /lib and /lib64; fixing the build failure with multiarch.

As multiarch is not too far off from unstable now, I think it would be best
if you could include this patch in your next upload.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -u postfix-2.8.1/makedefs postfix-2.8.1/makedefs
--- postfix-2.8.1/makedefs
+++ postfix-2.8.1/makedefs
@@ -282,9 +282,16 @@
 		#     GDBM_LIBS=gdbm
 		# fi
 		SYSLIBS="-ldb"
+		SEARCHDIRS=$(${CC-gcc} -print-search-dirs 2>/dev/null \
+			| grep libraries | cut -f2- -d= \
+			| sed -e's/\:/\n/g' | xargs -n1 readlink -f \
+			| grep -v 'gcc\|/[0-9.]\+$' | uniq)
+		if [ -z "$SEARCHDIRS" ]; then
+			SEARCHDIRS="/usr/lib64 /lib64 /usr/lib /lib"
+		fi
 		for name in nsl resolv $GDBM_LIBS
 		do
-		    for lib in /usr/lib64 /lib64 /usr/lib /lib
+		    for lib in $SEARCHDIRS
 		    do
 			test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
 			    SYSLIBS="$SYSLIBS -l$name"

Reply via email to