Merge mozilla-central to tracemonkey.
[mozilla-central.git] / toolkit / xre / Makefile.in
blob19cb187fa19d6bbc96a80766554ee72f6402af1c
1 # ***** BEGIN LICENSE BLOCK *****
2 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 # http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
12 # License.
14 # The Original Code is mozilla.org code.
16 # The Initial Developer of the Original Code is
17 # Netscape Communications.
18 # Portions created by the Initial Developer are Copyright (C) 2001
19 # the Initial Developer. All Rights Reserved.
21 # Contributor(s):
22 # Brian Ryner <bryner@brianryner.com>
23 # Benjamin Smedberg <benjamin@smedbergs.us>
25 # Alternatively, the contents of this file may be used under the terms of
26 # either the GNU General Public License Version 2 or later (the "GPL"), or
27 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
39 DEPTH = ../..
40 topsrcdir = @top_srcdir@
41 srcdir = @srcdir@
42 VPATH = @srcdir@
44 include $(DEPTH)/config/autoconf.mk
46 MODULE = xulapp
47 LIBRARY_NAME = xulapp_s
48 LIBXUL_LIBRARY = 1
50 FORCE_STATIC_LIB = 1
52 XPIDLSRCS = \
53 nsINativeAppSupport.idl \
54 $(NULL)
56 ifneq (,$(filter WINCE WINNT,$(OS_ARCH)))
57 XPIDLSRCS += nsIWinAppHelper.idl
58 endif
60 CPPSRCS = \
61 nsAppRunner.cpp \
62 nsConsoleWriter.cpp \
63 nsXREDirProvider.cpp \
64 nsNativeAppSupportBase.cpp \
65 nsAppData.cpp \
66 nsSigHandlers.cpp \
67 $(NULL)
69 ifdef MOZ_SPLASHSCREEN
70 ifeq ($(OS_ARCH),WINCE)
71 CPPSRCS += nsSplashScreenWin.cpp
72 else
73 CPPSRCS += nsSplashScreenDummy.cpp
74 endif
75 endif
77 DEFINES += -DIMPL_XREAPI -DMOZ_APP_NAME='"$(MOZ_APP_NAME)"'
79 ifndef BUILD_STATIC_LIBS
80 CPPSRCS += nsEmbedFunctions.cpp
81 endif
83 ifdef MOZ_UPDATER
84 ifneq ($(OS_TARGET),Android)
85 CPPSRCS += nsUpdateDriver.cpp
86 DEFINES += -DMOZ_UPDATER
87 endif
88 endif
90 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
91 CPPSRCS += nsNativeAppSupportWin.cpp
92 DEFINES += -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE
93 EXPORTS = nsWindowsDllInterceptor.h
94 else
95 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
96 CMMSRCS = nsNativeAppSupportCocoa.mm
97 else
98 ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
99 CPPSRCS += nsNativeAppSupportOS2.cpp
100 else
101 ifeq ($(MOZ_WIDGET_TOOLKIT),beos)
102 CPPSRCS += nsNativeAppSupportBeOS.cpp
103 else
104 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
105 CPPSRCS += nsNativeAppSupportUnix.cpp
106 else
107 ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
108 CPPSRCS += nsNativeAppSupportQt.cpp
109 CPPSRCS += nsQAppInstance.cpp
110 EXPORTS += nsQAppInstance.h
111 ifdef MOZ_ENABLE_MEEGOTOUCH
112 MOCSRCS += moc_MozMeegoAppService.cpp
113 CPPSRCS += moc_MozMeegoAppService.cpp
114 endif
115 else
116 CPPSRCS += nsNativeAppSupportDefault.cpp
117 endif
118 endif
119 endif
120 endif
121 endif
122 endif
124 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
125 CMMSRCS += MacLaunchHelper.mm
126 CMMSRCS += MacApplicationDelegate.mm
127 CMMSRCS += MacAutoreleasePool.mm
128 CPPSRCS += nsCommandLineServiceMac.cpp
129 OS_CXXFLAGS += -fexceptions
130 endif
132 ifdef MOZ_X11
133 CPPSRCS += nsX11ErrorHandler.cpp
134 endif
136 ifeq ($(OS_TARGET),Android)
137 CPPSRCS += nsAndroidStartup.cpp
138 DEFINES += -DANDROID_PACKAGE_NAME='"$(ANDROID_PACKAGE_NAME)"'
139 endif
141 SHARED_LIBRARY_LIBS += ../profile/src/$(LIB_PREFIX)profile_s.$(LIB_SUFFIX)
143 ifdef MOZ_ENABLE_XREMOTE
144 SHARED_LIBRARY_LIBS += $(DEPTH)/widget/src/xremoteclient/$(LIB_PREFIX)xremote_client_s.$(LIB_SUFFIX)
145 LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/xremoteclient
146 endif
148 ifdef MOZ_CRASHREPORTER
149 SHARED_LIBRARY_LIBS += $(DEPTH)/toolkit/crashreporter/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX)
150 ifeq ($(OS_ARCH),WINNT)
151 SHARED_LIBRARY_LIBS += \
152 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/windows/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
153 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/$(LIB_PREFIX)crash_generation_s.$(LIB_SUFFIX) \
154 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/windows/$(LIB_PREFIX)breakpad_windows_common_s.$(LIB_SUFFIX)
155 endif
157 ifeq ($(OS_ARCH),Darwin)
158 SHARED_LIBRARY_LIBS += \
159 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/$(LIB_PREFIX)minidump_file_writer_s.$(LIB_SUFFIX) \
160 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/$(LIB_PREFIX)crash_generation_s.$(LIB_SUFFIX) \
161 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/mac/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
162 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)breakpad_common_s.$(LIB_SUFFIX) \
163 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/mac/$(LIB_PREFIX)breakpad_mac_common_s.$(LIB_SUFFIX)
164 endif
166 ifeq ($(OS_ARCH),Linux)
167 SHARED_LIBRARY_LIBS += \
168 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/$(LIB_PREFIX)crash_generation_s.$(LIB_SUFFIX) \
169 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/linux/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
170 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/$(LIB_PREFIX)minidump_writer_s.$(LIB_SUFFIX) \
171 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/$(LIB_PREFIX)minidump_file_writer_s.$(LIB_SUFFIX) \
172 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)breakpad_common_s.$(LIB_SUFFIX) \
173 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/linux/$(LIB_PREFIX)breakpad_linux_common_s.$(LIB_SUFFIX) \
174 $(NULL)
175 endif
177 ifeq ($(OS_ARCH),SunOS)
178 SHARED_LIBRARY_LIBS += \
179 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
180 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/$(LIB_PREFIX)minidump_file_writer_s.$(LIB_SUFFIX) \
181 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)breakpad_common_s.$(LIB_SUFFIX) \
182 $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/solaris/$(LIB_PREFIX)breakpad_solaris_common_s.$(LIB_SUFFIX) \
183 $(NULL)
184 endif
185 endif
187 ifdef ENABLE_TESTS
188 DIRS += test
189 endif
191 include $(topsrcdir)/config/config.mk
192 include $(topsrcdir)/ipc/chromium/chromium-config.mk
193 include $(topsrcdir)/config/rules.mk
195 LOCAL_INCLUDES += \
196 -I$(topsrcdir)/dom/ipc \
197 -I$(topsrcdir)/toolkit/crashreporter \
198 -I$(topsrcdir)/dom/base \
199 $(NULL)
201 ifdef BUILD_STATIC_LIBS
202 export::
203 @$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMP_NAMES) Apprunner
204 endif
206 LOCAL_INCLUDES += \
207 -I$(srcdir) \
208 -I$(srcdir)/../profile/src \
209 -I$(topsrcdir)/config \
210 $(NULL)
212 CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
214 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
215 CXXFLAGS += $(MOZ_PANGO_CFLAGS)
216 endif
218 ifdef BUILD_STATIC_LIBS
219 DEFINES += -D_BUILD_STATIC_BIN
220 endif
222 DEFINES += \
223 -DOS_TARGET=\"$(OS_TARGET)\" \
224 -DMOZ_WIDGET_TOOLKIT=\"$(MOZ_WIDGET_TOOLKIT)\"
226 ifdef TARGET_XPCOM_ABI
227 DEFINES += \
228 -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\" \
229 -DTARGET_OS_ABI=\"$(OS_TARGET)_$(TARGET_XPCOM_ABI)\" \
230 $(NULL)
231 endif
233 DEFINES += -DTOOLKIT_EM_VERSION=\"$(shell $(PERL) $(topsrcdir)/config/milestone.pl --topsrcdir=$(topsrcdir))\"
235 ifdef WRAP_SYSTEM_INCLUDES
236 DEFINES += -DWRAP_SYSTEM_INCLUDES
237 endif
239 ifeq ($(OS_ARCH),Linux)
240 ifneq (,$(findstring lib64,$(libdir)))
241 DEFINES += -DHAVE_USR_LIB64_DIR
242 endif
243 endif
245 MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
246 # strip a trailing slash from the repo URL because it's not always present,
247 # and we want to construct a working URL in buildconfig.html
248 # make+shell+sed = awful
249 _dollar=$$
250 SOURCE_REPO := $(shell cd $(topsrcdir) && hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" -e "s/\/$(_dollar)//" )
252 ifdef MOZ_SOURCE_STAMP
253 INIARGS = --sourcestamp=$(MOZ_SOURCE_STAMP)
254 # extra sanity check for old versions of hg
255 # that don't support showconfig
256 ifeq (http,$(patsubst http%,http,$(SOURCE_REPO)))
257 INIARGS += --sourcerepo=$(SOURCE_REPO)
258 endif
259 endif
261 # Solaris /usr/bin/diff doesn't have -n option
262 GRE_MILESTONE := $(shell tail -n 1 $(topsrcdir)/config/milestone.txt 2>/dev/null || tail -1 $(topsrcdir)/config/milestone.txt)
263 GRE_BUILDID := $(shell cat $(DEPTH)/config/buildid)
265 DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID)
267 $(srcdir)/nsAppRunner.cpp: $(DEPTH)/config/buildid $(topsrcdir)/config/milestone.txt
269 platform.ini: FORCE
270 $(PYTHON) $(srcdir)/make-platformini.py --buildid=$(shell cat $(DEPTH)/config/buildid) $(INIARGS) $(topsrcdir)/config/milestone.txt > $@
272 GARBAGE += platform.ini
274 libs:: platform.ini
275 $(INSTALL) $^ $(DIST)/bin
277 install::
278 $(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)