diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -421,16 +421,17 @@ NSPR_CONFIG = @NSPR_CONFIG@ NSPR_CFLAGS = @NSPR_CFLAGS@ NSPR_LIBS = @NSPR_LIBS@ NSS_CONFIG = @NSS_CONFIG@ NSS_CFLAGS = @NSS_CFLAGS@ NSS_LIBS = @NSS_LIBS@ NSS_DEP_LIBS = @NSS_DEP_LIBS@ +MOZ_NATIVE_MOZLDAP = @SYSTEM_MOZLDAP@ LDAP_CFLAGS = @LDAP_CFLAGS@ LDAP_LIBS = @LDAP_LIBS@ XPCOM_GLUE_LDOPTS = @XPCOM_GLUE_LDOPTS@ XPCOM_STANDALONE_GLUE_LDOPTS = @XPCOM_STANDALONE_GLUE_LDOPTS@ MOZ_XPCOM_OBSOLETE_LIBS = @MOZ_XPCOM_OBSOLETE_LIBS@ USE_DEPENDENT_LIBS = @USE_DEPENDENT_LIBS@ diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -4936,16 +4936,34 @@ dnl ==================================== dnl = LDAP dnl ========================================================= MOZ_ARG_DISABLE_BOOL(ldap, [ --disable-ldap Disable LDAP support], MOZ_LDAP_XPCOM=, MOZ_LDAP_XPCOM=1) dnl ======================================================== +dnl = If mozldap was not detected in the system, +dnl = use the one in the source tree (mozilla/directory/c-sdk) +dnl ======================================================== + +if test -n "$MOZ_LDAP_XPCOM"; then + MOZ_ARG_ENABLE_BOOL(system-mozldap, + [ --enable-system-mozldap + Use system installed mozldap (located with pkgconfig)], + SYSTEM_MOZLDAP=1 ) + + if test -n "$SYSTEM_MOZLDAP"; then + PKG_CHECK_MODULES(MOZLDAP, mozldap >= 6.0.6, + SYSTEM_MOZLDAP=1, SYSTEM_MOZLDAP=) + fi +fi +AC_SUBST(SYSTEM_MOZLDAP) + +dnl ======================================================== dnl = Trademarked Branding dnl ======================================================== MOZ_ARG_ENABLE_BOOL(official-branding, [ --enable-official-branding Enable Official mozilla.org Branding Do not distribute builds with --enable-official-branding unless you have permission to use trademarks per http://www.mozilla.org/foundation/trademarks/ .], @@ -7043,17 +7061,22 @@ if test "$MOZ_LDAP_XPCOM"; then if test -n "$GNU_CC"; then LDAP_LIBS='-L$(DIST)/lib -lnsldap32v60 -lnsldappr32v60 -lnsldif32v60' else LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)nsldap32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldappr32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldif32v60.${IMPORT_LIB_SUFFIX}' fi elif test "$OS_ARCH" = "OS2"; then LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)ldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)prldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)ldif60.${IMPORT_LIB_SUFFIX}' else - LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60' + if test "$SYSTEM_MOZLDAP"; then + LDAP_LIBS="$MOZLDAP_LIBS" + LDAP_CFLAGS="$MOZLDAP_CFLAGS" + else + LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60' + fi fi fi dnl ======================================================== dnl = dnl = Maintainer debug option (no --enable equivalent) dnl = dnl ======================================================== @@ -7603,17 +7626,17 @@ fi AC_OUTPUT_SUBDIRS(mozilla) ac_configure_args="$_SUBDIR_CONFIG_ARGS" MOZ_BUILD_APP="$MOZ_BUILD_APP_CACHED" if test "$COMPILE_ENVIRONMENT"; then # if we're building the LDAP XPCOM component, we need to build # the c-sdk first. # -if test "$MOZ_LDAP_XPCOM"; then +if test "$MOZ_LDAP_XPCOM" -a -z "$SYSTEM_MOZLDAP" ; then # these subdirs may not yet have been created in the build tree. # don't use the "-p" switch to mkdir, since not all platforms have it # if test ! -d "directory"; then mkdir "directory" fi if test ! -d "directory/c-sdk"; then diff --git a/mail/build.mk b/mail/build.mk --- a/mail/build.mk +++ b/mail/build.mk @@ -47,17 +47,19 @@ ifdef MOZ_EXTENSIONS tier_app_dirs += extensions endif else # toplevel Makefile TIERS += app ifdef MOZ_LDAP_XPCOM +ifndef MOZ_NATIVE_MOZLDAP tier_app_staticdirs += directory/c-sdk +endif tier_app_dirs += directory/xpcom endif ifdef MOZ_COMPOSER tier_app_dirs += editor/ui endif ifdef MOZ_BRANDING_DIRECTORY diff --git a/suite/build.mk b/suite/build.mk --- a/suite/build.mk +++ b/suite/build.mk @@ -47,17 +47,19 @@ ifdef MOZ_EXTENSIONS tier_app_dirs += extensions endif else # toplevel Makefile TIERS += app ifdef MOZ_LDAP_XPCOM +ifndef MOZ_NATIVE_MOZLDAP tier_app_staticdirs += directory/c-sdk +endif tier_app_dirs += directory/xpcom endif ifdef MOZ_COMPOSER tier_app_dirs += editor/ui endif ifdef MOZ_BRANDING_DIRECTORY