PageRenderTime 66ms CodeModel.GetById 12ms app.highlight 49ms RepoModel.GetById 1ms app.codeStats 1ms

/toolkit/library/Makefile.in

http://github.com/zpao/v8monkey
Autoconf | 600 lines | 478 code | 104 blank | 18 comment | 0 complexity | 775dae622f65947e5bf6d6383092ff43 MD5 | raw file
  1# This Source Code Form is subject to the terms of the Mozilla Public
  2# License, v. 2.0. If a copy of the MPL was not distributed with this file,
  3# You can obtain one at http://mozilla.org/MPL/2.0/.
  4
  5DEPTH     = ../..
  6topsrcdir = @top_srcdir@
  7srcdir    = @srcdir@
  8VPATH     = @srcdir@
  9
 10include $(DEPTH)/config/autoconf.mk
 11
 12include $(topsrcdir)/rdf/util/src/objs.mk
 13include $(topsrcdir)/intl/unicharutil/util/objs.mk
 14
 15MODULE = libxul
 16LIBRARY_NAME = xul
 17FORCE_SHARED_LIB = 1
 18MOZILLA_INTERNAL_API = 1
 19
 20ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 21# This is going to be a framework named "XUL", not an ordinary library named
 22# "libxul.dylib"
 23LIBRARY_NAME=XUL
 24# Setting MAKE_FRAMEWORK makes DLL_PREFIX and DLL_SUFFIX be ignored when
 25# setting SHARED_LIBRARY; we need to leave DLL_PREFIX and DLL_SUFFIX
 26# as-is so that dependencies of the form -ltracemalloc still work.
 27MAKE_FRAMEWORK=1
 28endif
 29
 30VPATH += $(topsrcdir)/build/
 31CPPSRCS += $(STDCXX_COMPAT)
 32
 33ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 34CPPSRCS += dlldeps-xul.cpp
 35endif
 36
 37ifeq ($(OS_ARCH),OS2)
 38CPPSRCS += dlldeps-xul.cpp
 39endif
 40
 41ifneq (,$(MOZ_ENABLE_GTK2))
 42DEFINES += -DMOZ_ENABLE_GTK2
 43endif
 44
 45SHARED_LIBRARY_LIBS += \
 46  $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
 47  $(NULL)
 48
 49SHARED_LIBRARY_LIBS += \
 50  $(foreach component,$(COMPONENT_LIBS),$(DEPTH)/staticlib/components/$(LIB_PREFIX)$(component).$(LIB_SUFFIX)) \
 51  $(foreach lib,$(STATIC_LIBS),$(DEPTH)/staticlib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX)) \
 52  $(NULL)
 53
 54CPPSRCS += \
 55  nsStaticXULComponents.cpp \
 56  $(NULL)
 57
 58ifeq ($(OS_ARCH),WINNT)
 59REQUIRES += widget gfx
 60CPPSRCS += \
 61  nsDllMain.cpp \
 62  $(NULL)
 63endif
 64
 65ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 66CPPSRCS += \
 67  nsGFXDeps.cpp \
 68  $(NULL)
 69
 70RCINCLUDE = xulrunner.rc
 71
 72ifndef MOZ_NATIVE_ZLIB
 73CPPSRCS += dlldeps-zlib.cpp
 74endif
 75
 76LOCAL_INCLUDES += -I$(topsrcdir)/widget/windows
 77LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
 78endif
 79
 80ifneq (,$(filter WINNT OS2,$(OS_ARCH)))
 81DEFINES += -DZLIB_DLL=1
 82endif
 83
 84ifeq ($(OS_ARCH),OS2)
 85REQUIRES += widget gfx
 86
 87CPPSRCS += \
 88  nsGFXDeps.cpp \
 89  $(NULL)
 90
 91ifndef MOZ_NATIVE_ZLIB
 92CPPSRCS += dlldeps-zlib.cpp
 93endif
 94
 95RESFILE = xulrunos2.res
 96RCFLAGS += -i $(topsrcdir)/widget/os2
 97
 98LOCAL_INCLUDES += -I$(topsrcdir)/widget/os2
 99LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
