From 259001925d643c9f37843ff5712a42b8c4b4edbe Mon Sep 17 00:00:00 2001 From: humdinger Date: Sat, 27 Jan 2018 07:10:05 +0100 Subject: [PATCH] mailnews: update recipe to build again (#2146) Practically copying large parts of the BeZilla recipe and patch. Thanks, Diver! --- mail-client/mailnews/mailnews-2.0.0.25.recipe | 141 ++++-- .../patches/mailnews-2.0.0.25.patchset | 459 +++++++++++++++++- 2 files changed, 557 insertions(+), 43 deletions(-) diff --git a/mail-client/mailnews/mailnews-2.0.0.25.recipe b/mail-client/mailnews/mailnews-2.0.0.25.recipe index 9be115c3e..778024b8c 100644 --- a/mail-client/mailnews/mailnews-2.0.0.25.recipe +++ b/mail-client/mailnews/mailnews-2.0.0.25.recipe @@ -1,62 +1,138 @@ -SUMMARY="Fork of Mozilla Thunderbird for Haiku" +SUMMARY="A fork of Mozilla's email client Thunderbird" DESCRIPTION="Thunderbird is an open source mail client. \ It achieves balance between ease of use and customization, catering to the \ -needs of both casual and power users." +needs of both casual and power users. So does its fork MailNews." HOMEPAGE="https://github.com/mmadia/bezilla" -SOURCE_URI="git+https://github.com/mmadia/bezilla.git#686254" -REVISION="1" -LICENSE="MPL v1.1" COPYRIGHT="1995-2009 Mozilla Developers and Contributors" +LICENSE="MPL v1.1" +REVISION="2" +gitSrcRevision="6862542e81d0407f8fbdb8cf96a48fdc3156e902" +SOURCE_URI="$HOMEPAGE/archive/$gitSrcRevision.tar.gz" +CHECKSUM_SHA256="ecdb6e15bd3a48e4b3e036e7fe3c12341c36ddef621403c558a15441cf364d79" +SOURCE_DIR="bezilla-$gitSrcRevision" +PATCHES="mailnews-$portVersion.patchset" -ARCHITECTURES="x86_gcc2 x86 ?arm" -SECONDARY_ARCHITECTURES="x86_gcc2 x86 ?arm" +ARCHITECTURES="x86_gcc2 x86_64" PROVIDES=" - mailnews$secondaryArchSuffix = $portVersion - cmd:thunderbird$secondaryArchSuffix = $portVersion - app:MailNews$secondaryArchSuffix = $portVersion + mailnews = $portVersion + cmd:thunderbird = $portVersion + app:MailNews = $portVersion " - REQUIRES=" - haiku$secondaryArchSuffix + haiku + lib:libglib_2.0 + lib:libIDL_2 + lib:libintl + lib:libpng16 + lib:libz + " +if [ $effectiveTargetArchitecture == x86_64 ]; then + REQUIRES+=" + lib:libnspr4 + " +fi + +PROVIDES_devel=" + mailnews_devel = $portVersion + cmd:thunderbird_config = $portVersion + " +REQUIRES_devel=" + mailnews == $portVersion base " BUILD_REQUIRES=" - devel:libidl$secondaryArchSuffix - devel:libglib$secondaryArchSuffix + haiku_devel + devel:libIDL_2 + devel:libglib_2.0 + devel:libpng16 " +if [ $effectiveTargetArchitecture == x86_64 ]; then + BUILD_REQUIRES+=" + devel:libnspr4 + " +fi + BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:gcc$secondaryArchSuffix - cmd:make + cmd:gcc cmd:m4 + cmd:make cmd:gawk cmd:perl cmd:xargs cmd:tar cmd:zip - cmd:autoconf_2.13$secondaryArchSuffix - " - -PATCHES="mailnews-2.0.0.25.patchset" + cmd:autoconf_2.13 + cmd:libtoolize + cmd:pkg_config +" BUILD() { cd mozilla + pushd build/autoconf + chmod +x mozconfig-find + libtoolize -fci + popd autoconf-2.13 - pushd nsprpub - autoconf-2.13 - popd + # builtin version of libnspr4 doesn't built on x86_64 + if [ $effectiveTargetArchitecture = x86_gcc2 ]; then + pushd nsprpub + autoconf-2.13 + popd + fi pushd directory/c-sdk autoconf-2.13 popd - export MOZCONFIG=../supporting-files/mozilla-configs/mailnews.mozconfig + export MOZ_CO_PROJECT=mail + export MOZ_APP_NAME=MailNews + export MOZ_APP_DISPLAYNAME=MailNews + export AUTOCONF='autoconf-2.13' + export BUILD_OPT=1 + + if [ $effectiveTargetArchitecture == x86_64 ]; then + opt_flags='--enable-optimize=-O3 -fno-strict-aliasing -fpermissive' + fi + + if [ $effectiveTargetArchitecture = x86_gcc2 ]; then + opt_flags='--enable-optimize=-O3 -fthread-jumps -fforce-addr -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -malign-functions=4 -malign-jumps=4' + fi + + # export MOZCONFIG=../supporting-files/mozilla-configs/browser.mozconfig + # runConfigure breaks configure with opt_flags + # runConfigure --omit-dirs 'docDir dataRootDir' configure + + ./configure \ + --prefix=$prefix \ + --bindir=$binDir \ + --libdir=$libDir \ + --datadir=$prefix/data \ + --includedir=$includeDir \ + --mandir=$manDir \ + --enable-application=mail \ + --disable-updater \ + --disable-oji \ + --disable-svg \ + --disable-canvas \ + --with-system-png \ + --with-system-zlib \ + --with-system-nspr \ + --enable-nspr-threads \ + --disable-tests \ + --disable-ipv6 \ + --enable-cpp-rtti \ + --disable-cpp-exceptions \ + --disable-pedantic \ + --enable-static --disable-shared \ + --enable-strip \ + --enable-reorder \ + --disable-debug \ + "$opt_flags" - runConfigure --omit-dirs 'docDir dataRootDir' configure make $jobArgs } @@ -71,8 +147,7 @@ INSTALL() mv $appsDir/MailNews/thunderbird-bin $appsDir/MailNews/MailNews # creating the lib and add-ons - mkdir $appsDir/MailNews/lib - mkdir $appsDir/MailNews/add-ons + mkdir -p $appsDir/MailNews/{add-ons,lib} # arranging the files in lib and add-ons directories cd $appsDir/MailNews @@ -102,13 +177,3 @@ INSTALL() addAppDeskbarSymlink $appsDir/MailNews/MailNews } - -# ----- devel package ------------------------------------------------------- - -PROVIDES_devel=" - mailnews${secondaryArchSuffix}_devel = $portVersion - cmd:thunderbird_config$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mailnews$secondaryArchSuffix == $portVersion base - " diff --git a/mail-client/mailnews/patches/mailnews-2.0.0.25.patchset b/mail-client/mailnews/patches/mailnews-2.0.0.25.patchset index c773cb654..2a083397d 100644 --- a/mail-client/mailnews/patches/mailnews-2.0.0.25.patchset +++ b/mail-client/mailnews/patches/mailnews-2.0.0.25.patchset @@ -1,11 +1,11 @@ -From 26c3bfafc76c0e78a354b2c1ed265f057e9a25ea Mon Sep 17 00:00:00 2001 +From e6304426ad2434592cef1c142deb6defbaf2bf31 Mon Sep 17 00:00:00 2001 From: Theodore Kokkoris Date: Fri, 12 Dec 2014 13:45:46 +0200 Subject: Enable Haiku support in configure.in diff --git a/mozilla/configure.in b/mozilla/configure.in -index 23cc7e7..9bd8cb5 100755 +index 23cc7e7..9bd8cb5 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -885,12 +885,8 @@ if test -n "$CROSS_COMPILE"; then @@ -24,9 +24,459 @@ index 23cc7e7..9bd8cb5 100755 else OS_TARGET=`uname -s` -- -2.2.2 +2.15.1 +From 7ec730aacb0949bf310a32518a65db6dbb779452 Mon Sep 17 00:00:00 2001 +From: Sergei Reznikov +Date: Sun, 19 Apr 2015 20:59:27 +0300 +Subject: gcc5 fixes + + +diff --git a/mozilla/config/rules.mk b/mozilla/config/rules.mk +index bb8b09a..2b030ee 100644 +--- a/mozilla/config/rules.mk ++++ b/mozilla/config/rules.mk +@@ -669,7 +669,7 @@ ifdef IS_COMPONENT + $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components + $(ELF_DYNSTR_GC) $(FINAL_TARGET)/components/$(SHARED_LIBRARY) + ifdef BEOS_ADDON_WORKAROUND +- ( cd $(FINAL_TARGET)/components && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) ++ ( cd $(FINAL_TARGET)/components && $(CC) -shared -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) + endif + else # ! IS_COMPONENT + ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH))) +@@ -679,7 +679,7 @@ else + endif + $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET) + ifdef BEOS_ADDON_WORKAROUND +- ( cd $(FINAL_TARGET) && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) ++ ( cd $(FINAL_TARGET) && $(CC) -shared -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) + endif + endif # IS_COMPONENT + endif # SHARED_LIBRARY +diff --git a/mozilla/configure.in b/mozilla/configure.in +index 9bd8cb5..f6dba31 100644 +--- a/mozilla/configure.in ++++ b/mozilla/configure.in +@@ -1499,7 +1499,7 @@ case "$target" in + TARGET_MD_ARCH=beos + + DSO_PIC_CFLAGS=-fPIC +- DSO_LDOPTS='-nostart' ++ DSO_LDOPTS='-shared' + MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@' + MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@' + TK_LIBS='-lbe -lroot' +diff --git a/mozilla/directory/c-sdk/config/BeOS.mk b/mozilla/directory/c-sdk/config/BeOS.mk +index 881e644..01c3062 100644 +--- a/mozilla/directory/c-sdk/config/BeOS.mk ++++ b/mozilla/directory/c-sdk/config/BeOS.mk +@@ -66,7 +66,7 @@ CC = gcc + CCC = g++ + LD = gcc + RANLIB = ranlib +-DSO_LDOPTS = -nostart ++DSO_LDOPTS = -shared + PORT_FLAGS = -DHAVE_STRERROR + ifdef BUILD_OPT + OPTIMIZER = -O2 +diff --git a/mozilla/directory/c-sdk/configure.in b/mozilla/directory/c-sdk/configure.in +index ab471a1..1c3b91f 100644 +--- a/mozilla/directory/c-sdk/configure.in ++++ b/mozilla/directory/c-sdk/configure.in +@@ -824,7 +824,7 @@ case "$target" in + AC_DEFINE(BEOS) + AC_DEFINE(_POSIX_SOURCE) + DSO_CFLAGS=-fPIC +- DSO_LDOPTS=-nostart ++ DSO_LDOPTS=-shared + + MDCPUCFG_H=_beos.cfg + USE_BTHREADS=1 +diff --git a/mozilla/modules/libpref/src/prefapi.cpp b/mozilla/modules/libpref/src/prefapi.cpp +index b772070..155219b 100644 +--- a/mozilla/modules/libpref/src/prefapi.cpp ++++ b/mozilla/modules/libpref/src/prefapi.cpp +@@ -78,9 +78,6 @@ + #include + #endif + +-#ifdef XP_BEOS +-#include "Alert.h" +-#endif + + #define BOGUS_DEFAULT_INT_PREF_VALUE (-5632) + #define BOGUS_DEFAULT_BOOL_PREF_VALUE (-2) +diff --git a/mozilla/modules/libreg/src/vr_stubs.c b/mozilla/modules/libreg/src/vr_stubs.c +index f7f5a6f..94ec266 100644 +--- a/mozilla/modules/libreg/src/vr_stubs.c ++++ b/mozilla/modules/libreg/src/vr_stubs.c +@@ -619,7 +619,7 @@ long BUILDNUM = NS_BUILD_ID; + + REGERR vr_ParseVersion(char *verstr, VERSION *result); + +-#if defined(XP_UNIX) && !defined(XP_MACOSX) ++#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(XP_BEOS) + + #ifdef STANDALONE_REGISTRY + extern XP_File vr_fileOpen (const char *name, const char * mode) +diff --git a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp +index 9d427da..f15c296 100644 +--- a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp ++++ b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp +@@ -702,7 +702,7 @@ ns4xPlugin::CreatePlugin(nsIServiceManagerObsolete* aServiceMgr, + { + CheckClassInitialized(); + +-#if defined(XP_UNIX) && !defined(XP_MACOSX) ++#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(XP_BEOS) + + ns4xPlugin *plptr; + +@@ -900,7 +900,7 @@ ns4xPlugin::CreatePlugin(nsIServiceManagerObsolete* aServiceMgr, + plugin->SetPluginRefNum(pluginRefNum); + #endif // XP_MACOSX + +-#ifdef XP_BEOS ++#if defined (XP_BEOS) + // I just copied UNIX version. + // Makoto Hamanaka + +diff --git a/mozilla/nsprpub/pr/src/misc/prnetdb.c b/mozilla/nsprpub/pr/src/misc/prnetdb.c +index f758841..df83cb3 100644 +--- a/mozilla/nsprpub/pr/src/misc/prnetdb.c ++++ b/mozilla/nsprpub/pr/src/misc/prnetdb.c +@@ -90,7 +90,7 @@ PRLock *_pr_dnsLock = NULL; + #include /* pick up define for inet_addr */ + #include + #define _PR_HAVE_GETPROTO_R +-#define _PR_HAVE_GETPROTO_R_POINTER ++#define _PR_HAVE_GETPROTO_R_INT + #endif + + #if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \ +diff --git a/mozilla/security/coreconf/BeOS.mk b/mozilla/security/coreconf/BeOS.mk +index b42b71d..ff5269b 100644 +--- a/mozilla/security/coreconf/BeOS.mk ++++ b/mozilla/security/coreconf/BeOS.mk +@@ -59,7 +59,7 @@ else + CPU_ARCH = x86 + endif + +-MKSHLIB = $(CC) -nostart -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) ++MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) + ifdef BUILD_OPT + OPTIMIZER = -O2 + endif +diff --git a/mozilla/widget/src/beos/nsAppShell.cpp b/mozilla/widget/src/beos/nsAppShell.cpp +index fdcd236..49f26fb 100644 +--- a/mozilla/widget/src/beos/nsAppShell.cpp ++++ b/mozilla/widget/src/beos/nsAppShell.cpp +@@ -464,7 +464,7 @@ void *nsAppShell::GetNextEvent() + void *newitem = nsnull; + for (int i=0 ; i < PRIORITY_LEVELS ; i++) { + if (!events[i].IsEmpty()) { +- newitem = events[i].RemoveItem((long int)0); ++ newitem = events[i].RemoveItem((int32)0); + break; + } + } +diff --git a/mozilla/xpcom/build/nsXPCOMPrivate.h b/mozilla/xpcom/build/nsXPCOMPrivate.h +index 9fdb996..304d84f 100644 +--- a/mozilla/xpcom/build/nsXPCOMPrivate.h ++++ b/mozilla/xpcom/build/nsXPCOMPrivate.h +@@ -207,6 +207,8 @@ NS_GetFrozenFunctions(XPCOMFunctions *entryPoints, const char* libraryPath); + #define XPCOM_SEARCH_KEY "ADDON_PATH" + #define GRE_CONF_NAME ".gre.config" + #define GRE_CONF_PATH "/boot/home/config/settings/GRE/gre.conf" ++#define GRE_CONF_DIR "/boot/home/config/settings/GRE/" ++#define GRE_USER_CONF_DIR "/boot/home/config/settings/GRE/" + #define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX + #define XUL_DLL "libxul"MOZ_DLL_SUFFIX + +diff --git a/mozilla/xpcom/glue/nsGREGlue.cpp b/mozilla/xpcom/glue/nsGREGlue.cpp +index 752b2ca..dd21a21 100644 +--- a/mozilla/xpcom/glue/nsGREGlue.cpp ++++ b/mozilla/xpcom/glue/nsGREGlue.cpp +@@ -158,7 +158,7 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions, + snprintf(p, sizeof(p), "%s" XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL, env); + p[sizeof(p) - 1] = '\0'; + +-#if XP_UNIX ++#ifdef XP_UNIX + if (realpath(p, aBuffer)) + return NS_OK; + #elif XP_WIN +diff --git a/mozilla/xpcom/io/SpecialSystemDirectory.cpp b/mozilla/xpcom/io/SpecialSystemDirectory.cpp +index c3c7066..5807117 100644 +--- a/mozilla/xpcom/io/SpecialSystemDirectory.cpp ++++ b/mozilla/xpcom/io/SpecialSystemDirectory.cpp +@@ -82,8 +82,9 @@ + #include + #include + #include "prenv.h" ++#endif + +-#elif defined(XP_BEOS) ++#if defined(XP_BEOS) + + #include + #include +diff --git a/mozilla/xpcom/io/nsDirectoryServiceDefs.h b/mozilla/xpcom/io/nsDirectoryServiceDefs.h +index de28282..b2bfcb4 100644 +--- a/mozilla/xpcom/io/nsDirectoryServiceDefs.h ++++ b/mozilla/xpcom/io/nsDirectoryServiceDefs.h +@@ -189,7 +189,8 @@ + #define NS_OS2_DIR "OS2Dir" + #define NS_OS2_HOME_DIR NS_OS_HOME_DIR + #define NS_OS2_DESKTOP_DIR NS_OS_DESKTOP_DIR +-#elif defined (XP_BEOS) ++#endif ++#if defined (XP_BEOS) + #define NS_BEOS_SETTINGS_DIR "Setngs" + #define NS_BEOS_HOME_DIR NS_OS_HOME_DIR + #define NS_BEOS_DESKTOP_DIR NS_OS_DESKTOP_DIR +diff --git a/mozilla/xpcom/obsolete/nsSpecialSystemDirectory.cpp b/mozilla/xpcom/obsolete/nsSpecialSystemDirectory.cpp +index 0288d4a..63d2a12 100644 +--- a/mozilla/xpcom/obsolete/nsSpecialSystemDirectory.cpp ++++ b/mozilla/xpcom/obsolete/nsSpecialSystemDirectory.cpp +@@ -70,7 +70,8 @@ + #include + #include + #include "prenv.h" +-#elif defined(XP_BEOS) ++#endif ++#if defined(XP_BEOS) + #include + #include + #include +@@ -753,7 +754,7 @@ void nsSpecialSystemDirectory::operator = (SystemDirectories aSystemSystemDirect + + #endif + +-#ifdef XP_BEOS ++#if defined(XP_BEOS) + case BeOS_SettingsDirectory: + { + char path[MAXPATHLEN]; +diff --git a/mozilla/xpcom/threads/plevent.c b/mozilla/xpcom/threads/plevent.c +index 3d89f28..07da841 100644 +--- a/mozilla/xpcom/threads/plevent.c ++++ b/mozilla/xpcom/threads/plevent.c +@@ -169,8 +169,6 @@ struct PLEventQueue { + #elif defined(_WIN32) || defined(XP_OS2) + HWND eventReceiverWindow; + PRBool removeMsg; +-#elif defined(XP_BEOS) +- port_id eventport; + #elif defined(XP_MACOSX) + #if defined(MAC_USE_CFRUNLOOPSOURCE) + CFRunLoopSourceRef mRunLoopSource; +@@ -180,6 +178,10 @@ struct PLEventQueue { + EventHandlerRef eventHandlerRef; + #endif + #endif ++#if defined(XP_BEOS) ++ port_id eventport; ++#endif ++ + }; + + #define PR_EVENT_PTR(_qp) \ +@@ -1267,7 +1269,7 @@ _pl_NativeNotify(PLEventQueue* self) + status = SYS$SETEF(self->efn); + return ($VMS_STATUS_SUCCESS(status)) ? PR_SUCCESS : PR_FAILURE; + }/* --- end _pl_NativeNotify() --- */ +-#elif defined(XP_UNIX) && !defined(XP_MACOSX) ++#elif defined(XP_UNIX) && !defined(XP_MACOSX)&& !defined(XP_BEOS) + + static PRStatus + _pl_NativeNotify(PLEventQueue* self) +@@ -1377,8 +1379,9 @@ _pl_AcknowledgeNativeNotify(PLEventQueue* self) + sys$clref(self->efn); + return PR_SUCCESS; + #elif defined(XP_UNIX) && !defined(XP_MACOSX) +- ++#define NOTIFY_TOKEN 0xFA + PRInt32 count; ++ unsigned char buf[] = { NOTIFY_TOKEN }; + unsigned char c; + PR_LOG(event_lm, PR_LOG_DEBUG, + ("_pl_AcknowledgeNativeNotify: self=%p", +diff --git a/supporting-files/mozilla-configs/browser.mozconfig b/supporting-files/mozilla-configs/browser.mozconfig +index 43bac3b..a1058df 100644 +--- a/supporting-files/mozilla-configs/browser.mozconfig ++++ b/supporting-files/mozilla-configs/browser.mozconfig +@@ -4,6 +4,8 @@ + + . $topsrcdir/browser/config/mozconfig + mk_add_options MOZ_CO_PROJECT=browser ++mk_add_options MOZ_APP_DISPLAYNAME=BeZilla ++mk_add_options MOZ_LIBDIR=$prefix/BeZilla + + # Required to download the right version of the source code + mk_add_options MOZ_CO_TAG=MOZILLA_1_8_BRANCH +@@ -13,19 +15,11 @@ mk_add_options CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot + + # ----------------------------------------------------- + # --- EDIT THESE VALUES TO REFLECT YOUR LOCAL BUILD --- +-export GLIB_CONFIG=/boot/common/bin/glib-config +-mk_add_options GLIB_CONFIG=/boot/common/bin/glib-config +- +-export LIBIDL_CONFIG=/boot/common/bin/libIDL-config +-mk_add_options LIBIDL_CONFIG=/boot/common/bin/libIDL-config + + # --- Set the outputdir for the build --- + mk_add_options MOZ_OBJDIR=/moz_obj/browser + +-# autoconf 2.13 was built by +-#./configure --prefix=/boot/common/autoconf-2.13 --program-suffix=-2.13 --bindir=/boot/common/bin/ +-# make && make install +-export AUTOCONF='/boot/common/bin/autoconf-2.13 -m /boot/common/autoconf-2.13/share/autoconf' ++export AUTOCONF='autoconf-2.13' + # ----------------------------------------------------- + + # Automatic updates not currently supported on BeOS. Delete this when we add this feature. +@@ -40,8 +34,9 @@ ac_add_options --disable-canvas + + # Utilize Haiku's default shared libraries + ac_add_options --with-system-jpeg +-#ac_add_options --with-system-png ++ac_add_options --with-system-png + ac_add_options --with-system-zlib ++ac_add_options --with-system-nspr + + ac_add_options --enable-nspr-threads + +@@ -55,13 +50,17 @@ ac_add_options --enable-cpp-rtti + # Eliminate lots of relatively useless warnings during build + ac_add_options --disable-cpp-exceptions + ++# Workaround for floating-point literal cannot appear in a constant-expression ++ac_add_options --disable-pedantic ++ + # Optional optimizations + export BUILD_OPT=1 + mk_add_options BUILD_OPT=1 + ac_add_options --enable-static --disable-shared + ac_add_options --enable-strip + ac_add_options --enable-reorder +-ac_add_options --enable-js-static-build ++#ac_add_options --enable-js-static-build ++ac_add_options --disable-debug + #ac_add_options --enable-elf-dynstr-gc # doesn't build in gcc2. gcc4 untested. + + # ---------------------------------------------------------------------------- +@@ -71,11 +70,11 @@ ac_add_options --enable-js-static-build + # Uncomment the first line for GCC 2, the second line for GCC 4. + # + # --- GCC2 --- +-ac_add_options '--enable-optimize=-O3 -march=pentium -mcpu=pentiumpro -fthread-jumps -fforce-addr -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -malign-functions=4 -malign-jumps=4' ++ac_add_options '--enable-optimize=-O3 -fthread-jumps -fforce-addr -frerun-cse-after-loop -frerun-loop-opt -fexpensive-optimizations -malign-functions=4 -malign-jumps=4' + # + # --- GCC4 --- + # == This should be the GCC4 optimization string to use == +-#ac_add_options '--enable-optimize=-O3 -fno-strict-aliasing -march=i586 -mtune=pentiumpro' ++#ac_add_options '--enable-optimize=-O3 -fno-strict-aliasing -fpermissive' + # + # Read below for some history on how the above string was devised. + # +-- +2.15.1 + + +From 97982f850464d4822c1ae57fe25994e75db12ec7 Mon Sep 17 00:00:00 2001 +From: Sergei Reznikov +Date: Fri, 12 Jan 2018 02:21:03 +0300 +Subject: Fix build with newer png + + +diff --git a/mozilla/modules/libpr0n/decoders/png/nsPNGDecoder.cpp b/mozilla/modules/libpr0n/decoders/png/nsPNGDecoder.cpp +index 22947c1..ee4abfe 100644 +--- a/mozilla/modules/libpr0n/decoders/png/nsPNGDecoder.cpp ++++ b/mozilla/modules/libpr0n/decoders/png/nsPNGDecoder.cpp +@@ -171,7 +171,7 @@ static NS_METHOD ReadDataOut(nsIInputStream* in, + } + + // we need to do the setjmp here otherwise bad things will happen +- if (setjmp(decoder->mPNG->jmpbuf)) { ++ if (setjmp(png_jmpbuf(decoder->mPNG))) { + png_destroy_read_struct(&decoder->mPNG, &decoder->mInfo, NULL); + + decoder->mError = PR_TRUE; +@@ -227,7 +227,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr) + if (width > MOZ_PNG_MAX_DIMENSION || height > MOZ_PNG_MAX_DIMENSION) { + nsPNGDecoder *decoder = NS_STATIC_CAST(nsPNGDecoder*, + png_get_progressive_ptr(png_ptr)); +- longjmp(decoder->mPNG->jmpbuf, 1); ++ longjmp(png_jmpbuf(decoder->mPNG), 1); + } + #undef MOZ_PNG_MAX_DIMENSION + +@@ -307,7 +307,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr) + + decoder->mImage = do_CreateInstance("@mozilla.org/image/container;1"); + if (!decoder->mImage) +- longjmp(decoder->mPNG->jmpbuf, 5); // NS_ERROR_OUT_OF_MEMORY ++ longjmp(png_jmpbuf(decoder->mPNG), 5); // NS_ERROR_OUT_OF_MEMORY + + decoder->mImageLoad->SetImage(decoder->mImage); + +@@ -319,7 +319,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr) + + decoder->mFrame = do_CreateInstance("@mozilla.org/gfx/image/frame;2"); + if (!decoder->mFrame) +- longjmp(decoder->mPNG->jmpbuf, 5); // NS_ERROR_OUT_OF_MEMORY ++ longjmp(png_jmpbuf(decoder->mPNG), 5); // NS_ERROR_OUT_OF_MEMORY + + gfx_format format; + +@@ -341,7 +341,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr) + // then initalize the frame and append it to the container + nsresult rv = decoder->mFrame->Init(0, 0, width, height, format, 24); + if (NS_FAILED(rv)) +- longjmp(decoder->mPNG->jmpbuf, 5); // NS_ERROR_OUT_OF_MEMORY ++ longjmp(png_jmpbuf(decoder->mPNG), 5); // NS_ERROR_OUT_OF_MEMORY + + decoder->mImage->AppendFrame(decoder->mFrame); + +@@ -362,7 +362,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr) + decoder->ibpr = bpr; + decoder->interlacebuf = (PRUint8 *)nsMemory::Alloc(decoder->ibpr*height); + if (!decoder->interlacebuf) { +- longjmp(decoder->mPNG->jmpbuf, 5); // NS_ERROR_OUT_OF_MEMORY ++ longjmp(png_jmpbuf(decoder->mPNG), 5); // NS_ERROR_OUT_OF_MEMORY + } + } + +@@ -555,7 +555,7 @@ void + error_callback(png_structp png_ptr, png_const_charp error_msg) + { + PR_LOG(gPNGLog, PR_LOG_ERROR, ("libpng error: %s\n", error_msg)); +- longjmp(png_ptr->jmpbuf, 1); ++ longjmp(png_jmpbuf(png_ptr), 1); + } + + +diff --git a/mozilla/modules/libpr0n/encoders/png/nsPNGEncoder.cpp b/mozilla/modules/libpr0n/encoders/png/nsPNGEncoder.cpp +index 473fbbf..1934ada 100644 +--- a/mozilla/modules/libpr0n/encoders/png/nsPNGEncoder.cpp ++++ b/mozilla/modules/libpr0n/encoders/png/nsPNGEncoder.cpp +@@ -111,9 +111,7 @@ NS_IMETHODIMP nsPNGEncoder::InitFromData(const PRUint8* aData, + + // initialize + png_struct* png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, +- png_voidp_NULL, +- png_error_ptr_NULL, +- png_error_ptr_NULL); ++ NULL, NULL, NULL); + if (! png_ptr) + return NS_ERROR_OUT_OF_MEMORY; + png_info* info_ptr = png_create_info_struct(png_ptr); +-- +2.15.1 + From 207233d6d8837083f36506f1e8a3fcfdce0f5c64 Mon Sep 17 00:00:00 2001 From: Sergei Reznikov @@ -77,5 +527,4 @@ index a49ad60..98b123a 100644 # ---------------------------------------------------------------------------- -- -2.2.2 - +2.15.1