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.

Untracked file

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 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525
#
# ***** 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 Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#   Jeremy Morton (jez9999@runbox.com)
#
# Alternatively, the contents of this file may be used under the terms of
# either of 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

DIRS		= init.d

ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
DIRS += os2turbo
endif

# This code removes the console from release builds
# (unless you've set MOZ_WINCONSOLE=1).
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE=1
else
MOZ_WINCONSOLE=0
endif
endif


ifeq ($(OS_ARCH),WINNT)
ifndef BUILD_STATIC_LIBS
ifndef MOZ_TIMELINE
GRE_BUILD       = 1;
endif
endif
endif

ifdef GRE_BUILD
DEFINES		+= -DXPCOM_GLUE
else
MOZILLA_INTERNAL_API = 1
endif

DEFINES += -DMOZ_APP_NAME="$(MOZ_APP_NAME)"
DEFINES += -DMOZ_APP_DISPLAYNAME="$(MOZ_APP_DISPLAYNAME)"
DEFINES += -DMOZ_APP_VERSION="$(MOZ_APP_VERSION)"

MODULE		= apprunner
REQUIRES	= xpcom \
		  string \
		  webbrwsr \
		  widget \
		  dom \
		  necko \
		  content \
		  pref \
		  appshell \
		  toolkitcomps \
		  appcomps \
		  gfx \
		  xpinstall \
		  windowwatcher \
		  embed_base \
		  embedcomponents \
		  docshell \
		  locale \
		  profile \
		  chrome \
		  xremoteclient \
		  jar \
		  $(NULL)
# for jprof
REQUIRES	+= jprof

ifdef NS_TRACE_MALLOC
REQUIRES	+= tracemalloc
endif

ifdef MOZ_ENABLE_XREMOTE
REQUIRES	+= xremoteservice
endif

include $(topsrcdir)/config/config.mk

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

# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
BUILD_SHARED_LIBS=1
ifdef MOZ_COMPONENTLIB
DEFINES += -D_MOZCOMPS_SHARED_LIBRARY -D_BUILD_STATIC_BIN
endif
endif

PREF_JS_EXPORTS = $(srcdir)/browser-prefs.js

CPPSRCS		= \
		nsAppRunner.cpp \
		showOSAlert.cpp \
		$(NULL)


ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
STACKWALK_SRC_LCSRCS =               \
		nsStackFrameUnix.cpp \
		nsStackFrameUnix.h   \
		$(NULL)

STACKWALK_CPPSRCS := $(addprefix $(topsrcdir)/xpcom/base/, $(STACKWALK_SRC_LCSRCS))

CPPSRCS		+= nsSigHandlers.cpp nsStackFrameUnix.cpp
endif

ifdef BUILD_STATIC_LIBS
ifneq ($(MOZ_OS2_TOOLS),VACPP)
ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC))
STATIC_COMPONENTS_LINKER_PATH = -L$(DIST)/lib/components
endif
endif
endif

LIBS	= \
	$(STATIC_COMPONENTS_LINKER_PATH) \
	$(EXTRA_DSO_LIBS) \
	$(NULL)

ifdef MOZ_ENABLE_XREMOTE
LIBS += $(DEPTH)/widget/src/xremoteclient/$(LIB_PREFIX)xremote_client_s.$(LIB_SUFFIX)
LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/xremoteclient
endif

ifndef BUILD_STATIC_LIBS

ifdef NS_TRACE_MALLOC
EXTRA_DSO_LIBS	+= tracemalloc
endif

ifdef MOZ_COMPONENTLIB
EXTRA_DSO_LIBS += $(MOZ_COMPONENTLIB_EXTRA_DSO_LIBS)
LIBS += $(MOZ_COMPONENTLIB_EXTRA_LIBS)
endif

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

# If you change anything that mozilla links to, please talk to dougt@netscape.com
ifdef GRE_BUILD
LIBS            += \
		$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \
		$(NULL)
else
LIBS		+= $(XPCOM_LIBS)
endif

LIBS		+= \
		$(MOZ_JS_LIBS) \
		$(NSPR_LIBS) \
		$(NULL)

ifdef MOZ_JPROF
LIBS         += -ljprof
endif

ifdef GC_LEAK_DETECTOR
LIBS += -lboehm
endif

