masqmail

diff configure.ac @ 1:af25f5c39d90

added diff from debian (masqmail-0.2.21-4)
author meillo@marmaro.de
date Fri, 26 Sep 2008 20:56:23 +0200
parents 08114f7dcc23
children 8c55886cacd8
line diff
     1.1 --- a/configure.ac	Fri Sep 26 17:05:23 2008 +0200
     1.2 +++ b/configure.ac	Fri Sep 26 20:56:23 2008 +0200
     1.3 @@ -38,10 +38,23 @@
     1.4  dnl if not, it is probably libc6 and we need libresolv
     1.5  	AC_CHECK_LIB(c, res_search, need_resolv=no, need_resolv=yes)
     1.6  	if test "$need_resolv" = yes; then
     1.7 -		AC_CHECK_LIB(resolv, res_search,has_resolv=yes,AC_MSG_ERROR("no libresolv"))
     1.8 -		RESOLV_LIBS='-lresolv'
     1.9 -	else
    1.10 -		RESOLV_LIBS=''
    1.11 +		AC_CHECK_LIB(resolv, res_search,
    1.12 +			has_resolv=yes; RESOLV_LIBS="-lresolv",
    1.13 +			has_resolv=no)
    1.14 +		if test "$has_resolv" = no; then
    1.15 +			saved_LIBS="$LIBS"
    1.16 +			LIBS="$LIBS -lresolv"
    1.17 +			AC_MSG_CHECKING(for res_search in -lresolv)
    1.18 +			AC_TRY_LINK([#include <resolv.h>],
    1.19 +				[res_search (0, 0, 0, 0, 0);],
    1.20 +				RESOLV_LIBS="-lresolv"; has_resolv=yes; AC_MSG_RESULT(yes),
    1.21 +				AC_MSG_RESULT(no));
    1.22 +			LIBS="$saved_LIBS"
    1.23 +		fi
    1.24 +		if test "$has_resolv" = no; then
    1.25 +			AC_MSG_ERROR("no libresolv")
    1.26 +			RESOLV_LIBS=''
    1.27 +		fi
    1.28  	fi
    1.29  else
    1.30  	RESOLV_LIBS=''