On 29.03.2012 23:10, Quanah Gibson-Mount wrote:
> --On Thursday, March 29, 2012 10:56 PM +0400 Michael Tokarev 
> <m...@tls.msk.ru> wrote:
> 
>> Besides, gcc --print-search-dirs (as already used in makedefs)
>> includes all necessary multiarch directories already.  So
>> I'm not really sure why the OP have this problem to start
>> with.  Here's the content of SEARCHDIRS variable from
>> makedefs script on my 32bit system:
> 
> If postfix doesn't find nsl or resolv in the directories in that list, it 
> won't add them to the library list.  Thus the build fails.

Oh.  The code I was referring to has been removed in
postfix 2.9.  The fragment from postfix-2.8.7:

                SEARCHDIRS=$(${CC-gcc} -print-search-dirs 2>/dev/null |
                        sed -n '/^libraries: =/s/libraries: =//p' |
                        sed -e 's/:/\n/g' | xargs -n1 readlink -f |
                        grep -v 'gcc\|/[0-9.]\+$' | sort -u)
                if [ -z "$SEARCHDIRS" ]; then
                        SEARCHDIRS="/usr/lib64 /lib64 /usr/lib /lib"
                fi
                for name in nsl resolv $GDBM_LIBS
                do
                    for lib in $SEARCHDIRS
                    do
                        test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
                            SYSLIBS="$SYSLIBS -l$name"
                            break
                        }
                    done
                done

The same fragment from postfix-2.9.1:

                for name in nsl resolv $GDBM_LIBS
                do
                    for lib in /usr/lib64 /lib64 /usr/lib /lib
                    do
                        test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
                            SYSLIBS="$SYSLIBS -l$name"
                            break
                        }
                    done
                done


I don't know why this has been changed in 2.9, seems to
be a regression.

But at any case, the whole test appears to be wrong for
a long time already.  -lnsl -lresolv should be used
unconditionally for linux2 and linux3.

Thanks,

/mjt

Reply via email to