ac_res=$ac_cv_search_ber_set_option
if test "$ac_res" != no; then
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- LDAP_LIBS="$LDAP_LIBS -llber"
+ found=yes
+else
+ found=no
fi
+ if test $found="yes"; then
+ case "$LIBS" in
+ *-llber*) LDAP_LIBS="$LDAP_LIBS -llber";;
+ esac
+ fi
{ echo "$as_me:$LINENO: checking whether lber.h is needed" >&5
echo $ECHO_N "checking whether lber.h is needed... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
else
AC_MSG_RESULT([$LDAP_LIBS])
fi
- dnl check for ber_set_option in -llber
- AC_SEARCH_LIBS([ber_set_option], [lber], [LDAP_LIBS="$LDAP_LIBS -llber"])
+ dnl check if we need to link with -llbre for ber_set_option
+ AC_SEARCH_LIBS([ber_set_option], [lber], [found=yes], [found=no])
+ if test $found="yes"; then
+ case "$LIBS" in
+ *-llber*) LDAP_LIBS="$LDAP_LIBS -llber";;
+ esac
+ fi
dnl check if ldap.h includes lber.h for us
AC_MSG_CHECKING([whether lber.h is needed])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>