summaryrefslogtreecommitdiffstats
path: root/meta-moblin
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-09-01 19:09:11 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-01 19:09:57 +0100
commitd62ee7eaf2ba025c3f64b2d4e10dc7cec4637612 (patch)
treef36fe3008f36ff75cbdd31b630f8f13f1f205ebb /meta-moblin
parentcaab7fc509bf27706ff3248689f6afd04225cfda (diff)
downloadpoky-d62ee7eaf2ba025c3f64b2d4e10dc7cec4637612.tar.gz
packages: Separate out most of the remaining packages into recipes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta-moblin')
-rw-r--r--meta-moblin/packages/clutter/clutter-mozembed.inc14
-rw-r--r--meta-moblin/packages/clutter/clutter-mozembed_git.bb14
-rw-r--r--meta-moblin/packages/libidl/libidl_0.8.12.bb16
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless-services/confighack.patch13
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless-services_git.bb14
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/0001-Adds-initial-Gtk-clipboard-support-to-moz-headless.patch1478
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/autoconffix.patch66
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/buildfixhack.patch14
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/configurefix-1a622cb7c384.patch764
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/configurefix.patch774
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/i386/jsautocfg.h21
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/i486/jsautocfg.h21
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/i586/jsautocfg.h21
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/i686/jsautocfg.h21
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/mozconfig23
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/mozilla-jemalloc.patch24
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/removebadrpath-1a622cb7c384.patch26
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless/removebadrpath.patch44
-rw-r--r--meta-moblin/packages/mozilla-headless/mozilla-headless_hg.bb99
19 files changed, 3467 insertions, 0 deletions
diff --git a/meta-moblin/packages/clutter/clutter-mozembed.inc b/meta-moblin/packages/clutter/clutter-mozembed.inc
new file mode 100644
index 0000000000..72c9412d04
--- /dev/null
+++ b/meta-moblin/packages/clutter/clutter-mozembed.inc
@@ -0,0 +1,14 @@
1DESCRIPTION = "Clutter Mozilla Embedded"
2HOMEPAGE = "http://www.clutter-project.org/"
3LICENSE = "LGPL"
4
5DEPENDS = "mozilla-headless mozilla-headless-services clutter-1.0"
6
7FILESPATH = "${FILE_DIRNAME}/clutter-mozembed"
8
9FILES_${PN} =+ "${datadir}/cluttermozembed/chrome/"
10
11EXTRA_OECONF = "--enable-plugins"
12
13inherit autotools pkgconfig gtk-doc
14
diff --git a/meta-moblin/packages/clutter/clutter-mozembed_git.bb b/meta-moblin/packages/clutter/clutter-mozembed_git.bb
new file mode 100644
index 0000000000..e2da2d6a7d
--- /dev/null
+++ b/meta-moblin/packages/clutter/clutter-mozembed_git.bb
@@ -0,0 +1,14 @@
1require clutter-mozembed.inc
2
3PV = "0.8.0+git${SRCPV}"
4PR = "r7"
5
6SRC_URI = "git://git.clutter-project.org/clutter-mozembed.git;protocol=git \
7 file://link-with-g++-da7632f3e2c8d1a70ab01cc7adb63760d8718b41.patch;patch=1;rev=da7632f3e2c8d1a70ab01cc7adb63760d8718b41 \
8 file://link-with-g++.patch;patch=1;notrev=da7632f3e2c8d1a70ab01cc7adb63760d8718b41"
9S = "${WORKDIR}/git"
10
11do_configure_prepend () {
12 touch ${S}/clutter-mozembed/dummy.cpp
13 touch ${S}/clutter-mozembed/dummy2.cpp
14}
diff --git a/meta-moblin/packages/libidl/libidl_0.8.12.bb b/meta-moblin/packages/libidl/libidl_0.8.12.bb
new file mode 100644
index 0000000000..9cc9ea2ed8
--- /dev/null
+++ b/meta-moblin/packages/libidl/libidl_0.8.12.bb
@@ -0,0 +1,16 @@
1LICENSE = "LGPL"
2DESCRIPTION = "Library for parsing CORBA IDL files"
3SECTION = "gnome/libs"
4DEPENDS = "glib-2.0 flex"
5PR = "r4"
6
7SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/libIDL/0.8/libIDL-${PV}.tar.bz2"
8S = "${WORKDIR}/libIDL-${PV}"
9
10BINCONFIG_GLOB = "*-config-2"
11inherit autotools pkgconfig binconfig
12
13FILES_${PN} = "${libdir}/*.so.*"
14FILES_${PN}-dev += " ${bindir}"
15
16BBCLASSEXTEND = "native"
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless-services/confighack.patch b/meta-moblin/packages/mozilla-headless/mozilla-headless-services/confighack.patch
new file mode 100644
index 0000000000..dcfe11e0ff
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless-services/confighack.patch
@@ -0,0 +1,13 @@
1Index: places-glib/configure.ac
2===================================================================
3--- places-glib.orig/configure.ac 2009-04-17 10:29:15.000000000 +0100
4+++ places-glib/configure.ac 2009-04-17 10:29:44.000000000 +0100
5@@ -99,6 +99,8 @@
6 PKG_CHECK_MODULES(GLIB, [glib-2.0])
7 PKG_CHECK_MODULES(DBUS, [dbus-glib-1])
8
9+XUL_LIBS="$XUL_LIBS -lmozjs"
10+
11 MOZHOME=`${PKG_CONFIG} --variable=prefix mozilla-headless`"/lib/xulrunner-"`${PKG_CONFIG} --modversion mozilla-headless`
12 AC_SUBST([MOZHOME])
13
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless-services_git.bb b/meta-moblin/packages/mozilla-headless/mozilla-headless-services_git.bb
new file mode 100644
index 0000000000..14d64fa8c3
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless-services_git.bb
@@ -0,0 +1,14 @@
1SRC_URI = "git://git.moblin.org/mozilla-headless-services.git;protocol=git \
2 file://confighack.patch;patch=1"
3PV = "0.1+git${SRCPV}"
4PR = "r1"
5
6DEPENDS = "glib-2.0 dbus mozilla-headless json-glib"
7
8EXTRA_OECONF = "--enable-gnome-proxy"
9
10S = "${WORKDIR}/git"
11
12FILES_${PN} += "${datadir}/dbus-1/services"
13
14inherit autotools
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/0001-Adds-initial-Gtk-clipboard-support-to-moz-headless.patch b/meta-moblin/packages/mozilla-headless/mozilla-headless/0001-Adds-initial-Gtk-clipboard-support-to-moz-headless.patch
new file mode 100644
index 0000000000..db9e147990
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/0001-Adds-initial-Gtk-clipboard-support-to-moz-headless.patch
@@ -0,0 +1,1478 @@
1From fb41f028badb4dfddfc47fb2a1a68c1aa90dcef5 Mon Sep 17 00:00:00 2001
2From: Robert Bragg <robert@linux.intel.com>
3Date: Fri, 8 May 2009 13:57:22 +0100
4Subject: [PATCH] Adds initial Gtk clipboard support to moz-headless
5
6If build with MOZ_X11 enabled then this now builds the clipboard code taken
7from the gtk2 backend. This doesn't provide any embedding API yet to expose
8the clipboard.
9---
10 widget/src/headless/Makefile.in | 6 +
11 widget/src/headless/nsClipboard.cpp | 948 +++++++++++++++++++++++++++++++
12 widget/src/headless/nsClipboard.h | 93 +++
13 widget/src/headless/nsIImageToPixbuf.h | 62 ++
14 widget/src/headless/nsImageToPixbuf.cpp | 196 +++++++
15 widget/src/headless/nsImageToPixbuf.h | 71 +++
16 widget/src/headless/nsWidgetFactory.cpp | 18 +
17 7 files changed, 1394 insertions(+), 0 deletions(-)
18 create mode 100644 widget/src/headless/nsClipboard.cpp
19 create mode 100644 widget/src/headless/nsClipboard.h
20 create mode 100644 widget/src/headless/nsIImageToPixbuf.h
21 create mode 100644 widget/src/headless/nsImageToPixbuf.cpp
22 create mode 100644 widget/src/headless/nsImageToPixbuf.h
23
24Index: offscreen/widget/src/headless/Makefile.in
25===================================================================
26--- offscreen.orig/widget/src/headless/Makefile.in 2009-05-16 18:23:25.000000000 +0100
27+++ offscreen/widget/src/headless/Makefile.in 2009-06-12 14:14:05.000000000 +0100
28@@ -95,6 +95,12 @@
29 nsScreenManagerHeadless.cpp \
30 $(NULL)
31
32+ifdef MOZ_X11
33+CPPSRCS += nsClipboard.cpp \
34+ nsImageToPixbuf.cpp \
35+ $(NULL)
36+endif
37+
38 # build our subdirs, too
39 SHARED_LIBRARY_LIBS = ../xpwidgets/libxpwidgets_s.a
40
41Index: offscreen/widget/src/headless/nsClipboard.cpp
42===================================================================
43--- /dev/null 1970-01-01 00:00:00.000000000 +0000
44+++ offscreen/widget/src/headless/nsClipboard.cpp 2009-06-12 14:14:05.000000000 +0100
45@@ -0,0 +1,948 @@
46+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
47+/* vim:expandtab:shiftwidth=4:tabstop=4:
48+ */
49+/* ***** BEGIN LICENSE BLOCK *****
50+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
51+ *
52+ * The contents of this file are subject to the Mozilla Public License Version
53+ * 1.1 (the "License"); you may not use this file except in compliance with
54+ * the License. You may obtain a copy of the License at
55+ * http://www.mozilla.org/MPL/
56+ *
57+ * Software distributed under the License is distributed on an "AS IS" basis,
58+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
59+ * for the specific language governing rights and limitations under the
60+ * License.
61+ *
62+ * The Original Code is mozilla.org code.
63+ *
64+ * The Initial Developer of the Original Code is Christopher Blizzard
65+ * <blizzard@mozilla.org>. Portions created by the Initial Developer
66+ * are Copyright (C) 2001 the Initial Developer. All Rights Reserved.
67+ *
68+ * Contributor(s):
69+ *
70+ * Alternatively, the contents of this file may be used under the terms of
71+ * either the GNU General Public License Version 2 or later (the "GPL"), or
72+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
73+ * in which case the provisions of the GPL or the LGPL are applicable instead
74+ * of those above. If you wish to allow use of your version of this file only
75+ * under the terms of either the GPL or the LGPL, and not to allow others to
76+ * use your version of this file under the terms of the MPL, indicate your
77+ * decision by deleting the provisions above and replace them with the notice
78+ * and other provisions required by the GPL or the LGPL. If you do not delete
79+ * the provisions above, a recipient may use your version of this file under
80+ * the terms of any one of the MPL, the GPL or the LGPL.
81+ *
82+ * ***** END LICENSE BLOCK ***** */
83+
84+#include "nsClipboard.h"
85+#include "nsSupportsPrimitives.h"
86+#include "nsString.h"
87+#include "nsReadableUtils.h"
88+#include "nsXPIDLString.h"
89+#include "nsPrimitiveHelpers.h"
90+#include "nsICharsetConverterManager.h"
91+#include "nsIServiceManager.h"
92+#include "nsIImage.h"
93+#include "nsImageToPixbuf.h"
94+#include "nsStringStream.h"
95+
96+#include <gtk/gtk.h>
97+
98+// For manipulation of the X event queue
99+#include <X11/Xlib.h>
100+#include <gdk/gdkx.h>
101+#include <sys/time.h>
102+#include <sys/types.h>
103+#include <unistd.h>
104+
105+#ifdef POLL_WITH_XCONNECTIONNUMBER
106+#include <poll.h>
107+#endif
108+
109+// Callback when someone asks us for the selection
110+void
111+invisible_selection_get_cb (GtkWidget *aWidget,
112+ GtkSelectionData *aSelectionData,
113+ guint aTime,
114+ guint aInfo,
115+ nsClipboard *aClipboard);
116+
117+gboolean
118+selection_clear_event_cb (GtkWidget *aWidget,
119+ GdkEventSelection *aEvent,
120+ nsClipboard *aClipboard);
121+
122+static void
123+ConvertHTMLtoUCS2 (guchar *data,
124+ PRInt32 dataLength,
125+ PRUnichar **unicodeData,
126+ PRInt32 &outUnicodeLen);
127+
128+static void
129+GetHTMLCharset (guchar * data, PRInt32 dataLength, nsCString& str);
130+
131+
132+// Our own versions of gtk_clipboard_wait_for_contents and
133+// gtk_clipboard_wait_for_text, which don't run the event loop while
134+// waiting for the data. This prevents a lot of problems related to
135+// dispatching events at unexpected times.
136+
137+static GtkSelectionData *
138+wait_for_contents (GtkClipboard *clipboard, GdkAtom target);
139+
140+static gchar *
141+wait_for_text (GtkClipboard *clipboard);
142+
143+static Bool
144+checkEventProc(Display *display, XEvent *event, XPointer arg);
145+
146+struct retrieval_context
147+{
148+ PRBool completed;
149+ void *data;
150+
151+ retrieval_context() : completed(PR_FALSE), data(nsnull) { }
152+};
153+
154+static void
155+wait_for_retrieval(GtkClipboard *clipboard, retrieval_context *transferData);
156+
157+static void
158+clipboard_contents_received(GtkClipboard *clipboard,
159+ GtkSelectionData *selection_data,
160+ gpointer data);
161+
162+static void
163+clipboard_text_received(GtkClipboard *clipboard,
164+ const gchar *text,
165+ gpointer data);
166+
167+nsClipboard::nsClipboard()
168+{
169+ mWidget = nsnull;
170+}
171+
172+nsClipboard::~nsClipboard()
173+{
174+ if (mWidget)
175+ gtk_widget_destroy(mWidget);
176+}
177+
178+NS_IMPL_ISUPPORTS1(nsClipboard, nsIClipboard)
179+
180+nsresult
181+nsClipboard::Init(void)
182+{
183+ mWidget = gtk_invisible_new();
184+ if (!mWidget)
185+ return NS_ERROR_FAILURE;
186+
187+ g_signal_connect(G_OBJECT(mWidget), "selection_get",
188+ G_CALLBACK(invisible_selection_get_cb), this);
189+
190+ g_signal_connect(G_OBJECT(mWidget), "selection_clear_event",
191+ G_CALLBACK(selection_clear_event_cb), this);
192+
193+ // XXX make sure to set up the selection_clear event
194+
195+ return NS_OK;
196+}
197+
198+NS_IMETHODIMP
199+nsClipboard::SetData(nsITransferable *aTransferable,
200+ nsIClipboardOwner *aOwner, PRInt32 aWhichClipboard)
201+{
202+ // See if we can short cut
203+ if ((aWhichClipboard == kGlobalClipboard &&
204+ aTransferable == mGlobalTransferable.get() &&
205+ aOwner == mGlobalOwner.get()) ||
206+ (aWhichClipboard == kSelectionClipboard &&
207+ aTransferable == mSelectionTransferable.get() &&
208+ aOwner == mSelectionOwner.get())) {
209+ return NS_OK;
210+ }
211+
212+ nsresult rv;
213+ if (!mPrivacyHandler) {
214+ rv = NS_NewClipboardPrivacyHandler(getter_AddRefs(mPrivacyHandler));
215+ NS_ENSURE_SUCCESS(rv, rv);
216+ }
217+ rv = mPrivacyHandler->PrepareDataForClipboard(aTransferable);
218+ NS_ENSURE_SUCCESS(rv, rv);
219+
220+ // Clear out the clipboard in order to set the new data
221+ EmptyClipboard(aWhichClipboard);
222+
223+ if (aWhichClipboard == kSelectionClipboard) {
224+ mSelectionOwner = aOwner;
225+ mSelectionTransferable = aTransferable;
226+ }
227+ else {
228+ mGlobalOwner = aOwner;
229+ mGlobalTransferable = aTransferable;
230+ }
231+
232+ // Which selection are we about to claim, CLIPBOARD or PRIMARY?
233+ GdkAtom selectionAtom = GetSelectionAtom(aWhichClipboard);
234+
235+ // Make ourselves the owner. If we fail to, return.
236+ if (!gtk_selection_owner_set(mWidget, selectionAtom, GDK_CURRENT_TIME))
237+ return NS_ERROR_FAILURE;
238+
239+ // Clear the old selection target list.
240+ gtk_selection_clear_targets(mWidget, selectionAtom);
241+
242+ // Get the types of supported flavors
243+ nsCOMPtr<nsISupportsArray> flavors;
244+
245+ rv = aTransferable->FlavorsTransferableCanExport(getter_AddRefs(flavors));
246+ if (!flavors || NS_FAILED(rv))
247+ return NS_ERROR_FAILURE;
248+
249+ // Add all the flavors to this widget's supported type.
250+ PRUint32 count;
251+ flavors->Count(&count);
252+ for (PRUint32 i=0; i < count; i++) {
253+ nsCOMPtr<nsISupports> tastesLike;
254+ flavors->GetElementAt(i, getter_AddRefs(tastesLike));
255+ nsCOMPtr<nsISupportsCString> flavor = do_QueryInterface(tastesLike);
256+
257+ if (flavor) {
258+ nsXPIDLCString flavorStr;
259+ flavor->ToString(getter_Copies(flavorStr));
260+
261+ // special case text/unicode since we can handle all of
262+ // the string types
263+ if (!strcmp(flavorStr, kUnicodeMime)) {
264+ AddTarget(gdk_atom_intern("UTF8_STRING", FALSE),
265+ selectionAtom);
266+ AddTarget(gdk_atom_intern("COMPOUND_TEXT", FALSE),
267+ selectionAtom);
268+ AddTarget(gdk_atom_intern("TEXT", FALSE), selectionAtom);
269+ AddTarget(GDK_SELECTION_TYPE_STRING, selectionAtom);
270+ // next loop iteration
271+ continue;
272+ }
273+
274+ // very special case for this one. since our selection mechanism doesn't work for images,
275+ // we must use GTK's clipboard utility functions
276+ if (!strcmp(flavorStr, kNativeImageMime) || !strcmp(flavorStr, kPNGImageMime) ||
277+ !strcmp(flavorStr, kJPEGImageMime) || !strcmp(flavorStr, kGIFImageMime)) {
278+ nsCOMPtr<nsISupports> item;
279+ PRUint32 len;
280+ rv = aTransferable->GetTransferData(flavorStr, getter_AddRefs(item), &len);
281+ nsCOMPtr<nsISupportsInterfacePointer> ptrPrimitive(do_QueryInterface(item));
282+ if (!ptrPrimitive)
283+ continue;
284+
285+ nsCOMPtr<nsISupports> primitiveData;
286+ ptrPrimitive->GetData(getter_AddRefs(primitiveData));
287+ nsCOMPtr<nsIImage> image(do_QueryInterface(primitiveData));
288+ if (!image) // Not getting an image for an image mime type!?
289+ continue;
290+
291+ if (NS_FAILED(image->LockImagePixels(PR_FALSE)))
292+ continue;
293+ GdkPixbuf* pixbuf = nsImageToPixbuf::ImageToPixbuf(image);
294+ if (!pixbuf) {
295+ image->UnlockImagePixels(PR_FALSE);
296+ continue;
297+ }
298+
299+ GtkClipboard *aClipboard = gtk_clipboard_get(GetSelectionAtom(aWhichClipboard));
300+ gtk_clipboard_set_image(aClipboard, pixbuf);
301+ g_object_unref(pixbuf);
302+ image->UnlockImagePixels(PR_FALSE);
303+ continue;
304+ }
305+
306+ // Add this to our list of valid targets
307+ GdkAtom atom = gdk_atom_intern(flavorStr, FALSE);
308+ AddTarget(atom, selectionAtom);
309+ }
310+ }
311+
312+ return NS_OK;
313+}
314+
315+NS_IMETHODIMP
316+nsClipboard::GetData(nsITransferable *aTransferable, PRInt32 aWhichClipboard)
317+{
318+ if (!aTransferable)
319+ return NS_ERROR_FAILURE;
320+
321+ GtkClipboard *clipboard;
322+ clipboard = gtk_clipboard_get(GetSelectionAtom(aWhichClipboard));
323+
324+ guchar *data = NULL;
325+ gint length = 0;
326+ PRBool foundData = PR_FALSE;
327+ nsCAutoString foundFlavor;
328+
329+ // Get a list of flavors this transferable can import
330+ nsCOMPtr<nsISupportsArray> flavors;
331+ nsresult rv;
332+ rv = aTransferable->FlavorsTransferableCanImport(getter_AddRefs(flavors));
333+ if (!flavors || NS_FAILED(rv))
334+ return NS_ERROR_FAILURE;
335+
336+ PRUint32 count;
337+ flavors->Count(&count);
338+ for (PRUint32 i=0; i < count; i++) {
339+ nsCOMPtr<nsISupports> genericFlavor;
340+ flavors->GetElementAt(i, getter_AddRefs(genericFlavor));
341+
342+ nsCOMPtr<nsISupportsCString> currentFlavor;
343+ currentFlavor = do_QueryInterface(genericFlavor);
344+
345+ if (currentFlavor) {
346+ nsXPIDLCString flavorStr;
347+ currentFlavor->ToString(getter_Copies(flavorStr));
348+
349+ // Special case text/unicode since we can convert any
350+ // string into text/unicode
351+ if (!strcmp(flavorStr, kUnicodeMime)) {
352+ gchar* new_text = wait_for_text(clipboard);
353+ if (new_text) {
354+ // Convert utf-8 into our unicode format.
355+ NS_ConvertUTF8toUTF16 ucs2string(new_text);
356+ data = (guchar *)ToNewUnicode(ucs2string);
357+ length = ucs2string.Length() * 2;
358+ g_free(new_text);
359+ foundData = PR_TRUE;
360+ foundFlavor = kUnicodeMime;
361+ break;
362+ }
363+ // If the type was text/unicode and we couldn't get
364+ // text off the clipboard, run the next loop
365+ // iteration.
366+ continue;
367+ }
368+
369+ // For images, we must wrap the data in an nsIInputStream then return instead of break,
370+ // because that code below won't help us.
371+ if (!strcmp(flavorStr, kJPEGImageMime) || !strcmp(flavorStr, kPNGImageMime) || !strcmp(flavorStr, kGIFImageMime)) {
372+ GdkAtom atom;
373+ if (!strcmp(flavorStr, kJPEGImageMime)) // This is image/jpg, but X only understands image/jpeg
374+ atom = gdk_atom_intern("image/jpeg", FALSE);
375+ else
376+ atom = gdk_atom_intern(flavorStr, FALSE);
377+
378+ GtkSelectionData *selectionData = wait_for_contents(clipboard, atom);
379+ if (!selectionData)
380+ continue;
381+
382+ nsCOMPtr<nsIInputStream> byteStream;
383+ NS_NewByteInputStream(getter_AddRefs(byteStream), (const char*)selectionData->data,
384+ selectionData->length, NS_ASSIGNMENT_COPY);
385+ aTransferable->SetTransferData(flavorStr, byteStream, sizeof(nsIInputStream*));
386+ gtk_selection_data_free(selectionData);
387+ return NS_OK;
388+ }
389+
390+ // Get the atom for this type and try to request it off
391+ // the clipboard.
392+ GdkAtom atom = gdk_atom_intern(flavorStr, FALSE);
393+ GtkSelectionData *selectionData;
394+ selectionData = wait_for_contents(clipboard, atom);
395+ if (selectionData) {
396+ length = selectionData->length;
397+ // Special case text/html since we can convert into UCS2
398+ if (!strcmp(flavorStr, kHTMLMime)) {
399+ PRUnichar* htmlBody= nsnull;
400+ PRInt32 htmlBodyLen = 0;
401+ // Convert text/html into our unicode format
402+ ConvertHTMLtoUCS2((guchar *)selectionData->data, length,
403+ &htmlBody, htmlBodyLen);
404+ if (!htmlBodyLen)
405+ break;
406+ data = (guchar *)htmlBody;
407+ length = htmlBodyLen * 2;
408+ } else {
409+ data = (guchar *)nsMemory::Alloc(length);
410+ if (!data)
411+ break;
412+ memcpy(data, selectionData->data, length);
413+ }
414+ foundData = PR_TRUE;
415+ foundFlavor = flavorStr;
416+ break;
417+ }
418+ }
419+ }
420+
421+ if (foundData) {
422+ nsCOMPtr<nsISupports> wrapper;
423+ nsPrimitiveHelpers::CreatePrimitiveForData(foundFlavor.get(),
424+ data, length,
425+ getter_AddRefs(wrapper));
426+ aTransferable->SetTransferData(foundFlavor.get(),
427+ wrapper, length);
428+ }
429+
430+ if (data)
431+ nsMemory::Free(data);
432+
433+ return NS_OK;
434+}
435+
436+NS_IMETHODIMP
437+nsClipboard::EmptyClipboard(PRInt32 aWhichClipboard)
438+{
439+ if (aWhichClipboard == kSelectionClipboard) {
440+ if (mSelectionOwner) {
441+ mSelectionOwner->LosingOwnership(mSelectionTransferable);
442+ mSelectionOwner = nsnull;
443+ }
444+ mSelectionTransferable = nsnull;
445+ }
446+ else {
447+ if (mGlobalOwner) {
448+ mGlobalOwner->LosingOwnership(mGlobalTransferable);
449+ mGlobalOwner = nsnull;
450+ }
451+ mGlobalTransferable = nsnull;
452+ }
453+
454+ return NS_OK;
455+}
456+
457+NS_IMETHODIMP
458+nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, PRUint32 aLength,
459+ PRInt32 aWhichClipboard, PRBool *_retval)
460+{
461+ if (!aFlavorList || !_retval)
462+ return NS_ERROR_NULL_POINTER;
463+
464+ *_retval = PR_FALSE;
465+
466+ GtkSelectionData *selection_data =
467+ GetTargets(GetSelectionAtom(aWhichClipboard));
468+ if (!selection_data)
469+ return NS_OK;
470+
471+ gint n_targets = 0;
472+ GdkAtom *targets = NULL;
473+
474+ if (!gtk_selection_data_get_targets(selection_data,
475+ &targets, &n_targets) ||
476+ !n_targets)
477+ return NS_OK;
478+
479+ // Walk through the provided types and try to match it to a
480+ // provided type.
481+ for (PRUint32 i = 0; i < aLength && !*_retval; i++) {
482+ // We special case text/unicode here.
483+ if (!strcmp(aFlavorList[i], kUnicodeMime) &&
484+ gtk_selection_data_targets_include_text(selection_data)) {
485+ *_retval = PR_TRUE;
486+ break;
487+ }
488+
489+ for (PRInt32 j = 0; j < n_targets; j++) {
490+ gchar *atom_name = gdk_atom_name(targets[j]);
491+ if (!strcmp(atom_name, aFlavorList[i]))
492+ *_retval = PR_TRUE;
493+
494+ // X clipboard wants image/jpeg, not image/jpg
495+ if (!strcmp(aFlavorList[i], kJPEGImageMime) && !strcmp(atom_name, "image/jpeg"))
496+ *_retval = PR_TRUE;
497+
498+ g_free(atom_name);
499+
500+ if (*_retval)
501+ break;
502+ }
503+ }
504+ gtk_selection_data_free(selection_data);
505+ g_free(targets);
506+
507+ return NS_OK;
508+}
509+
510+NS_IMETHODIMP
511+nsClipboard::SupportsSelectionClipboard(PRBool *_retval)
512+{
513+ *_retval = PR_TRUE; // yeah, unix supports the selection clipboard
514+ return NS_OK;
515+}
516+
517+/* static */
518+GdkAtom
519+nsClipboard::GetSelectionAtom(PRInt32 aWhichClipboard)
520+{
521+ if (aWhichClipboard == kGlobalClipboard)
522+ return GDK_SELECTION_CLIPBOARD;
523+
524+ return GDK_SELECTION_PRIMARY;
525+}
526+
527+/* static */
528+GtkSelectionData *
529+nsClipboard::GetTargets(GdkAtom aWhichClipboard)
530+{
531+ GtkClipboard *clipboard = gtk_clipboard_get(aWhichClipboard);
532+ return wait_for_contents(clipboard, gdk_atom_intern("TARGETS", FALSE));
533+}
534+
535+nsITransferable *
536+nsClipboard::GetTransferable(PRInt32 aWhichClipboard)
537+{
538+ nsITransferable *retval;
539+
540+ if (aWhichClipboard == kSelectionClipboard)
541+ retval = mSelectionTransferable.get();
542+ else
543+ retval = mGlobalTransferable.get();
544+
545+ return retval;
546+}
547+
548+void
549+nsClipboard::AddTarget(GdkAtom aName, GdkAtom aClipboard)
550+{
551+ gtk_selection_add_target(mWidget, aClipboard, aName, 0);
552+}
553+
554+void
555+nsClipboard::SelectionGetEvent (GtkWidget *aWidget,
556+ GtkSelectionData *aSelectionData,
557+ guint aTime)
558+{
559+ // Someone has asked us to hand them something. The first thing
560+ // that we want to do is see if that something includes text. If
561+ // it does, try to give it text/unicode after converting it to
562+ // utf-8.
563+
564+ PRInt32 whichClipboard;
565+
566+ // which clipboard?
567+ if (aSelectionData->selection == GDK_SELECTION_PRIMARY)
568+ whichClipboard = kSelectionClipboard;
569+ else if (aSelectionData->selection == GDK_SELECTION_CLIPBOARD)
570+ whichClipboard = kGlobalClipboard;
571+ else
572+ return; // THAT AIN'T NO CLIPBOARD I EVER HEARD OF
573+
574+ nsCOMPtr<nsITransferable> trans = GetTransferable(whichClipboard);
575+
576+ nsresult rv;
577+ nsCOMPtr<nsISupports> item;
578+ PRUint32 len;
579+
580+ // Check to see if the selection data includes any of the string
581+ // types that we support.
582+ if (aSelectionData->target == gdk_atom_intern ("STRING", FALSE) ||
583+ aSelectionData->target == gdk_atom_intern ("TEXT", FALSE) ||
584+ aSelectionData->target == gdk_atom_intern ("COMPOUND_TEXT", FALSE) ||
585+ aSelectionData->target == gdk_atom_intern ("UTF8_STRING", FALSE)) {
586+ // Try to convert our internal type into a text string. Get
587+ // the transferable for this clipboard and try to get the
588+ // text/unicode type for it.
589+ rv = trans->GetTransferData("text/unicode", getter_AddRefs(item),
590+ &len);
591+ if (!item || NS_FAILED(rv))
592+ return;
593+
594+ nsCOMPtr<nsISupportsString> wideString;
595+ wideString = do_QueryInterface(item);
596+ if (!wideString)
597+ return;
598+
599+ nsAutoString ucs2string;
600+ wideString->GetData(ucs2string);
601+ char *utf8string = ToNewUTF8String(ucs2string);
602+ if (!utf8string)
603+ return;
604+
605+ gtk_selection_data_set_text (aSelectionData, utf8string,
606+ strlen(utf8string));
607+
608+ nsMemory::Free(utf8string);
609+ return;
610+ }
611+
612+ // Try to match up the selection data target to something our
613+ // transferable provides.
614+ gchar *target_name = gdk_atom_name(aSelectionData->target);
615+ if (!target_name)
616+ return;
617+
618+ rv = trans->GetTransferData(target_name, getter_AddRefs(item), &len);
619+ // nothing found?
620+ if (!item || NS_FAILED(rv)) {
621+ g_free(target_name);
622+ return;
623+ }
624+
625+ void *primitive_data = nsnull;
626+ nsPrimitiveHelpers::CreateDataFromPrimitive(target_name, item,
627+ &primitive_data, len);
628+
629+ if (primitive_data) {
630+ // Check to see if the selection data is text/html
631+ if (aSelectionData->target == gdk_atom_intern (kHTMLMime, FALSE)) {
632+ /*
633+ * "text/html" can be encoded UCS2. It is recommended that
634+ * documents transmitted as UCS2 always begin with a ZERO-WIDTH
635+ * NON-BREAKING SPACE character (hexadecimal FEFF, also called
636+ * Byte Order Mark (BOM)). Adding BOM can help other app to
637+ * detect mozilla use UCS2 encoding when copy-paste.
638+ */
639+ guchar *buffer = (guchar *)
640+ nsMemory::Alloc((len * sizeof(guchar)) + sizeof(PRUnichar));
641+ if (!buffer)
642+ return;
643+ PRUnichar prefix = 0xFEFF;
644+ memcpy(buffer, &prefix, sizeof(prefix));
645+ memcpy(buffer + sizeof(prefix), primitive_data, len);
646+ nsMemory::Free((guchar *)primitive_data);
647+ primitive_data = (guchar *)buffer;
648+ len += sizeof(prefix);
649+ }
650+
651+ gtk_selection_data_set(aSelectionData, aSelectionData->target,
652+ 8, /* 8 bits in a unit */
653+ (const guchar *)primitive_data, len);
654+ nsMemory::Free(primitive_data);
655+ }
656+
657+ g_free(target_name);
658+
659+}
660+
661+void
662+nsClipboard::SelectionClearEvent (GtkWidget *aWidget,
663+ GdkEventSelection *aEvent)
664+{
665+ PRInt32 whichClipboard;
666+
667+ // which clipboard?
668+ if (aEvent->selection == GDK_SELECTION_PRIMARY)
669+ whichClipboard = kSelectionClipboard;
670+ else if (aEvent->selection == GDK_SELECTION_CLIPBOARD)
671+ whichClipboard = kGlobalClipboard;
672+ else
673+ return; // THAT AIN'T NO CLIPBOARD I EVER HEARD OF
674+
675+ EmptyClipboard(whichClipboard);
676+}
677+
678+void
679+invisible_selection_get_cb (GtkWidget *aWidget,
680+ GtkSelectionData *aSelectionData,
681+ guint aTime,
682+ guint aInfo,
683+ nsClipboard *aClipboard)
684+{
685+ aClipboard->SelectionGetEvent(aWidget, aSelectionData, aTime);
686+}
687+
688+gboolean
689+selection_clear_event_cb (GtkWidget *aWidget,
690+ GdkEventSelection *aEvent,
691+ nsClipboard *aClipboard)
692+{
693+ aClipboard->SelectionClearEvent(aWidget, aEvent);
694+ return TRUE;
695+}
696+
697+/*
698+ * when copy-paste, mozilla wants data encoded using UCS2,
699+ * other app such as StarOffice use "text/html"(RFC2854).
700+ * This function convert data(got from GTK clipboard)
701+ * to data mozilla wanted.
702+ *
703+ * data from GTK clipboard can be 3 forms:
704+ * 1. From current mozilla
705+ * "text/html", charset = utf-16
706+ * 2. From old version mozilla or mozilla-based app
707+ * content("body" only), charset = utf-16
708+ * 3. From other app who use "text/html" when copy-paste
709+ * "text/html", has "charset" info
710+ *
711+ * data : got from GTK clipboard
712+ * dataLength: got from GTK clipboard
713+ * body : pass to Mozilla
714+ * bodyLength: pass to Mozilla
715+ */
716+void ConvertHTMLtoUCS2(guchar * data, PRInt32 dataLength,
717+ PRUnichar** unicodeData, PRInt32& outUnicodeLen)
718+{
719+ nsCAutoString charset;
720+ GetHTMLCharset(data, dataLength, charset);// get charset of HTML
721+ if (charset.EqualsLiteral("UTF-16")) {//current mozilla
722+ outUnicodeLen = (dataLength / 2) - 1;
723+ *unicodeData = reinterpret_cast<PRUnichar*>
724+ (nsMemory::Alloc((outUnicodeLen + sizeof('\0')) *
725+ sizeof(PRUnichar)));
726+ if (*unicodeData) {
727+ memcpy(*unicodeData, data + sizeof(PRUnichar),
728+ outUnicodeLen * sizeof(PRUnichar));
729+ (*unicodeData)[outUnicodeLen] = '\0';
730+ }
731+ } else if (charset.EqualsLiteral("UNKNOWN")) {
732+ outUnicodeLen = 0;
733+ return;
734+ } else {
735+ // app which use "text/html" to copy&paste
736+ nsCOMPtr<nsIUnicodeDecoder> decoder;
737+ nsresult rv;
738+ // get the decoder
739+ nsCOMPtr<nsICharsetConverterManager> ccm =
740+ do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
741+ if (NS_FAILED(rv)) {
742+#ifdef DEBUG_CLIPBOARD
743+ g_print(" can't get CHARSET CONVERTER MANAGER service\n");
744+#endif
745+ outUnicodeLen = 0;
746+ return;
747+ }
748+ rv = ccm->GetUnicodeDecoder(charset.get(), getter_AddRefs(decoder));
749+ if (NS_FAILED(rv)) {
750+#ifdef DEBUG_CLIPBOARD
751+ g_print(" get unicode decoder error\n");
752+#endif
753+ outUnicodeLen = 0;
754+ return;
755+ }
756+ // converting
757+ decoder->GetMaxLength((const char *)data, dataLength, &outUnicodeLen);
758+ // |outUnicodeLen| is number of chars
759+ if (outUnicodeLen) {
760+ *unicodeData = reinterpret_cast<PRUnichar*>
761+ (nsMemory::Alloc((outUnicodeLen + sizeof('\0')) *
762+ sizeof(PRUnichar)));
763+ if (*unicodeData) {
764+ PRInt32 numberTmp = dataLength;
765+ decoder->Convert((const char *)data, &numberTmp,
766+ *unicodeData, &outUnicodeLen);
767+#ifdef DEBUG_CLIPBOARD
768+ if (numberTmp != dataLength)
769+ printf("didn't consume all the bytes\n");
770+#endif
771+ // null terminate. Convert() doesn't do it for us
772+ (*unicodeData)[outUnicodeLen] = '\0';
773+ }
774+ } // if valid length
775+ }
776+}
777+
778+/*
779+ * get "charset" information from clipboard data
780+ * return value can be:
781+ * 1. "UTF-16": mozilla or "text/html" with "charset=utf-16"
782+ * 2. "UNKNOWN": mozilla can't detect what encode it use
783+ * 3. other: "text/html" with other charset than utf-16
784+ */
785+void GetHTMLCharset(guchar * data, PRInt32 dataLength, nsCString& str)
786+{
787+ // if detect "FFFE" or "FEFF", assume UTF-16
788+ PRUnichar* beginChar = (PRUnichar*)data;
789+ if ((beginChar[0] == 0xFFFE) || (beginChar[0] == 0xFEFF)) {
790+ str.AssignLiteral("UTF-16");
791+ return;
792+ }
793+ // no "FFFE" and "FEFF", assume ASCII first to find "charset" info
794+ const nsDependentCString htmlStr((const char *)data, dataLength);
795+ nsACString::const_iterator start, end;
796+ htmlStr.BeginReading(start);
797+ htmlStr.EndReading(end);
798+ nsACString::const_iterator valueStart(start), valueEnd(start);
799+
800+ if (CaseInsensitiveFindInReadable(
801+ NS_LITERAL_CSTRING("CONTENT=\"text/html;"),
802+ start, end)) {
803+ start = end;
804+ htmlStr.EndReading(end);
805+
806+ if (CaseInsensitiveFindInReadable(
807+ NS_LITERAL_CSTRING("charset="),
808+ start, end)) {
809+ valueStart = end;
810+ start = end;
811+ htmlStr.EndReading(end);
812+
813+ if (FindCharInReadable('"', start, end))
814+ valueEnd = start;
815+ }
816+ }
817+ // find "charset" in HTML
818+ if (valueStart != valueEnd) {
819+ str = Substring(valueStart, valueEnd);
820+ ToUpperCase(str);
821+#ifdef DEBUG_CLIPBOARD
822+ printf("Charset of HTML = %s\n", charsetUpperStr.get());
823+#endif
824+ return;
825+ }
826+ str.AssignLiteral("UNKNOWN");
827+}
828+
829+static void
830+DispatchSelectionNotifyEvent(GtkWidget *widget, XEvent *xevent)
831+{
832+ GdkEvent event;
833+ event.selection.type = GDK_SELECTION_NOTIFY;
834+ event.selection.window = widget->window;
835+ event.selection.selection = gdk_x11_xatom_to_atom(xevent->xselection.selection);
836+ event.selection.target = gdk_x11_xatom_to_atom(xevent->xselection.target);
837+ event.selection.property = gdk_x11_xatom_to_atom(xevent->xselection.property);
838+ event.selection.time = xevent->xselection.time;
839+
840+ gtk_widget_event(widget, &event);
841+}
842+
843+static void
844+DispatchPropertyNotifyEvent(GtkWidget *widget, XEvent *xevent)
845+{
846+ if (((GdkWindowObject *) widget->window)->event_mask & GDK_PROPERTY_CHANGE_MASK) {
847+ GdkEvent event;
848+ event.property.type = GDK_PROPERTY_NOTIFY;
849+ event.property.window = widget->window;
850+ event.property.atom = gdk_x11_xatom_to_atom(xevent->xproperty.atom);
851+ event.property.time = xevent->xproperty.time;
852+ event.property.state = xevent->xproperty.state;
853+
854+ gtk_widget_event(widget, &event);
855+ }
856+}
857+
858+struct checkEventContext
859+{
860+ GtkWidget *cbWidget;
861+ Atom selAtom;
862+};
863+
864+static Bool
865+checkEventProc(Display *display, XEvent *event, XPointer arg)
866+{
867+ checkEventContext *context = (checkEventContext *) arg;
868+
869+ if (event->xany.type == SelectionNotify ||
870+ (event->xany.type == PropertyNotify &&
871+ event->xproperty.atom == context->selAtom)) {
872+
873+ GdkWindow *cbWindow = gdk_window_lookup(event->xany.window);
874+ if (cbWindow) {
875+ GtkWidget *cbWidget = NULL;
876+ gdk_window_get_user_data(cbWindow, (gpointer *)&cbWidget);
877+ if (cbWidget && GTK_IS_WIDGET(cbWidget)) {
878+ context->cbWidget = cbWidget;
879+ return True;
880+ }
881+ }
882+ }
883+
884+ return False;
885+}
886+
887+// Idle timeout for receiving selection and property notify events (microsec)
888+static const int kClipboardTimeout = 500000;
889+
890+static void
891+wait_for_retrieval(GtkClipboard *clipboard, retrieval_context *r_context)
892+{
893+ if (r_context->completed) // the request completed synchronously
894+ return;
895+
896+ Display *xDisplay = GDK_DISPLAY();
897+ checkEventContext context;
898+ context.cbWidget = NULL;
899+ context.selAtom = gdk_x11_atom_to_xatom(gdk_atom_intern("GDK_SELECTION",
900+ FALSE));
901+
902+ // Send X events which are relevant to the ongoing selection retrieval
903+ // to the clipboard widget. Wait until either the operation completes, or
904+ // we hit our timeout. All other X events remain queued.
905+
906+ int select_result;
907+
908+#ifdef POLL_WITH_XCONNECTIONNUMBER
909+ struct pollfd fds[1];
910+ fds[0].fd = XConnectionNumber(xDisplay);
911+ fds[0].events = POLLIN;
912+#else
913+ int cnumber = ConnectionNumber(xDisplay);
914+ fd_set select_set;
915+ FD_ZERO(&select_set);
916+ FD_SET(cnumber, &select_set);
917+ ++cnumber;
918+ struct timeval tv;
919+#endif
920+
921+ do {
922+ XEvent xevent;
923+
924+ while (XCheckIfEvent(xDisplay, &xevent, checkEventProc,
925+ (XPointer) &context)) {
926+
927+ if (xevent.xany.type == SelectionNotify)
928+ DispatchSelectionNotifyEvent(context.cbWidget, &xevent);
929+ else
930+ DispatchPropertyNotifyEvent(context.cbWidget, &xevent);
931+
932+ if (r_context->completed)
933+ return;
934+ }
935+
936+#ifdef POLL_WITH_XCONNECTIONNUMBER
937+ select_result = poll(fds, 1, kClipboardTimeout / 1000);
938+#else
939+ tv.tv_sec = 0;
940+ tv.tv_usec = kClipboardTimeout;
941+ select_result = select(cnumber, &select_set, NULL, NULL, &tv);
942+#endif
943+ } while (select_result == 1);
944+
945+#ifdef DEBUG_CLIPBOARD
946+ printf("exceeded clipboard timeout\n");
947+#endif
948+}
949+
950+static void
951+clipboard_contents_received(GtkClipboard *clipboard,
952+ GtkSelectionData *selection_data,
953+ gpointer data)
954+{
955+ retrieval_context *context = static_cast<retrieval_context *>(data);
956+ context->completed = PR_TRUE;
957+
958+ if (selection_data->length >= 0)
959+ context->data = gtk_selection_data_copy(selection_data);
960+}
961+
962+
963+static GtkSelectionData *
964+wait_for_contents(GtkClipboard *clipboard, GdkAtom target)
965+{
966+ retrieval_context context;
967+ gtk_clipboard_request_contents(clipboard, target,
968+ clipboard_contents_received,
969+ &context);
970+
971+ wait_for_retrieval(clipboard, &context);
972+ return static_cast<GtkSelectionData *>(context.data);
973+}
974+
975+static void
976+clipboard_text_received(GtkClipboard *clipboard,
977+ const gchar *text,
978+ gpointer data)
979+{
980+ retrieval_context *context = static_cast<retrieval_context *>(data);
981+ context->completed = PR_TRUE;
982+ context->data = g_strdup(text);
983+}
984+
985+static gchar *
986+wait_for_text(GtkClipboard *clipboard)
987+{
988+ retrieval_context context;
989+ gtk_clipboard_request_text(clipboard, clipboard_text_received, &context);
990+
991+ wait_for_retrieval(clipboard, &context);
992+ return static_cast<gchar *>(context.data);
993+}
994Index: offscreen/widget/src/headless/nsClipboard.h
995===================================================================
996--- /dev/null 1970-01-01 00:00:00.000000000 +0000
997+++ offscreen/widget/src/headless/nsClipboard.h 2009-06-12 14:14:05.000000000 +0100
998@@ -0,0 +1,93 @@
999+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
1000+/* vim:expandtab:shiftwidth=4:tabstop=4:
1001+ */
1002+/* ***** BEGIN LICENSE BLOCK *****
1003+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1004+ *
1005+ * The contents of this file are subject to the Mozilla Public License Version
1006+ * 1.1 (the "License"); you may not use this file except in compliance with
1007+ * the License. You may obtain a copy of the License at
1008+ * http://www.mozilla.org/MPL/
1009+ *
1010+ * Software distributed under the License is distributed on an "AS IS" basis,
1011+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1012+ * for the specific language governing rights and limitations under the
1013+ * License.
1014+ *
1015+ * The Original Code is mozilla.org code.
1016+ *
1017+ * The Initial Developer of the Original Code is Christopher Blizzard
1018+ * <blizzard@mozilla.org>. Portions created by the Initial Developer
1019+ * are Copyright (C) 2001 the Initial Developer. All Rights Reserved.
1020+ *
1021+ * Contributor(s):
1022+ *
1023+ * Alternatively, the contents of this file may be used under the terms of
1024+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1025+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1026+ * in which case the provisions of the GPL or the LGPL are applicable instead
1027+ * of those above. If you wish to allow use of your version of this file only
1028+ * under the terms of either the GPL or the LGPL, and not to allow others to
1029+ * use your version of this file under the terms of the MPL, indicate your
1030+ * decision by deleting the provisions above and replace them with the notice
1031+ * and other provisions required by the GPL or the LGPL. If you do not delete
1032+ * the provisions above, a recipient may use your version of this file under
1033+ * the terms of any one of the MPL, the GPL or the LGPL.
1034+ *
1035+ * ***** END LICENSE BLOCK ***** */
1036+
1037+#ifndef __nsClipboard_h_
1038+#define __nsClipboard_h_
1039+
1040+#include "nsIClipboard.h"
1041+#include "nsClipboardPrivacyHandler.h"
1042+#include "nsAutoPtr.h"
1043+#include <gtk/gtk.h>
1044+
1045+class nsClipboard : public nsIClipboard
1046+{
1047+public:
1048+ nsClipboard();
1049+ virtual ~nsClipboard();
1050+
1051+ NS_DECL_ISUPPORTS
1052+
1053+ NS_DECL_NSICLIPBOARD
1054+
1055+ // Make sure we are initialized, called from the factory
1056+ // constructor
1057+ nsresult Init (void);
1058+ // Someone requested the selection from the hidden widget
1059+ void SelectionGetEvent (GtkWidget *aWidget,
1060+ GtkSelectionData *aSelectionData,
1061+ guint aTime);
1062+ void SelectionClearEvent (GtkWidget *aWidget,
1063+ GdkEventSelection *aEvent);
1064+
1065+
1066+private:
1067+ // Utility methods
1068+ static GdkAtom GetSelectionAtom (PRInt32 aWhichClipboard);
1069+ static GtkSelectionData *GetTargets (GdkAtom aWhichClipboard);
1070+
1071+ // Get our hands on the correct transferable, given a specific
1072+ // clipboard
1073+ nsITransferable *GetTransferable (PRInt32 aWhichClipboard);
1074+
1075+ // Add a target type to the hidden widget
1076+ void AddTarget (GdkAtom aName,
1077+ GdkAtom aClipboard);
1078+
1079+ // The hidden widget where we do all of our operations
1080+ GtkWidget *mWidget;
1081+ // Hang on to our owners and transferables so we can transfer data
1082+ // when asked.
1083+ nsCOMPtr<nsIClipboardOwner> mSelectionOwner;
1084+ nsCOMPtr<nsIClipboardOwner> mGlobalOwner;
1085+ nsCOMPtr<nsITransferable> mSelectionTransferable;
1086+ nsCOMPtr<nsITransferable> mGlobalTransferable;
1087+ nsRefPtr<nsClipboardPrivacyHandler> mPrivacyHandler;
1088+
1089+};
1090+
1091+#endif /* __nsClipboard_h_ */
1092Index: offscreen/widget/src/headless/nsIImageToPixbuf.h
1093===================================================================
1094--- /dev/null 1970-01-01 00:00:00.000000000 +0000
1095+++ offscreen/widget/src/headless/nsIImageToPixbuf.h 2009-06-12 14:14:05.000000000 +0100
1096@@ -0,0 +1,62 @@
1097+/* ***** BEGIN LICENSE BLOCK *****
1098+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1099+ *
1100+ * The contents of this file are subject to the Mozilla Public License Version
1101+ * 1.1 (the "License"); you may not use this file except in compliance with
1102+ * the License. You may obtain a copy of the License at
1103+ * http://www.mozilla.org/MPL/
1104+ *
1105+ * Software distributed under the License is distributed on an "AS IS" basis,
1106+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1107+ * for the specific language governing rights and limitations under the
1108+ * License.
1109+ *
1110+ * The Original Code is mozilla.org widget code.
1111+ *
1112+ * The Initial Developer of the Original Code is
1113+ * Christian Biesinger <cbiesinger@web.de>.
1114+ * Portions created by the Initial Developer are Copyright (C) 2006
1115+ * the Initial Developer. All Rights Reserved.
1116+ *
1117+ * Contributor(s):
1118+ *
1119+ * Alternatively, the contents of this file may be used under the terms of
1120+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1121+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1122+ * in which case the provisions of the GPL or the LGPL are applicable instead
1123+ * of those above. If you wish to allow use of your version of this file only
1124+ * under the terms of either the GPL or the LGPL, and not to allow others to
1125+ * use your version of this file under the terms of the MPL, indicate your
1126+ * decision by deleting the provisions above and replace them with the notice
1127+ * and other provisions required by the GPL or the LGPL. If you do not delete
1128+ * the provisions above, a recipient may use your version of this file under
1129+ * the terms of any one of the MPL, the GPL or the LGPL.
1130+ *
1131+ * ***** END LICENSE BLOCK ***** */
1132+
1133+#ifndef NSIIMAGETOPIXBUF_H_
1134+#define NSIIMAGETOPIXBUF_H_
1135+
1136+#include "nsISupports.h"
1137+
1138+// dfa4ac93-83f2-4ab8-9b2a-0ff7022aebe2
1139+#define NSIIMAGETOPIXBUF_IID \
1140+{ 0xdfa4ac93, 0x83f2, 0x4ab8, \
1141+ { 0x9b, 0x2a, 0x0f, 0xf7, 0x02, 0x2a, 0xeb, 0xe2 } }
1142+
1143+class nsIImage;
1144+typedef struct _GdkPixbuf GdkPixbuf;
1145+
1146+/**
1147+ * An interface that allows converting an nsIImage to a GdkPixbuf*.
1148+ */
1149+class nsIImageToPixbuf : public nsISupports {
1150+ public:
1151+ NS_DECLARE_STATIC_IID_ACCESSOR(NSIIMAGETOPIXBUF_IID)
1152+
1153+ NS_IMETHOD_(GdkPixbuf*) ConvertImageToPixbuf(nsIImage* aImage) = 0;
1154+};
1155+
1156+NS_DEFINE_STATIC_IID_ACCESSOR(nsIImageToPixbuf, NSIIMAGETOPIXBUF_IID)
1157+
1158+#endif
1159Index: offscreen/widget/src/headless/nsImageToPixbuf.cpp
1160===================================================================
1161--- /dev/null 1970-01-01 00:00:00.000000000 +0000
1162+++ offscreen/widget/src/headless/nsImageToPixbuf.cpp 2009-06-12 14:14:05.000000000 +0100
1163@@ -0,0 +1,196 @@
1164+/* vim:set sw=4 sts=4 et cin: */
1165+/* ***** BEGIN LICENSE BLOCK *****
1166+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1167+ *
1168+ * The contents of this file are subject to the Mozilla Public License Version
1169+ * 1.1 (the "License"); you may not use this file except in compliance with
1170+ * the License. You may obtain a copy of the License at
1171+ * http://www.mozilla.org/MPL/
1172+ *
1173+ * Software distributed under the License is distributed on an "AS IS" basis,
1174+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1175+ * for the specific language governing rights and limitations under the
1176+ * License.
1177+ *
1178+ * The Original Code is mozilla.org widget code.
1179+ *
1180+ * The Initial Developer of the Original Code is
1181+ * Christian Biesinger <cbiesinger@web.de>.
1182+ * Portions created by the Initial Developer are Copyright (C) 2006
1183+ * the Initial Developer. All Rights Reserved.
1184+ *
1185+ * Contributor(s):
1186+ *
1187+ * Alternatively, the contents of this file may be used under the terms of
1188+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1189+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1190+ * in which case the provisions of the GPL or the LGPL are applicable instead
1191+ * of those above. If you wish to allow use of your version of this file only
1192+ * under the terms of either the GPL or the LGPL, and not to allow others to
1193+ * use your version of this file under the terms of the MPL, indicate your
1194+ * decision by deleting the provisions above and replace them with the notice
1195+ * and other provisions required by the GPL or the LGPL. If you do not delete
1196+ * the provisions above, a recipient may use your version of this file under
1197+ * the terms of any one of the MPL, the GPL or the LGPL.
1198+ *
1199+ * ***** END LICENSE BLOCK ***** */
1200+
1201+#include <gdk-pixbuf/gdk-pixbuf.h>
1202+
1203+#include "gfxASurface.h"
1204+#include "gfxImageSurface.h"
1205+#include "gfxContext.h"
1206+
1207+#include "nsIImage.h"
1208+
1209+#include "nsAutoPtr.h"
1210+
1211+#include "nsImageToPixbuf.h"
1212+
1213+NS_IMPL_ISUPPORTS1(nsImageToPixbuf, nsIImageToPixbuf)
1214+
1215+inline unsigned char
1216+unpremultiply (unsigned char color,
1217+ unsigned char alpha)
1218+{
1219+ if (alpha == 0)
1220+ return 0;
1221+ // plus alpha/2 to round instead of truncate
1222+ return (color * 255 + alpha / 2) / alpha;
1223+}
1224+
1225+NS_IMETHODIMP_(GdkPixbuf*)
1226+nsImageToPixbuf::ConvertImageToPixbuf(nsIImage* aImage)
1227+{
1228+ return ImageToPixbuf(aImage);
1229+}
1230+
1231+GdkPixbuf*
1232+nsImageToPixbuf::ImageToPixbuf(nsIImage* aImage)
1233+{
1234+ PRInt32 width = aImage->GetWidth(),
1235+ height = aImage->GetHeight();
1236+
1237+ nsRefPtr<gfxPattern> pattern;
1238+ aImage->GetPattern(getter_AddRefs(pattern));
1239+
1240+ return PatternToPixbuf(pattern, width, height);
1241+}
1242+
1243+GdkPixbuf*
1244+nsImageToPixbuf::ImgSurfaceToPixbuf(gfxImageSurface* aImgSurface, PRInt32 aWidth, PRInt32 aHeight)
1245+{
1246+ GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, PR_TRUE, 8,
1247+ aWidth, aHeight);
1248+ if (!pixbuf)
1249+ return nsnull;
1250+
1251+ PRUint32 rowstride = gdk_pixbuf_get_rowstride (pixbuf);
1252+ guchar* pixels = gdk_pixbuf_get_pixels (pixbuf);
1253+
1254+ long cairoStride = aImgSurface->Stride();
1255+ unsigned char* cairoData = aImgSurface->Data();
1256+
1257+ gfxASurface::gfxImageFormat format = aImgSurface->Format();
1258+
1259+ for (PRInt32 row = 0; row < aHeight; ++row) {
1260+ for (PRInt32 col = 0; col < aWidth; ++col) {
1261+ guchar* pixel = pixels + row * rowstride + 4 * col;
1262+
1263+ PRUint32* cairoPixel = reinterpret_cast<PRUint32*>
1264+ ((cairoData + row * cairoStride + 4 * col));
1265+
1266+ if (format == gfxASurface::ImageFormatARGB32) {
1267+ const PRUint8 a = (*cairoPixel >> 24) & 0xFF;
1268+ const PRUint8 r = unpremultiply((*cairoPixel >> 16) & 0xFF, a);
1269+ const PRUint8 g = unpremultiply((*cairoPixel >> 8) & 0xFF, a);
1270+ const PRUint8 b = unpremultiply((*cairoPixel >> 0) & 0xFF, a);
1271+
1272+ *pixel++ = r;
1273+ *pixel++ = g;
1274+ *pixel++ = b;
1275+ *pixel++ = a;
1276+ } else {
1277+ NS_ASSERTION(format == gfxASurface::ImageFormatRGB24,
1278+ "unexpected format");
1279+ const PRUint8 r = (*cairoPixel >> 16) & 0xFF;
1280+ const PRUint8 g = (*cairoPixel >> 8) & 0xFF;
1281+ const PRUint8 b = (*cairoPixel >> 0) & 0xFF;
1282+
1283+ *pixel++ = r;
1284+ *pixel++ = g;
1285+ *pixel++ = b;
1286+ *pixel++ = 0xFF; // A
1287+ }
1288+ }
1289+ }
1290+
1291+ return pixbuf;
1292+}
1293+
1294+GdkPixbuf*
1295+nsImageToPixbuf::SurfaceToPixbuf(gfxASurface* aSurface, PRInt32 aWidth, PRInt32 aHeight)
1296+{
1297+ if (aSurface->CairoStatus()) {
1298+ NS_ERROR("invalid surface");
1299+ return nsnull;
1300+ }
1301+
1302+ nsRefPtr<gfxImageSurface> imgSurface;
1303+ if (aSurface->GetType() == gfxASurface::SurfaceTypeImage) {
1304+ imgSurface = static_cast<gfxImageSurface*>
1305+ (static_cast<gfxASurface*>(aSurface));
1306+ } else {
1307+ imgSurface = new gfxImageSurface(gfxIntSize(aWidth, aHeight),
1308+ gfxImageSurface::ImageFormatARGB32);
1309+
1310+ if (!imgSurface)
1311+ return nsnull;
1312+
1313+ nsRefPtr<gfxContext> context = new gfxContext(imgSurface);
1314+ if (!context)
1315+ return nsnull;
1316+
1317+ context->SetOperator(gfxContext::OPERATOR_SOURCE);
1318+ context->SetSource(aSurface);
1319+ context->Paint();
1320+ }
1321+
1322+ return ImgSurfaceToPixbuf(imgSurface, aWidth, aHeight);
1323+}
1324+
1325+GdkPixbuf*
1326+nsImageToPixbuf::PatternToPixbuf(gfxPattern* aPattern, PRInt32 aWidth, PRInt32 aHeight)
1327+{
1328+ if (aPattern->CairoStatus()) {
1329+ NS_ERROR("invalid pattern");
1330+ return nsnull;
1331+ }
1332+
1333+ nsRefPtr<gfxImageSurface> imgSurface;
1334+ if (aPattern->GetType() == gfxPattern::PATTERN_SURFACE) {
1335+ nsRefPtr<gfxASurface> surface = aPattern->GetSurface();
1336+ if (surface->GetType() == gfxASurface::SurfaceTypeImage) {
1337+ imgSurface = static_cast<gfxImageSurface*>
1338+ (static_cast<gfxASurface*>(surface.get()));
1339+ }
1340+ }
1341+
1342+ if (!imgSurface) {
1343+ imgSurface = new gfxImageSurface(gfxIntSize(aWidth, aHeight),
1344+ gfxImageSurface::ImageFormatARGB32);
1345+
1346+ if (!imgSurface)
1347+ return nsnull;
1348+
1349+ nsRefPtr<gfxContext> context = new gfxContext(imgSurface);
1350+ if (!context)
1351+ return nsnull;
1352+
1353+ context->SetOperator(gfxContext::OPERATOR_SOURCE);
1354+ context->SetPattern(aPattern);
1355+ context->Paint();
1356+ }
1357+
1358+ return ImgSurfaceToPixbuf(imgSurface, aWidth, aHeight);
1359+}
1360Index: offscreen/widget/src/headless/nsImageToPixbuf.h
1361===================================================================
1362--- /dev/null 1970-01-01 00:00:00.000000000 +0000
1363+++ offscreen/widget/src/headless/nsImageToPixbuf.h 2009-06-12 14:14:05.000000000 +0100
1364@@ -0,0 +1,71 @@
1365+/* vim:set sw=4 sts=4 et cin: */
1366+/* ***** BEGIN LICENSE BLOCK *****
1367+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1368+ *
1369+ * The contents of this file are subject to the Mozilla Public License Version
1370+ * 1.1 (the "License"); you may not use this file except in compliance with
1371+ * the License. You may obtain a copy of the License at
1372+ * http://www.mozilla.org/MPL/
1373+ *
1374+ * Software distributed under the License is distributed on an "AS IS" basis,
1375+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1376+ * for the specific language governing rights and limitations under the
1377+ * License.
1378+ *
1379+ * The Original Code is mozilla.org widget code.
1380+ *
1381+ * The Initial Developer of the Original Code is
1382+ * Christian Biesinger <cbiesinger@web.de>.
1383+ * Portions created by the Initial Developer are Copyright (C) 2006
1384+ * the Initial Developer. All Rights Reserved.
1385+ *
1386+ * Contributor(s):
1387+ *
1388+ * Alternatively, the contents of this file may be used under the terms of
1389+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1390+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1391+ * in which case the provisions of the GPL or the LGPL are applicable instead
1392+ * of those above. If you wish to allow use of your version of this file only
1393+ * under the terms of either the GPL or the LGPL, and not to allow others to
1394+ * use your version of this file under the terms of the MPL, indicate your
1395+ * decision by deleting the provisions above and replace them with the notice
1396+ * and other provisions required by the GPL or the LGPL. If you do not delete
1397+ * the provisions above, a recipient may use your version of this file under
1398+ * the terms of any one of the MPL, the GPL or the LGPL.
1399+ *
1400+ * ***** END LICENSE BLOCK ***** */
1401+
1402+#ifndef NSIMAGETOPIXBUF_H_
1403+#define NSIMAGETOPIXBUF_H_
1404+
1405+#include "nsIImageToPixbuf.h"
1406+
1407+class gfxASurface;
1408+class gfxPattern;
1409+class gfxImageSurface;
1410+
1411+class nsImageToPixbuf : public nsIImageToPixbuf {
1412+ public:
1413+ NS_DECL_ISUPPORTS
1414+ NS_IMETHOD_(GdkPixbuf*) ConvertImageToPixbuf(nsIImage* aImage);
1415+
1416+ // Friendlier version of ConvertImageToPixbuf for callers inside of
1417+ // widget
1418+ static GdkPixbuf* ImageToPixbuf(nsIImage* aImage);
1419+ static GdkPixbuf* SurfaceToPixbuf(gfxASurface* aSurface,
1420+ PRInt32 aWidth, PRInt32 aHeight);
1421+ static GdkPixbuf* PatternToPixbuf(gfxPattern* aPattern,
1422+ PRInt32 aWidth, PRInt32 aHeight);
1423+ private:
1424+ static GdkPixbuf* ImgSurfaceToPixbuf(gfxImageSurface* aImgSurface,
1425+ PRInt32 aWidth, PRInt32 aHeight);
1426+ ~nsImageToPixbuf() {}
1427+};
1428+
1429+
1430+// fc2389b8-c650-4093-9e42-b05e5f0685b7
1431+#define NS_IMAGE_TO_PIXBUF_CID \
1432+{ 0xfc2389b8, 0xc650, 0x4093, \
1433+ { 0x9e, 0x42, 0xb0, 0x5e, 0x5f, 0x06, 0x85, 0xb7 } }
1434+
1435+#endif
1436Index: offscreen/widget/src/headless/nsWidgetFactory.cpp
1437===================================================================
1438--- offscreen.orig/widget/src/headless/nsWidgetFactory.cpp 2009-06-12 14:08:56.000000000 +0100
1439+++ offscreen/widget/src/headless/nsWidgetFactory.cpp 2009-06-12 14:15:24.000000000 +0100
1440@@ -46,6 +46,10 @@
1441 #include "nsWindow.h"
1442 #include "nsTransferable.h"
1443 #include "nsHTMLFormatConverter.h"
1444+#ifdef MOZ_X11
1445+#include "nsClipboardHelper.h"
1446+#include "nsClipboard.h"
1447+#endif
1448 #include "nsSound.h"
1449 #include "nsBidiKeyboard.h"
1450 #include "nsScreenManagerHeadless.h"
1451@@ -66,6 +70,10 @@
1452 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
1453 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
1454 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
1455+#ifdef MOZ_X11
1456+NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
1457+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsClipboard, Init)
1458+#endif
1459 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
1460 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerHeadless)
1461 //NS_GENERIC_FACTORY_CONSTRUCTOR(nsImageToPixbuf)
1462@@ -142,6 +150,16 @@
1463 NS_TRANSFERABLE_CID,
1464 "@mozilla.org/widget/transferable;1",
1465 nsTransferableConstructor },
1466+#ifdef MOZ_X11
1467+ { "Gtk Clipboard",
1468+ NS_CLIPBOARD_CID,
1469+ "@mozilla.org/widget/clipboard;1",
1470+ nsClipboardConstructor },
1471+ { "Clipboard Helper",
1472+ NS_CLIPBOARDHELPER_CID,
1473+ "@mozilla.org/widget/clipboardhelper;1",
1474+ nsClipboardHelperConstructor },
1475+#endif
1476 { "HTML Format Converter",
1477 NS_HTMLFORMATCONVERTER_CID,
1478 "@mozilla.org/widget/htmlformatconverter;1",
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/autoconffix.patch b/meta-moblin/packages/mozilla-headless/mozilla-headless/autoconffix.patch
new file mode 100644
index 0000000000..2874b0d832
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/autoconffix.patch
@@ -0,0 +1,66 @@
1Fixes to enable building with latest autoconf and automake
2
3RP 2/2/10
4
5Index: offscreen/js/ctypes/libffi/configure.ac
6===================================================================
7--- offscreen.orig/js/ctypes/libffi/configure.ac 2010-02-02 19:53:16.753906134 +0000
8+++ offscreen/js/ctypes/libffi/configure.ac 2010-02-02 19:53:21.895155509 +0000
9@@ -17,10 +17,10 @@
10 # the wrong, non-multilib-adjusted value will be used in multilibs.
11 # As a side effect, we have to subst CFLAGS ourselves.
12
13-m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
14+m4_rename_force([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
15 m4_define([_AC_ARG_VAR_PRECIOUS],[])
16 AC_PROG_CC
17-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
18+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
19
20 AC_SUBST(CFLAGS)
21
22Index: offscreen/modules/libpr0n/build/Makefile.in
23===================================================================
24--- offscreen.orig/modules/libpr0n/build/Makefile.in 2010-02-02 19:53:16.783906873 +0000
25+++ offscreen/modules/libpr0n/build/Makefile.in 2010-02-02 19:53:21.895155509 +0000
26@@ -92,6 +92,7 @@
27
28 export::
29 @{ \
30+ \
31 $(foreach d,$(filter-out icon,$(MOZ_IMG_DECODERS)), \
32 echo "#define IMG_BUILD_DECODER_${d}";) \
33 $(foreach d,$(MOZ_IMG_ENCODERS), \
34Index: offscreen/configure.in
35===================================================================
36--- offscreen.orig/configure.in 2010-02-02 19:53:28.493904163 +0000
37+++ offscreen/configure.in 2010-02-02 16:33:09.000000000 +0000
38@@ -3250,11 +3250,7 @@
39 dnl ========================================================
40 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
41 $XLIBS $XEXT_LIBS)
42- AC_CHECK_HEADER(X11/extensions/XShm.h)
43- if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
44- test -n "$_HAVE_XSHM_XEXT"; then
45- AC_DEFINE(HAVE_XSHM)
46- fi
47+ AC_DEFINE(HAVE_XSHM)
48
49 dnl ========================================================
50 dnl = Check for XIE
51@@ -8120,15 +8116,7 @@
52 fi # COMPILE_ENVIRONMENT
53
54 if test "$USE_FC_FREETYPE"; then
55- if test "$COMPILE_ENVIRONMENT"; then
56- _SAVE_CPPFLAGS="$CPPFLAGS"
57- CPPFLAGS="$CPPFLAGS $FT2_CFLAGS"
58- AC_CHECK_HEADERS(fontconfig/fcfreetype.h, ,
59- [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)])
60- CPPFLAGS="$_SAVE_CPPFLAGS"
61- else
62 AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
63- fi
64 fi
65
66 dnl Set various defines and substitutions
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/buildfixhack.patch b/meta-moblin/packages/mozilla-headless/mozilla-headless/buildfixhack.patch
new file mode 100644
index 0000000000..31fc40f28b
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/buildfixhack.patch
@@ -0,0 +1,14 @@
1diff -r ad8be5166ccd layout/generic/nsFrame.h
2--- a/layout/generic/nsFrame.h Tue Nov 17 19:24:56 2009 +0000
3+++ b/layout/generic/nsFrame.h Thu Nov 19 12:33:38 2009 +0000
4@@ -151,7 +151,7 @@
5 // Left undefined; nsFrame objects are never allocated from the heap.
6 void* operator new(size_t sz) CPP_THROW_NEW;
7
8-protected:
9+public:
10 // Overridden to prevent the global delete from being called, since
11 // the memory came out of an arena instead of the heap.
12 //
13
14
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/configurefix-1a622cb7c384.patch b/meta-moblin/packages/mozilla-headless/mozilla-headless/configurefix-1a622cb7c384.patch
new file mode 100644
index 0000000000..d31f91a42d
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/configurefix-1a622cb7c384.patch
@@ -0,0 +1,764 @@
1Index: offscreen/configure.in
2===================================================================
3--- offscreen.orig/configure.in 2009-06-12 14:15:55.000000000 +0100
4+++ offscreen/configure.in 2009-06-12 14:15:55.000000000 +0100
5@@ -62,7 +62,6 @@
6
7 AC_PREREQ(2.13)
8 AC_INIT(config/config.mk)
9-AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
10 AC_CANONICAL_SYSTEM
11 TARGET_CPU="${target_cpu}"
12 TARGET_VENDOR="${target_vendor}"
13@@ -103,7 +102,6 @@
14 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
15 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
16 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
17-_SUBDIR_CONFIG_ARGS="$ac_configure_args"
18
19 dnl Set the version number of the libs included with mozilla
20 dnl ========================================================
21@@ -135,6 +133,9 @@
22
23 MSMANIFEST_TOOL=
24
25+ac_cv_have_usable_wchar_v2=no
26+ac_cv_have_usable_wchar_option_v2=no
27+
28 dnl Set various checks
29 dnl ========================================================
30 MISSING_X=
31@@ -285,7 +286,7 @@
32 ;;
33 esac
34
35-if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
36+
37 echo "cross compiling from $host to $target"
38 cross_compiling=yes
39
40@@ -323,7 +324,7 @@
41
42 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
43 AC_TRY_COMPILE([], [return(0);],
44- [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
45+ [ac_cv_prog_hostcc_works=1; AC_MSG_RESULT([yes])],
46 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
47
48 CC="$HOST_CXX"
49@@ -331,7 +332,7 @@
50
51 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
52 AC_TRY_COMPILE([], [return(0);],
53- [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
54+ [ac_cv_prog_hostcxx_works=1; AC_MSG_RESULT([yes])],
55 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
56
57 CC=$_SAVE_CC
58@@ -352,7 +353,7 @@
59 ;;
60 esac
61
62- AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
63+ CC="${target_alias}-gcc"
64 unset ac_cv_prog_CC
65 AC_PROG_CC
66 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
67@@ -376,37 +377,6 @@
68 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
69 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
70 AC_DEFINE(CROSS_COMPILE)
71-else
72- AC_PROG_CC
73- AC_PROG_CXX
74- AC_PROG_RANLIB
75- MOZ_PATH_PROGS(AS, $AS as, $CC)
76- AC_CHECK_PROGS(AR, ar, :)
77- AC_CHECK_PROGS(LD, ld, :)
78- AC_CHECK_PROGS(STRIP, strip, :)
79- AC_CHECK_PROGS(WINDRES, windres, :)
80- if test -z "$HOST_CC"; then
81- HOST_CC="$CC"
82- fi
83- if test -z "$HOST_CFLAGS"; then
84- HOST_CFLAGS="$CFLAGS"
85- fi
86- if test -z "$HOST_CXX"; then
87- HOST_CXX="$CXX"
88- fi
89- if test -z "$HOST_CXXFLAGS"; then
90- HOST_CXXFLAGS="$CXXFLAGS"
91- fi
92- if test -z "$HOST_LDFLAGS"; then
93- HOST_LDFLAGS="$LDFLAGS"
94- fi
95- if test -z "$HOST_RANLIB"; then
96- HOST_RANLIB="$RANLIB"
97- fi
98- if test -z "$HOST_AR"; then
99- HOST_AR="$AR"
100- fi
101-fi
102
103 GNU_AS=
104 GNU_LD=
105@@ -1606,6 +1576,7 @@
106 '
107
108 dnl test that the macros actually work:
109+ac_cv_static_assertion_macros_work="yes"
110 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
111 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
112 [AC_LANG_SAVE
113@@ -2767,9 +2738,13 @@
114 AC_LANG_C
115 AC_HEADER_STDC
116 AC_C_CONST
117+ac_cv_type_mode_t=yes
118 AC_TYPE_MODE_T
119+ac_cv_type_off_t=yes
120 AC_TYPE_OFF_T
121+ac_cv_type_pid_t=yes
122 AC_TYPE_PID_T
123+ac_cv_type_size_t=yes
124 AC_TYPE_SIZE_T
125 AC_STRUCT_ST_BLKSIZE
126 AC_MSG_CHECKING(for siginfo_t)
127@@ -3152,19 +3127,9 @@
128 dnl We don't want to link against libm or libpthread on Darwin since
129 dnl they both are just symlinks to libSystem and explicitly linking
130 dnl against libSystem causes issues when debugging (see bug 299601).
131-case $target in
132-*-darwin*)
133- ;;
134-*-beos*)
135- ;;
136-*)
137 AC_CHECK_LIB(m, atan)
138 AC_CHECK_LIB(dl, dlopen,
139- AC_CHECK_HEADER(dlfcn.h,
140- LIBS="-ldl $LIBS"
141- AC_DEFINE(HAVE_LIBDL)))
142- ;;
143-esac
144+ AC_DEFINE(HAVE_LIBDL))
145
146 _SAVE_CFLAGS="$CFLAGS"
147 CFLAGS="$CFLAGS -D_GNU_SOURCE"
148@@ -7007,18 +6972,13 @@
149
150 # Demangle only for debug or trace-malloc builds
151 MOZ_DEMANGLE_SYMBOLS=
152-if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
153- MOZ_DEMANGLE_SYMBOLS=1
154- AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
155-fi
156+
157 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
158
159 dnl ========================================================
160 dnl = Support for gcc stack unwinding (from gcc 3.3)
161 dnl ========================================================
162-if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
163- AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
164-fi
165+
166
167 dnl ========================================================
168 dnl =
169@@ -7530,10 +7490,7 @@
170 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
171 dnl to either libIDL1 or libIDL2.
172 if test -z "$_LIBIDL_FOUND"; then
173- AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
174- if test -z "$_LIBIDL_FOUND"; then
175 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
176- fi
177 fi
178 dnl
179 dnl If we don't have a libIDL config program & not cross-compiling,
180@@ -7605,13 +7562,7 @@
181 fi
182
183 if test -z "$SKIP_PATH_CHECKS"; then
184-if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
185- if test "$MOZ_ENABLE_GTK2" || test "$USE_ELF_DYNSTR_GC" || test "$MOZ_ENABLE_HEADLESS"; then
186 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
187- else
188- AM_PATH_GLIB(${GLIB_VERSION})
189- fi
190-fi
191 fi
192
193 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
194@@ -8457,10 +8408,7 @@
195 HAVE_WCRTOMB
196 "
197
198-AC_CONFIG_HEADER(
199-netwerk/necko-config.h
200-xpcom/xpcom-config.h
201-xpcom/xpcom-private.h
202+AC_CONFIG_HEADER(netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h
203 )
204
205 # Save the defines header file before autoconf removes it.
206@@ -8519,31 +8467,11 @@
207 dnl To add new Makefiles, edit allmakefiles.sh.
208 dnl allmakefiles.sh sets the variable, MAKEFILES.
209 . ${srcdir}/allmakefiles.sh
210-dnl
211-dnl Run a perl script to quickly create the makefiles.
212-dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
213-dnl for the files it cannot handle correctly. This way, config.status
214-dnl will handle these files.
215-dnl If it fails, nothing is set and config.status will run as usual.
216-dnl
217-dnl This does not change the $MAKEFILES variable.
218-dnl
219-dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
220-dnl
221-if test -z "${AS_PERL}"; then
222-echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
223-else
224-echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
225-fi
226-. ./conftest.sh
227-rm conftest.sh
228
229 echo $MAKEFILES > unallmakefiles
230
231 mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
232
233-AC_OUTPUT($MAKEFILES)
234-
235 dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
236 if test "$CAIRO_FEATURES_H"; then
237 if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
238@@ -8569,14 +8497,14 @@
239 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
240 RC=
241
242-unset MAKEFILES
243-unset CONFIG_FILES
244+#unset MAKEFILES
245+#unset CONFIG_FILES
246
247 # No need to run subconfigures when building with LIBXUL_SDK_DIR
248 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
249
250 if test -z "$MOZ_NATIVE_NSPR"; then
251- ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
252+ ac_configure_args="$ac_configure_args --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
253 if test -z "$MOZ_DEBUG"; then
254 ac_configure_args="$ac_configure_args --disable-debug"
255 fi
256@@ -8592,8 +8520,7 @@
257 if test -n "$USE_ARM_KUSER"; then
258 ac_configure_args="$ac_configure_args --with-arm-kuser"
259 fi
260- AC_OUTPUT_SUBDIRS(nsprpub)
261- ac_configure_args="$_SUBDIR_CONFIG_ARGS"
262+ AC_CONFIG_SUBDIRS(nsprpub)
263 fi
264
265 if test -z "$MOZ_NATIVE_NSPR"; then
266@@ -8610,7 +8537,6 @@
267
268 # Run the SpiderMonkey 'configure' script.
269 dist=$MOZ_BUILD_ROOT/dist
270-ac_configure_args="$_SUBDIR_CONFIG_ARGS"
271 ac_configure_args="$ac_configure_args --enable-threadsafe"
272 if test -z "$MOZ_NATIVE_NSPR"; then
273 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
274@@ -8627,11 +8553,14 @@
275 export MOZ_MEMORY_LDFLAGS
276 fi
277 fi
278-AC_OUTPUT_SUBDIRS(js/src)
279-ac_configure_args="$_SUBDIR_CONFIG_ARGS"
280+AC_CONFIG_SUBDIRS(js/src)
281
282 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
283
284+m4_pattern_allow(AS_BIN)
285+
286+AC_OUTPUT($MAKEFILES)
287+
288 dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
289 dnl Needs to be at the end to respect possible changes from NSPR configure
290 if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
291Index: offscreen/js/src/configure.in
292===================================================================
293--- offscreen.orig/js/src/configure.in 2009-06-12 14:15:55.000000000 +0100
294+++ offscreen/js/src/configure.in 2009-06-12 14:15:55.000000000 +0100
295@@ -62,7 +62,6 @@
296
297 AC_PREREQ(2.13)
298 AC_INIT(jsapi.h)
299-AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
300 AC_CONFIG_HEADER(js-config.h)
301 AC_CANONICAL_SYSTEM
302 TARGET_CPU="${target_cpu}"
303@@ -101,6 +100,9 @@
304 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
305 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
306
307+ac_cv_have_usable_wchar_v2=no
308+ac_cv_have_usable_wchar_option_v2=no
309+
310 dnl Set the version number of the libs included with mozilla
311 dnl ========================================================
312 NSPR_VERSION=4
313@@ -113,6 +115,8 @@
314
315 MSMANIFEST_TOOL=
316
317+m4_pattern_allow(AS_BIN)
318+
319 dnl Set various checks
320 dnl ========================================================
321 MISSING_X=
322@@ -198,7 +202,7 @@
323
324 if test "$COMPILE_ENVIRONMENT"; then
325
326-if test "$target" != "$host"; then
327+
328 echo "cross compiling from $host to $target"
329
330 _SAVE_CC="$CC"
331@@ -235,7 +239,7 @@
332
333 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
334 AC_TRY_COMPILE([], [return(0);],
335- [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
336+ [ac_cv_prog_hostcc_works=1; AC_MSG_RESULT([yes])],
337 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
338
339 CC="$HOST_CXX"
340@@ -243,7 +247,7 @@
341
342 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
343 AC_TRY_COMPILE([], [return(0);],
344- [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
345+ [ac_cv_prog_hostcxx_works=1; AC_MSG_RESULT([yes])],
346 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
347
348 CC=$_SAVE_CC
349@@ -298,7 +302,7 @@
350 ;;
351 esac
352
353- AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
354+ CC="${target_alias}-gcc"
355 unset ac_cv_prog_CC
356 AC_PROG_CC
357 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
358@@ -328,37 +332,6 @@
359 dnl able to run ppc code in a translated environment, making a cross
360 dnl compiler appear native. So we override that here.
361 cross_compiling=yes
362-else
363- AC_PROG_CC
364- AC_PROG_CXX
365- AC_PROG_RANLIB
366- MOZ_PATH_PROGS(AS, $AS as, $CC)
367- AC_CHECK_PROGS(AR, ar, :)
368- AC_CHECK_PROGS(LD, ld, :)
369- AC_CHECK_PROGS(STRIP, strip, :)
370- AC_CHECK_PROGS(WINDRES, windres, :)
371- if test -z "$HOST_CC"; then
372- HOST_CC="$CC"
373- fi
374- if test -z "$HOST_CFLAGS"; then
375- HOST_CFLAGS="$CFLAGS"
376- fi
377- if test -z "$HOST_CXX"; then
378- HOST_CXX="$CXX"
379- fi
380- if test -z "$HOST_CXXFLAGS"; then
381- HOST_CXXFLAGS="$CXXFLAGS"
382- fi
383- if test -z "$HOST_LDFLAGS"; then
384- HOST_LDFLAGS="$LDFLAGS"
385- fi
386- if test -z "$HOST_RANLIB"; then
387- HOST_RANLIB="$RANLIB"
388- fi
389- if test -z "$HOST_AR"; then
390- HOST_AR="$AR"
391- fi
392-fi
393
394 GNU_AS=
395 GNU_LD=
396@@ -1424,6 +1397,8 @@
397 fi # GNU_CC
398 fi # COMPILE_ENVIRONMENT
399
400+ac_cv_static_assertion_macros_work=yes
401+
402 dnl =================================================================
403 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
404 dnl which is bad when cross compiling.
405@@ -2579,9 +2554,13 @@
406 AC_LANG_C
407 AC_HEADER_STDC
408 AC_C_CONST
409+ac_cv_type_mode_t=yes
410 AC_TYPE_MODE_T
411+ac_cv_type_off_t=yes
412 AC_TYPE_OFF_T
413+ac_cv_type_pid_t=yes
414 AC_TYPE_PID_T
415+ac_cv_type_size_t=yes
416 AC_TYPE_SIZE_T
417 AC_STRUCT_ST_BLKSIZE
418 AC_MSG_CHECKING(for siginfo_t)
419@@ -2606,7 +2585,8 @@
420
421 AC_CHECK_HEADER(stdint.h)
422 if test "$ac_cv_header_stdint_h" = yes; then
423- AC_DEFINE(JS_HAVE_STDINT_H)
424+ AC_DEFINE(JS_HAVE_STDINT_H, 1, [have stdint.h])
425+ AC_DEFINE(HAVE_STDINT_H)
426 else
427 dnl We'll figure them out for ourselves. List more likely types
428 dnl earlier. If we ever really encounter a size for which none of
429@@ -3004,10 +2984,7 @@
430 ;;
431 *)
432 AC_CHECK_LIB(m, atan)
433- AC_CHECK_LIB(dl, dlopen,
434- AC_CHECK_HEADER(dlfcn.h,
435- LIBS="-ldl $LIBS"
436- AC_DEFINE(HAVE_LIBDL)))
437+ AC_CHECK_LIB(dl, dlopen, AC_DEFINE(HAVE_LIBDL))
438 ;;
439 esac
440
441@@ -3903,6 +3880,7 @@
442 [ --with-nspr-libs=LIBS Pass LIBS to LD when linking code that uses NSPR.
443 See --with-nspr-cflags for more details.],
444 NSPR_LIBS=$withval)
445+$NSPR_LIBS="$NSPR_LIBS -L$(LIBXUL_DIST)/sdk/lib"
446 AC_SUBST(NSPR_CFLAGS)
447 AC_SUBST(NSPR_LIBS)
448
449@@ -4512,18 +4490,11 @@
450
451 # Demangle only for debug or trace-malloc builds
452 MOZ_DEMANGLE_SYMBOLS=
453-if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
454- MOZ_DEMANGLE_SYMBOLS=1
455- AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
456-fi
457 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
458
459 dnl ========================================================
460 dnl = Support for gcc stack unwinding (from gcc 3.3)
461 dnl ========================================================
462-if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
463- AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
464-fi
465
466 dnl ========================================================
467 dnl =
468@@ -5231,6 +5202,8 @@
469 done
470 AC_SUBST(LIBS_PATH)
471
472+
473+
474 dnl ========================================================
475 dnl JavaScript shell
476 dnl ========================================================
477@@ -5371,3 +5344,4 @@
478 # 'js-config' in Makefile.in.
479 AC_MSG_RESULT(invoking make to create js-config script)
480 $MAKE js-config
481+
482Index: offscreen/nsprpub/configure.in
483===================================================================
484--- offscreen.orig/nsprpub/configure.in 2009-06-12 14:15:55.000000000 +0100
485+++ offscreen/nsprpub/configure.in 2009-06-12 14:15:55.000000000 +0100
486@@ -42,7 +42,6 @@
487 AC_PREREQ(2.12)
488 AC_INIT(config/libc_r.h)
489
490-AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
491 AC_CANONICAL_SYSTEM
492
493 dnl ========================================================
494@@ -396,7 +395,7 @@
495 dnl ========================================================
496 dnl Checks for compilers.
497 dnl ========================================================
498-if test "$target" != "$host"; then
499+
500 echo "cross compiling from $host to $target"
501 cross_compiling=yes
502
503@@ -423,7 +422,7 @@
504
505 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
506 AC_TRY_COMPILE([], [return(0);],
507- [ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
508+ [ac_cv_prog_host_cc_works=1; AC_MSG_RESULT([yes])],
509 AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
510
511 CC=$_SAVE_CC
512@@ -444,7 +443,7 @@
513 ;;
514 esac
515
516- AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
517+ CC="${target_alias}-gcc"
518 unset ac_cv_prog_CC
519 AC_PROG_CC
520 if test -n "$USE_CPLUS"; then
521@@ -470,30 +469,6 @@
522 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
523 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
524
525-else
526- AC_PROG_CC
527- if test -n "$USE_CPLUS"; then
528- if test "$CC" = "cl" -a -z "$CXX"; then
529- CXX=$CC
530- else
531- AC_PROG_CXX
532- fi
533- fi
534- AC_PROG_CPP
535- AC_PROG_RANLIB
536- AC_PATH_PROGS(AS, as, $CC)
537- AC_PATH_PROGS(AR, ar, echo not_ar)
538- AC_PATH_PROGS(LD, ld link, echo not_ld)
539- AC_PATH_PROGS(STRIP, strip, echo not_strip)
540- AC_PATH_PROGS(WINDRES, windres, echo not_windres)
541- if test -z "$HOST_CC"; then
542- HOST_CC="$CC"
543- fi
544- if test -z "$HOST_CFLAGS"; then
545- HOST_CFLAGS="$CFLAGS"
546- fi
547-fi
548-
549 if test "$GCC" = "yes"; then
550 GNU_CC=1
551 fi
552@@ -514,11 +489,8 @@
553 ;;
554 esac
555
556-if test "$cross_compiling" = "yes"; then
557+
558 CROSS_COMPILE=1
559-else
560- CROSS_COMPILE=
561-fi
562
563 dnl ========================================================
564 dnl Check for gcc -pipe support
565@@ -2283,10 +2255,7 @@
566 *-darwin*|*-beos*)
567 ;;
568 *)
569- AC_CHECK_LIB(dl, dlopen,
570- AC_CHECK_HEADER(dlfcn.h,
571- OS_LIBS="-ldl $OS_LIBS"))
572- ;;
573+ AC_CHECK_LIB(dl, dlopen)
574 esac
575
576
577@@ -2904,6 +2873,8 @@
578 dnl pr/tests/w16gui/Makefile
579 dnl tools/Makefile
580
581+m4_pattern_allow(AS_BIN)
582+
583 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
584 MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
585 elif test -n "$USE_PTHREADS"; then
586@@ -2919,3 +2890,5 @@
587 echo $MAKEFILES > unallmakefiles
588
589 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])
590+
591+
592Index: offscreen/js/src/Makefile.in
593===================================================================
594--- offscreen.orig/js/src/Makefile.in 2009-06-12 14:15:55.000000000 +0100
595+++ offscreen/js/src/Makefile.in 2009-06-12 14:15:55.000000000 +0100
596@@ -514,20 +514,8 @@
597
598 export:: jsautocfg.h
599
600-ifeq (,$(CROSS_COMPILE)$(GNU_CC)$(filter-out WINNT,$(OS_ARCH)))
601 jsautocfg.h:
602 touch $@
603-else
604-ifeq ($(OS_ARCH),WINCE)
605-jsautocfg.h:
606- touch $@
607-else
608-jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX)
609- @rm -f $@ jsautocfg.tmp
610- ./jscpucfg > jsautocfg.tmp
611- mv jsautocfg.tmp $@
612-endif
613-endif
614
615 # jscpucfg is a strange target
616 # Needs to be built with the host compiler but needs to include
617@@ -557,7 +545,7 @@
618 echo no need to build jscpucfg $<
619 else
620 jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in
621- $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $<
622+ $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -I$(DIST)/sdk/include $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $<
623 endif
624 endif
625
626Index: offscreen/js/src/xpconnect/loader/mozJSComponentLoader.cpp
627===================================================================
628--- offscreen.orig/js/src/xpconnect/loader/mozJSComponentLoader.cpp 2009-06-12 14:15:55.000000000 +0100
629+++ offscreen/js/src/xpconnect/loader/mozJSComponentLoader.cpp 2009-06-12 14:15:55.000000000 +0100
630@@ -47,6 +47,8 @@
631
632 #include <stdarg.h>
633
634+#include "mozilla-config.h"
635+
636 #include "prlog.h"
637
638 #include "nsCOMPtr.h"
639Index: offscreen/js/src/xpconnect/loader/mozJSSubScriptLoader.cpp
640===================================================================
641--- offscreen.orig/js/src/xpconnect/loader/mozJSSubScriptLoader.cpp 2009-06-12 14:15:55.000000000 +0100
642+++ offscreen/js/src/xpconnect/loader/mozJSSubScriptLoader.cpp 2009-06-12 14:15:55.000000000 +0100
643@@ -39,6 +39,8 @@
644 *
645 * ***** END LICENSE BLOCK ***** */
646
647+#include "mozilla-config.h"
648+
649 #if !defined(XPCONNECT_STANDALONE) && !defined(NO_SUBSCRIPT_LOADER)
650
651 #include "mozJSSubScriptLoader.h"
652Index: offscreen/modules/lcms/include/icc34.h
653===================================================================
654--- offscreen.orig/modules/lcms/include/icc34.h 2009-06-12 14:15:55.000000000 +0100
655+++ offscreen/modules/lcms/include/icc34.h 2009-06-12 14:15:55.000000000 +0100
656@@ -144,7 +144,7 @@
657 */
658
659
660-#ifdef PACKAGE_NAME
661+#if 0
662 /*
663 June 9, 2003, Adapted for use with configure by Bob Friesenhahn
664 Added the stupid check for autoconf by Marti Maria.
665Index: offscreen/toolkit/mozapps/update/src/updater/Makefile.in
666===================================================================
667--- offscreen.orig/toolkit/mozapps/update/src/updater/Makefile.in 2009-06-12 14:15:55.000000000 +0100
668+++ offscreen/toolkit/mozapps/update/src/updater/Makefile.in 2009-06-12 14:15:55.000000000 +0100
669@@ -60,7 +60,7 @@
670
671 LIBS += \
672 $(DEPTH)/modules/libmar/src/$(LIB_PREFIX)mar.$(LIB_SUFFIX) \
673- $(BZ2_LIBS) \
674+ $(BZ2_LIBS) -lpthread \
675 $(NULL)
676
677 ifeq ($(OS_ARCH),WINNT)
678Index: offscreen/xpcom/sample/program/Makefile.in
679===================================================================
680--- offscreen.orig/xpcom/sample/program/Makefile.in 2009-06-12 14:15:55.000000000 +0100
681+++ offscreen/xpcom/sample/program/Makefile.in 2009-06-12 14:15:55.000000000 +0100
682@@ -57,7 +57,7 @@
683 # that the application be linked against the XPCOM dynamic library or the NSPR
684 # dynamic libraries.
685 LIBS = \
686- $(XPCOM_STANDALONE_GLUE_LDOPTS) \
687+ $(XPCOM_STANDALONE_GLUE_LDOPTS) -ldl \
688 $(NULL)
689
690 # Need to link with CoreFoundation on Mac
691Index: offscreen/xpcom/tools/registry/Makefile.in
692===================================================================
693--- offscreen.orig/xpcom/tools/registry/Makefile.in 2009-06-12 14:15:55.000000000 +0100
694+++ offscreen/xpcom/tools/registry/Makefile.in 2009-06-12 14:15:55.000000000 +0100
695@@ -54,7 +54,7 @@
696 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_SUFFIX))
697
698 LIBS = \
699- $(XPCOM_STANDALONE_GLUE_LDOPTS) \
700+ $(XPCOM_STANDALONE_GLUE_LDOPTS) -ldl \
701 $(NULL)
702
703 # Need to link with CoreFoundation on Mac
704Index: offscreen/xulrunner/app/Makefile.in
705===================================================================
706--- offscreen.orig/xulrunner/app/Makefile.in 2009-06-12 14:15:55.000000000 +0100
707+++ offscreen/xulrunner/app/Makefile.in 2009-06-12 14:15:55.000000000 +0100
708@@ -184,7 +184,7 @@
709 RCFLAGS += -DXULRUNNER_ICO=\"$(DIST)/branding/xulrunner.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\"
710 endif
711
712-LIBS += $(JEMALLOC_LIBS)
713+LIBS += $(JEMALLOC_LIBS) -lpthread -ldl
714
715 include $(topsrcdir)/config/rules.mk
716
717Index: offscreen/xulrunner/stub/Makefile.in
718===================================================================
719--- offscreen.orig/xulrunner/stub/Makefile.in 2009-06-12 14:15:55.000000000 +0100
720+++ offscreen/xulrunner/stub/Makefile.in 2009-06-12 14:15:55.000000000 +0100
721@@ -101,7 +101,7 @@
722 endif
723 endif
724
725-LIBS += $(JEMALLOC_LIBS)
726+LIBS += $(JEMALLOC_LIBS) -lpthread -ldl
727
728 include $(topsrcdir)/config/rules.mk
729
730Index: offscreen/modules/plugin/test/testplugin/Makefile.in
731===================================================================
732--- offscreen.orig/modules/plugin/test/testplugin/Makefile.in 2009-06-12 14:15:55.000000000 +0100
733+++ offscreen/modules/plugin/test/testplugin/Makefile.in 2009-06-12 14:15:55.000000000 +0100
734@@ -63,9 +63,7 @@
735 CMMSRCS = nptest_macosx.mm
736 endif
737
738-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
739 CPPSRCS += nptest_gtk2.cpp
740-endif
741
742 ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
743 CPPSRCS += nptest_os2.cpp
744Index: offscreen/js/src/aclocal.m4
745===================================================================
746--- offscreen.orig/js/src/aclocal.m4 2009-06-12 14:15:55.000000000 +0100
747+++ offscreen/js/src/aclocal.m4 2009-06-12 14:15:55.000000000 +0100
748@@ -9,4 +9,3 @@
749 builtin(include, build/autoconf/moznbytetype.m4)dnl
750 builtin(include, build/autoconf/mozprog.m4)dnl
751
752-MOZ_PROG_CHECKMSYS()
753Index: offscreen/toolkit/toolkit-makefiles.sh
754===================================================================
755--- offscreen.orig/toolkit/toolkit-makefiles.sh 2009-06-12 14:19:59.000000000 +0100
756+++ offscreen/toolkit/toolkit-makefiles.sh 2009-06-12 14:20:09.000000000 +0100
757@@ -342,7 +342,6 @@
758 modules/plugin/sdk/samples/Makefile
759 modules/plugin/sdk/samples/common/Makefile
760 modules/plugin/sdk/samples/basic/windows/Makefile
761- modules/plugin/sdk/samples/basic/unix/Makefile
762 modules/plugin/sdk/samples/winless/windows/Makefile
763 "
764
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/configurefix.patch b/meta-moblin/packages/mozilla-headless/mozilla-headless/configurefix.patch
new file mode 100644
index 0000000000..7ee1211f1a
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/configurefix.patch
@@ -0,0 +1,774 @@
1Index: offscreen/configure.in
2===================================================================
3--- offscreen.orig/configure.in 2009-12-09 13:10:12.000000000 +0000
4+++ offscreen/configure.in 2009-12-09 13:38:51.000000000 +0000
5@@ -64,7 +64,6 @@
6
7 AC_PREREQ(2.13)
8 AC_INIT(config/config.mk)
9-AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
10 AC_CANONICAL_SYSTEM
11 TARGET_CPU="${target_cpu}"
12 TARGET_VENDOR="${target_vendor}"
13@@ -106,7 +105,6 @@
14 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
15 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
16 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
17-_SUBDIR_CONFIG_ARGS="$ac_configure_args"
18
19 dnl Set the version number of the libs included with mozilla
20 dnl ========================================================
21@@ -139,6 +137,9 @@
22
23 MSMANIFEST_TOOL=
24
25+ac_cv_have_usable_wchar_v2=no
26+ac_cv_have_usable_wchar_option_v2=no
27+
28 dnl Set various checks
29 dnl ========================================================
30 MISSING_X=
31@@ -308,7 +309,7 @@
32 ;;
33 esac
34
35-if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
36+
37 echo "cross compiling from $host to $target"
38 cross_compiling=yes
39
40@@ -346,7 +347,7 @@
41
42 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
43 AC_TRY_COMPILE([], [return(0);],
44- [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
45+ [ac_cv_prog_hostcc_works=1; AC_MSG_RESULT([yes])],
46 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
47
48 CC="$HOST_CXX"
49@@ -354,7 +355,7 @@
50
51 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
52 AC_TRY_COMPILE([], [return(0);],
53- [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
54+ [ac_cv_prog_hostcxx_works=1; AC_MSG_RESULT([yes])],
55 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
56
57 CC=$_SAVE_CC
58@@ -375,7 +376,7 @@
59 ;;
60 esac
61
62- AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
63+ CC="${target_alias}-gcc"
64 unset ac_cv_prog_CC
65 AC_PROG_CC
66 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
67@@ -399,37 +400,6 @@
68 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
69 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
70 AC_DEFINE(CROSS_COMPILE)
71-else
72- AC_PROG_CC
73- AC_PROG_CXX
74- AC_PROG_RANLIB
75- MOZ_PATH_PROGS(AS, $AS as, $CC)
76- AC_CHECK_PROGS(AR, ar, :)
77- AC_CHECK_PROGS(LD, ld, :)
78- AC_CHECK_PROGS(STRIP, strip, :)
79- AC_CHECK_PROGS(WINDRES, windres, :)
80- if test -z "$HOST_CC"; then
81- HOST_CC="$CC"
82- fi
83- if test -z "$HOST_CFLAGS"; then
84- HOST_CFLAGS="$CFLAGS"
85- fi
86- if test -z "$HOST_CXX"; then
87- HOST_CXX="$CXX"
88- fi
89- if test -z "$HOST_CXXFLAGS"; then
90- HOST_CXXFLAGS="$CXXFLAGS"
91- fi
92- if test -z "$HOST_LDFLAGS"; then
93- HOST_LDFLAGS="$LDFLAGS"
94- fi
95- if test -z "$HOST_RANLIB"; then
96- HOST_RANLIB="$RANLIB"
97- fi
98- if test -z "$HOST_AR"; then
99- HOST_AR="$AR"
100- fi
101-fi
102
103 GNU_AS=
104 GNU_LD=
105@@ -1586,6 +1556,7 @@
106 '
107
108 dnl test that the macros actually work:
109+ac_cv_static_assertion_macros_work="yes"
110 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
111 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
112 [AC_LANG_SAVE
113@@ -2770,9 +2741,13 @@
114 AC_LANG_C
115 AC_HEADER_STDC
116 AC_C_CONST
117+ac_cv_type_mode_t=yes
118 AC_TYPE_MODE_T
119+ac_cv_type_off_t=yes
120 AC_TYPE_OFF_T
121+ac_cv_type_pid_t=yes
122 AC_TYPE_PID_T
123+ac_cv_type_size_t=yes
124 AC_TYPE_SIZE_T
125 AC_STRUCT_ST_BLKSIZE
126 AC_MSG_CHECKING(for siginfo_t)
127@@ -3174,21 +3149,9 @@
128 dnl We don't want to link against libm or libpthread on Darwin since
129 dnl they both are just symlinks to libSystem and explicitly linking
130 dnl against libSystem causes issues when debugging (see bug 299601).
131-case $target in
132-*-darwin*)
133- ;;
134-*-beos*)
135- ;;
136-*-os2*)
137- ;;
138-*)
139 AC_CHECK_LIB(m, atan)
140 AC_CHECK_LIB(dl, dlopen,
141- AC_CHECK_HEADER(dlfcn.h,
142- LIBS="-ldl $LIBS"
143- AC_DEFINE(HAVE_LIBDL)))
144- ;;
145-esac
146+ AC_DEFINE(HAVE_LIBDL))
147
148 _SAVE_CFLAGS="$CFLAGS"
149 CFLAGS="$CFLAGS -D_GNU_SOURCE"
150@@ -6889,18 +6852,13 @@
151
152 # Demangle only for debug or trace-malloc builds
153 MOZ_DEMANGLE_SYMBOLS=
154-if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
155- MOZ_DEMANGLE_SYMBOLS=1
156- AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
157-fi
158+
159 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
160
161 dnl ========================================================
162 dnl = Support for gcc stack unwinding (from gcc 3.3)
163 dnl ========================================================
164-if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
165- AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
166-fi
167+
168
169 dnl ========================================================
170 dnl =
171@@ -7420,10 +7378,7 @@
172 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
173 dnl to either libIDL1 or libIDL2.
174 if test -z "$_LIBIDL_FOUND"; then
175- AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
176- if test -z "$_LIBIDL_FOUND"; then
177 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
178- fi
179 fi
180 dnl
181 dnl If we don't have a libIDL config program & not cross-compiling,
182@@ -7495,13 +7450,7 @@
183 fi
184
185 if test -z "$SKIP_PATH_CHECKS"; then
186-if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
187- if test "$MOZ_ENABLE_GTK2" || test "$USE_ELF_DYNSTR_GC" || test "$MOZ_ENABLE_HEADLESS"; then
188 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
189- else
190- AM_PATH_GLIB(${GLIB_VERSION})
191- fi
192-fi
193 fi
194
195 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
196@@ -8278,10 +8227,7 @@
197 HAVE_WCRTOMB
198 "
199
200-AC_CONFIG_HEADER(
201-netwerk/necko-config.h
202-xpcom/xpcom-config.h
203-xpcom/xpcom-private.h
204+AC_CONFIG_HEADER(netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h
205 )
206
207 # Save the defines header file before autoconf removes it.
208@@ -8340,31 +8286,11 @@
209 dnl To add new Makefiles, edit allmakefiles.sh.
210 dnl allmakefiles.sh sets the variable, MAKEFILES.
211 . ${srcdir}/allmakefiles.sh
212-dnl
213-dnl Run a perl script to quickly create the makefiles.
214-dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
215-dnl for the files it cannot handle correctly. This way, config.status
216-dnl will handle these files.
217-dnl If it fails, nothing is set and config.status will run as usual.
218-dnl
219-dnl This does not change the $MAKEFILES variable.
220-dnl
221-dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
222-dnl
223-if test -z "${AS_PERL}"; then
224-echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
225-else
226-echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
227-fi
228-. ./conftest.sh
229-rm conftest.sh
230
231 echo $MAKEFILES > unallmakefiles
232
233 mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
234
235-AC_OUTPUT($MAKEFILES)
236-
237 dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
238 if test "$CAIRO_FEATURES_H"; then
239 if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
240@@ -8390,14 +8316,14 @@
241 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
242 RC=
243
244-unset MAKEFILES
245-unset CONFIG_FILES
246+#unset MAKEFILES
247+#unset CONFIG_FILES
248
249 # No need to run subconfigures when building with LIBXUL_SDK_DIR
250 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
251
252 if test -z "$MOZ_NATIVE_NSPR"; then
253- ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
254+ ac_configure_args="$ac_configure_args --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
255 if test -z "$MOZ_DEBUG"; then
256 ac_configure_args="$ac_configure_args --disable-debug"
257 fi
258@@ -8413,8 +8339,7 @@
259 if test -n "$USE_ARM_KUSER"; then
260 ac_configure_args="$ac_configure_args --with-arm-kuser"
261 fi
262- AC_OUTPUT_SUBDIRS(nsprpub)
263- ac_configure_args="$_SUBDIR_CONFIG_ARGS"
264+ AC_CONFIG_SUBDIRS(nsprpub)
265 fi
266
267 if test -z "$MOZ_NATIVE_NSPR"; then
268@@ -8431,7 +8356,6 @@
269
270 # Run the SpiderMonkey 'configure' script.
271 dist=$MOZ_BUILD_ROOT/dist
272-ac_configure_args="$_SUBDIR_CONFIG_ARGS"
273 ac_configure_args="$ac_configure_args --enable-threadsafe"
274 if test -z "$MOZ_NATIVE_NSPR"; then
275 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
276@@ -8448,8 +8372,7 @@
277 export MOZ_MEMORY_LDFLAGS
278 fi
279 fi
280-AC_OUTPUT_SUBDIRS(js/src)
281-ac_configure_args="$_SUBDIR_CONFIG_ARGS"
282+AC_CONFIG_SUBDIRS(js/src)
283
284 # Build jsctypes on the platforms we can.
285 if test "$BUILD_CTYPES"; then
286@@ -8465,20 +8388,14 @@
287 if test -n "$CROSS_COMPILE"; then
288 ac_configure_args="$ac_configure_args --build=$build --host=$target"
289 fi
290- if test "$SOLARIS_SUNPRO_CC"; then
291- # Always use gcc for libffi on Solaris
292- old_cache_file=$cache_file
293- cache_file=js/ctypes/libffi/config.cache
294- ac_configure_args="$ac_configure_args CC=gcc"
295- AC_OUTPUT_SUBDIRS(js/ctypes/libffi)
296- cache_file=$old_cache_file
297- else
298- AC_OUTPUT_SUBDIRS(js/ctypes/libffi)
299- fi
300- ac_configure_args="$_SUBDIR_CONFIG_ARGS"
301+ AC_CONFIG_SUBDIRS(js/ctypes/libffi)
302 fi
303 fi
304
305+m4_pattern_allow(AS_BIN)
306+
307+AC_OUTPUT($MAKEFILES)
308+
309 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
310
311 dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
312Index: offscreen/js/src/configure.in
313===================================================================
314--- offscreen.orig/js/src/configure.in 2009-12-09 13:10:12.000000000 +0000
315+++ offscreen/js/src/configure.in 2009-12-09 13:38:51.000000000 +0000
316@@ -62,7 +62,6 @@
317
318 AC_PREREQ(2.13)
319 AC_INIT(jsapi.h)
320-AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
321 AC_CONFIG_HEADER(js-config.h)
322 AC_CANONICAL_SYSTEM
323 TARGET_CPU="${target_cpu}"
324@@ -101,6 +100,9 @@
325 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
326 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
327
328+ac_cv_have_usable_wchar_v2=no
329+ac_cv_have_usable_wchar_option_v2=no
330+
331 dnl Set the version number of the libs included with mozilla
332 dnl ========================================================
333 NSPR_VERSION=4
334@@ -113,6 +115,8 @@
335
336 MSMANIFEST_TOOL=
337
338+m4_pattern_allow(AS_BIN)
339+
340 dnl Set various checks
341 dnl ========================================================
342 MISSING_X=
343@@ -212,7 +216,7 @@
344
345 if test "$COMPILE_ENVIRONMENT"; then
346
347-if test "$target" != "$host"; then
348+
349 echo "cross compiling from $host to $target"
350
351 _SAVE_CC="$CC"
352@@ -249,7 +253,7 @@
353
354 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
355 AC_TRY_COMPILE([], [return(0);],
356- [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
357+ [ac_cv_prog_hostcc_works=1; AC_MSG_RESULT([yes])],
358 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
359
360 CC="$HOST_CXX"
361@@ -257,7 +261,7 @@
362
363 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
364 AC_TRY_COMPILE([], [return(0);],
365- [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
366+ [ac_cv_prog_hostcxx_works=1; AC_MSG_RESULT([yes])],
367 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
368
369 CC=$_SAVE_CC
370@@ -312,7 +316,7 @@
371 ;;
372 esac
373
374- AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
375+ CC="${target_alias}-gcc"
376 unset ac_cv_prog_CC
377 AC_PROG_CC
378 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
379@@ -342,37 +346,6 @@
380 dnl able to run ppc code in a translated environment, making a cross
381 dnl compiler appear native. So we override that here.
382 cross_compiling=yes
383-else
384- AC_PROG_CC
385- AC_PROG_CXX
386- AC_PROG_RANLIB
387- MOZ_PATH_PROGS(AS, $AS as, $CC)
388- AC_CHECK_PROGS(AR, ar, :)
389- AC_CHECK_PROGS(LD, ld, :)
390- AC_CHECK_PROGS(STRIP, strip, :)
391- AC_CHECK_PROGS(WINDRES, windres, :)
392- if test -z "$HOST_CC"; then
393- HOST_CC="$CC"
394- fi
395- if test -z "$HOST_CFLAGS"; then
396- HOST_CFLAGS="$CFLAGS"
397- fi
398- if test -z "$HOST_CXX"; then
399- HOST_CXX="$CXX"
400- fi
401- if test -z "$HOST_CXXFLAGS"; then
402- HOST_CXXFLAGS="$CXXFLAGS"
403- fi
404- if test -z "$HOST_LDFLAGS"; then
405- HOST_LDFLAGS="$LDFLAGS"
406- fi
407- if test -z "$HOST_RANLIB"; then
408- HOST_RANLIB="$RANLIB"
409- fi
410- if test -z "$HOST_AR"; then
411- HOST_AR="$AR"
412- fi
413-fi
414
415 GNU_AS=
416 GNU_LD=
417@@ -1370,6 +1343,8 @@
418 fi # GNU_CC
419 fi # COMPILE_ENVIRONMENT
420
421+ac_cv_static_assertion_macros_work=yes
422+
423 dnl =================================================================
424 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
425 dnl which is bad when cross compiling.
426@@ -2557,9 +2532,13 @@
427 AC_LANG_C
428 AC_HEADER_STDC
429 AC_C_CONST
430+ac_cv_type_mode_t=yes
431 AC_TYPE_MODE_T
432+ac_cv_type_off_t=yes
433 AC_TYPE_OFF_T
434+ac_cv_type_pid_t=yes
435 AC_TYPE_PID_T
436+ac_cv_type_size_t=yes
437 AC_TYPE_SIZE_T
438 AC_STRUCT_ST_BLKSIZE
439 AC_MSG_CHECKING(for siginfo_t)
440@@ -2584,7 +2563,8 @@
441
442 AC_CHECK_HEADER(stdint.h)
443 if test "$ac_cv_header_stdint_h" = yes; then
444- AC_DEFINE(JS_HAVE_STDINT_H)
445+ AC_DEFINE(JS_HAVE_STDINT_H, 1, [have stdint.h])
446+ AC_DEFINE(HAVE_STDINT_H)
447 else
448 dnl We'll figure them out for ourselves. List more likely types
449 dnl earlier. If we ever really encounter a size for which none of
450@@ -2938,10 +2918,7 @@
451 ;;
452 *)
453 AC_CHECK_LIB(m, atan)
454- AC_CHECK_LIB(dl, dlopen,
455- AC_CHECK_HEADER(dlfcn.h,
456- LIBS="-ldl $LIBS"
457- AC_DEFINE(HAVE_LIBDL)))
458+ AC_CHECK_LIB(dl, dlopen, AC_DEFINE(HAVE_LIBDL))
459 ;;
460 esac
461
462@@ -3847,6 +3824,7 @@
463 [ --with-nspr-libs=LIBS Pass LIBS to LD when linking code that uses NSPR.
464 See --with-nspr-cflags for more details.],
465 NSPR_LIBS=$withval)
466+$NSPR_LIBS="$NSPR_LIBS -L$(LIBXUL_DIST)/sdk/lib"
467 AC_SUBST(NSPR_CFLAGS)
468 AC_SUBST(NSPR_LIBS)
469
470@@ -4386,18 +4364,11 @@
471
472 # Demangle only for debug or trace-malloc builds
473 MOZ_DEMANGLE_SYMBOLS=
474-if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
475- MOZ_DEMANGLE_SYMBOLS=1
476- AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
477-fi
478 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
479
480 dnl ========================================================
481 dnl = Support for gcc stack unwinding (from gcc 3.3)
482 dnl ========================================================
483-if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
484- AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
485-fi
486
487 dnl ========================================================
488 dnl =
489@@ -5097,6 +5068,8 @@
490
491 AC_HAVE_FUNCS(setlocale)
492
493+
494+
495 dnl ========================================================
496 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
497 dnl ========================================================
498@@ -5234,3 +5207,4 @@
499 # 'js-config' in Makefile.in.
500 AC_MSG_RESULT(invoking make to create js-config script)
501 $MAKE js-config
502+
503Index: offscreen/nsprpub/configure.in
504===================================================================
505--- offscreen.orig/nsprpub/configure.in 2009-12-09 13:10:12.000000000 +0000
506+++ offscreen/nsprpub/configure.in 2009-12-09 13:10:12.000000000 +0000
507@@ -42,7 +42,6 @@
508 AC_PREREQ(2.12)
509 AC_INIT(config/libc_r.h)
510
511-AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
512 AC_CANONICAL_SYSTEM
513
514 dnl ========================================================
515@@ -396,7 +395,7 @@
516 dnl ========================================================
517 dnl Checks for compilers.
518 dnl ========================================================
519-if test "$target" != "$host"; then
520+
521 echo "cross compiling from $host to $target"
522 cross_compiling=yes
523
524@@ -423,7 +422,7 @@
525
526 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
527 AC_TRY_COMPILE([], [return(0);],
528- [ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
529+ [ac_cv_prog_host_cc_works=1; AC_MSG_RESULT([yes])],
530 AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
531
532 CC=$_SAVE_CC
533@@ -444,7 +443,7 @@
534 ;;
535 esac
536
537- AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
538+ CC="${target_alias}-gcc"
539 unset ac_cv_prog_CC
540 AC_PROG_CC
541 if test -n "$USE_CPLUS"; then
542@@ -470,30 +469,6 @@
543 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
544 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
545
546-else
547- AC_PROG_CC
548- if test -n "$USE_CPLUS"; then
549- if test "$CC" = "cl" -a -z "$CXX"; then
550- CXX=$CC
551- else
552- AC_PROG_CXX
553- fi
554- fi
555- AC_PROG_CPP
556- AC_PROG_RANLIB
557- AC_PATH_PROGS(AS, as, $CC)
558- AC_PATH_PROGS(AR, ar, echo not_ar)
559- AC_PATH_PROGS(LD, ld link, echo not_ld)
560- AC_PATH_PROGS(STRIP, strip, echo not_strip)
561- AC_PATH_PROGS(WINDRES, windres, echo not_windres)
562- if test -z "$HOST_CC"; then
563- HOST_CC="$CC"
564- fi
565- if test -z "$HOST_CFLAGS"; then
566- HOST_CFLAGS="$CFLAGS"
567- fi
568-fi
569-
570 if test "$GCC" = "yes"; then
571 GNU_CC=1
572 fi
573@@ -514,11 +489,8 @@
574 ;;
575 esac
576
577-if test "$cross_compiling" = "yes"; then
578+
579 CROSS_COMPILE=1
580-else
581- CROSS_COMPILE=
582-fi
583
584 dnl ========================================================
585 dnl Check for gcc -pipe support
586@@ -2286,10 +2258,7 @@
587 *-darwin*|*-beos*|*-os2*)
588 ;;
589 *)
590- AC_CHECK_LIB(dl, dlopen,
591- AC_CHECK_HEADER(dlfcn.h,
592- OS_LIBS="-ldl $OS_LIBS"))
593- ;;
594+ AC_CHECK_LIB(dl, dlopen)
595 esac
596
597
598@@ -2907,6 +2876,8 @@
599 dnl pr/tests/w16gui/Makefile
600 dnl tools/Makefile
601
602+m4_pattern_allow(AS_BIN)
603+
604 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
605 MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
606 elif test -n "$USE_PTHREADS"; then
607@@ -2922,3 +2893,5 @@
608 echo $MAKEFILES > unallmakefiles
609
610 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])
611+
612+
613Index: offscreen/js/src/Makefile.in
614===================================================================
615--- offscreen.orig/js/src/Makefile.in 2009-12-09 13:10:12.000000000 +0000
616+++ offscreen/js/src/Makefile.in 2009-12-09 13:10:12.000000000 +0000
617@@ -513,20 +513,8 @@
618
619 export:: jsautocfg.h
620
621-ifeq (,$(CROSS_COMPILE)$(GNU_CC)$(filter-out WINNT,$(OS_ARCH)))
622 jsautocfg.h:
623 touch $@
624-else
625-ifeq ($(OS_ARCH),WINCE)
626-jsautocfg.h:
627- touch $@
628-else
629-jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX)
630- @rm -f $@ jsautocfg.tmp
631- ./jscpucfg > jsautocfg.tmp
632- mv jsautocfg.tmp $@
633-endif
634-endif
635
636 # jscpucfg is a strange target
637 # Needs to be built with the host compiler but needs to include
638@@ -556,7 +544,7 @@
639 echo no need to build jscpucfg $<
640 else
641 jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in
642- $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $<
643+ $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -I$(DIST)/sdk/include $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $<
644 endif
645 endif
646
647Index: offscreen/js/src/xpconnect/loader/mozJSComponentLoader.cpp
648===================================================================
649--- offscreen.orig/js/src/xpconnect/loader/mozJSComponentLoader.cpp 2009-12-09 13:10:12.000000000 +0000
650+++ offscreen/js/src/xpconnect/loader/mozJSComponentLoader.cpp 2009-12-09 13:10:12.000000000 +0000
651@@ -47,6 +47,8 @@
652
653 #include <stdarg.h>
654
655+#include "mozilla-config.h"
656+
657 #include "prlog.h"
658
659 #include "nsCOMPtr.h"
660Index: offscreen/js/src/xpconnect/loader/mozJSSubScriptLoader.cpp
661===================================================================
662--- offscreen.orig/js/src/xpconnect/loader/mozJSSubScriptLoader.cpp 2009-12-09 13:10:12.000000000 +0000
663+++ offscreen/js/src/xpconnect/loader/mozJSSubScriptLoader.cpp 2009-12-09 13:10:12.000000000 +0000
664@@ -39,6 +39,8 @@
665 *
666 * ***** END LICENSE BLOCK ***** */
667
668+#include "mozilla-config.h"
669+
670 #if !defined(XPCONNECT_STANDALONE) && !defined(NO_SUBSCRIPT_LOADER)
671
672 #include "mozJSSubScriptLoader.h"
673Index: offscreen/toolkit/mozapps/update/src/updater/Makefile.in
674===================================================================
675--- offscreen.orig/toolkit/mozapps/update/src/updater/Makefile.in 2009-12-09 13:10:12.000000000 +0000
676+++ offscreen/toolkit/mozapps/update/src/updater/Makefile.in 2009-12-09 13:10:12.000000000 +0000
677@@ -56,7 +56,7 @@
678
679 LIBS += \
680 $(DEPTH)/modules/libmar/src/$(LIB_PREFIX)mar.$(LIB_SUFFIX) \
681- $(BZ2_LIBS) \
682+ $(BZ2_LIBS) -lpthread \
683 $(NULL)
684
685 ifeq ($(OS_ARCH),WINNT)
686Index: offscreen/xpcom/sample/program/Makefile.in
687===================================================================
688--- offscreen.orig/xpcom/sample/program/Makefile.in 2009-12-09 13:10:12.000000000 +0000
689+++ offscreen/xpcom/sample/program/Makefile.in 2009-12-09 13:10:12.000000000 +0000
690@@ -57,7 +57,7 @@
691 # that the application be linked against the XPCOM dynamic library or the NSPR
692 # dynamic libraries.
693 LIBS = \
694- $(XPCOM_STANDALONE_GLUE_LDOPTS) \
695+ $(XPCOM_STANDALONE_GLUE_LDOPTS) -ldl \
696 $(NULL)
697
698 # Need to link with CoreFoundation on Mac
699Index: offscreen/xpcom/tools/registry/Makefile.in
700===================================================================
701--- offscreen.orig/xpcom/tools/registry/Makefile.in 2009-12-09 13:10:12.000000000 +0000
702+++ offscreen/xpcom/tools/registry/Makefile.in 2009-12-09 13:10:12.000000000 +0000
703@@ -54,7 +54,7 @@
704 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_SUFFIX))
705
706 LIBS = \
707- $(XPCOM_STANDALONE_GLUE_LDOPTS) \
708+ $(XPCOM_STANDALONE_GLUE_LDOPTS) -ldl \
709 $(NULL)
710
711 # Need to link with CoreFoundation on Mac
712Index: offscreen/xulrunner/app/Makefile.in
713===================================================================
714--- offscreen.orig/xulrunner/app/Makefile.in 2009-12-09 13:10:12.000000000 +0000
715+++ offscreen/xulrunner/app/Makefile.in 2009-12-09 13:10:12.000000000 +0000
716@@ -173,7 +173,7 @@
717 RCFLAGS += -DXULRUNNER_ICO=\"$(DIST)/branding/xulrunner.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\"
718 endif
719
720-LIBS += $(JEMALLOC_LIBS)
721+LIBS += $(JEMALLOC_LIBS) -lpthread -ldl
722
723 include $(topsrcdir)/config/rules.mk
724
725Index: offscreen/xulrunner/stub/Makefile.in
726===================================================================
727--- offscreen.orig/xulrunner/stub/Makefile.in 2009-12-09 13:10:12.000000000 +0000
728+++ offscreen/xulrunner/stub/Makefile.in 2009-12-09 13:10:12.000000000 +0000
729@@ -100,7 +100,7 @@
730 endif
731 endif
732
733-LIBS += $(JEMALLOC_LIBS)
734+LIBS += $(JEMALLOC_LIBS) -lpthread -ldl
735
736 include $(topsrcdir)/config/rules.mk
737
738Index: offscreen/modules/plugin/test/testplugin/Makefile.in
739===================================================================
740--- offscreen.orig/modules/plugin/test/testplugin/Makefile.in 2009-12-09 13:10:12.000000000 +0000
741+++ offscreen/modules/plugin/test/testplugin/Makefile.in 2009-12-09 13:10:12.000000000 +0000
742@@ -60,9 +60,7 @@
743 CMMSRCS = nptest_macosx.mm
744 endif
745
746-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
747 CPPSRCS += nptest_gtk2.cpp
748-endif
749
750 ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
751 CPPSRCS += nptest_os2.cpp
752Index: offscreen/js/src/aclocal.m4
753===================================================================
754--- offscreen.orig/js/src/aclocal.m4 2009-12-09 13:10:12.000000000 +0000
755+++ offscreen/js/src/aclocal.m4 2009-12-09 13:39:01.000000000 +0000
756@@ -8,6 +8,4 @@
757 builtin(include, build/autoconf/altoptions.m4)dnl
758 builtin(include, build/autoconf/moznbytetype.m4)dnl
759 builtin(include, build/autoconf/mozprog.m4)dnl
760-builtin(include, build/autoconf/acwinpaths.m4)dnl
761
762-MOZ_PROG_CHECKMSYS()
763Index: offscreen/toolkit/toolkit-makefiles.sh
764===================================================================
765--- offscreen.orig/toolkit/toolkit-makefiles.sh 2009-12-09 13:10:12.000000000 +0000
766+++ offscreen/toolkit/toolkit-makefiles.sh 2009-12-09 13:10:12.000000000 +0000
767@@ -369,7 +369,6 @@
768 modules/plugin/sdk/samples/Makefile
769 modules/plugin/sdk/samples/common/Makefile
770 modules/plugin/sdk/samples/basic/windows/Makefile
771- modules/plugin/sdk/samples/basic/unix/Makefile
772 modules/plugin/sdk/samples/winless/windows/Makefile
773 "
774
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/i386/jsautocfg.h b/meta-moblin/packages/mozilla-headless/mozilla-headless/i386/jsautocfg.h
new file mode 100644
index 0000000000..94b44f8e14
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/i386/jsautocfg.h
@@ -0,0 +1,21 @@
1#ifndef js_cpucfg___
2#define js_cpucfg___
3
4/* AUTOMATICALLY GENERATED - DO NOT EDIT */
5
6#define IS_LITTLE_ENDIAN 1
7#undef IS_BIG_ENDIAN
8
9
10#define JS_BYTES_PER_WORD 4L
11#define JS_BYTES_PER_DOUBLE 8L
12#define JS_BITS_PER_WORD_LOG2 5L
13#define JS_ALIGN_OF_POINTER 4L
14
15#define JS_THREADSAFE 1
16
17#define JS_STACK_GROWTH_DIRECTION (-1)
18
19#define JS_HAVE_LONG_LONG
20
21#endif /* js_cpucfg___ */
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/i486/jsautocfg.h b/meta-moblin/packages/mozilla-headless/mozilla-headless/i486/jsautocfg.h
new file mode 100644
index 0000000000..94b44f8e14
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/i486/jsautocfg.h
@@ -0,0 +1,21 @@
1#ifndef js_cpucfg___
2#define js_cpucfg___
3
4/* AUTOMATICALLY GENERATED - DO NOT EDIT */
5
6#define IS_LITTLE_ENDIAN 1
7#undef IS_BIG_ENDIAN
8
9
10#define JS_BYTES_PER_WORD 4L
11#define JS_BYTES_PER_DOUBLE 8L
12#define JS_BITS_PER_WORD_LOG2 5L
13#define JS_ALIGN_OF_POINTER 4L
14
15#define JS_THREADSAFE 1
16
17#define JS_STACK_GROWTH_DIRECTION (-1)
18
19#define JS_HAVE_LONG_LONG
20
21#endif /* js_cpucfg___ */
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/i586/jsautocfg.h b/meta-moblin/packages/mozilla-headless/mozilla-headless/i586/jsautocfg.h
new file mode 100644
index 0000000000..94b44f8e14
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/i586/jsautocfg.h
@@ -0,0 +1,21 @@
1#ifndef js_cpucfg___
2#define js_cpucfg___
3
4/* AUTOMATICALLY GENERATED - DO NOT EDIT */
5
6#define IS_LITTLE_ENDIAN 1
7#undef IS_BIG_ENDIAN
8
9
10#define JS_BYTES_PER_WORD 4L
11#define JS_BYTES_PER_DOUBLE 8L
12#define JS_BITS_PER_WORD_LOG2 5L
13#define JS_ALIGN_OF_POINTER 4L
14
15#define JS_THREADSAFE 1
16
17#define JS_STACK_GROWTH_DIRECTION (-1)
18
19#define JS_HAVE_LONG_LONG
20
21#endif /* js_cpucfg___ */
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/i686/jsautocfg.h b/meta-moblin/packages/mozilla-headless/mozilla-headless/i686/jsautocfg.h
new file mode 100644
index 0000000000..94b44f8e14
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/i686/jsautocfg.h
@@ -0,0 +1,21 @@
1#ifndef js_cpucfg___
2#define js_cpucfg___
3
4/* AUTOMATICALLY GENERATED - DO NOT EDIT */
5
6#define IS_LITTLE_ENDIAN 1
7#undef IS_BIG_ENDIAN
8
9
10#define JS_BYTES_PER_WORD 4L
11#define JS_BYTES_PER_DOUBLE 8L
12#define JS_BITS_PER_WORD_LOG2 5L
13#define JS_ALIGN_OF_POINTER 4L
14
15#define JS_THREADSAFE 1
16
17#define JS_STACK_GROWTH_DIRECTION (-1)
18
19#define JS_HAVE_LONG_LONG
20
21#endif /* js_cpucfg___ */
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/mozconfig b/meta-moblin/packages/mozilla-headless/mozilla-headless/mozconfig
new file mode 100644
index 0000000000..6123d11d27
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/mozconfig
@@ -0,0 +1,23 @@
1# this line sets the directory for all build output
2mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj-headless-release
3
4# comment out the previous line and uncomment these two for a debug build
5#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj-headless-debug
6#ac_add_options --disable-optimize --enable-debug
7
8# this is the line that enables the headless implementation
9ac_add_options --enable-default-toolkit=cairo-headless
10
11# comment out the previous line and uncomment these two for a GTK build
12#ac_add_options --enable-system-cairo
13#ac_add_options --enable-default-toolkit=cairo-gtk2
14
15ac_add_options --disable-tests
16ac_add_options --disable-javaxpcom
17ac_add_options --enable-application=xulrunner
18ac_add_options --enable-pango
19ac_add_options --disable-printing
20ac_add_options --disable-crashreporter
21ac_add_options --enable-plugins
22ac_add_options --disable-accessibility
23mk_add_options MOZ_CO_PROJECT=xulrunner
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/mozilla-jemalloc.patch b/meta-moblin/packages/mozilla-headless/mozilla-headless/mozilla-jemalloc.patch
new file mode 100644
index 0000000000..aabd6906e8
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/mozilla-jemalloc.patch
@@ -0,0 +1,24 @@
1diff -r f1af606531f5 memory/jemalloc/jemalloc.h
2--- a/memory/jemalloc/jemalloc.h Sat Nov 22 20:22:22 2008 +0100
3+++ b/memory/jemalloc/jemalloc.h Mon Dec 01 16:53:06 2008 -0500
4@@ -45,14 +45,14 @@
5 } jemalloc_stats_t;
6
7 #ifndef MOZ_MEMORY_DARWIN
8-void *malloc(size_t size);
9-void *valloc(size_t size);
10-void *calloc(size_t num, size_t size);
11-void *realloc(void *ptr, size_t size);
12-void free(void *ptr);
13+void *malloc(size_t size) __THROW __attribute_malloc__ __wur;
14+void *valloc(size_t size) __THROW __attribute_malloc__ __wur;
15+void *calloc(size_t num, size_t size) __THROW __attribute_malloc__ __wur;
16+void *realloc(void *ptr, size_t size) __THROW __attribute_malloc__ __wur;
17+void free(void *ptr) __THROW __attribute_malloc__ __wur;
18 #endif
19
20-int posix_memalign(void **memptr, size_t alignment, size_t size);
21+int posix_memalign(void **memptr, size_t alignment, size_t size) __THROW __attribute_malloc__ __wur;
22 void *memalign(size_t alignment, size_t size);
23 size_t malloc_usable_size(const void *ptr);
24 void jemalloc_stats(jemalloc_stats_t *stats);
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/removebadrpath-1a622cb7c384.patch b/meta-moblin/packages/mozilla-headless/mozilla-headless/removebadrpath-1a622cb7c384.patch
new file mode 100644
index 0000000000..9409105780
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/removebadrpath-1a622cb7c384.patch
@@ -0,0 +1,26 @@
1Index: offscreen/js/src/configure.in
2===================================================================
3--- offscreen.orig/js/src/configure.in 2009-06-17 14:31:40.000000000 +0100
4+++ offscreen/js/src/configure.in 2009-06-17 14:31:40.000000000 +0100
5@@ -880,7 +880,7 @@
6 HOST_AR_FLAGS='$(AR_FLAGS)'
7
8 MOZ_JS_LIBS='-L$(libdir) -lmozjs'
9-MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(PREFIX)/lib'
10+MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin'
11
12 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
13 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
14Index: offscreen/configure.in
15===================================================================
16--- offscreen.orig/configure.in 2009-06-17 15:09:44.000000000 +0100
17+++ offscreen/configure.in 2009-06-17 15:10:00.000000000 +0100
18@@ -1060,7 +1060,7 @@
19
20 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
21 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
22-MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
23+MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin'
24 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
25 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
26 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless/removebadrpath.patch b/meta-moblin/packages/mozilla-headless/mozilla-headless/removebadrpath.patch
new file mode 100644
index 0000000000..53ae6d3251
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless/removebadrpath.patch
@@ -0,0 +1,44 @@
1Index: offscreen/js/src/configure.in
2===================================================================
3--- offscreen.orig/js/src/configure.in 2009-12-09 13:38:51.000000000 +0000
4+++ offscreen/js/src/configure.in 2009-12-09 14:14:08.000000000 +0000
5@@ -858,7 +858,7 @@
6 HOST_AR_FLAGS='$(AR_FLAGS)'
7
8 MOZ_JS_LIBS='-L$(libdir) -lmozjs'
9-MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(PREFIX)/lib'
10+MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin'
11
12 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
13
14@@ -3824,7 +3824,7 @@
15 [ --with-nspr-libs=LIBS Pass LIBS to LD when linking code that uses NSPR.
16 See --with-nspr-cflags for more details.],
17 NSPR_LIBS=$withval)
18-$NSPR_LIBS="$NSPR_LIBS -L$(LIBXUL_DIST)/sdk/lib"
19+NSPR_LIBS="$NSPR_LIBS -L$(LIBXUL_DIST)/sdk/lib"
20 AC_SUBST(NSPR_CFLAGS)
21 AC_SUBST(NSPR_LIBS)
22
23Index: offscreen/configure.in
24===================================================================
25--- offscreen.orig/configure.in 2009-12-09 13:38:51.000000000 +0000
26+++ offscreen/configure.in 2009-12-09 14:31:33.000000000 +0000
27@@ -1041,7 +1041,7 @@
28
29 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
30 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
31-MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
32+MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin'
33 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
34 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
35 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
36@@ -8378,7 +8378,7 @@
37 if test "$BUILD_CTYPES"; then
38 # Run the libffi 'configure' script on platforms that it supports.
39 if test -z "$_MSC_VER"; then
40- ac_configure_args="--disable-shared --enable-static --disable-raw-api"
41+ ac_configure_args="$ac_configure_args --disable-shared --enable-static --disable-raw-api"
42 if test "$MOZ_DEBUG"; then
43 ac_configure_args="$ac_configure_args --enable-debug"
44 fi
diff --git a/meta-moblin/packages/mozilla-headless/mozilla-headless_hg.bb b/meta-moblin/packages/mozilla-headless/mozilla-headless_hg.bb
new file mode 100644
index 0000000000..669c526163
--- /dev/null
+++ b/meta-moblin/packages/mozilla-headless/mozilla-headless_hg.bb
@@ -0,0 +1,99 @@
1
2#file://0001-Adds-initial-Gtk-clipboard-support-to-moz-headless.patch;patch=1 \
3SRC_URI = "hg://hg.mozilla.org/incubator;protocol=http;module=offscreen \
4 file://configurefix-1a622cb7c384.patch;patch=1;rev=1a622cb7c384 \
5 file://configurefix.patch;patch=1;notrev=1a622cb7c384 \
6 file://mozilla-jemalloc.patch;patch=1 \
7 file://removebadrpath-1a622cb7c384.patch;patch=1;rev=1a622cb7c384 \
8 file://removebadrpath.patch;patch=1;notrev=1a622cb7c384 \
9 file://buildfixhack.patch;patch=1;notrev=1a622cb7c384 \
10 file://autoconffix.patch;patch=1 \
11 file://jsautocfg.h \
12 file://mozconfig"
13PV = "0.2+hg-1.0+${SRCPV}"
14PR = "r10"
15
16S = "${WORKDIR}/offscreen"
17
18DEPENDS = "gconf gnome-vfs pango dbus-glib alsa-lib libidl-native sqlite3 libidl"
19
20FILES_${PN} += "${libdir}/xulrunner-${XULVERSION} ${libdir}/xulrunner-devel-${XULVERSION}/sdk/lib/*.so"
21FILES_${PN}-dev += "${libdir}/xulrunner-devel-${XULVERSION}"
22FILES_${PN}-dbg += "${libdir}/xulrunner-devel-${XULVERSION}/sdk/lib/.debug"
23
24# Mozilla's build rules search for -L paths to find libraries. Its
25# not clever enough to know where the sysroot is and hence finds host
26# object files which is bad. We therefore tell pkg-config not to hide
27# paths. See config/rules.mk and the LIBS_DEPS and _LIBDIRS variables.
28export PKG_CONFIG_ALLOW_SYSTEM_LIBS = "1"
29
30TARGET_CC_ARCH = ""
31
32CFLAGS = "${TARGET_CFLAGS}"
33TARGET_CFLAGS = "-Os -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse -fasynchronous-unwind-tables"
34
35LDFLAGS = "${TARGET_LDFLAGS}"
36TARGET_LDFLAGS = "-Wl,-rpath,${libdir}/xulrunner-${XULVERSION}"
37
38export target_alias=${TARGET_PREFIX}
39
40inherit autotools mozilla
41
42acpaths = "-I ${S}/build/autoconf "
43
44export topsrcdir = "${S}"
45
46do_configure () {
47 if [ "${SRCREV}" != "1a622cb7c384" ]; then
48 rm -rf ${S}/build/autoconf/acwinpaths.m4
49 rm -rf ${S}/js/src/build/autoconf/acwinpaths.m4
50 rm -rf ${S}/nsprpub/build/autoconf/acwinpaths.m4
51 mkdir -p ${S}/js/src/dist/include
52 ln -fs ../../../../nsprpub/dist/include/nspr ${S}/js/src/dist/include/nsprpub
53 fi
54 cp ${S}/build/autoconf/install-sh ${S}
55 autotools_do_configure
56 # Yes, we run this twice. The first pass sets up npsrpub-config which then
57 # sets the values correctly on the second try. Ick.
58 autotools_do_configure
59}
60
61do_compile () {
62 cp ${WORKDIR}/jsautocfg.h ${S}/js/src/
63 #oe_runmake -f client.mk build_all
64 base_do_compile
65}
66
67XULVERSION = "1.9.3a1pre"
68
69do_install_append () {
70 install -d ${D}${sysconfdir}/ld.so.conf.d/
71 echo ${libdir}/xulrunner-${XULVERSION}/ > ${D}${sysconfdir}/ld.so.conf.d/mozilla-headless
72}
73
74EXTRA_OECONF =+ "--enable-application=xulrunner --enable-default-toolkit=cairo-headless --with-pthreads \
75 --enable-pango --enable-optimize --disable-debug --disable-tests \
76 --disable-printing --disable-crashreporter --disable-accessibility \
77 --disable-javaxpcom --enable-plugins --enable-system-sqlite --disable-necko-wifi"
78
79export LIBXUL_DIST="${S}/dist"
80
81SYSROOT_PREPROCESS_FUNCS += "mozilla_sysroot_preprocess"
82
83mozilla_sysroot_preprocess () {
84 autotools_stage_dir ${D}/${libdir}/xulrunner-${XULVERSION} ${SYSROOT_DESTDIR}${STAGING_DIR_HOST}${libdir}/xulrunner-${XULVERSION}/
85 autotools_stage_dir ${D}/${libdir}/xulrunner-devel-${XULVERSION} ${SYSROOT_DESTDIR}${STAGING_DIR_HOST}${libdir}/xulrunner-devel-${XULVERSION}/
86
87 ln -fs ${STAGING_DIR_HOST}${libdir}/xulrunner-${XULVERSION}/ ${SYSROOT_DESTDIR}${STAGING_DIR_HOST}${libdir}/xulrunner-devel-${XULVERSION}/bin
88 ln -fs ${STAGING_DIR_HOST}${datadir}/xulrunner-${XULVERSION}/unstable/ ${SYSROOT_DESTDIR}${STAGING_DIR_HOST}${libdir}/xulrunner-devel-${XULVERSION}/idl
89 ln -fs ${STAGING_DIR_HOST}${includedir}/xulrunner-${XULVERSION}/unstable/ ${SYSROOT_DESTDIR}${STAGING_DIR_HOST}${libdir}/xulrunner-devel-${XULVERSION}/include
90 ln -fs ${STAGING_DIR_HOST}${libdir}/xulrunner-devel-${XULVERSION}/sdk/lib/ ${SYSROOT_DESTDIR}${STAGING_DIR_HOST}${libdir}/xulrunner-devel-${XULVERSION}/lib
91
92 install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
93 install -m 755 ${S}/dist/host/bin/host_xpidl ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/xpidl
94}
95
96__anonymous () {
97 if bb.data.getVar("SRCREV", d, True) == "1a622cb7c384":
98 bb.data.setVar("XULVERSION", "1.9.2a1pre", d)
99}