Follow up fix for bug 623435. (r=brendan)
[mozilla-central.git] / xulrunner / installer / Makefile.in
blobdfa78a8d0f3709ad73df91adf3a5e4ed0eb973f0
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 the Mozilla Browser code.
16 # The Initial Developer of the Original Code is
17 # IBM Corporation.
18 # Portions created by the Initial Developer are Copyright (C) 2004
19 # the Initial Developer. All Rights Reserved.
21 # Contributor(s):
22 # Brian Ryner <bryner@brianryner.com>
23 # Benjamin Smedberg <bsmedberg@covad.net>
24 # Darin Fisher <darin@meer.net>
26 # Alternatively, the contents of this file may be used under the terms of
27 # either the GNU General Public License Version 2 or later (the "GPL"), or
28 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
38 # ***** END LICENSE BLOCK *****
40 DEPTH = ../..
41 topsrcdir = @top_srcdir@
42 srcdir = @srcdir@
43 VPATH = @srcdir@
45 include $(DEPTH)/config/autoconf.mk
47 NO_PKG_FILES = \
48 xulrunner-config \
49 regchrome* \
50 regxpcom* \
51 $(NULL)
53 # If we're on mac, we want to make the .pkg first, in the mac/
54 # directory. Then packager.mk can put it into a DMG
56 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
57 DIRS += mac
58 _APPNAME = $(PKG_BASENAME).pkg
59 PKG_SKIP_STRIP = 1
60 MOZ_PKG_SPECIAL = pkg
61 PKG_DMG_SOURCE = $(STAGEPATH)xulrunner-pkg
62 endif
64 include $(topsrcdir)/config/rules.mk
66 INSTALL_SDK = 1
68 include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
70 $(MOZILLA_VERSION).system.conf: $(topsrcdir)/config/milestone.txt Makefile
71 printf "[%s]\nGRE_PATH=%s\nxulrunner=true\nabi=%s" \
72 $(MOZILLA_VERSION) $(installdir) $(TARGET_XPCOM_ABI)> $@
74 ifndef SKIP_GRE_REGISTRATION
75 # to register xulrunner per-user, override this with $HOME/.gre.d
76 regdir = /etc/gre.d
78 install:: $(MOZILLA_VERSION).system.conf
79 $(NSINSTALL) -D $(DESTDIR)$(regdir)
80 $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(regdir)
81 endif
83 # Add pkg-config files to the install:: target
85 pkg_config_files = \
86 libxul.pc \
87 libxul-embedding.pc \
88 mozilla-js.pc \
89 mozilla-plugin.pc \
90 mozilla-gtkmozembed.pc \
91 mozilla-gtkmozembed-embedding.pc \
92 $(NULL)
94 ifdef MOZ_NATIVE_NSPR
95 NSPR_NAME=nspr
96 NSPR_VERSION=$(shell $(NSPR_CONFIG) --version)
97 else
98 pkg_config_files += mozilla-nspr.pc
99 NSPR_NAME=mozilla-nspr
100 FULL_NSPR_CFLAGS=-I\$${includedir}
101 FULL_NSPR_LIBS=$(subst $(prefix),\$${sdkdir},$(shell $(DEPTH)/nsprpub/config/nspr-config --libs))
102 NSPR_VERSION=$(shell $(DEPTH)/nsprpub/config/nspr-config --version)
103 endif
105 MOZ_XUL_LINK = -lxpcomglue_s -lxul -lxpcom
106 ifdef JS_SHARED_LIBRARY
107 MOZ_JS_LINK = -lmozjs
108 else
109 MOZ_JS_LINK = $(MOZ_XUL_LINK)
110 endif
112 $(warning FULL_NSPR_CFLAGS=$(FULL_NSPR_CFLAGS))
114 ifndef MOZ_NATIVE_NSS
115 pkg_config_files += mozilla-nss.pc
116 endif
118 %.pc: $(srcdir)/%.pc.in $(GLOBAL_DEPS)
119 cat $< | sed \
120 -e "s|%prefix%|$(prefix)|" \
121 -e "s|%includedir%|$(includedir)|" \
122 -e "s|%idldir%|$(idldir)|" \
123 -e "s|%sdkdir%|$(sdkdir)|" \
124 -e "s|%MOZ_APP_NAME%|$(MOZ_APP_NAME)|" \
125 -e "s|%MOZILLA_VERSION%|$(MOZ_APP_VERSION)|" \
126 -e "s|%WCHAR_CFLAGS%|$(WCHAR_CFLAGS)|" \
127 -e "s|%FULL_NSPR_LIBS%|$(FULL_NSPR_LIBS)|" \
128 -e "s|%FULL_NSPR_CFLAGS%|$(FULL_NSPR_CFLAGS)|" \
129 -e "s|%NSPR_NAME%|$(NSPR_NAME)|" \
130 -e "s|%NSPR_VERSION%|$(NSPR_VERSION)|" \
131 -e "s|%MOZ_XUL_LINK%|$(MOZ_XUL_LINK)|" \
132 -e "s|%MOZ_JS_LINK%|$(MOZ_JS_LINK)|" > $@
133 chmod 644 $@
135 install:: $(pkg_config_files)
136 @echo pkg_config_file: $(pkg_config_files)
137 $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(libdir)/pkgconfig
139 GARBAGE += $(MOZILLA_VERSION).system.conf $(pkg_config_files)
141 GARBAGE += debian/changelog
143 DEBDESTDIR=debian/$(MOZ_BUILD_APP)
145 GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
146 GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
147 MOZ_DEB_TIMESTAMP = "$(shell date +"%a, %d %b %Y %T %z" )"
149 DEFINES += \
150 -DGRE_MILESTONE=$(GRE_MILESTONE) \
151 -DGRE_BUILDID=$(GRE_BUILDID) \
152 -DMOZ_DEB_TIMESTAMP=$(MOZ_DEB_TIMESTAMP) \
153 -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
154 -Dinstalldir=$(installdir) \
155 $(NULL)
157 ifeq ($(OS_TARGET),Linux)
158 debian/changelog: $(srcdir)/debian/changelog.in $(LIBXUL_DIST)/bin/platform.ini
159 mkdir -p debian
160 $(PYTHON) $(topsrcdir)/config/Preprocessor.py \
161 $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ > $@
163 debian/xulrunner.links: $(srcdir)/debian/xulrunner.links.in
164 $(PYTHON) $(topsrcdir)/config/Preprocessor.py \
165 $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ > $@
167 debian/xulrunner.service: $(srcdir)/debian/xulrunner.service.in
168 $(PYTHON) $(topsrcdir)/config/Preprocessor.py \
169 $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ > $@
171 package:
172 $(MAKE) package -C $(DEPTH)
174 deb: package debian/changelog debian/xulrunner.service debian/xulrunner.links $(MOZILLA_VERSION).system.conf
175 $(NSINSTALL) $(topsrcdir)/$(MOZ_BUILD_APP)/installer/debian .
176 rm -fr $(DEBDESTDIR)
177 $(NSINSTALL) -D $(DEBDESTDIR)/$(installdir)
178 cp -pRL $(DEPTH)/dist/$(MOZ_BUILD_APP)/* $(DEBDESTDIR)/$(installdir)
179 $(NSINSTALL) -D $(DEBDESTDIR)/usr/share/dbus-1/services/
180 cp debian/$(MOZ_BUILD_APP).service $(DEBDESTDIR)/usr/share/dbus-1/services/org.mozilla.$(MOZ_BUILD_APP).service
181 $(NSINSTALL) -D $(DEBDESTDIR)$(regdir)
182 $(SYSINSTALL) $(MOZILLA_VERSION).system.conf $(DEBDESTDIR)$(regdir)/
183 rm $(DEBDESTDIR)/$(installdir)/xpidl
184 dh_shlibdeps; fakeroot dh_fixperms; fakeroot dh_installdeb; fakeroot dh_gencontrol; fakeroot dh_md5sums; dh_builddeb
185 endif
187 DEB_BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
188 # package name comes from xulrunner/installer/debian/changelog.in
189 DEB_PKG_NAME = $(MOZ_PKG_APPNAME)_$(GRE_MILESTONE)-$(GRE_BUILDID)_$(DEB_BUILD_ARCH).deb
190 # relative to $(DIST)
191 UPLOAD_EXTRA_FILES += ../xulrunner/$(DEB_PKG_NAME)