mail/configure.in
author Philip Chee <philip.chee@gmail.com>
Fri, 21 Jun 2013 18:11:51 +0800
changeset 15588 4b022ddb9be42a08059f5342490157c5d9761726
parent 15549 c75bd0c80e55ddeec7b3e6fc0460d3110157a64b
child 15855 b2ae1dae373986bcdc1a981499e0dab49db13410
child 16010 a5ad797c274a5a0f890cbc0850e6ff2caf117ae3
permissions -rw-r--r--
Bug 883203 On OS X, run all plugins OOP by default when in 32-bit mode (i386/x86) f=Stefanh r=IanN a+comm-beta=IanN. a=Callek for checkin to a CLOSED TREE

dnl -*- Mode: Autoconf; tab-width: 2; indent-tabs-mode: nil; -*-
dnl vi: set tabstop=2 shiftwidth=2 expandtab:
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.

dnl Things we need to carry from confvars.sh
AC_DEFINE(MOZ_THUNDERBIRD)
AC_SUBST(MOZ_THUNDERBIRD)
AC_SUBST(MOZ_COMPOSER)
AC_SUBST(THUNDERBIRD_VERSION)

dnl Optional parts of the build.
AC_SUBST(MOZ_MORK)
if test "$MOZ_MORK"; then
  AC_DEFINE(MOZ_MORK)
  MORK_COMPONENT=mork
  MORK_MODULE="MODULE(nsMorkModule)"
fi
if test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
  MOZ_MOVEMAIL=1
fi
AC_SUBST(MOZ_MOVEMAIL)

dnl Get other versions (for the calendar plugin)
if test "$COMM_BUILD" = "1"; then
  commdir=$topsrcdir
else
  commdir=$topsrcdir/..
fi
SUNBIRD_VERSION=`cat $commdir/calendar/sunbird/config/version.txt`
SEAMONKEY_VERSION=`cat $commdir/suite/config/version.txt`
AC_SUBST(SUNBIRD_VERSION)
AC_SUBST(SEAMONKEY_VERSION)

dnl =========================================================
dnl = Lightning extension
dnl =========================================================
MOZ_ARG_ENABLE_BOOL(calendar,
[  --enable-calendar      Enable building of the Lightning calendar extension],
    MOZ_CALENDAR=1,
    MOZ_CALENDAR= )
AC_SUBST(MOZ_CALENDAR)

MOZ_ARG_ENABLE_BOOL(incomplete-external-linkage,
[  --enable-incomplete-external-linkage Changes some comm-central code to be built with external linkage. Developer only option, incomplete broken builds will result - There are already existing bugs for this. ],
    MOZ_INCOMPLETE_EXTERNAL_LINKAGE=1,
    MOZ_INCOMPLETE_EXTERNAL_LINKAGE= )

AC_SUBST(MOZ_INCOMPLETE_EXTERNAL_LINKAGE)

dnl =========================================================
dnl = LDAP
dnl =========================================================
MOZ_ARG_DISABLE_BOOL(ldap,
[  --disable-ldap          Disable LDAP support],
    MOZ_LDAP_XPCOM=,
    MOZ_LDAP_XPCOM=1)

if test "$MOZ_LDAP_XPCOM"; then
    MOZ_ARG_ENABLE_BOOL(incomplete-toolkit-ldap-autocomplete,
    [  --enable-incomplete-toolkit-ldap-autocomplete Builds a JavaScript component that implements an LDAP autocomplete component using the toolkit interfaces rather than the C++ component using the obsolete XPFE interfaces. ],
        MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE=1,
        MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE= )

    LDAP_CFLAGS='-I${DIST}/public/ldap'
    if test "$OS_ARCH" = "WINNT"; 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'
    fi

    LDAP_COMPONENT=mozldap
    LDAP_MODULE="MODULE(nsLDAPProtocolModule)"
fi
AC_SUBST(MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE)

AC_SUBST(MOZ_LDAP_XPCOM)
AC_SUBST(LDAP_CFLAGS)
AC_SUBST(LDAP_LIBS)

if test -z "$MOZ_INCOMPLETE_EXTERNAL_LINKAGE"; then
  MOZ_APP_COMPONENT_LIBS="xpautocomplete mailcomps $MAIL_COMPONENT $LDAP_COMPONENT $MORK_COMPONENT"
  MOZ_APP_COMPONENT_MODULES="MODULE(xpAutoComplete) MODULE(nsMailCompsModule) $MAIL_MODULE $LDAP_MODULE $MORK_MODULE"
  MOZ_APP_EXTRA_LIBS="$LDAP_LIBS"
fi

# Check for PBBUILD on OS X.
case "$target_os" in
darwin*)
  for name in pbbuild xcodebuild pbxbuild; do
    PBBUILD_BIN=`which $name`
    test -n "$PBBUILD_BIN" && break
  done
  AC_SUBST(PBBUILD_BIN)
  ;;
esac

# if we're building the LDAP XPCOM component, we need to build
# the c-sdk first.
if test -n "$COMPILE_ENVIRONMENT" -a -n "$MOZ_LDAP_XPCOM"; then
    # Save configure args so we can restore them after configuring LDAP.
    _save_ac_configure_args="$ac_configure_args"
    ac_configure_args="$_SUBDIR_CONFIG_ARGS"

    mkdir -p ../ldap/sdks/c-sdk/ldap
    # 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 "ldap/sdks/c-sdk/ldap"; then
        if test ! -d "ldap/sdks/c-sdk"; then
            if test ! -d "ldap/sdks"; then
                if test ! -d "ldap"; then
                    mkdir "ldap"
                fi
                mkdir "ldap/sdks"
            fi
            mkdir "ldap/sdks/c-sdk"
        fi
        mkdir "ldap/sdks/c-sdk/ldap"
    fi

    ac_configure_args="$_SUBDIR_CONFIG_ARGS --prefix=$MOZ_BUILD_ROOT/dist --with-dist-prefix=$MOZ_BUILD_ROOT/dist --without-nss --with-mozilla"
    if test -n "$HAVE_64BIT_OS"; then
        dnl A 64-bit OS was (auto-)detected: (explicitly) enable 64-bit support.
        ac_configure_args="$ac_configure_args --enable-64bit"
    fi
    if test -n "$LIBXUL_SDK"; then
        ac_configure_args="$ac_configure_args --with-nspr=$LIBXUL_DIST"
    fi

    dnl The cache file needs to be an absolute path to work properly.
    cache_file_base=`dirname $cache_file`
    cache_file=`cd $cache_file_base && pwd`/`basename $cache_file`

    AC_OUTPUT_SUBDIRS(../ldap/sdks/c-sdk)
    ac_configure_args="$_save_ac_configure_args"
fi # COMPILE_ENVIRONMENT && MOZ_LDAP_XPCOM