mail/app/Makefile.in
author Phil Ringnalda <philringnalda@gmail.com>
Thu, 04 Dec 2008 06:16:06 -0800
branchCOMM_20081201_RELBRANCH
changeset 1331 ae57fee4ac62332bdf9ae51c7ef439732bf08873
parent 1157 c3188fbc768b302946a794d80fb2ff8b54a2a89a
child 1402 1818c8fa024fb8d73d693ce6d30ac3908634ecda
permissions -rw-r--r--
Bug 467809 - Advanced addressbook search error when changing from "match any" to "match all", r+sr=Standard8

# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#  Brian Ryner <bryner@brianryner.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****

DEPTH		= ../..
topsrcdir	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= @srcdir@

include $(DEPTH)/config/autoconf.mk

AB_CD = $(MOZ_UI_LOCALE) 

GRE_MILESTONE = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
GRE_BUILDID = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)

PLATFORM_LICENSE_FILE = $(MOZILLA_SRCDIR)/toolkit/content/license.html
MAIL_LICENSE_HTML_FILE = ../license.html
MAIL_LICENSE_TXT_FILE = $(topsrcdir)/mail/LICENSE.txt
MAIL_APP_LICENSE_FILE = $(srcdir)/app-license.html

DEFINES += \
  -DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\" \
  -DAB_CD=$(AB_CD) \
  -DGRE_MILESTONE=$(GRE_MILESTONE) \
  -DGRE_BUILDID=$(GRE_BUILDID) \
  -DAPP_EULA_BLOCK=$(MAIL_APP_LICENSE_FILE) \
   $(NULL)

DIRS		= profile

GARBAGE += \
	$(MAIL_LICENSE_HTML_FILE) \
	$(FINAL_TARGET)/license.html \
	$(NULL)

PREF_JS_EXPORTS = \
    $(srcdir)/profile/all-thunderbird.js \
    $(srcdir)/profile/channel-prefs.js \
    $(NULL)

ifeq ($(USE_SHORT_LIBNAME), 1)
PROGRAM = thunderbird$(BIN_SUFFIX)
else
PROGRAM = thunderbird-bin$(BIN_SUFFIX)
endif

REQUIRES = \
	xpcom \
	string \
	xulapp \
	$(NULL)

CPPSRCS = nsMailApp.cpp

DIST_FILES = application.ini

LOCAL_INCLUDES += -I$(MOZILLA_SRCDIR)/toolkit/xre

