2
# The contents of this file are subject to the Mozilla Public
3
# License Version 1.1 (the "License"); you may not use this file
4
# except in compliance with the License. You may obtain a copy of
5
# the License at http://www.mozilla.org/MPL/
7
# Software distributed under the License is distributed on an "AS
8
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
# implied. See the License for the specific language governing
10
# rights and limitations under the License.
12
# The Original Code is the Mozilla browser.
14
# The Initial Developer of the Original Code is Christopher
15
# Blizzard. Portions created by Christopher Blizzard are
16
# Copyright (C) 1999, Mozilla. All Rights Reserved.
19
# Christopher Blizzard <blizzard@mozilla.org>
22
topsrcdir = @top_srcdir@
26
include $(DEPTH)/config/autoconf.mk
29
LIBRARY_NAME = phembedmoz
51
profdirserviceprovider \
56
EmbedPrintListener.cpp \
59
EmbedContentListener.cpp \
60
EmbedEventListener.cpp \
61
EmbedWindowCreator.cpp \
67
nsUnknownContentTypeHandler.cpp
69
# Force applications to be built non-statically
70
# when building the mozcomps meta component
71
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
76
ifdef BUILD_STATIC_LIBS
78
DEFINES += -D_BUILD_STATIC_BIN=1
79
CPPSRCS += EmbedComponents.cpp
95
SHARED_LIBRARY_LIBS= \
96
$(DIST)/lib/libembed_base_s.$(LIB_SUFFIX) \
97
$(DIST)/lib/libprofdirserviceprovider_s.$(LIB_SUFFIX) \
104
$(MOZ_COMPONENT_LIBS) \
107
EXTRA_DSO_LDOPTS += $(MOZ_GTK_LDFLAGS)
109
include $(topsrcdir)/config/rules.mk
111
CXXFLAGS += $(MOZ_GTK_CFLAGS)
113
ifdef BUILD_STATIC_LIBS
115
# This is so sick! We'll work backwards from the embedding manifest to
116
# produce the set of components that we need to link in to a
117
# ``minimal'' embedding harness.
119
EMBED_MANIFEST=$(topsrcdir)/embedding/config/minimo-qnx
121
EMBED_MANIFEST=$(topsrcdir)/embedding/config/basebrowser-qnx
125
EMBED_LINK_COMPS=$(FINAL_LINK_COMPS)
126
EMBED_LINK_COMP_NAMES=$(FINAL_LINK_COMP_NAMES)
127
EMBED_LINK_COMP_MODULES = $(FINAL_LINK_COMP_NAMES)
129
EMBED_LINK_COMPS=embed-link-comps
130
EMBED_LINK_COMP_NAMES=embed-link-comp-names
131
EMBED_LINK_COMP_MODULES = embed-link-comp-modules
134
# Create a map that we can use to go from library name to component
135
# symbol. N.B. that this will break if the $(FINAL_LINK_COMP_NAMES)
136
# and $(FINAL_LINK_COMPS) somehow get out-of-sync and aren't in
137
# _exactly_ the same order. (Hey, this is a hack!)
138
components: $(FINAL_LINK_COMPS) $(FINAL_LINK_COMP_NAMES)
139
cat $(FINAL_LINK_COMPS) $(FINAL_LINK_COMP_NAMES) | sort -k 1,1 > $@
141
# Compute the embedding libs by extracting them from the embedding
144
# We start by selecting anything that starts with `components/', as
145
# these are the component libraries. We print the `first' field to
146
# strip off any crap after the library name. Next, we select for files
147
# ending with `.so' so we end up with only the libraries. We then rip
148
# off the `components/lib' prefix and the `.so' suffix, leaving just
149
# the library name. This list is sorted, and joined with the list of
150
# components that were actually _built_ to cull out anything that's
151
# included in the manifest, but wasn't built.
152
embed-link-comps: $(EMBED_MANIFEST) components
153
grep '^components/' $< | \
154
awk '{ print $$1; }' | \
156
sed -e 's.^components/lib..' -e 's/\.so//' | \
158
join -o 1.1 - components > $@
161
# Compute the symbols we'll need for the ``minimal embedding client''
162
# by joining the compoent list with the sorted list of embedding
164
embed-link-comp-names: embed-link-comps components
165
sort embed-link-comps | join -o 1.1 - components > $@
166
#sort embed-link-comps | join -o 2.2 - components > $@
169
# since embed-link-comp-names is filled with the static library names, we cannot use them - we need something
170
# filled with the modules names ( foe instance nsCookieModule instead of cookie
171
embed-link-comp-modules: embed-link-comp-names
172
for i in `cat embed-link-comp-names` ; \
174
objdump -x ../../../../dist/lib/components/lib$$i.a | \
175
grep _gModuleInfo | \
176
awk '{ print $$6; }' | \
177
sed -e "s/_gModuleInfo//" ) ; \
181
EmbedComponents.cpp: EmbedComponents.cpp.in Makefile Makefile.in $(EMBED_LINK_COMP_MODULES)
183
sed -e "s|%DECL_NSGETMODULES%|$(foreach m,$(shell cat $(EMBED_LINK_COMP_MODULES)),DECL_NSGETMODULE($(m)))|" | \
184
sed -e "s|%MODULE_LIST%|$(foreach m, $(shell cat $(EMBED_LINK_COMP_MODULES)),MODULE($(m)),)|" \
187
GARBAGE += EmbedComponents.cpp embed-link-comp-names embed-link-comps components embed-link-comp-modules