2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Original Code is the Mozilla browser.
17 # The Initial Developer of the Original Code is
18 # Christopher Blizzard.
19 # Portions created by the Initial Developer are Copyright (C) 1999
20 # the Initial Developer. All Rights Reserved.
23 # Christopher Blizzard <blizzard@mozilla.org>
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 *****
40 topsrcdir
= @top_srcdir@
44 include $(DEPTH
)/config
/autoconf.mk
47 LIBRARY_NAME
= phembedmoz
68 profdirserviceprovider \
73 EmbedPrintListener.
cpp \
76 EmbedContentListener.
cpp \
77 EmbedEventListener.
cpp \
78 EmbedWindowCreator.
cpp \
84 nsUnknownContentTypeHandler.
cpp
86 DEFINES
+= -DMOZILLA_INTERNAL_API
=1
88 # Force applications to be built non-statically
89 # when building the mozcomps meta component
90 ifneq (,$(filter mozcomps
,$(MOZ_META_COMPONENTS
)))
94 ifdef BUILD_STATIC_LIBS
96 DEFINES
+= -D_BUILD_STATIC_BIN
=1
97 CPPSRCS
+= EmbedComponents.
cpp
113 SHARED_LIBRARY_LIBS
= \
114 $(DIST
)/lib
/libembed_base_s.
$(LIB_SUFFIX
) \
115 $(DIST
)/lib
/libprofdirserviceprovider_s.
$(LIB_SUFFIX
) \
122 $(MOZ_COMPONENT_LIBS
) \
125 EXTRA_DSO_LDOPTS
+= $(MOZ_GTK_LDFLAGS
)
127 include $(topsrcdir
)/config
/rules.mk
129 CXXFLAGS
+= $(MOZ_GTK_CFLAGS
)
131 ifneq ($(QCONF_OVERRIDE
),)
132 include $(QCONF_OVERRIDE
)
133 CXXFLAGS
+= -I
$(if
$(USE_INSTALL_ROOT
),$(INSTALL_ROOT_nto
),$(USE_ROOT_nto
))/usr
/include
136 ifdef BUILD_STATIC_LIBS
138 # This is so sick! We'll work backwards from the embedding manifest to
139 # produce the set of components that we need to link in to a
140 # ``minimal'' embedding harness.
141 EMBED_MANIFEST
=$(topsrcdir
)/embedding
/config
/basebrowser-qnx
144 EMBED_LINK_COMPS
=$(FINAL_LINK_COMPS
)
145 EMBED_LINK_COMP_NAMES
=$(FINAL_LINK_COMP_NAMES
)
146 EMBED_LINK_COMP_MODULES
= $(FINAL_LINK_COMP_NAMES
)
148 EMBED_LINK_COMPS
=embed-link-comps
149 EMBED_LINK_COMP_NAMES
=embed-link-comp-names
150 EMBED_LINK_COMP_MODULES
= embed-link-comp-modules
153 # Create a map that we can use to go from library name to component
154 # symbol. N.B. that this will break if the $(FINAL_LINK_COMP_NAMES)
155 # and $(FINAL_LINK_COMPS) somehow get out-of-sync and aren't in
156 # _exactly_ the same order. (Hey, this is a hack!)
157 components
: $(FINAL_LINK_COMPS
) $(FINAL_LINK_COMP_NAMES
)
158 cat
$(FINAL_LINK_COMPS
) $(FINAL_LINK_COMP_NAMES
) |
sort -k
1,1 > $@
160 # Compute the embedding libs by extracting them from the embedding
163 # We start by selecting anything that starts with `components/', as
164 # these are the component libraries. We print the `first' field to
165 # strip off any crap after the library name. Next, we select for files
166 # ending with `.so' so we end up with only the libraries. We then rip
167 # off the `components/lib' prefix and the `.so' suffix, leaving just
168 # the library name. This list is sorted, and joined with the list of
169 # components that were actually _built_ to cull out anything that's
170 # included in the manifest, but wasn't built.
171 embed-link-comps
: $(EMBED_MANIFEST
) components
172 grep
'^components/' $< | \
173 awk
'{ print $$1; }' | \
175 sed
-e
's.^components/lib..' -e
's/\.so//' | \
177 join -o
1.1 - components
> $@
180 # Compute the symbols we'll need for the ``minimal embedding client''
181 # by joining the compoent list with the sorted list of embedding
183 embed-link-comp-names
: embed-link-comps components
184 sort embed-link-comps |
join -o
1.1 - components
> $@
185 #sort embed-link-comps | join -o 2.2 - components > $@
188 # since embed-link-comp-names is filled with the static library names, we cannot use them - we need something
189 # filled with the modules names ( foe instance nsCookieModule instead of cookie
190 embed-link-comp-modules
: embed-link-comp-names
191 for i in
`cat embed-link-comp-names` ; \
193 objdump
-x ..
/..
/..
/..
/dist/lib
/components
/lib
$$i.a | \
194 grep _gModuleInfo | \
195 awk
'{ print $$6; }' | \
196 sed
-e
"s/_gModuleInfo//" ) ; \
200 EmbedComponents.
cpp: EmbedComponents.
cpp.in Makefile Makefile.in
$(EMBED_LINK_COMP_MODULES
)
202 sed
-e
"s|%DECL_NSGETMODULES%|$(foreach m,$(shell cat $(EMBED_LINK_COMP_MODULES)),DECL_NSGETMODULE($(m)))|" | \
203 sed
-e
"s|%MODULE_LIST%|$(foreach m, $(shell cat $(EMBED_LINK_COMP_MODULES)),MODULE($(m)),)|" \
206 GARBAGE
+= EmbedComponents.
cpp embed-link-comp-names embed-link-comps components embed-link-comp-modules