ifdef WRAP_SYSTEM_INCLUDES
DEFINES		+= -DWRAP_SYSTEM_INCLUDES
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),beos)
BEOS_PROGRAM_RESOURCE = $(srcdir)/apprunner-beos.rsrc
CPPSRCS += nsNativeAppSupportBeOS.cpp
CPPSRCS += nsNativeAppSupportBase.cpp
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
CPPSRCS += nsNativeAppSupportPh.cpp
LIBS += -lphexlib -lph
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
REQUIRES += xpconnect intl profile
CPPSRCS += nsNativeAppSupportOS2.cpp
CPPSRCS += nsNativeAppSupportBase.cpp
RESFILE = splashos2.res
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
CPPSRCS += nsNativeAppSupportMac.cpp
CPPSRCS += nsNativeAppSupportBase.cpp
LIBS	+= $(TK_LIBS)
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
SPLASH_XPM = $(srcdir)/splash.xpm
CPPSRCS += nsNativeAppSupportGtk.cpp \
	   nsNativeAppSupportBase.cpp
DEFINES += -DSPLASH_XPM=\"$(SPLASH_XPM)\"
LIBS += $(MOZ_GTK_LDFLAGS)
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
SPLASH_XPM = $(srcdir)/splash.xpm
CPPSRCS += nsNativeAppSupportGtk.cpp \
	   nsNativeAppSupportBase.cpp
DEFINES += -DSPLASH_XPM=\"$(SPLASH_XPM)\"
LIBS += $(MOZ_GTK2_LIBS)
endif

ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
LIBS += $(MOZ_QT_LDFLAGS)
endif

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

ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
REQUIRES += xpconnect intl appcomps
ifdef MOZ_PHOENIX
REQUIRES += winhooks
endif

RCINCLUDE = splash.rc
CPPSRCS += nsNativeAppSupportWin.cpp nsNativeAppSupportBase.cpp
OS_LIBS	+= $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool gdi32)
endif

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

# Include icons based on widget toolkit; not all platforms need the same set.

# All-platform icons
DESKTOP_ICONS = \
	abcardWindow \
	addressbookWindow \
	bmPropsWindow \
	bookmark-window \
	calendar-window \
	chatzilla-window \
	downloadManager \
	editorWindow \
	findBookmarkWindow \
	findHistoryWindow \
	history-window \
	jsconsoleWindow \
	main-window \
	messengerWindow \
	msgcomposeWindow \
	venkman-window \
	winInspectorMain \
	$(NULL) 

ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
# Windows icons
DESKTOP_ICONS += \
	gif-file \
	html-file \
	misc-file \
	image-file \
	jpeg-file \
	script-file \
	xml-file \
	xul-file \
	$(NULL)
endif

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

DESKTOP_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(DESKTOP_ICONS) $(DESKTOP_ICONS_SMALL))

GARBAGE	+= $(addprefix $(DIST)/bin/chrome/icons/default/,$(DESKTOP_ICON_FILES))

all::

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

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

ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
CMMSRCS += nsNativeAppSupportForCocoa.mm
LIBS += -framework Cocoa $(TK_LIBS)
endif

ifeq ($(OS_ARCH),OS2)
ifdef BUILD_STATIC_LIBS
EXE_DEF_FILE = mozilla.def
RCFLAGS += -DMOZ_STATIC_BUILD  -i $(DIST)/include/widget
endif
endif

SRCS_IN_OBJDIR=1 

ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
GARBAGE         += $(STACKWALK_SRC_LCSRCS) $(wildcard *.$(OBJ_SUFFIX))
endif

include $(topsrcdir)/config/rules.mk

ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
export:: $(STACKWALK_CPPSRCS)
	$(INSTALL) $^ .
endif

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

ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
$(PROGRAM): $(SPLASH_XPM)
endif

ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
ifdef BUILD_STATIC_LIBS
LIBS	+= -framework QuickTime -framework IOKit
endif

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

CXXFLAGS	+= $(MOZ_TOOLKIT_REGISTRY_CFLAGS)

LOCAL_INCLUDES  += -I$(srcdir) -I.

ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
$(MOZ_APP_NAME).1: mozilla.man.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
	@sed -e "s|\@bindir\@|$(bindir)|g" -e "s|\@mozappdir\@|$(mozappdir)|g" \
		-e "s|\@MOZ_APP_DISPLAYNAME\@|$(MOZ_APP_DISPLAYNAME)|g" \
		-e "s|\@MOZ_APP_NAME\@|$(MOZ_APP_NAME)|g" \
		-e "s|\@MOZ_APP_VERSION\@|${MOZ_APP_VERSION}|g" < $< > $@