ifdef BUILD_STATIC_LIBS
ifdef _MSC_VER
STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(MOZDEPTH)/staticlib
else
STATIC_COMPONENTS_LINKER_PATH = -L$(MOZDEPTH)/staticlib
endif
LIBS += $(MOZDEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
LIBS += $(DIST)/bin/XUL
else
EXTRA_DSO_LIBS += xul
endif
endif

ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TK_LIBS := -framework Cocoa $(TK_LIBS)
ifdef BUILD_STATIC_LIBS
TK_LIBS := -framework SystemConfiguration $(TK_LIBS)
endif
endif

ifdef MOZ_ENABLE_LIBXUL
APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
else
MOZILLA_INTERNAL_API = 1
APP_XPCOM_LIBS = $(XPCOM_LIBS)
endif

LIBS += \
	$(STATIC_COMPONENTS_LINKER_PATH) \
	$(MOZ_JS_LIBS) \
	$(EXTRA_DSO_LIBS) \
	$(APP_XPCOM_LIBS) \
	$(NSPR_LIBS) \
	$(TK_LIBS) \
	$(NULL)

# Add explicit X11 dependency when building against X11 toolkits
ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
LIBS += $(XLDFLAGS) $(XLIBS)
endif

ifdef MOZ_JPROF
LIBS += -ljprof
endif

ifdef MOZ_ENABLE_DBUS
LIBS += $(MOZ_DBUS_GLIB_LIBS)
endif


ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif

# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
NSDISTMODE = copy

include $(topsrcdir)/config/config.mk

ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif

ifndef BUILD_STATIC_LIBS

else
include $(topsrcdir)/config/static-config.mk

EXTRA_DEPS	+= \
	$(STATIC_EXTRA_DEPS) \
	$(NULL)
DEFINES		+= $(STATIC_DEFINES)
CPPSRCS		+= $(STATIC_CPPSRCS)
EXTRA_DSO_LIBS	+= $(STATIC_EXTRA_DSO_LIBS)
REQUIRES	+= $(STATIC_REQUIRES)
EXTRA_LIBS	+= $(STATIC_EXTRA_LIBS)
endif

ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
RCINCLUDE = splash.rc
ifndef GNU_CC
RCFLAGS += -DMOZ_THUNDERBIRD -I$(srcdir)
else
RCFLAGS += -DMOZ_THUNDERBIRD --include-dir $(srcdir)
endif
ifdef BUILD_STATIC_LIBS
RCFLAGS += -DMOZ_STATIC_BUILD
endif
endif

ifeq ($(OS_ARCH),BeOS)
ifdef BUILD_STATIC_LIBS
OS_LIBS += -ltracker -lgame
endif
endif

ifeq ($(OS_ARCH),OS2)
RESFILE=splashos2.res
RCFLAGS += -DMOZ_THUNDERBIRD
ifdef BUILD_STATIC_LIBS
RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include/widget
endif
ifdef DEBUG
RCFLAGS += -DDEBUG
endif
endif

LIBS += $(JEMALLOC_LIBS)

include $(topsrcdir)/config/rules.mk

ifdef MOZILLA_OFFICIAL
DEFINES += -DMOZILLA_OFFICIAL
endif

ifdef BUILD_STATIC_LIBS
include $(topsrcdir)/config/static-rules.mk

DEFINES	+= -DIMPL_XREAPI
endif

APP_VERSION = $(shell cat $(srcdir)/../config/version.txt)
APP_UA_NAME = $(shell echo $(MOZ_APP_DISPLAYNAME) | sed -e's/[^A-Za-z]//g')
DEFINES += -DAPP_VERSION="$(APP_VERSION)" -DAPP_UA_NAME="$(APP_UA_NAME)"

ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
ifdef BUILD_STATIC_LIBS
LIBS	+= -lcups
endif
LIBS	+= -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
endif

ifeq ($(OS_ARCH),WINNT)
#
# Control the default heap size.
# This is the heap returned by GetProcessHeap().
# As we use the CRT heap, the default size is too large and wastes VM.
#
# The default heap size is 1MB on Win32.
# The heap will grow if need be.
#
# Set it to 256k.  See bug 127069.
#
ifndef GNU_CC
LDFLAGS += /HEAP:0x40000
endif
endif

$(PROGRAM): $(MOZDEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)

ifneq (,$(filter windows os2 gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT)))
ICON_SUFFIX=.ico
else
ICON_SUFFIX=.xpm
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
ICON_DIR=gtk
else
ICON_DIR=$(MOZ_WIDGET_TOOLKIT)
endif

DESKTOP_ICONS = \
	abcardWindow \
	addressbookWindow \
	msgcomposeWindow \
	$(NULL) 

BRANDED_ICONS = \
	messengerWindow \
	$(NULL)

ifeq ($(ICON_DIR),gtk)
DESKTOP_ICONS_SMALL=$(patsubst %,%16,$(DESKTOP_ICONS))
BRANDED_ICONS_SMALL=$(patsubst %,%16,$(BRANDED_ICONS))
endif

DESKTOP_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(DESKTOP_ICONS) $(DESKTOP_ICONS_SMALL))
BRANDED_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(BRANDED_ICONS) $(BRANDED_ICONS_SMALL))

libs:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES))
	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/chrome/icons/default

libs:: $(addprefix $(DIST)/branding/,$(BRANDED_ICON_FILES))
	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/chrome/icons/default

install:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES))
	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/chrome/icons/default

install:: $(addprefix $(DIST)/branding,$(BRANDED_ICON_FILES))
	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/chrome/icons/default
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
libs::
	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default.xpm $(DIST)/bin/chrome/icons/default

install::
	$(SYSINSTALL) $(IFLAGS1) $(DIST)/branding/default.xpm $(DESTDIR)$(mozappdir)/chrome/icons/default
endif

ifneq (,$(filter-out OS2 WINNT Darwin,$(OS_ARCH)))
thunderbird:: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
	cat $< | sed -e "s|%MOZAPPDIR%|$(mozappdir)|" \
		-e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@
	chmod +x $@

libs:: thunderbird
	$(INSTALL) $< $(DIST)/bin

install:: thunderbird
	$(SYSINSTALL) $< $(DESTDIR)$(bindir)

GARBAGE += thunderbird
GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, all.js all-thunderbird.js channel-prefs.js mailnews.js)
endif

ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
ICON_FILES	= \
		$(DIST)/branding/mozicon50.xpm \
		$(DIST)/branding/mozicon16.xpm \
		$(NULL)

libs::
	$(INSTALL) $(IFLAGS1) $(ICON_FILES) $(DIST)/bin/icons

install::
	$(SYSINSTALL) $(IFLAGS1) $(ICON_FILES) $(DESTDIR)$(mozappdir)/icons
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
LIBS += -lphexlib
endif

ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))

AB := $(firstword $(subst -, ,$(AB_CD)))

APP_NAME = $(MOZ_APP_DISPLAYNAME)

ifdef MOZ_DEBUG
APP_NAME := $(APP_NAME)Debug
endif

libs:: $(PROGRAM)
	mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS
	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
	mkdir -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
	sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
	sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings
	rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/MacOS
	rm -f $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
	rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
	mkdir -p $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
	rsync -a --copy-unsafe-links $(DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
	cp -RL $(DIST)/branding/thunderbird.icns $(DIST)/$(APP_NAME).app/Contents/Resources/thunderbird.icns
	echo -n APPLMOZM > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
#       remove CVS dirs from packaged app
	find $(DIST)/$(APP_NAME).app -type d -name "CVS" -prune -exec rm -rf {} \;

clean clobber::
	rm -rf $(DIST)/$(APP_NAME).app
endif

$(MAIL_LICENSE_HTML_FILE): $(PLATFORM_LICENSE_FILE) $(MAIL_APP_LICENSE_FILE)
	$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $< | \
	sed -e "s/about:license\#/\#/" > $@

libs:: $(MAIL_LICENSE_TXT_FILE) $(MAIL_LICENSE_HTML_FILE)
ifeq ($(OS_ARCH),WINNT)
	$(EXIT_ON_ERROR) \
	for file in $^; do \
	$(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $$file > $(FINAL_TARGET)/`basename $$file`; \
	done
else
	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
endif

libs:: $(srcdir)/profile/prefs.js
	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile

install:: $(srcdir)/profile/prefs.js
	$(SYSINSTALL) $(IFLAGS1) $^  $(DESTDIR)$(mozappdir)/defaults/profile

# Disable these tests due to bug 431125
TEST_COOKIES_FILE=$(DIST)/../_tests/xpcshell-simple/test_cookies/unit/test_cookies.js
TEST_COOKIE_HEADER_FILE=$(DIST)/../_tests/xpcshell-simple/test_necko/unit/test_cookie_header.js

libs::
	if test -f $(TEST_COOKIES_FILE); then $(RM) $(TEST_COOKIES_FILE); echo "function run_test() {dump('disabled for bug 431125');}" >$(TEST_COOKIES_FILE); fi;
	if test -f $(TEST_COOKIE_HEADER_FILE); then $(RM) $(TEST_COOKIE_HEADER_FILE); echo "function run_test() {dump('disabled for TB for bug 431125');}" >$(TEST_COOKIE_HEADER_FILE); fi;
	$(RM) $(DIST)/bin/TestCookie
	if test -f $(DIST)/bin/TestTArray; then cp $(DIST)/bin/TestTArray $(DIST)/bin/TestCookie; fi;