100endif
101
102# dependent libraries
103STATIC_LIBS += \
104  jsipc_s \
105  domipc_s \
106  domplugins_s \
107  mozipc_s \
108  mozipdlgen_s \
109  ipcshell_s \
110  gfx2d \
111  gfxipc_s \
112  hal_s \
113  $(NULL)
114
115ifdef MOZ_B2G_RIL #{
116STATIC_LIBS += mozril_s
117endif #}
118
119ifdef MOZ_IPDL_TESTS
120STATIC_LIBS += ipdlunittest_s
121endif
122
123ifeq (Linux,$(OS_ARCH))
124ifneq (Android,$(OS_TARGET))
125OS_LIBS += -lrt
126endif
127endif
128
129STATIC_LIBS += \
130  xpcom_core \
131  ucvutil_s \
132  chromium_s \
133  snappy_s \
134  $(NULL)
135
136# component libraries
137COMPONENT_LIBS += \
138  necko \
139  uconv \
140  i18n \
141  chardet \
142  jar$(VERSION_NUMBER) \
143  startupcache \
144  pref \
145  htmlpars \
146  imglib2 \
147  gkgfx \
148  gklayout \
149  docshell \
150  embedcomponents \
151  webbrwsr \
152  nsappshell \
153  txmgr \
154  commandlines \
155  toolkitcomps \
156  pipboot \
157  pipnss \
158  appcomps \
159  jsreflect \
160  composer \
161  telemetry \
162  jsinspector \
163  jsdebugger \
164  storagecomps \
165  rdf \
166  windowds \
167  $(NULL)
168
169ifdef BUILD_CTYPES
170COMPONENT_LIBS += \
171  jsctypes \
172  $(NULL)
173endif
174
175COMPONENT_LIBS += \
176  jsperf \
177  gkplugin \
178  $(NULL)
179
180ifdef MOZ_XUL
181ifdef MOZ_ENABLE_GTK2
182COMPONENT_LIBS += \
183  unixproxy \
184  $(NULL)
185endif
186endif
187
188ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
189COMPONENT_LIBS += \
190  osxproxy \
191  $(NULL)
192endif
193
194ifdef MOZ_XUL
195ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
196COMPONENT_LIBS += \
197        unixproxy \
198        $(NULL)
199endif
200endif
201
202ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
203COMPONENT_LIBS += \
204  windowsproxy \
205  $(NULL)
206endif
207
208ifdef MOZ_JSDEBUGGER
209DEFINES += -DMOZ_JSDEBUGGER
210COMPONENT_LIBS += \
211  jsd \
212  $(NULL)
213endif
214
215ifdef MOZ_PREF_EXTENSIONS
216DEFINES += -DMOZ_PREF_EXTENSIONS
217COMPONENT_LIBS += \
218  autoconfig \
219  $(NULL)
220endif
221
222ifdef MOZ_AUTH_EXTENSION
223COMPONENT_LIBS += auth
224DEFINES += -DMOZ_AUTH_EXTENSION
225endif
226
227ifdef MOZ_PERMISSIONS
228COMPONENT_LIBS += cookie permissions
229DEFINES += -DMOZ_PERMISSIONS
230endif
231
232ifdef MOZ_UNIVERSALCHARDET
233COMPONENT_LIBS += universalchardet
234DEFINES += -DMOZ_UNIVERSALCHARDET
235endif
236
237ifeq (,$(filter android gonk qt os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
238ifdef MOZ_XUL
239COMPONENT_LIBS += fileview
240DEFINES += -DMOZ_FILEVIEW
241endif
242endif
243
244ifdef MOZ_PLACES
245COMPONENT_LIBS += \
246	places \
247	$(NULL)
248endif
249
250ifdef MOZ_XUL
251COMPONENT_LIBS += \
252	tkautocomplete \
253	satchel \
254	pippki \
255	$(NULL)
256endif
257
258ifdef MOZ_ENABLE_GTK2
259COMPONENT_LIBS += widget_gtk2
260endif
261
262ifdef MOZ_ENABLE_GTK2
263ifdef MOZ_X11
264STATIC_LIBS += gtkxtbin
265endif
266endif
267
268# Platform-specific icon channel stuff - supported mostly-everywhere
269ifneq (,$(filter windows os2 mac cocoa gtk2 qt android,$(MOZ_WIDGET_TOOLKIT)))
270DEFINES += -DICON_DECODER
271COMPONENT_LIBS += imgicon
272endif
273
274ifeq ($(MOZ_WIDGET_TOOLKIT),android)
275COMPONENT_LIBS += widget_android
276STATIC_LIBS += skia_npapi
277endif
278
279ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
280COMPONENT_LIBS += widget_gonk
281endif
282
283STATIC_LIBS += thebes gl ycbcr
284
285COMPONENT_LIBS += profiler
286
287ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
288COMPONENT_LIBS += widget_windows
289endif
290ifeq (os2,$(MOZ_WIDGET_TOOLKIT))
291COMPONENT_LIBS += wdgtos2
292endif
293ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
294COMPONENT_LIBS += widget_mac
295endif
296ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
297COMPONENT_LIBS += widget_qt
298endif
299
300ifdef ACCESSIBILITY
301COMPONENT_LIBS += accessibility
302endif
303
304ifdef MOZ_ENABLE_XREMOTE
305COMPONENT_LIBS += remoteservice
306endif
307
308ifdef MOZ_SPELLCHECK
309DEFINES += -DMOZ_SPELLCHECK
310COMPONENT_LIBS += spellchecker
311endif
312
313ifdef MOZ_ZIPWRITER
314DEFINES += -DMOZ_ZIPWRITER
315COMPONENT_LIBS += zipwriter
316endif
317
318COMPONENT_LIBS += services-crypto
319
320ifdef MOZ_DEBUG
321ifdef ENABLE_TESTS
322COMPONENT_LIBS += gkdebug
323endif
324endif
325
326ifdef MOZ_APP_COMPONENT_LIBS
327COMPONENT_LIBS += $(MOZ_APP_COMPONENT_LIBS)
328endif
329
330ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
331OS_LIBS += -framework OpenGL -lcups
332endif
333
334EXTRA_DSO_LDOPTS += \
335  $(LIBS_DIR) \
336  $(JPEG_LIBS) \
337  $(PNG_LIBS) \
338  $(QCMS_LIBS) \
339  $(MOZ_JS_LIBS) \
340  $(NSS_LIBS) \
341  $(MOZ_CAIRO_LIBS) \
342  $(MOZ_HARFBUZZ_LIBS) \
343  $(MOZ_APP_EXTRA_LIBS) \
344  $(SQLITE_LIBS) \
345  $(NULL)
346
347ifdef MOZ_GRAPHITE
348EXTRA_DSO_LDOPTS += $(MOZ_GRAPHITE_LIBS)
349endif
350
351ifdef MOZ_NATIVE_ZLIB
352EXTRA_DSO_LDOPTS += $(ZLIB_LIBS)
353else
354EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
355endif
356
357ifdef MOZ_NATIVE_HUNSPELL
358EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
359endif
360
361ifdef MOZ_NATIVE_LIBEVENT
362EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
363endif
364
365ifdef MOZ_NATIVE_LIBVPX
366EXTRA_DSO_LDOPTS += $(MOZ_LIBVPX_LIBS)
367endif
368
369EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib) 
370
371ifdef MOZ_SYDNEYAUDIO
372ifeq ($(OS_ARCH),Linux)
373EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
374endif
375endif
376
377ifdef HAVE_CLOCK_MONOTONIC
378EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
379endif
380
381ifdef MOZ_ENABLE_SKIA
382EXTRA_DSO_LDOPTS += $(MOZ_SKIA_LIBS)
383endif
384
385ifeq (android,$(MOZ_WIDGET_TOOLKIT))
386OS_LIBS += -lGLESv2
387endif
388
389ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
390OS_LIBS += \
391  -lui \
392  -lmedia \
393  -lhardware_legacy \
394  -lhardware \
395  -lutils \
396  -lcutils \
397  -lcamera_client \
398  -lbinder \
399  -lsensorservice \
400  $(NULL)
401ifdef MOZ_B2G_BT
402OS_LIBS += -lbluedroid
403endif
404endif
405
406EXTRA_DEPS += \
407  $(topsrcdir)/intl/unicharutil/util/objs.mk \
408  $(topsrcdir)/rdf/util/src/objs.mk \
409  $(NULL)
410
411CPPSRCS += \
412  $(INTL_UNICHARUTIL_UTIL_LCPPSRCS) \
413  $(RDF_UTIL_SRC_LCPPSRCS) \
414  $(NULL)
415
416GARBAGE += \
417  $(INTL_UNICHARUTIL_UTIL_LCPPSRCS) \
418  $(wildcard *.$(OBJ_SUFFIX)) \
419  $(RDF_UTIL_SRC_LCPPSRCS) \
420  $(NULL)
421
422LOCAL_INCLUDES += -I$(topsrcdir)/intl/unicharutil/util \
423  -I$(topsrcdir)/intl/unicharutil/src
424
425ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
426SDK_LIBRARY = $(IMPORT_LIBRARY)
427else
428SDK_LIBRARY = $(SHARED_LIBRARY)
429endif
430
431# See bug 653662 - some builders are hitting an internal size limit on
432# incremental builds. Disable incremental linking for debug builds on VC8 or
433# on 32-bit hosts.
434# See: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/c34d5c37-ca4a-4580-9c7c-4379a8c76d1f/
435ifeq ($(OS_ARCH),WINNT)
436IS_32BIT_HOST := $(if $(filter AMD64,$(PROCESSOR_ARCHITECTURE) $(PROCESSOR_ARCHITEW6432)),,yes)
437ifneq (,$(or $(filter 1400,$(_MSC_VER)),$(IS_32BIT_HOST)))
438ifdef MOZ_DEBUG
439EXTRA_DSO_LDOPTS += -INCREMENTAL:NO
440endif
441endif
442endif
443
444EXTRA_DSO_LDOPTS += $(LIBS_DIR) $(EXTRA_DSO_LIBS)
445
446DEFINES += -DIMPL_XREAPI
447
448EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB)
449
450ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
451CXXFLAGS += $(TK_CFLAGS)
452OS_LIBS += \
453  -framework SystemConfiguration \
454  -framework QuickTime \
455  -framework IOKit \
456  -F/System/Library/PrivateFrameworks -framework CoreUI \
457  $(TK_LIBS) \
458  $(NULL)
459endif
460
461ifeq ($(OS_ARCH),Darwin)
462ifdef MOZ_SYDNEYAUDIO
463OS_LIBS += \
464  -framework Carbon \
465  -framework CoreAudio \
466  -framework AudioToolbox \
467  -framework AudioUnit \
468  -framework IOKit \
469  -framework Foundation \
470  -framework AppKit \
471  $(NULL)
472endif
473endif
474
475ifneq (,$(filter NetBSD OpenBSD,$(OS_ARCH)))
476ifdef MOZ_SYDNEYAUDIO
477EXTRA_DSO_LDOPTS += -lossaudio
478endif
479endif
480
481ifdef MOZ_PLATFORM_MAEMO
482EXTRA_DSO_LDOPTS += $(MOZ_PLATFORM_MAEMO_LIBS)
483endif
484
485ifdef MOZ_ENABLE_LIBCONIC
486EXTRA_DSO_LDOPTS += $(LIBCONIC_LIBS)
487endif
488
489ifdef MOZ_ENABLE_DBUS
490EXTRA_DSO_LDOPTS += $(MOZ_DBUS_GLIB_LIBS)
491endif
492
493ifeq (gtk2,$(MOZ_WIDGET_TOOLKIT))
494EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XEXT_LIBS) $(XCOMPOSITE_LIBS) $(MOZ_PANGO_LIBS) $(MOZ_GTK2_LIBS) $(XT_LIBS) -lgthread-2.0
495EXTRA_DSO_LDOPTS += $(FT2_LIBS)
496endif
497
498ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
499EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XT_LIBS) $(MOZ_QT_LIBS) -lgthread-2.0
500EXTRA_DSO_LDOPTS += $(FT2_LIBS) $(MOZ_PANGO_LIBS)
501EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/../widget/qt/faststartupqt/$(LIB_PREFIX)faststartupqt.$(LIB_SUFFIX)
502endif
503
504ifdef MOZ_TREE_FREETYPE
505ifndef MOZ_TREE_CAIRO
506EXTRA_DSO_LDOPTS += $(FT2_LIBS)
507endif
508endif
509
510ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
511EXTRA_DSO_LDOPTS += $(MOZ_STARTUP_NOTIFICATION_LIBS)
512endif
513
514ifdef MOZ_ENABLE_LIBPROXY
515EXTRA_DSO_LDOPTS += $(MOZ_LIBPROXY_LIBS)
516endif
517
518ifeq ($(OS_ARCH),SunOS)
519ifdef GNU_CC
520EXTRA_DSO_LDOPTS += -lelf
521else
522EXTRA_DSO_LDOPTS += -lelf -ldemangle
523endif
524endif
525
526ifeq ($(OS_ARCH),WINNT)
527OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 uuid version winspool comdlg32 imm32 winmm wsock32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg)
528ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
529OS_LIBS += $(call EXPAND_LIBNAME,imagehlp)
530endif
531ifdef MOZ_CRASHREPORTER
532OS_LIBS += $(call EXPAND_LIBNAME,wininet)
533endif
534ifdef ACCESSIBILITY
535OS_LIBS += $(call EXPAND_LIBNAME,oleacc)
536endif
537ifdef _MSC_VER
538OS_LIBS += $(call EXPAND_LIBNAME,delayimp)
539EXTRA_DSO_LDOPTS += \
540  -DELAYLOAD:gkmedias.dll \
541  -DELAYLOAD:rasapi32.dll \
542  -DELAYLOAD:rasdlg.dll \
543  -DELAYLOAD:comdlg32.dll \
544  -DELAYLOAD:winspool.drv \
545  $(NULL)
546ifdef ACCESSIBILITY
547EXTRA_DSO_LDOPTS += -DELAYLOAD:oleacc.dll
548endif
549endif
550endif # WINNT
551
552ifdef MOZ_JPROF
553EXTRA_DSO_LDOPTS += -ljprof
554endif
555
556ifdef MOZ_ENABLE_QT
557EXTRA_DSO_LDOPTS += $(MOZ_QT_LDFLAGS) $(XEXT_LIBS)
558endif
559
560include $(topsrcdir)/config/rules.mk
561
562export:: $(RDF_UTIL_SRC_CPPSRCS) $(INTL_UNICHARUTIL_UTIL_CPPSRCS)
563	$(INSTALL) $^ .
564
565# need widget/windows for resource.h (included from widget.rc)
566LOCAL_INCLUDES += \
567  -I$(topsrcdir)/config \
568  -I$(topsrcdir)/widget/windows \
569  $(NULL)
570
571OS_LIBS += $(LIBICONV)
572
573DEFINES += \
574  -D_IMPL_NS_COM \
575  -D_IMPL_NS_STRINGAPI \
576  -DEXPORT_XPT_API \
577  -DEXPORT_XPTC_API \
578  -D_IMPL_NS_GFX \
579  -D_IMPL_NS_WIDGET \
580  $(NULL)
581
582ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
583OS_LIBS += $(call EXPAND_LIBNAME,usp10 oleaut32)
584endif
585
586ifeq ($(OS_ARCH),OpenBSD)
587# Needed by nsAuthGSSAPI
588EXTRA_DSO_LDOPTS += -lkrb5 -lcrypto
589endif
590
591ifdef MOZ_DEBUG
592ifdef ENABLE_TESTS
593DEFINES += -DENABLE_LAYOUTDEBUG
594endif
595endif
596
597ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_PROFILE_USE))
598# Wrap linker to measure peak virtual memory usage.
599LD := $(PYTHON) $(topsrcdir)/build/link.py $(CURDIR)/linker-vsize $(LD)
600endif