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