DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (379a2370cd89)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
# ***** 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)

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

MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
ifdef MOZ_SOURCE_STAMP
DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
endif

SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
ifdef SOURCE_REPO
DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
endif

ifdef MOZILLA_OFFICIAL
DEFINES += -DOFFICIAL_BUILD=1
endif

DIRS		= profile

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

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

ifneq (,$(filter OS2 Darwin WINCE WINNT,$(OS_ARCH)))
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
else
PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
endif


CPPSRCS = nsMailApp.cpp

DIST_FILES = application.ini

LOCAL_INCLUDES += \
  -I$(MOZILLA_SRCDIR)/toolkit/xre \
  -I$(MOZILLA_SRCDIR)/xpcom/base \
  -I$(MOZILLA_SRCDIR)/xpcom/build \
  $(NULL)

DEFINES += -DXPCOM_GLUE
STL_FLAGS=

ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
TK_LIBS := -framework Cocoa $(TK_LIBS)
endif

LIBS += \
	$(EXTRA_DSO_LIBS) \
	$(XPCOM_STANDALONE_GLUE_LDOPTS) \
	$(NULL)

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

ifeq ($(OS_ARCH),WINNT)
# Extract the icons we care about embedding into the EXE
mailtoolbar = $(topsrcdir)/mail/themes/qute/mail/icons/mail-toolbar-aero.png
# Each icon is 18x18 in the toolbar, and we want a 16x16 icon here, so we cut
# off a pixel at each end.
libs::
	$(call png2ico,$(mailtoolbar),19,1,16,write-message.ico)
	$(call png2ico,$(mailtoolbar),37,1,16,address-book.ico)

GARBAGE += write-message.ico address-book.ico

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
endif

ifeq ($(OS_ARCH),OS2)
RESFILE=splashos2.res
RCFLAGS += -DMOZ_THUNDERBIRD
ifdef DEBUG
RCFLAGS += -DDEBUG
endif
RCFLAGS += -DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\"
endif

include $(topsrcdir)/config/rules.mk

ifdef MOZILLA_OFFICIAL
DEFINES += -DMOZILLA_OFFICIAL
endif

APP_UA_NAME = $(shell echo $(MOZ_APP_DISPLAYNAME) | sed -e's/[^A-Za-z]//g')
DEFINES += -DAPP_VERSION="$(MOZ_APP_VERSION)" -DAPP_UA_NAME="$(APP_UA_NAME)"

ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
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

ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT)))
ICON_SUFFIX=.ico

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

BRANDED_ICONS = \
	messengerWindow \
	$(NULL)


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/$(MOZ_WIDGET_TOOLKIT)/,$(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/$(MOZ_WIDGET_TOOLKIT)/,$(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* $(DIST)/bin/chrome/icons/default

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

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

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

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

GARBAGE += $(MOZ_APP_NAME)
else
libs::
	cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)

endif # ! Mac
GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, all.js all-thunderbird.js channel-prefs.js mailnews.js)
endif # ! OS 2 or WinNT

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

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

libs:: blocklist.xml
	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin

ifdef ENABLE_TESTS
# XXX This is a hack to ensure that we get the right xpcshell.ini for our tests
# and that we can share the core mozilla-central xpcshell.ini.
# mozilla-central does this in testing/xpcshell-tests which means that it is
# very hard for anyone to specify anything else.
libs::
	$(NSINSTALL) -D $(MOZDEPTH)/_tests/xpcshell
	cp $(MOZILLA_SRCDIR)/testing/xpcshell/xpcshell.ini $(MOZDEPTH)/_tests/xpcshell/xpcshell-core.ini
	$(INSTALL) $(topsrcdir)/mail/test/xpcshell.ini $(MOZDEPTH)/_tests/xpcshell
	cp $(topsrcdir)/mail/test/xpcshell.ini $(MOZDEPTH)/_tests/xpcshell/all-test-dirs.list
endif

ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))

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

MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)

ifdef MOZ_DEBUG
MAC_APP_NAME := $(MAC_APP_NAME)Debug
endif

LOWER_MAC_APP_NAME = $(shell echo $(MAC_APP_NAME) | tr '[A-Z]' '[a-z]')

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

clean clobber::
	rm -rf $(DIST)/$(MOZ_MACBUNDLE_NAME)
endif

# Note that anything you do to dist/ down here isn't going to make it into the
# Mac build, since it's already been copied over to the .app, above.