libs:: $(MOZ_APP_NAME).1
	$(INSTALL) $< $(DIST)/man/man1

install:: $(MOZ_APP_NAME).1
	$(SYSINSTALL) $(IFLAGS1) $< $(DESTDIR)$(mandir)/man1

MOZILLA_SCRIPT=$(MOZ_APP_NAME)

$(MOZILLA_SCRIPT):: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
	cat $< | sed -e "s|%MOZAPPDIR%|$(mozappdir)|" \
		-e "s|%MOZ_USER_DIR%|.mozilla|" \
		-e "s|%MREDIR%|$(mredir)|" \
		-e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" \
		-e "s|%MOZILLA-BIN%|$(PROGRAM)|g" > $@
	chmod +x $@

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

install:: $(MOZILLA_SCRIPT)
	$(SYSINSTALL) $(IFLAGS2) $< $(DESTDIR)$(bindir)

GARBAGE += $(MOZ_APP_NAME).1 $(MOZILLA_SCRIPT)

endif

ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
libs:: $(srcdir)/splash.bmp
	$(INSTALL) $< $(DIST)/bin
endif

ifeq ($(OS_ARCH),OS2)
LDFLAGS += -Zlinker /NOE
ifdef BUILD_STATIC_LIBS
$(EXE_DEF_FILE):
	rm -f $@
	@echo NAME mozilla >$(EXE_DEF_FILE)
	@echo IMPORTS >>$(EXE_DEF_FILE)
	@echo 	WinQueryProperty		= PMMERGE.5450 >>$(EXE_DEF_FILE)
	@echo 	WinRemoveProperty		= PMMERGE.5451 >>$(EXE_DEF_FILE)
	@echo 	WinSetProperty			= PMMERGE.5452 >>$(EXE_DEF_FILE)

endif
endif

ifeq ($(MOZ_REORDER),1)

LDSCRIPT = ldscript
LDFLAGS += -Wl,-T,$(LDSCRIPT)
GARBAGE += $(LDSCRIPT)
ORDERFILE = $(srcdir)/mozilla-bin.order

$(PROGRAM) : $(LDSCRIPT) $(ORDERFILE)

$(LDSCRIPT): $(ORDERFILE)
	$(PERL) $(topsrcdir)/config/mklinkscript.pl -o $@ $<

endif

libs::
	touch $(DIST)/bin/.autoreg

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

INCLUDES += -I$(srcdir)/../appshell/src -I$(srcdir)/appleevents

ifdef MOZ_DEBUG
APP_NAME = $(MOZ_APP_DISPLAYNAME)Debug
else
APP_NAME = $(MOZ_APP_DISPLAYNAME)
endif

libs:: $(PROGRAM)
	mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS
	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app
	sed -e "s/MOZ_APP_NAME/$(MOZ_APP_NAME)/" -e "s/MOZ_APP_DISPLAYNAME/$(MOZ_APP_DISPLAYNAME)/" -e "s/MOZ_APP_VERSION/$(MOZ_APP_VERSION)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
	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
# Bug 297227: the next line only exists to repair broken depend builds, it can
# go away once that bug has been closed for a while.
	rm -rf $(DIST)/$(APP_NAME).app/Contents/Plug-Ins/PrintPDE.plugin
	rsync -a --copy-unsafe-links $(DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
	cp -RL $(DIST)/package/mozillaSuite.rsrc $(DIST)/$(APP_NAME).app/Contents/Resources/$(PROGRAM).rsrc
	echo -n APPLMOZZ > $(DIST)/$(APP_NAME).app/Contents/PkgInfo

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

echo_objs:
	@echo $(OBJS)

ifeq ($(OS_ARCH),OS2)
README_FILE = $(topsrcdir)/README/mozilla/README.os2
else
README_FILE = $(topsrcdir)/README.txt
endif

libs::
ifndef MOZ_SUITE
ifeq ($(OS_ARCH),OS2)
	cp $(README_FILE) $(DIST)/bin/README.txt
else
	$(INSTALL) $(README_FILE) $(DIST)/bin
endif
endif
	$(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin