better checking for ldap and jpilot headers
[claws.git] / configure.in
index 67f59811a0fecaa20aeb8efae18a322e117fd70d..d02c8a38b98ba0cc1c3e91aceff09c67dfbb03ef 100644 (file)
@@ -125,7 +125,7 @@ if test $ac_cv_enable_ssl = yes; then
        [ AC_MSG_RESULT(no) 
          LIBS="$ac_save_LIBS" ])
 fi
-         
+
 dnl Check for X-Face support
 AC_ARG_ENABLE(compface,
        [  --disable-compface      Do not use compface (X-Face)],
@@ -135,20 +135,32 @@ if test "$ac_cv_disable_compface" = no; then
 fi
 
 dnl for JPilot support in addressbook
+dnl no check for libraries: these are dynamically loaded
+AC_MSG_CHECKING([whether to use jpilot])
 AC_ARG_ENABLE(jpilot,
        [  --enable-jpilot         Enable JPilot support [default=no]],
        [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
-
-AC_MSG_CHECKING([whether to use jpilot])
 if test "$ac_cv_enable_jpilot" = yes; then
        AC_MSG_RESULT(yes)
-       LIBS="$LIBS -lpisock"
-       AC_DEFINE(USE_JPILOT)
+       if test "$ac_cv_enable_jpilot" = yes; then
+               AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address, , [ac_cv_enable_jpilot=no])
+               if test "$ac_cv_enable_jpilot" = yes; then              
+                       LIBS="$LIBS -lpisock"
+                       AC_DEFINE(USE_JPILOT)
+               fi
+       fi
+       AC_MSG_CHECKING(whether jpilot is available)
+       if test "$ac_cv_enable_jpilot" = yes; then
+               AC_MSG_RESULT(yes)
+       else
+               AC_MSG_RESULT(no)
+       fi
 else
        AC_MSG_RESULT(no)
 fi
 
 dnl for LDAP support in addressbook
+dnl no check for libraries; dynamically loaded
 AC_ARG_ENABLE(ldap,
        [  --enable-ldap         Enable LDAP support [default=no]],
        [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
@@ -156,8 +168,19 @@ AC_ARG_ENABLE(ldap,
 AC_MSG_CHECKING([whether to use ldap])
 if test "$ac_cv_enable_ldap" = yes; then
        AC_MSG_RESULT(yes)
-       LIBS="$LIBS -lldap -llber -lpthread -lresolv"
-       AC_DEFINE(USE_LDAP)
+       if test "$ac_cv_enable_ldap" = yes; then
+               AC_CHECK_HEADERS(ldap.h lber.h pthread.h, , [ac_cv_enable_ldap=no])
+               if test "$ac_cv_enable_ldap" = yes; then
+                       LIBS="$LIBS -lldap -llber -lpthread -lresolv"
+                       AC_DEFINE(USE_LDAP)
+               fi      
+       fi
+       AC_MSG_CHECKING(whether ldap is available)
+       if test "$ac_cv_enable_ldap" = yes; then
+               AC_MSG_RESULT(yes)
+       else
+               AC_MSG_RESULT(no)
+       fi
 else
        AC_MSG_RESULT(no)
 fi