# HG changeset patch # User Mark Brand # Date 1348130586 -7200 # Node ID d733a98b84d6387bbf729d12dae21d32d6d54b65 # Parent 851daf6da276176063d24a0fa32dac2afb86d696# Parent 1d1285b1f6a0e72ca3d736f0a5a0a410f72ecb94 Merge branch 'stable' Conflicts: src/qt-1-cherrypicks.patch diff -r 1d1285b1f6a0 -r d733a98b84d6 .gitignore --- a/.gitignore Thu Sep 20 10:38:14 2012 +0200 +++ b/.gitignore Thu Sep 20 10:43:06 2012 +0200 @@ -1,3 +1,4 @@ +/settings.mk /usr/ /log/ /pkg diff -r 1d1285b1f6a0 -r d733a98b84d6 Makefile --- a/Makefile Thu Sep 20 10:38:14 2012 +0200 +++ b/Makefile Thu Sep 20 10:43:06 2012 +0200 @@ -4,6 +4,8 @@ JOBS := 1 TARGET := i686-pc-mingw32 SOURCEFORGE_MIRROR := freefr.dl.sourceforge.net +PKG_MIRROR := s3.amazonaws.com/mxe-pkg +PKG_CDN := d1yihgixbnrglp.cloudfront.net PWD := $(shell pwd) SHELL := bash @@ -13,6 +15,9 @@ LIBTOOLIZE := $(shell glibtoolize --help >/dev/null 2>&1 && echo g)libtoolize PATCH := $(shell gpatch --help >/dev/null 2>&1 && echo g)patch SED := $(shell gsed --help >/dev/null 2>&1 && echo g)sed +WGET := wget --no-check-certificate \ + --user-agent=$(shell wget --version | \ + $(SED) -n 's,GNU \(Wget\) \([0-9.]*\).*,\1/\2,p') REQUIREMENTS := autoconf automake bash bison bzip2 cmake flex \ gcc intltoolize $(LIBTOOL) $(LIBTOOLIZE) \ @@ -26,7 +31,7 @@ TMP_DIR = $(PWD)/tmp-$(1) MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) TOP_DIR := $(patsubst %/,%,$(dir $(MAKEFILE))) -PKGS := $(shell $(SED) -n 's/^.* id="\([^"]*\)-package".*$$/\1/p' '$(TOP_DIR)/index.html') +PKGS := $(shell $(SED) -n 's/^.* id="\([^"]*\)-package">.*$$/\1/p' '$(TOP_DIR)/index.html') PATH := $(PREFIX)/bin:$(PATH) CMAKE_TOOLCHAIN_FILE := $(PREFIX)/$(TARGET)/share/cmake/mxe-conf.cmake @@ -61,12 +66,29 @@ DOWNLOAD_PKG_ARCHIVE = \ mkdir -p '$(PKG_DIR)' && \ $(if $($(1)_URL_2), \ - ( wget -T 30 -t 3 --no-check-certificate -O- '$($(1)_URL)' || wget --no-check-certificate -O- '$($(1)_URL_2)' ), \ - wget --no-check-certificate -O- '$($(1)_URL)') \ + ( $(WGET) -T 30 -t 3 -O- '$($(1)_URL)' || \ + $(WGET) -O- '$($(1)_URL_2)' || \ + $(WGET) -O- '$(PKG_MIRROR)/$($(1)_FILE)' || \ + $(WGET) -O- '$(PKG_CDN)/$($(1)_FILE)' ), \ + ( $(WGET) -O- '$($(1)_URL)' || \ + $(WGET) -O- '$(PKG_MIRROR)/$($(1)_FILE)' || \ + $(WGET) -O- '$(PKG_CDN)/$($(1)_FILE)' )) \ $(if $($(1)_FIX_GZIP), \ | gzip -d | gzip -9n, \ ) \ - > '$(PKG_DIR)/$($(1)_FILE)' + > '$(PKG_DIR)/$($(1)_FILE)' || rm -f '$(PKG_DIR)/$($(1)_FILE)' + +ifeq ($(IGNORE_SETTINGS),yes) + $(info [ignore settings.mk]) +else ifeq ($(wildcard $(PWD)/settings.mk),$(PWD)/settings.mk) + include $(PWD)/settings.mk +else + $(info [create settings.mk]) + $(shell { \ + echo '#JOBS = $(JOBS)'; \ + echo '#PKGS ='; \ + } >'$(PWD)/settings.mk') +endif .PHONY: all all: $(PKGS) diff -r 1d1285b1f6a0 -r d733a98b84d6 index.html --- a/index.html Thu Sep 20 10:38:14 2012 +0200 +++ b/index.html Thu Sep 20 10:43:06 2012 +0200 @@ -668,7 +668,7 @@
aptitude install -R autoconf automake bash bison bzip2 \
                     cmake flex gettext git g++ intltool \
-                    libtool libltdl-dev openssl libssl-dev \
+                    libffi-dev libtool libltdl-dev openssl libssl-dev \
                     libxml-parser-perl make patch perl \
                     pkg-config scons sed unzip wget \
                     xz-utils yasm
@@ -683,7 +683,7 @@
yum install autoconf automake bash bison bzip2 cmake \
             flex gcc-c++ gettext git intltool make sed \
-            libtool openssl-devel patch perl pkgconfig \
+            libffi-devel libtool openssl-devel patch perl pkgconfig \
             scons yasm unzip wget xz

@@ -695,7 +695,7 @@

pkg_add -r automake111 autoconf268 bash bison cmake \
-           flex gettext git gmake gsed intltool libtool \
+           flex gettext git gmake gsed intltool libffi libtool \
            openssl patch perl p5-XML-Parser pkg-config \
            scons unzip wget yasm
@@ -719,7 +719,7 @@
pacman-g2 -S autoconf automake bash bzip2 bison cmake \
-             flex gcc gettext git intltool make sed libtool \
+             flex gcc gettext git intltool make sed libffi libtool \
              openssl patch perl perl-xml-parser pkgconfig \
              scons unzip wget xz xz-lzma yasm
@@ -736,7 +736,7 @@ dev-util/cmake sys-devel/flex sys-devel/gcc \ sys-devel/gettext dev-vcs/git \ dev-util/intltool sys-devel/make sys-apps/sed \ - sys-devel/libtool dev-libs/openssl sys-devel/patch \ + dev-libs/libffi sys-devel/libtool dev-libs/openssl sys-devel/patch \ dev-lang/perl dev-perl/XML-Parser \ dev-util/pkgconfig dev-util/scons app-arch/unzip \ net-misc/wget app-arch/xz-utils dev-lang/yasm @@ -752,7 +752,7 @@

sudo port install autoconf automake bison cmake flex \
-                  gettext git-core gsed intltool libtool \
+                  gettext git-core gsed intltool libffi libtool \
                   openssl p5-xml-parser pkgconfig scons \
                   wget xz yasm

@@ -764,7 +764,7 @@

zypper install -R autoconf automake bash bison bzip2 \
                   cmake flex gcc-c++ gettext-tools git \
-                  intltool libtool make openssl \
+                  intltool libffi-devel libtool make openssl \
                   libopenssl-devel patch perl \
                   perl-XML-Parser pkg-config scons \
                   sed unzip wget xz yasm
@@ -914,8 +914,23 @@ Anti-Grain Geometry + apr-util + 1.3.10 + APR-util + + + apr + 1.4.2 + APR + + + armadillo + 3.4.0 + Armadillo C++ linear algebra library + + atk - 2.2.0 + 2.4.0 ATK @@ -945,7 +960,7 @@ boost - 1.49.0 + 1.51.0 Boost C++ Library @@ -955,7 +970,7 @@ cairo - 1.10.2 + 1.12.2 cairo @@ -970,10 +985,15 @@ cgal - 4.0 + 4.0.2 cgal + cminpack + 1.2.0 + cminpack + + cppunit 1.12.1 CppUnit @@ -985,12 +1005,12 @@ curl - 7.25.0 + 7.27.0 cURL dbus - 1.5.12 + 1.6.4 dbus @@ -1025,12 +1045,12 @@ ffmpeg - 0.10.2 + 0.11.2 ffmpeg fftw - 3.3.1 + 3.3.2 fftw @@ -1050,7 +1070,7 @@ fontconfig - 2.9.0 + 2.10.1 fontconfig @@ -1070,12 +1090,12 @@ freetype - 2.4.9 + 2.4.10 freetype fribidi - 0.19.2 + 0.19.4 FriBidi @@ -1085,27 +1105,27 @@ gc - 7.1 + 7.2d gc gcc - 4.7.0 + 4.7.1 GCC gcc-gmp - 5.0.4 + 5.0.5 GMP for GCC gcc-mpc - 0.9 + 1.0.1 MPC for GCC gcc-mpfr - 3.1.0 + 3.1.1 MPFR for GCC @@ -1115,22 +1135,22 @@ gdal - 1.9.0 + 1.9.1 GDAL gdb - 7.4 + 7.5 gdb gdk-pixbuf - 2.22.1 + 2.26.1 GDK-pixbuf geos - 3.3.2 + 3.3.5 GEOS @@ -1140,37 +1160,37 @@ giflib - 4.1.6 + 5.0.0 giflib glew - 1.7.0 + 1.9.0 GLEW glib - 2.28.8 + 2.32.3 GLib glibmm - 2.28.2 + 2.32.0 GLibmm gmp - 5.0.4 + 5.0.5 GMP gnutls - 3.0.17 + 3.0.19 GnuTLS graphicsmagick - 1.3.14 + 1.3.16 GraphicsMagick @@ -1180,35 +1200,40 @@ gsoap - 2.8.8 + 2.8.10 gSOAP gst-plugins-base - 0.10.35 + 0.10.36 gst-plugins-base gst-plugins-good - 0.10.30 + 0.10.31 gst-plugins-good gstreamer - 0.10.35 + 0.10.36 gstreamer gta - 1.0.2 + 1.0.3 gta gtk2 - 2.24.4 + 2.24.10 GTK+ + gtkGLArea + 2.0.1 + GtkGLArea + + gtkglext 1.2.0 GtkGLExt @@ -1230,7 +1255,7 @@ gtksourceviewmm2 - 2.10.1 + 2.10.3 GtkSourceViewmm @@ -1239,6 +1264,11 @@ GNU Guile + hunspell + 1.3.2 + Hunspell + + id3lib 3.8.3 id3lib @@ -1265,7 +1295,7 @@ json-c - 0.9 + 0.10 json-c @@ -1280,7 +1310,7 @@ lcms - 2.3 + 2.4 lcms @@ -1289,6 +1319,11 @@ lcms1 + levmar + 2.6 + levmar + + libarchive 3.0.3 Libarchive @@ -1310,12 +1345,17 @@ libevent - 2.0.18 + 2.0.20 libevent + libf2c + 1 + libf2c + + libffi - 3.0.10 + 3.0.11 libffi @@ -1324,16 +1364,31 @@ libgcrypt + libgda + 4.2.13 + libgda + + + libgdamm + 4.1.3 + libgdamm + + libgee 0.5.0 libgee libgeotiff - 1.3.0 + 1.4.0 GeoTiff + libglade + 2.6.4 + glade + + libgnurx 2.5.1 libgnurx @@ -1350,12 +1405,12 @@ libgsasl - 1.6.1 + 1.8.0 Libgsasl libgsf - 1.14.22 + 1.14.23 libgsf @@ -1380,7 +1435,7 @@ libidn - 1.24 + 1.25 Libidn @@ -1409,13 +1464,18 @@ libmng + libmodplug + 0.8.8.4 + libmodplug + + libntlm 1.3 Libntlm liboauth - 0.9.6 + 0.9.7 liboauth @@ -1435,18 +1495,23 @@ libpaper - 1.1.24+nmu1 + 1.1.24+nmu2 libpaper libpng - 1.5.10 + 1.5.12 libpng librsvg - 2.36.0 + 2.36.3 librsvg + + + librtmp + 2.4 + librtmp libsamplerate @@ -1455,7 +1520,7 @@ libshout - 2.2.2 + 2.3.1 libshout @@ -1470,7 +1535,7 @@ libssh2 - 1.4.0 + 1.4.2 libssh2 @@ -1490,22 +1555,22 @@ libvpx - 1.0.0 + 1.1.0 vpx libxml++ - 2.35.2 + 2.35.3 libxml2 libxml2 - 2.7.8 + 2.8.0 libxml2 libxslt - 1.1.26 + 1.1.27 libxslt @@ -1514,8 +1579,13 @@ llvm + log4cxx + 0.10.0 + log4cxx + + lua - 5.1.4 + 5.2.0 Lua @@ -1529,23 +1599,28 @@ matio + mdbtools + 0.7 + mdbtools + + mingw-utils 0.4-1 MinGW Utilities mingwrt - 3.20 + 3.20-2 MinGW Runtime mpfr - 3.1.0 + 3.1.1 mpfr muparser - 1.34 + 2.2.2 muParser @@ -1554,8 +1629,13 @@ Mini-XML + ncurses + 5.9 + Ncurses + + nettle - 2.4 + 2.5 nettle @@ -1575,7 +1655,7 @@ openal - 1.13 + 1.14 openal @@ -1600,22 +1680,22 @@ openssl - 1.0.1 + 1.0.1c openssl pango - 1.29.3 + 1.30.1 Pango pangomm - 2.28.2 + 2.28.4 Pangomm pcre - 8.30 + 8.31 PCRE @@ -1624,8 +1704,13 @@ PDcurses + plibc + 0.1.7 + Plibc + + pdflib_lite - 7.0.5 + 7.0.5p3 PDFlib Lite @@ -1640,7 +1725,7 @@ pixman - 0.25.2 + 0.27.2 pixman @@ -1659,18 +1744,23 @@ POCO C++ Libraries + poppler + 0.20.2 + poppler + + popt 1.16 popt portaudio - 19_20071207 + 19_20111121 portaudio postgresql - 9.1.3 + 9.2.0 PostgreSQL @@ -1679,21 +1769,36 @@ proj + protobuf + 2.4.1 + protobuf + + pthreads - 2-8-0 + 2-9-1 Pthreads-w32 + qdbm + 1.8.78 + QDBM + + qjson 0.7.1 QJson qt - 4.8.1 + 4.8.3 Qt + qwt + 6.0.1 + Qwt + + qwtplot3d 0.2.7 QwtPlot3D @@ -1744,18 +1849,23 @@ smpeg + sox + 14.4.0 + SoX + + speex 1.2rc1 Speex sqlite - 3071100 + 3071400 SQLite suitesparse - 3.7.0 + 4.0.2 SuiteSparse @@ -1765,7 +1875,7 @@ taglib - 1.7.1 + 1.7.2 TagLib @@ -1775,7 +1885,7 @@ tiff - 4.0.1 + 4.0.2 LibTIFF @@ -1800,7 +1910,7 @@ vorbis - 1.3.2 + 1.3.3 Vorbis @@ -1820,7 +1930,7 @@ wt - 3.2.0 + 3.2.1 Wt @@ -1834,18 +1944,23 @@ x264 + xapian-core + 1.2.10 + Xapian-Core + + xerces 3.1.1 Xerces-C++ xine-lib - 1.1.20.1 + 1.1.21 xine-lib xmlwrapp - 0.6.2 + 0.6.3 xmlwrapp @@ -1855,12 +1970,12 @@ xz - 5.0.3 + 5.0.4 XZ zlib - 1.2.6 + 1.2.7 zlib @@ -1944,6 +2059,23 @@
  • + Add your package to the list of packages. +

    +

    + Each package gets its own table row element with table cells having IDs + specifying your .mk file, package version and website: +

    +
    +<tr>
    +    <td id="gettext-package">gettext</td>
    +    <td id="gettext-version">0.18.1.1</td>
    +    <td id="gettext-website"><a href="http://www.gnu.org/software/gettext/">gettext</a></td>
    +</tr>
    +        
    +
  • + +
  • +

    Write your $(PKG)_BUILD. If your library has a ./configure script, enable/disable all dependency libraries explicitly @@ -2058,6 +2190,7 @@ make$(MAKE) patch$(PATCH) sed$(SED) + wget$(WGET)

  • diff -r 1d1285b1f6a0 -r d733a98b84d6 src/agg-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/agg-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,27 @@ +This file is part of MXE. +See index.html for further information. + +From 2617d6a743ad197dc7ae0278a9c7015cc7dff61f Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Tue, 12 Jun 2012 17:05:49 +0200 +Subject: [PATCH] automake 1.12 compatibility fix + +--- + configure.in | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/configure.in b/configure.in +index fceca82..317e17b 100644 +--- a/configure.in ++++ b/configure.in +@@ -8,7 +8,6 @@ dnl Checks for programs. + AC_PROG_CC + AC_PROG_CXX + AC_ISC_POSIX +-AM_C_PROTOTYPES + if test "x$U" != "x"; then + AC_MSG_ERROR(Compiler not ANSI compliant) + fi +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/agg.mk --- a/src/agg.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/agg.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc freetype sdl define $(PKG)_UPDATE - wget -q -O- 'http://www.antigrain.com/download/index.html' | \ + $(WGET) -q -O- 'http://www.antigrain.com/download/index.html' | \ $(SED) -n 's,.* + +using namespace arma; + +int main() +{ + mat A = randu(50,50); + mat B = trans(A)*A; // generate a symmetric matrix + + vec eigval; + mat eigvec; + + // use standard algorithm by default + eig_sym(eigval, eigvec, B); + + // use divide & conquer algorithm + eig_sym(eigval, eigvec, B, "dc"); + return 0; +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/armadillo.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/armadillo.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,29 @@ +# This file is part of MXE. +# See index.html for further information. + +# armadillo +PKG := armadillo +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := e7fdb6518172aabaa28c84412b52db7d86ef37a5 +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/arma/$($(PKG)_FILE) +$(PKG)_DEPS := gcc boost blas lapack + +define $(PKG)_UPDATE + wget -q -O- 'http://sourceforge.net/projects/arma/files/' | \ + $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && cmake . -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' + $(MAKE) -C '$(1)' -j '$(JOBS)' install VERBOSE=1 + + # note: don't use -Werror with GCC 4.7.0 and .1 + '$(TARGET)-g++' \ + -W -Wall \ + '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-armadillo.exe' \ + -larmadillo -llapack -lblas -lgfortran + -lboost_serialization-mt -lboost_thread_win32-mt -lboost_system-mt +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/atk-1-DllMain.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/atk-1-DllMain.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,12 @@ +diff -uNr atk-2.2.0-orig/atk/atkobject.c atk-2.2.0/atk/atkobject.c +--- atk-2.2.0-orig/atk/atkobject.c 2011-09-19 19:06:54.000000000 +0200 ++++ atk-2.2.0/atk/atkobject.c 2012-04-14 20:26:12.763814596 +0200 +@@ -366,7 +366,7 @@ + static HMODULE atk_dll; + + BOOL WINAPI +-DllMain (HINSTANCE hinstDLL, ++atk_DllMain (HINSTANCE hinstDLL, + DWORD fdwReason, + LPVOID lpvReserved) + { diff -r 1d1285b1f6a0 -r d733a98b84d6 src/atk.mk --- a/src/atk.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/atk.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := atk $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 3f4daf31f99b6e0c12ce9675400f2f02dbf1b820 +$(PKG)_CHECKSUM := ca13d01660bdcd5262ef6cedb8a64542ff8aa804 $(PKG)_SUBDIR := atk-$($(PKG)_VERSION) -$(PKG)_FILE := atk-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := atk-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/atk/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_DEPS := gcc glib gettext define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/atk/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/atk/refs/tags' | \ grep ']*>\([0-9][^<]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/aubio.mk --- a/src/aubio.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/aubio.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc fftw libsamplerate libsndfile define $(PKG)_UPDATE - wget -q -O- 'http://www.aubio.org/download' | \ + $(WGET) -q -O- 'http://www.aubio.org/download' | \ $(SED) -n 's,.*aubio-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/binutils.mk --- a/src/binutils.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/binutils.mk Thu Sep 20 10:43:06 2012 +0200 @@ -11,7 +11,7 @@ $(PKG)_DEPS := define $(PKG)_UPDATE - wget -q -O- 'http://ftp.gnu.org/gnu/binutils/?C=M;O=D' | \ + $(WGET) -q -O- 'http://ftp.gnu.org/gnu/binutils/?C=M;O=D' | \ $(SED) -n 's,.*$(TARGET)-windres $(TARGET)-ar ;' > '$(1)/user-config.jam' - # make the build script generate .a library files instead of .lib - $(SED) -i 's,windows : lib ;,windows : a ;,' '$(1)/tools/build/v2/tools/types/lib.jam' # compile boost jam cd '$(1)/tools/build/v2/engine' && ./build.sh cd '$(1)' && tools/build/v2/engine/bin.*/bjam \ @@ -45,5 +47,8 @@ -W -Wall -Werror -ansi -U__STRICT_ANSI__ -pedantic \ '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-boost.exe' \ -DBOOST_THREAD_USE_LIB \ - -lboost_serialization-mt -lboost_thread_win32-mt + -lboost_serialization-mt \ + -lboost_thread_win32-mt \ + -lboost_system-mt \ + -lboost_chrono-mt endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/bzip2.mk --- a/src/bzip2.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/bzip2.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.bzip.org/downloads.html' | \ + $(WGET) -q -O- 'http://www.bzip.org/downloads.html' | \ grep 'bzip2-' | \ $(SED) -n 's,.*bzip2-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/cairo-1-ssize-t-defined.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cairo-1-ssize-t-defined.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,18 @@ +This file is part of MXE. +See index.html for further information. + +Insist that ssize_t is defined. + +diff --git a/util/cairo-missing/cairo-missing.h b/util/cairo-missing/cairo-missing.h +index 7e4f0a3..c20b869 100644 +--- a/util/cairo-missing/cairo-missing.h ++++ b/util/cairo-missing/cairo-missing.h +@@ -37,6 +37,8 @@ + #include + #include + ++#define _SSIZE_T_DEFINED 1 ++ + #ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #include diff -r 1d1285b1f6a0 -r d733a98b84d6 src/cairo-2-static-init.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cairo-2-static-init.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,27 @@ +This file is part of MXE. +See index.html for further information. + +When DllMain is not being run, we need to initialize the font face mutex before using it. + +diff --git a/src/win32/cairo-win32-font.c b/src/win32/cairo-win32-font.c +index a65d81b..31d854d 100644 +--- a/src/win32/cairo-win32-font.c ++++ b/src/win32/cairo-win32-font.c +@@ -1912,6 +1912,8 @@ _cairo_win32_font_face_hash_table_destroy (void) + { + cairo_hash_table_t *hash_table; + ++ CAIRO_MUTEX_INITIALIZE (); ++ + /* We manually acquire the lock rather than calling + * _cairo_win32_font_face_hash_table_lock simply to avoid creating + * the table only to destroy it again. */ +@@ -1927,6 +1929,8 @@ _cairo_win32_font_face_hash_table_destroy (void) + static cairo_hash_table_t * + _cairo_win32_font_face_hash_table_lock (void) + { ++ CAIRO_MUTEX_INITIALIZE (); ++ + CAIRO_MUTEX_LOCK (_cairo_win32_font_face_mutex); + + if (unlikely (cairo_win32_font_face_hash_table == NULL)) diff -r 1d1285b1f6a0 -r d733a98b84d6 src/cairo.mk --- a/src/cairo.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/cairo.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := cairo $(PKG)_IGNORE := -$(PKG)_CHECKSUM := ccce5ae03f99c505db97c286a0c9a90a926d3c6e +$(PKG)_CHECKSUM := bc2ee50690575f16dab33af42a2e6cdc6451e3f9 $(PKG)_SUBDIR := cairo-$($(PKG)_VERSION) -$(PKG)_FILE := cairo-$($(PKG)_VERSION).tar.gz +$(PKG)_FILE := cairo-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://cairographics.org/releases/$($(PKG)_FILE) $(PKG)_DEPS := gcc zlib libpng fontconfig freetype pixman define $(PKG)_UPDATE - wget -q -O- 'http://cairographics.org/releases/?C=M;O=D' | \ + $(WGET) -q -O- 'http://cairographics.org/releases/?C=M;O=D' | \ $(SED) -n 's,.*"cairo-\([0-9][^"]*\)\.tar.*,\1,p' | \ head -1 endef @@ -20,6 +20,7 @@ $(SED) -i 's,^\(Libs:.*\),\1 @CAIRO_NONPKGCONFIG_LIBS@,' '$(1)/src/cairo.pc.in' cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --disable-gtk-doc \ @@ -33,7 +34,6 @@ --disable-quartz-image \ --disable-os2 \ --disable-beos \ - --disable-glitz \ --disable-directfb \ --disable-atomic \ --enable-win32 \ @@ -44,6 +44,7 @@ --enable-pdf \ --enable-svg \ --disable-pthread \ + CFLAGS="$(CFLAGS) -DCAIRO_WIN32_STATIC_BUILD" \ LIBS="-lmsimg32 -lgdi32 `$(TARGET)-pkg-config pixman-1 --libs`" $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/cairomm.mk --- a/src/cairomm.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/cairomm.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc cairo libsigc++ define $(PKG)_UPDATE - wget -q -O- 'http://cairographics.org/releases/?C=M;O=D' | \ + $(WGET) -q -O- 'http://cairographics.org/releases/?C=M;O=D' | \ $(SED) -n 's,.*"cairomm-\([0-9][^"]*\)\.tar.*,\1,p' | \ grep -v '^1\.8\.' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/cgal-1-fixes.patch --- a/src/cgal-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/cgal-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -1,19 +1,17 @@ This file is part of MXE. See index.html for further information. -Contains ad hoc patches for cross building. - -From a2df8b5dea68d02643faa69b7119628eb1751d5e Mon Sep 17 00:00:00 2001 -From: MXE +From 036e8f90ce7f2f1302a2603b89ae7661211c090d Mon Sep 17 00:00:00 2001 +From: Mark Brand Date: Fri, 21 Oct 2011 23:08:52 +0200 -Subject: [PATCH 1/3] adjustments for MXE +Subject: [PATCH 1/4] adjustments for mingw-cross-env diff --git a/CMakeLists.txt b/CMakeLists.txt -index a0ef19a..bb8c02f 100644 +index af8be68..61a5ee7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -359,6 +359,8 @@ message( STATUS "System: ${CMAKE_SYSTEM_NAME}" ) +@@ -400,6 +400,8 @@ message( STATUS "System: ${CMAKE_SYSTEM_NAME}" ) # #-------------------------------------------------------------------------------------------------- @@ -249,7 +247,7 @@ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} diff --git a/include/CGAL/Constrained_Delaunay_triangulation_2.h b/include/CGAL/Constrained_Delaunay_triangulation_2.h -index bb59f8c..9cebb51 100644 +index c89e7f7..57a5d40 100644 --- a/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -390,7 +390,7 @@ is_flipable(Face_handle f, int i, bool perturb) const @@ -271,13 +269,13 @@ if (os == ON_ORIENTED_BOUNDARY && is_infinite(fh)) { -- -1.7.7 +1.7.10.4 -From 7393c43ef7534fc8a9289992cdcb9ebefa293680 Mon Sep 17 00:00:00 2001 -From: MXE +From a455aa3d21f432831ccafcffc90bc7baf766ce6b Mon Sep 17 00:00:00 2001 +From: Mark Brand Date: Fri, 18 Nov 2011 00:08:25 +0100 -Subject: [PATCH 2/3] prevent Qt's moc from choking on BOOST_JOIN +Subject: [PATCH 2/4] prevent Qt's moc from choking on BOOST_JOIN Taken from: https://lists-sop.inria.fr/sympa/arc/cgal-discuss/2011-11/msg00087.html @@ -300,32 +298,52 @@ else() -- -1.7.7 +1.7.10.4 + + +From 7225ba1e69c3e4501706e73e2f1e61e3d1313bfa Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Fri, 6 Jul 2012 09:27:49 +0200 +Subject: [PATCH 3/4] update "detected" Qt version -From ac8a99188725f1cb848c6cec3e33c52363754797 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Wed, 28 Mar 2012 00:25:48 +1100 -Subject: [PATCH 3/3] Cmake min version 2.8.6 is only for Windows DLLs +diff --git a/TryRunResults.cgal.cmake b/TryRunResults.cgal.cmake +index 299de90..f11ddc6 100644 +--- a/TryRunResults.cgal.cmake ++++ b/TryRunResults.cgal.cmake +@@ -192,7 +192,7 @@ SET( ZLIB_RUN_RES__TRYRUN_OUTPUT + CACHE STRING "version=1.2.5" FORCE) + SET( QT4_RUN_RES + 0 +- CACHE STRING "version=4.8.0" FORCE) ++ CACHE STRING "version=4.8.2" FORCE) + SET( QT4_RUN_RES__TRYRUN_OUTPUT + 0 +- CACHE STRING "version=4.8.0" FORCE) ++ CACHE STRING "version=4.8.2" FORCE) +-- +1.7.10.4 -http://www.cgal.org/Manual/latest/doc_html/installation_manual/Chapter_installation_manual.html - -Section 3: -"On Windows, CMake version 2.8.6 or higher is required, for a proper support of DLLs generation." -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bb8c02f..1f0a4cb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ - project(CGAL CXX) - - # Minimal version of CMake: --if(WIN32) -+if(WIN32 AND BUILD_SHARED_LIBS) - cmake_minimum_required(VERSION 2.8.6) - else() - cmake_minimum_required(VERSION 2.6.2) +From c6a34b69b8c538456fa23d07f2914aef6395bcf7 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Wed, 18 Jul 2012 00:43:17 +0200 +Subject: [PATCH 4/4] boost 1.50 compatibility + + +diff --git a/cmake/modules/CGAL_SetupBoost.cmake b/cmake/modules/CGAL_SetupBoost.cmake +index fc3dc11..d72074fd 100644 +--- a/cmake/modules/CGAL_SetupBoost.cmake ++++ b/cmake/modules/CGAL_SetupBoost.cmake +@@ -3,7 +3,7 @@ if ( NOT CGAL_Boost_Setup ) + include(CGAL_TweakFindBoost) + # In the documentation, we say we require Boost-1.39, but technically we + # require 1.33.1. Some packages may require more recent versions, though. +- find_package( Boost 1.33.1 REQUIRED thread ) ++ find_package( Boost 1.33.1 REQUIRED thread system chrono ) + + message( STATUS "Boost include: ${Boost_INCLUDE_DIRS}" ) + message( STATUS "Boost libraries: ${Boost_LIBRARIES}" ) -- -1.7.7 +1.7.10.4 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/cgal.mk --- a/src/cgal.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/cgal.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := cgal $(PKG)_IGNORE := -$(PKG)_CHECKSUM := d1f3f328bc5cb026ddb825cb585c7ae27a8856f7 +$(PKG)_CHECKSUM := 20c58ebc021754e8be35237bcda43b0084f60617 $(PKG)_SUBDIR := CGAL-$($(PKG)_VERSION) $(PKG)_FILE := CGAL-$($(PKG)_VERSION).tar.xz -$(PKG)_URL := https://gforge.inria.fr/frs/download.php/30385/$($(PKG)_FILE) +$(PKG)_URL := https://gforge.inria.fr/frs/download.php/31176/$($(PKG)_FILE) $(PKG)_DEPS := gcc boost gmp mpfr qt define $(PKG)_UPDATE - wget -q --no-check-certificate -O- 'https://gforge.inria.fr/frs/?group_id=52' | \ + $(WGET) -q -O- 'https://gforge.inria.fr/frs/?group_id=52' | \ grep 'CGAL-' | \ $(SED) -n 's,.*CGAL-\([0-9][^>a-z]*\)\.tar.*,\1,p' | \ head -1 @@ -19,7 +19,6 @@ define $(PKG)_BUILD cd '$(1)' && cmake \ -DCGAL_INSTALL_CMAKE_DIR:STRING="lib/CGAL" \ - -DCMAKE_BUILD_TYPE:STRING="Release" \ -DCGAL_INSTALL_INC_DIR:STRING="include" \ -DCGAL_INSTALL_DOC_DIR:STRING="share/doc/CGAL-3.9" \ -DCGAL_INSTALL_BIN_DIR:STRING="bin" \ @@ -41,6 +40,7 @@ -DBOOST_USE_STATIC_LIBS=1 \ -DBUILD_SHARED_LIBS=0 \ -DCGAL_DIR:STRING="../.." . + $(MAKE) -C '$(1)/examples/AABB_tree' -j $(JOBS) $(MAKE) -C '$(1)' -j $(JOBS) install $(INSTALL) '$(1)/examples/AABB_tree/AABB_polyhedron_edge_example.exe' '$(PREFIX)/$(TARGET)/bin/test-cgal.exe' diff -r 1d1285b1f6a0 -r d733a98b84d6 src/cminpack.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cminpack.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,27 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := cminpack +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 7ac79d8623d0bc6c95c61e0c364ca9e38e8a13ca +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://devernay.free.fr/hacks/cminpack/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://devernay.free.fr/hacks/cminpack/cminpack.html' | \ + $(SED) -n 's,.*cminpack-\([0-9.]*\)\.tar.*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && cmake \ + -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' + $(MAKE) -C '$(1)' -j $(JOBS) + + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib' + $(INSTALL) -m644 '$(1)/libcminpack.a' '$(PREFIX)/$(TARGET)/lib/' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/include' + $(INSTALL) -m644 '$(1)/cminpack.h' '$(PREFIX)/$(TARGET)/include/' +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/cppunit.mk --- a/src/cppunit.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/cppunit.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/cppunit/files/cppunit/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/cppunit/files/cppunit/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/cunit.mk --- a/src/cunit.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/cunit.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/cunit/files/CUnit/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/cunit/files/CUnit/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/curl-1-fixes.patch --- a/src/curl-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/curl-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -1,33 +1,31 @@ This file is part of MXE. See index.html for further information. -Commits backported (cherry-picked) from upstream. -http://github.com/bagder/curl -Also contains MXE specific fixes. +From 29c2441e39372b34dfac348954385d2fecb361d1 Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Mon, 6 Aug 2012 15:04:25 +0200 +Subject: [PATCH] gtls: fix build failure by including nettle-specific headers -From ee69c33117cf616c19e9cd288f08eb4c91bf190d Mon Sep 17 00:00:00 2001 -From: Volker Grabsch -Date: Fri, 28 Oct 2011 13:48:04 +0200 -Subject: [PATCH] static linking for MXE - ---- - include/curl/curlbuild.h.in | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) +Bug: http://curl.haxx.se/bug/view.cgi?id=3554668 +Reported by: Anthony G. Basile +(cherry picked from commit 986c7949c0638bebb99bd08d63216433254c2185) -diff --git a/include/curl/curlbuild.h.in b/include/curl/curlbuild.h.in -index fe348f4..c428273 100644 ---- a/include/curl/curlbuild.h.in -+++ b/include/curl/curlbuild.h.in -@@ -111,6 +111,9 @@ - /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */ - /* ================================================================ */ +diff --git a/lib/gtls.c b/lib/gtls.c +index d981ef1..c750a6f 100644 +--- a/lib/gtls.c ++++ b/lib/gtls.c +@@ -34,7 +34,10 @@ -+/* Configure process defines this to 1 when static linking is requested. */ -+#undef CURL_STATICLIB -+ - /* Configure process defines this to 1 when it finds out that system */ - /* header file ws2tcpip.h must be included by the external interface. */ - #undef CURL_PULL_WS2TCPIP_H + #include + #include +-#ifndef USE_GNUTLS_NETTLE ++#ifdef USE_GNUTLS_NETTLE ++#include ++#include ++#else + #include + #endif + -- -1.7.8.3 +1.7.10.4 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/curl.mk --- a/src/curl.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/curl.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,20 +3,19 @@ PKG := curl $(PKG)_IGNORE := -$(PKG)_CHECKSUM := f6016a24051d98806ca3ddf754592701cb66e00c +$(PKG)_CHECKSUM := 51f563587720b71047b6e307412d49ce24ad7bfb $(PKG)_SUBDIR := curl-$($(PKG)_VERSION) $(PKG)_FILE := curl-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := http://curl.haxx.se/download/$($(PKG)_FILE) $(PKG)_DEPS := gcc gnutls libidn libssh2 define $(PKG)_UPDATE - wget -q -O- 'http://curl.haxx.se/download/?C=M;O=D' | \ + $(WGET) -q -O- 'http://curl.haxx.se/download/?C=M;O=D' | \ $(SED) -n 's,.*curl-\([0-9][^"]*\)\.tar.*,\1,p' | \ head -1 endef define $(PKG)_BUILD - cd '$(1)' && ./buildconf cd '$(1)' && ./configure \ --host='$(TARGET)' \ --build="`config.guess`" \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/dbus-1-fixes.patch --- a/src/dbus-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/dbus-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -3,32 +3,10 @@ Contains ad hoc patches for cross building. -From 9c99802fc9d0e3b2c90b00ba877ae8be9bab615f Mon Sep 17 00:00:00 2001 -From: MXE -Date: Tue, 4 Jan 2011 00:47:49 +0100 -Subject: [PATCH 1/2] always static in MXE - - -diff --git a/dbus/dbus-macros.h b/dbus/dbus-macros.h -index dcd3eeb..8324278 100644 ---- a/dbus/dbus-macros.h -+++ b/dbus/dbus-macros.h -@@ -172,6 +172,7 @@ - */ - - #if defined(_WIN32) -+# define DBUS_STATIC_BUILD - # if defined(DBUS_STATIC_BUILD) - # define DBUS_EXPORT - # elif defined(dbus_1_EXPORTS) --- -1.7.6.3 - - From d7bc1aff67132c09d154999c282e1b391bbe7a39 Mon Sep 17 00:00:00 2001 From: MXE Date: Fri, 23 Sep 2011 16:24:46 +0200 -Subject: [PATCH 2/2] add missing MemoryBarrier (MXE specific) +Subject: [PATCH 1/1] add missing MemoryBarrier (MXE specific) Windows API has this, but it's not in MinGW. See http://lists-archives.org/mingw-users/15935-missing-definition-of-memorybarrier.html diff -r 1d1285b1f6a0 -r d733a98b84d6 src/dbus.mk --- a/src/dbus.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/dbus.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := dbus $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 3140ea452337d664dbe6d30f0d990c756d101694 +$(PKG)_CHECKSUM := 17e619f008301592b7f01a60e7cf18e2752b5270 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://$(PKG).freedesktop.org/releases/$(PKG)/$($(PKG)_FILE) $(PKG)_DEPS := gcc expat define $(PKG)_UPDATE - wget -q -O- 'http://cgit.freedesktop.org/dbus/dbus/refs/tags' | \ + $(WGET) -q -O- 'http://cgit.freedesktop.org/dbus/dbus/refs/tags' | \ $(SED) -n "s,.*]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/exiv2.mk --- a/src/exiv2.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/exiv2.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc libiconv zlib expat define $(PKG)_UPDATE - wget -q -O- 'http://www.exiv2.org/download.html' | \ + $(WGET) -q -O- 'http://www.exiv2.org/download.html' | \ grep 'href="exiv2-' | \ $(SED) -n 's,.*exiv2-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/expat.mk --- a/src/expat.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/expat.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/expat/files/expat/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/expat/files/expat/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/faad2.mk --- a/src/faad2.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/faad2.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/faac/files/faad2-src/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/faac/files/faad2-src/' | \ $(SED) -n 's,.*faad2-\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/ffmpeg-1-pkgconfig.patch --- a/src/ffmpeg-1-pkgconfig.patch Thu Sep 20 10:38:14 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -This file is part of MXE. -See index.html for further information. - -This patch adds a libswresample dependency to libavfilter.pc, and a libavfilter -dependency to libavdevice.pc. Both issues have patches upstream, so this patch -can be dropped for the next FFmpeg version. - ---- ffmpeg-0.10/configure.orig 2012-03-09 21:18:38.403806202 +0100 -+++ ffmpeg-0.10/configure 2012-03-09 21:19:37.175808737 +0100 -@@ -3749,8 +3749,8 @@ - pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM" - pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION" - pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION" --pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION" --pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" -+pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION, libavfilter = $LIBAVFILTER_VERSION" -+pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libswresample = $LIBSWRESAMPLE_VERSION" - pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION" - pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" - pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" diff -r 1d1285b1f6a0 -r d733a98b84d6 src/ffmpeg.mk --- a/src/ffmpeg.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/ffmpeg.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,7 +3,7 @@ PKG := ffmpeg $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 743f44a71f93b14c9b26ca2424b0da8457cef4be +$(PKG)_CHECKSUM := 5d98729b8368df8145472ae6955ef8d6b9ed0efb $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := http://www.ffmpeg.org/releases/$($(PKG)_FILE) @@ -11,12 +11,13 @@ $(PKG)_DEPS := gcc bzip2 lame libvpx opencore-amr sdl speex theora vorbis x264 xvidcore zlib define $(PKG)_UPDATE - wget -q -O- 'http://www.ffmpeg.org/download.html' | \ + $(WGET) -q -O- 'http://www.ffmpeg.org/download.html' | \ $(SED) -n 's,.*ffmpeg-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef define $(PKG)_BUILD + '$(SED)' -i "s^[-]lvpx^`'$(TARGET)'-pkg-config --libs-only-l vpx`^g;" $(1)/configure cd '$(1)' && ./configure \ --cross-prefix='$(TARGET)'- \ --enable-cross-compile \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/fftw.mk --- a/src/fftw.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/fftw.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := fftw $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 3fecc492f576503a6a509d2073bd82b3fe0aef13 +$(PKG)_CHECKSUM := 11a8c31186ff5a7d686a79a3f21b2530888e0dc2 $(PKG)_SUBDIR := fftw-$($(PKG)_VERSION) $(PKG)_FILE := fftw-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://www.fftw.org/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.fftw.org/download.html' | \ + $(WGET) -q -O- 'http://www.fftw.org/download.html' | \ $(SED) -n 's,.*fftw-\([0-9][^>]*\)\.tar.*,\1,p' | \ grep -v alpha | \ grep -v beta | \ @@ -20,6 +20,7 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --enable-threads \ @@ -29,6 +30,7 @@ cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --enable-threads \ @@ -38,6 +40,7 @@ cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --enable-threads \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/file.mk --- a/src/file.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/file.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc libgnurx define $(PKG)_UPDATE - wget -q -O- 'ftp://ftp.astron.com/pub/file/' | \ + $(WGET) -q -O- 'ftp://ftp.astron.com/pub/file/' | \ grep 'file-' | \ $(SED) -n 's,.*file-\([0-9][^>]*\)\.tar.*,\1,p' | \ tail -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/flac.mk --- a/src/flac.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/flac.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc libiconv ogg define $(PKG)_UPDATE - wget -q -O- 'http://flac.cvs.sourceforge.net/viewvc/flac/flac/' | \ + $(WGET) -q -O- 'http://flac.cvs.sourceforge.net/viewvc/flac/flac/' | \ grep ']*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gdal-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/gdal-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,231 @@ +This file is part of MXE. +See index.html for further information. + +From a0c0640eb7e98db4a9cbe5104abef8425d975712 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Wed, 4 Jul 2012 10:05:33 +0200 +Subject: [PATCH 1/2] giflib compatibility + +Taken from http://trac.osgeo.org/gdal/changeset/24491?format=diff&new=24491 +--- + frmts/gif/gifdataset.cpp | 30 ++++++++++++++++++++++++------ + 1 file changed, 24 insertions(+), 6 deletions(-) + +diff --git a/frmts/gif/gifdataset.cpp b/frmts/gif/gifdataset.cpp +index c89f34c..1947edd 100644 +--- a/frmts/gif/gifdataset.cpp ++++ b/frmts/gif/gifdataset.cpp +@@ -470,6 +470,28 @@ GDALDataset *GIFDataset::Open( GDALOpenInfo * poOpenInfo ) + } + + /************************************************************************/ ++/* GDALPrintGifError() */ ++/************************************************************************/ ++ ++static void GDALPrintGifError(const char* pszMsg) ++{ ++/* GIFLIB_MAJOR is only defined in libgif >= 4.2.0 */ ++/* libgif 4.2.0 has retired PrintGifError() and added GifErrorString() */ ++#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \ ++ ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4) ++ /* Static string actually, hence the const char* cast */ ++ const char* pszGIFLIBError = (const char*) GifErrorString(); ++ if (pszGIFLIBError == NULL) ++ pszGIFLIBError = "Unknown error"; ++ CPLError( CE_Failure, CPLE_AppDefined, ++ "%s. GIFLib Error : %s", pszMsg, pszGIFLIBError ); ++#else ++ PrintGifError(); ++ CPLError( CE_Failure, CPLE_AppDefined, "%s", pszMsg ); ++#endif ++} ++ ++/************************************************************************/ + /* CreateCopy() */ + /************************************************************************/ + +@@ -596,9 +618,7 @@ GIFDataset::CreateCopy( const char * pszFilename, GDALDataset *poSrcDS, + psGifCT->ColorCount, 255, psGifCT) == GIF_ERROR) + { + FreeMapObject(psGifCT); +- PrintGifError(); +- CPLError( CE_Failure, CPLE_AppDefined, +- "Error writing gif file." ); ++ GDALPrintGifError("Error writing gif file."); + EGifCloseFile(hGifFile); + VSIFCloseL( fp ); + return NULL; +@@ -622,9 +642,7 @@ GIFDataset::CreateCopy( const char * pszFilename, GDALDataset *poSrcDS, + + if (EGifPutImageDesc(hGifFile, 0, 0, nXSize, nYSize, bInterlace, NULL) == GIF_ERROR ) + { +- PrintGifError(); +- CPLError( CE_Failure, CPLE_AppDefined, +- "Error writing gif file." ); ++ GDALPrintGifError("Error writing gif file."); + EGifCloseFile(hGifFile); + VSIFCloseL( fp ); + return NULL; +-- +1.7.10.4 + + +From 7411f59dd769a72a79838e932d1a0988b04dc4d5 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Wed, 4 Jul 2012 10:42:33 +0200 +Subject: [PATCH 2/2] giflib 5 compatibility + +taken from +http://trac.osgeo.org/gdal/changeset/24627 +--- + frmts/gif/biggifdataset.cpp | 5 +++++ + frmts/gif/gifdataset.cpp | 43 ++++++++++++++++++++++++++++++++++++------- + 2 files changed, 41 insertions(+), 7 deletions(-) + +diff --git a/frmts/gif/biggifdataset.cpp b/frmts/gif/biggifdataset.cpp +index e3029e5..6bed0dc 100644 +--- a/frmts/gif/biggifdataset.cpp ++++ b/frmts/gif/biggifdataset.cpp +@@ -371,7 +371,12 @@ CPLErr BIGGIFDataset::ReOpen() + VSIFSeekL( fp, 0, SEEK_SET ); + + nLastLineRead = -1; ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 ++ int nError; ++ hGifFile = DGifOpen( fp, VSIGIFReadFunc, &nError ); ++#else + hGifFile = DGifOpen( fp, VSIGIFReadFunc ); ++#endif + if( hGifFile == NULL ) + { + CPLError( CE_Failure, CPLE_OpenFailed, +diff --git a/frmts/gif/gifdataset.cpp b/frmts/gif/gifdataset.cpp +index 1947edd..0b99158 100644 +--- a/frmts/gif/gifdataset.cpp ++++ b/frmts/gif/gifdataset.cpp +@@ -36,8 +36,17 @@ CPL_CVSID("$Id: gifdataset.cpp 23621 2011-12-20 23:26:56Z rouault $"); + CPL_C_START + void GDALRegister_GIF(void); + ++#if !(defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5) ++ + // This prototype seems to have been messed up! + GifFileType * EGifOpen(void* userData, OutputFunc writeFunc); ++ ++// Define alias compatible with giflib >= 5.0.0 ++#define GifMakeMapObject MakeMapObject ++#define GifFreeMapObject FreeMapObject ++ ++#endif // defined(GIFLIB_MAJOR) && GIFLIB_MAJOR < 5 ++ + CPL_C_END + + static const int InterlacedOffset[] = { 0, 4, 2, 1 }; +@@ -322,7 +331,12 @@ GDALDataset *GIFDataset::Open( GDALOpenInfo * poOpenInfo ) + if( fp == NULL ) + return NULL; + ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 ++ int nError; ++ hGifFile = DGifOpen( fp, VSIGIFReadFunc, &nError ); ++#else + hGifFile = DGifOpen( fp, VSIGIFReadFunc ); ++#endif + if( hGifFile == NULL ) + { + VSIFCloseL( fp ); +@@ -380,7 +394,12 @@ GDALDataset *GIFDataset::Open( GDALOpenInfo * poOpenInfo ) + DGifCloseFile( hGifFile ); + + VSIFSeekL( fp, 0, SEEK_SET); ++ ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 ++ hGifFile = DGifOpen( fp, VSIGIFReadFunc, &nError ); ++#else + hGifFile = DGifOpen( fp, VSIGIFReadFunc ); ++#endif + if( hGifFile == NULL ) + { + VSIFCloseL( fp ); +@@ -473,14 +492,19 @@ GDALDataset *GIFDataset::Open( GDALOpenInfo * poOpenInfo ) + /* GDALPrintGifError() */ + /************************************************************************/ + +-static void GDALPrintGifError(const char* pszMsg) ++static void GDALPrintGifError(GifFileType *hGifFile, const char* pszMsg) + { + /* GIFLIB_MAJOR is only defined in libgif >= 4.2.0 */ + /* libgif 4.2.0 has retired PrintGifError() and added GifErrorString() */ + #if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \ + ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4) + /* Static string actually, hence the const char* cast */ ++ ++#if GIFLIB_MAJOR >= 5 ++ const char* pszGIFLIBError = (const char*) GifErrorString(hGifFile->Error); ++#else + const char* pszGIFLIBError = (const char*) GifErrorString(); ++#endif + if (pszGIFLIBError == NULL) + pszGIFLIBError = "Unknown error"; + CPLError( CE_Failure, CPLE_AppDefined, +@@ -557,7 +581,12 @@ GIFDataset::CreateCopy( const char * pszFilename, GDALDataset *poSrcDS, + return NULL; + } + ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 ++ int nError; ++ hGifFile = EGifOpen( fp, VSIGIFWriteFunc, &nError ); ++#else + hGifFile = EGifOpen( fp, VSIGIFWriteFunc ); ++#endif + if( hGifFile == NULL ) + { + VSIFCloseL( fp ); +@@ -577,7 +606,7 @@ GIFDataset::CreateCopy( const char * pszFilename, GDALDataset *poSrcDS, + + if( poBand->GetColorTable() == NULL ) + { +- psGifCT = MakeMapObject( 256, NULL ); ++ psGifCT = GifMakeMapObject( 256, NULL ); + for( iColor = 0; iColor < 256; iColor++ ) + { + psGifCT->Colors[iColor].Red = (GifByteType) iColor; +@@ -593,7 +622,7 @@ GIFDataset::CreateCopy( const char * pszFilename, GDALDataset *poSrcDS, + while( nFullCount < poCT->GetColorEntryCount() ) + nFullCount = nFullCount * 2; + +- psGifCT = MakeMapObject( nFullCount, NULL ); ++ psGifCT = GifMakeMapObject( nFullCount, NULL ); + for( iColor = 0; iColor < poCT->GetColorEntryCount(); iColor++ ) + { + GDALColorEntry sEntry; +@@ -617,14 +646,14 @@ GIFDataset::CreateCopy( const char * pszFilename, GDALDataset *poSrcDS, + if (EGifPutScreenDesc(hGifFile, nXSize, nYSize, + psGifCT->ColorCount, 255, psGifCT) == GIF_ERROR) + { +- FreeMapObject(psGifCT); +- GDALPrintGifError("Error writing gif file."); ++ GifFreeMapObject(psGifCT); ++ GDALPrintGifError(hGifFile, "Error writing gif file."); + EGifCloseFile(hGifFile); + VSIFCloseL( fp ); + return NULL; + } + +- FreeMapObject(psGifCT); ++ GifFreeMapObject(psGifCT); + psGifCT = NULL; + + /* Support for transparency */ +@@ -642,7 +671,7 @@ GIFDataset::CreateCopy( const char * pszFilename, GDALDataset *poSrcDS, + + if (EGifPutImageDesc(hGifFile, 0, 0, nXSize, nYSize, bInterlace, NULL) == GIF_ERROR ) + { +- GDALPrintGifError("Error writing gif file."); ++ GDALPrintGifError(hGifFile, "Error writing gif file."); + EGifCloseFile(hGifFile); + VSIFCloseL( fp ); + return NULL; +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gdal.mk --- a/src/gdal.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gdal.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,7 +3,7 @@ PKG := gdal $(PKG)_IGNORE := -$(PKG)_CHECKSUM := e2eaaf0fba39137b40c0d3069ac41dfb6f3c76db +$(PKG)_CHECKSUM := c1eae556398ff7b9332afe9d3022dcd931130808 $(PKG)_SUBDIR := gdal-$($(PKG)_VERSION) $(PKG)_FILE := gdal-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://download.osgeo.org/gdal/$($(PKG)_FILE) @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc zlib libpng tiff libgeotiff jpeg jasper giflib expat sqlite curl geos postgresql gta define $(PKG)_UPDATE - wget -q -O- 'http://trac.osgeo.org/gdal/wiki/DownloadSource' | \ + $(WGET) -q -O- 'http://trac.osgeo.org/gdal/wiki/DownloadSource' | \ $(SED) -n 's,.*gdal-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef @@ -20,6 +20,7 @@ # The option '--without-threads' means native win32 threading without pthread. cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --with-bsb \ @@ -65,7 +66,6 @@ --without-ingres \ --without-dods-root \ --without-dwgdirect \ - --without-dwg-plt \ --without-idb \ --without-sde \ --without-epsilon \ @@ -73,7 +73,6 @@ --without-php \ --without-ruby \ --without-python \ - --without-macosx-framework \ LIBS="-ljpeg -lsecur32 `'$(TARGET)-pkg-config' --libs openssl libtiff-4`" $(MAKE) -C '$(1)' -j 1 lib-target $(MAKE) -C '$(1)' -j 1 install-lib diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gdb-2-fix-makeinfo.patch --- a/src/gdb-2-fix-makeinfo.patch Thu Sep 20 10:38:14 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -This file is part of MXE. -See index.html for further information. - -This patch has been taken from: -http://sourceware.org/bugzilla/show_bug.cgi?id=13638 - -=================================================================== -RCS file: /cvs/src/src/gdb/configure,v -retrieving revision 1.335.2.2 -retrieving revision 1.335.2.3 -diff -u -r1.335.2.2 -r1.335.2.3 ---- src/gdb/configure 2012/02/21 22:03:47 1.335.2.2 -+++ src/gdb/configure 2012/02/21 22:07:40 1.335.2.3 -@@ -995,6 +995,8 @@ - LIBS - CPPFLAGS - CPP -+MAKEINFO -+MAKEINFOFLAGS - YACC - YFLAGS - XMKMF' -@@ -1696,6 +1698,9 @@ - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor -+ MAKEINFO Parent configure detects if it is of sufficient version. -+ MAKEINFOFLAGS -+ Parameters for MAKEINFO. - YACC The `Yet Another C Compiler' implementation to use. Defaults to - the first program found out of: `bison -y', `byacc', `yacc'. - YFLAGS The list of arguments that will be passed by default to $YACC. -@@ -7158,59 +7163,9 @@ - - - --# Do we have a single-tree copy of texinfo? Even if we do, we can't --# rely on it - libiberty is built before texinfo. --# Extract the first word of "makeinfo", so it can be a program name with args. --set dummy makeinfo; ac_word=$2 --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 --$as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_MAKEINFO+set}" = set; then : -- $as_echo_n "(cached) " >&6 --else -- if test -n "$MAKEINFO"; then -- ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test. --else --as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -- ac_cv_prog_MAKEINFO="makeinfo" -- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done -- done --IFS=$as_save_IFS -- --fi --fi --MAKEINFO=$ac_cv_prog_MAKEINFO --if test -n "$MAKEINFO"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINFO" >&5 --$as_echo "$MAKEINFO" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --fi -- -- --if test "x$MAKEINFO" = "x"; then -- as_fn_error "makeinfo is required for compilation" "$LINENO" 5 --else -- case "$MAKEINFO" in -- */missing\ makeinfo*) -- as_fn_error "makeinfo is required for compilation" "$LINENO" 5 -- ;; -- esac --fi -- -+# We never need to detect it in this sub-configure. -+# But preserve it for config.status --recheck. - --# --split-size=5000000 may be already in $MAKEINFO from parent configure. --# Re-running configure in gdb/ would lose it so ensure it stays present. --MAKEINFOFLAGS=${MAKEINFOFLAGS---split-size=5000000} - - - MAKEINFO_EXTRA_FLAGS="" diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gdb.mk --- a/src/gdb.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gdb.mk Thu Sep 20 10:43:06 2012 +0200 @@ -2,7 +2,7 @@ # See index.html for further information. PKG := gdb -$(PKG)_CHECKSUM := 43a3ee582eae4d69c2babea4f8700b7bec8e37fa +$(PKG)_CHECKSUM := 79b61152813e5730fa670c89e5fc3c04b670b02c $(PKG)_SUBDIR := gdb-$($(PKG)_VERSION) $(PKG)_FILE := gdb-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := ftp://ftp.gnu.org/pub/gnu/$(PKG)/$($(PKG)_FILE) @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc expat libiconv zlib define $(PKG)_UPDATE - wget -q -O- 'http://ftp.gnu.org/gnu/gdb/?C=M;O=D' | \ + $(WGET) -q -O- 'http://ftp.gnu.org/gnu/gdb/?C=M;O=D' | \ $(SED) -n 's,.* -Date: Mon, 24 Jan 2011 10:39:22 +0000 -Subject: [PATCH 2/3] Use png_jmpbuf macro - -This makes the png loader compatible with libpng 1.5 ---- - gdk-pixbuf/io-png.c | 12 ++++++------ - 1 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c -index 79c81fd..76f3304 100644 ---- a/gdk-pixbuf/io-png.c -+++ b/gdk-pixbuf/io-png.c -@@ -183,7 +183,7 @@ png_simple_error_callback(png_structp png_save_ptr, - error_msg); - } - -- longjmp (png_save_ptr->jmpbuf, 1); -+ longjmp (png_jmpbuf(png_save_ptr), 1); - } - - static void -@@ -287,7 +287,7 @@ gdk_pixbuf__png_image_load (FILE *f, GError **error) - return NULL; - } - -- if (setjmp (png_ptr->jmpbuf)) { -+ if (setjmp (png_jmpbuf(png_ptr))) { - g_free (rows); - - if (pixbuf) -@@ -459,7 +459,7 @@ gdk_pixbuf__png_image_begin_load (GdkPixbufModuleSizeFunc size_func, - return NULL; - } - -- if (setjmp (lc->png_read_ptr->jmpbuf)) { -+ if (setjmp (png_jmpbuf(lc->png_read_ptr))) { - if (lc->png_info_ptr) - png_destroy_read_struct(&lc->png_read_ptr, NULL, NULL); - g_free(lc); -@@ -531,7 +531,7 @@ gdk_pixbuf__png_image_load_increment(gpointer context, - lc->error = error; - - /* Invokes our callbacks as needed */ -- if (setjmp (lc->png_read_ptr->jmpbuf)) { -+ if (setjmp (png_jmpbuf(lc->png_read_ptr))) { - lc->error = NULL; - return FALSE; - } else { -@@ -769,7 +769,7 @@ png_error_callback(png_structp png_read_ptr, - error_msg); - } - -- longjmp (png_read_ptr->jmpbuf, 1); -+ longjmp (png_jmpbuf(png_read_ptr), 1); - } - - static void -@@ -978,7 +978,7 @@ static gboolean real_save_png (GdkPixbuf *pixbuf, - success = FALSE; - goto cleanup; - } -- if (setjmp (png_ptr->jmpbuf)) { -+ if (setjmp (png_jmpbuf(png_ptr))) { - success = FALSE; - goto cleanup; - } --- -1.7.8 - - -From 98b7ca46c998a497a1bc6cd563e0201d0cd65de0 Mon Sep 17 00:00:00 2001 -From: Mark Brand -Date: Fri, 23 Dec 2011 18:54:01 +0100 -Subject: [PATCH 3/3] add libtiff-4 to Requires.private - ---- - gdk-pixbuf-2.0.pc.in | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/gdk-pixbuf-2.0.pc.in b/gdk-pixbuf-2.0.pc.in -index 7e61775..bc33627 100644 ---- a/gdk-pixbuf-2.0.pc.in -+++ b/gdk-pixbuf-2.0.pc.in -@@ -12,6 +12,7 @@ Name: GdkPixbuf - Description: Image loading and scaling - Version: @VERSION@ - Requires: gobject-2.0 gmodule-no-export-2.0 @PNG_DEP_CFLAGS_PACKAGES@ -+Requires.private: libtiff-4 - Libs: -L${libdir} -lgdk_pixbuf-@GDK_PIXBUF_API_VERSION@ @GDK_PIXBUF_EXTRA_LIBS@ - Cflags: -I${includedir}/gdk-pixbuf-@GDK_PIXBUF_API_VERSION@ @GDK_PIXBUF_EXTRA_CFLAGS@ - --- -1.7.8 - diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gdk-pixbuf-2-libtiff.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/gdk-pixbuf-2-libtiff.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,13 @@ +diff --git a/gdk-pixbuf-2.0.pc.in b/gdk-pixbuf-2.0.pc.in +index 7addefc..a07a46f 100644 +--- a/gdk-pixbuf-2.0.pc.in ++++ b/gdk-pixbuf-2.0.pc.in +@@ -12,7 +12,7 @@ Name: GdkPixbuf + Description: Image loading and scaling + Version: @VERSION@ + Requires: gobject-2.0 +-Requires.private: gmodule-no-export-2.0 @PNG_DEP_CFLAGS_PACKAGES@ ++Requires.private: gmodule-no-export-2.0 @PNG_DEP_CFLAGS_PACKAGES@ libtiff-4 + Libs: -L${libdir} -lgdk_pixbuf-@GDK_PIXBUF_API_VERSION@ + Libs.private: @GDK_PIXBUF_EXTRA_LIBS@ + Cflags: -I${includedir}/gdk-pixbuf-@GDK_PIXBUF_API_VERSION@ @GDK_PIXBUF_EXTRA_CFLAGS@ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gdk-pixbuf-3-allow-static.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/gdk-pixbuf-3-allow-static.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,31 @@ +diff --git a/configure.ac b/configure.ac +index d929c84..20f8121 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -126,16 +126,16 @@ case $host in + ;; + esac + +-if test "$os_win32" = "yes"; then +- if test x$enable_static = xyes -o x$enable_static = x; then +- AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.]) +- enable_static=no +- fi +- if test x$enable_shared = xno; then +- AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.]) +- fi +- enable_shared=yes +-fi ++dnl if test "$os_win32" = "yes"; then ++dnl if test x$enable_static = xyes -o x$enable_static = x; then ++dnl AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.]) ++dnl enable_static=no ++dnl fi ++dnl if test x$enable_shared = xno; then ++dnl AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.]) ++dnl fi ++dnl enable_shared=yes ++dnl fi + + dnl Initialize libtool + LT_PREREQ([2.2.6]) diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gdk-pixbuf.mk --- a/src/gdk-pixbuf.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gdk-pixbuf.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := gdk-pixbuf $(PKG)_IGNORE := -$(PKG)_CHECKSUM := b452208963ddd84f7280865695b50255fcafaa2e +$(PKG)_CHECKSUM := 43e4fe5bd8d19bc7d7b853f71c85c193392cb2f7 $(PKG)_SUBDIR := gdk-pixbuf-$($(PKG)_VERSION) -$(PKG)_FILE := gdk-pixbuf-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := gdk-pixbuf-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_DEPS := gcc glib libpng jpeg tiff jasper libiconv define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/gdk-pixbuf/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/gdk-pixbuf/refs/tags' | \ grep ']*>\([0-9]*\.[0-9]*[02468]\.[^<]*\)<.*,\1,p' | \ grep -v '^2\.9' | \ @@ -18,13 +18,15 @@ endef define $(PKG)_BUILD - cd '$(1)' && ./configure \ + cd '$(1)' && autoreconf && ./configure \ --host='$(TARGET)' \ --build="`config.guess`" \ + --enable-static \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --disable-modules \ --with-included-loaders \ + --without-gdiplus \ LIBS="`'$(TARGET)-pkg-config' --libs libtiff-4`" $(MAKE) -C '$(1)' -j '$(JOBS)' install endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/geos.mk --- a/src/geos.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/geos.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,7 +3,7 @@ PKG := geos $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 942b0bbc61a059bd5269fddd4c0b44a508670cb3 +$(PKG)_CHECKSUM := 791e2b36a9a6114c7f213fae3fc995960c35a428 $(PKG)_SUBDIR := geos-$($(PKG)_VERSION) $(PKG)_FILE := geos-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := http://download.osgeo.org/geos/$($(PKG)_FILE) @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://geos.refractions.net/' | \ + $(WGET) -q -O- 'http://geos.refractions.net/' | \ $(SED) -n 's,.*geos-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef @@ -19,9 +19,9 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ - --prefix='$(PREFIX)/$(TARGET)' \ - --disable-swig + --prefix='$(PREFIX)/$(TARGET)' $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= '$(TARGET)-gcc' \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gettext.mk --- a/src/gettext.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gettext.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc libiconv define $(PKG)_UPDATE - wget -q -O- 'http://www.gnu.org/software/gettext/' | \ + $(WGET) -q -O- 'http://www.gnu.org/software/gettext/' | \ grep 'gettext-' | \ $(SED) -n 's,.*gettext-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/giflib-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/giflib-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,32 @@ +This file is part of MXE. +See index.html for further information. + +From e0bcec52c73afb97b91449f1e91cd4da8bf1582f Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Wed, 4 Jul 2012 08:58:48 +0200 +Subject: [PATCH] fix dir delimiter for mingw + +--- + lib/egif_lib.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/lib/egif_lib.c b/lib/egif_lib.c +index 47be4d9..0e50b06 100644 +--- a/lib/egif_lib.c ++++ b/lib/egif_lib.c +@@ -17,11 +17,10 @@ two modules will be linked. Preserve this property! + + #ifdef _WIN32 + #include +-#include + #else + #include +-#include + #endif /* _WIN32 */ ++#include + + #include "gif_lib.h" + #include "gif_lib_private.h" +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/giflib.mk --- a/src/giflib.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/giflib.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,24 +3,30 @@ PKG := giflib $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 22680f604ec92065f04caf00b1c180ba74fb8562 +$(PKG)_CHECKSUM := 0b032c2104a0956e2f91b6c11ff8c5515421cd8b $(PKG)_SUBDIR := giflib-$($(PKG)_VERSION) $(PKG)_FILE := giflib-$($(PKG)_VERSION).tar.bz2 -$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/giflib/giflib-4.x/giflib-$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/giflib/giflib-5.x/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/giflib/files/giflib 4.x/' | \ - $(SED) -n 's,.*/giflib-\([0-9][^"]*\)/".*,\1,p' | \ + $(WGET) -q -O- 'http://giflib.git.sourceforge.net/git/gitweb.cgi?p=giflib/giflib;a=tags' | \ + grep ']*>\([0-9][^<]*\)<.*,\1,p' | \ + grep -v alpha | \ + grep -v beta | \ + grep -v rc | \ head -1 endef define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ + --prefix='$(PREFIX)/$(TARGET)' \ --disable-shared \ - --prefix='$(PREFIX)/$(TARGET)' \ --without-x \ CPPFLAGS='-D_OPEN_BINARY' + echo 'all:' > '$(1)/doc/Makefile' $(MAKE) -C '$(1)/lib' -j '$(JOBS)' install endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/glew.mk --- a/src/glew.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/glew.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := glew $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 9266f2360c1687a96f2ea06419671d370b2928d1 +$(PKG)_CHECKSUM := 9291f5c5afefd482c7f3e91ffb3cd4716c6c9ffe $(PKG)_SUBDIR := glew-$($(PKG)_VERSION) $(PKG)_FILE := glew-$($(PKG)_VERSION).tgz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/glew/glew/$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/glew/files/glew/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/glew/files/glew/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/glib-1-fixes.patch --- a/src/glib-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/glib-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -3,40 +3,21 @@ Contains ad hoc patches for cross building. -From 4693f62d3f01f7b7d26607e6eed843202cbf90f7 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Thu, 23 Sep 2010 21:36:04 +0200 -Subject: [PATCH 1/5] no gtk doc check +From 2a15b5d8c570d34e44d315116219bcd731054a54 Mon Sep 17 00:00:00 2001 +From: "a@mxe.cc" +Date: Thu, 23 Sep 2010 21:41:51 +0200 +Subject: [PATCH 1/8] optional gettext +--- + configure.ac | 4 ++-- + glib/gi18n.h | 5 +++++ + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index a821267..2e541d2 100644 +index cadd925..241284d 100644 --- a/configure.ac +++ b/configure.ac -@@ -2741,8 +2741,6 @@ dnl ************************** - dnl *** Checks for gtk-doc *** - dnl ************************** - --GTK_DOC_CHECK([1.15]) -- - AC_ARG_ENABLE(man, - [AC_HELP_STRING([--enable-man], - [regenerate man pages from Docbook [default=no]])],enable_man=yes, --- -1.7.1 - - -From 46d0d473e6fb32c5204d063cad5f5073d2a139a5 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Thu, 23 Sep 2010 21:41:51 +0200 -Subject: [PATCH 2/5] optional gettext - - -diff --git a/configure.ac b/configure.ac -index 2e541d2..18c2dea 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -464,8 +464,8 @@ AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS']) +@@ -479,8 +479,8 @@ AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS']) GLIB_GNU_GETTEXT if test "$gt_cv_have_gettext" != "yes" ; then @@ -65,17 +46,20 @@ #define _(String) gettext (String) -- -1.7.1 +1.7.10.4 -From 3473b5183b2e59d247cd1db053efc6c9ecaf2aab Mon Sep 17 00:00:00 2001 -From: MXE +From 6e19d772238eb429fe0ea77b65dbc9d8a5d89afa Mon Sep 17 00:00:00 2001 +From: "a@mxe.cc" Date: Thu, 23 Sep 2010 21:42:46 +0200 -Subject: [PATCH 3/5] fix tool paths +Subject: [PATCH 2/8] fix tool paths +--- + glib-2.0.pc.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in -index 3d1ac12..58e1ecf 100644 +index 4a8898e..5164bae 100644 --- a/glib-2.0.pc.in +++ b/glib-2.0.pc.in @@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@ @@ -92,60 +76,1155 @@ Name: GLib Description: C Utility Library -- -1.7.1 +1.7.10.4 -From 0e57514812500d5d4dee03e1be8059a25876dd99 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Thu, 23 Sep 2010 21:45:50 +0200 -Subject: [PATCH 4/5] fix dependency libs +From 556504bac07f4d80c0d9e50be1090f3ae02a653b Mon Sep 17 00:00:00 2001 +From: Hans Petter Jansson +Date: Fri, 15 Jun 2012 15:25:01 +0200 +Subject: [PATCH 3/8] Avoid DllMain symbol conflict when linking statically + +--- + gio/giomodule.c | 6 +----- + glib/glib-init.c | 6 +++--- + 2 files changed, 4 insertions(+), 8 deletions(-) + +diff --git a/gio/giomodule.c b/gio/giomodule.c +index d8ce138..679279f 100644 +--- a/gio/giomodule.c ++++ b/gio/giomodule.c +@@ -782,10 +782,8 @@ extern GType _g_network_monitor_netlink_get_type (void); + + static HMODULE gio_dll = NULL; + +-#ifdef DLL_EXPORT +- + BOOL WINAPI +-DllMain (HINSTANCE hinstDLL, ++gio_DllMain (HINSTANCE hinstDLL, + DWORD fdwReason, + LPVOID lpvReserved) + { +@@ -801,8 +799,6 @@ _g_io_win32_get_module (void) + return gio_dll; + } + +-#endif +- + #undef GIO_MODULE_DIR + + /* GIO_MODULE_DIR is used only in code called just once, +diff --git a/glib/glib-init.c b/glib/glib-init.c +index f4edd5c..02bf678 100644 +--- a/glib/glib-init.c ++++ b/glib/glib-init.c +@@ -226,9 +226,9 @@ glib_init (void) + HMODULE glib_dll; + + BOOL WINAPI +-DllMain (HINSTANCE hinstDLL, +- DWORD fdwReason, +- LPVOID lpvReserved) ++glib_DllMain (HINSTANCE hinstDLL, ++ DWORD fdwReason, ++ LPVOID lpvReserved) + { + switch (fdwReason) + { +-- +1.7.10.4 +From a83efeaa712bdfe43a1fcada6775ce2c89781631 Mon Sep 17 00:00:00 2001 +From: Hans Petter Jansson +Date: Fri, 15 Jun 2012 15:27:22 +0200 +Subject: [PATCH 4/8] Allow building without inotify support + +--- + configure.ac | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + diff --git a/configure.ac b/configure.ac -index 18c2dea..e472768 100644 +index 241284d..04d8590 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1700,11 +1700,18 @@ dnl ***************************** + dnl ** Check for inotify (GIO) ** + dnl ***************************** + inotify_support=no +-AC_CHECK_HEADERS([sys/inotify.h], +-[ ++ ++AC_ARG_ENABLE(inotify, ++ AC_HELP_STRING([--disable-inotify], ++ [build without inotify support])) ++ ++if test "x$enable_inotify" != "xno"; then ++ AC_CHECK_HEADERS([sys/inotify.h], ++ [ + inotify_support=yes + AC_CHECK_FUNCS(inotify_init1) +-]) ++ ]) ++fi + + AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"]) + +-- +1.7.10.4 + + +From e3d193f7e4f3d1ada0d65ccdccab1f28ef6d23d3 Mon Sep 17 00:00:00 2001 +From: Hans Petter Jansson +Date: Fri, 15 Jun 2012 15:28:14 +0200 +Subject: [PATCH 5/8] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF. + Backported from upstream + +--- + configure.ac | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 04d8590..29b6252 100644 --- a/configure.ac +++ b/configure.ac -@@ -2698,7 +2698,7 @@ case $host in - G_LIBS_EXTRA="-luser32 -lkernel32" - ;; - *-*-mingw*) -- G_LIBS_EXTRA="-lws2_32 -lole32" -+ G_LIBS_EXTRA="-lws2_32 -lole32 -lshlwapi" - ;; - *) - G_LIBS_EXTRA="" -diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in -index 58e1ecf..17b2133 100644 ---- a/glib-2.0.pc.in -+++ b/glib-2.0.pc.in -@@ -11,5 +11,5 @@ Name: GLib - Description: C Utility Library +@@ -452,6 +452,8 @@ fi + + AC_MSG_RESULT($enable_iconv_cache) + ++# Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF ++AS_IF([false], [AC_CHECK_HEADER([stdint.h])]) + + dnl + dnl zlib support +-- +1.7.10.4 + + +From 08b493b8480f360ab21a0ce5c79b096392a389a8 Mon Sep 17 00:00:00 2001 +From: Hans Petter Jansson +Date: Fri, 15 Jun 2012 15:29:06 +0200 +Subject: [PATCH 6/8] Link with dnsapi + +--- + gio-2.0.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in +index 9f7123f..b0d5779 100644 +--- a/gio-2.0.pc.in ++++ b/gio-2.0.pc.in +@@ -13,6 +13,6 @@ Description: glib I/O library Version: @VERSION@ - Libs: -L${libdir} -lglib-2.0 @INTLLIBS@ --Libs.private: @ICONV_LIBS@ -+Libs.private: @G_THREAD_LIBS@ @G_LIBS_EXTRA@ @PCRE_LIBS@ @INTLLIBS@ @ICONV_LIBS@ - Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include @GLIB_EXTRA_CFLAGS@ + Requires: glib-2.0 gobject-2.0 + Requires.private: gmodule-no-export-2.0 +-Libs: -L${libdir} -lgio-2.0 ++Libs: -L${libdir} -lgio-2.0 -ldnsapi + Libs.private: @ZLIB_LIBS@ @NETWORK_LIBS@ + Cflags: -- -1.7.1 +1.7.10.4 + + +From 645849d2055b1c7a46132a8b83739290b316ffba Mon Sep 17 00:00:00 2001 +From: Hans Petter Jansson +Date: Fri, 15 Jun 2012 15:29:38 +0200 +Subject: [PATCH 7/8] Ensure globals are initialized even when DllMain is not + being run + +--- + glib/gmain.c | 6 +++ + glib/gthread-win32.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 112 insertions(+) + +diff --git a/glib/gmain.c b/glib/gmain.c +index 760f179..878ac14 100644 +--- a/glib/gmain.c ++++ b/glib/gmain.c +@@ -1981,12 +1981,15 @@ g_get_real_time (void) + #ifdef G_OS_WIN32 + static ULONGLONG (*g_GetTickCount64) (void) = NULL; + static guint32 g_win32_tick_epoch = 0; ++static gboolean g_win32_clock_is_initialized; + + G_GNUC_INTERNAL void + g_clock_win32_init (void) + { + HMODULE kernel32; + ++ g_win32_clock_is_initialized = TRUE; ++ + g_GetTickCount64 = NULL; + kernel32 = GetModuleHandle ("KERNEL32.DLL"); + if (kernel32 != NULL) +@@ -2105,6 +2108,9 @@ g_get_monotonic_time (void) + * timeBeginPeriod() to increase it as much as they want + */ + ++ if (!g_win32_clock_is_initialized) ++ g_clock_win32_init (); ++ + if (g_GetTickCount64 != NULL) + { + guint32 ticks_as_32bit; +diff --git a/glib/gthread-win32.c b/glib/gthread-win32.c +index 5a9ac97..e4d1d48 100644 +--- a/glib/gthread-win32.c ++++ b/glib/gthread-win32.c +@@ -117,18 +117,28 @@ typedef struct + void (__stdcall * WakeConditionVariable) (gpointer cond); + } GThreadImplVtable; + ++/* Needed for static builds where DllMain initializer doesn't get called */ ++static gboolean g_threads_is_initialized; ++G_GNUC_INTERNAL void g_thread_win32_init (void); ++ + static GThreadImplVtable g_thread_impl_vtable; + + /* {{{1 GMutex */ + void + g_mutex_init (GMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.InitializeSRWLock (mutex); + } + + void + g_mutex_clear (GMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + if (g_thread_impl_vtable.DeleteSRWLock != NULL) + g_thread_impl_vtable.DeleteSRWLock (mutex); + } +@@ -136,18 +146,27 @@ g_mutex_clear (GMutex *mutex) + void + g_mutex_lock (GMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.AcquireSRWLockExclusive (mutex); + } + + gboolean + g_mutex_trylock (GMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + return g_thread_impl_vtable.TryAcquireSRWLockExclusive (mutex); + } + + void + g_mutex_unlock (GMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.ReleaseSRWLockExclusive (mutex); + } + +@@ -158,6 +177,9 @@ g_rec_mutex_impl_new (void) + { + CRITICAL_SECTION *cs; + ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + cs = g_slice_new (CRITICAL_SECTION); + InitializeCriticalSection (cs); + +@@ -168,6 +190,10 @@ static void + g_rec_mutex_impl_free (CRITICAL_SECTION *cs) + { + DeleteCriticalSection (cs); ++ ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_slice_free (CRITICAL_SECTION, cs); + } + +@@ -176,6 +202,9 @@ g_rec_mutex_get_impl (GRecMutex *mutex) + { + CRITICAL_SECTION *impl = mutex->p; + ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + if G_UNLIKELY (mutex->p == NULL) + { + impl = g_rec_mutex_impl_new (); +@@ -190,30 +219,45 @@ g_rec_mutex_get_impl (GRecMutex *mutex) + void + g_rec_mutex_init (GRecMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + mutex->p = g_rec_mutex_impl_new (); + } + + void + g_rec_mutex_clear (GRecMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_rec_mutex_impl_free (mutex->p); + } + + void + g_rec_mutex_lock (GRecMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + EnterCriticalSection (g_rec_mutex_get_impl (mutex)); + } + + void + g_rec_mutex_unlock (GRecMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + LeaveCriticalSection (mutex->p); + } + + gboolean + g_rec_mutex_trylock (GRecMutex *mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + return TryEnterCriticalSection (g_rec_mutex_get_impl (mutex)); + } + +@@ -222,12 +266,18 @@ g_rec_mutex_trylock (GRecMutex *mutex) + void + g_rw_lock_init (GRWLock *lock) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.InitializeSRWLock (lock); + } + + void + g_rw_lock_clear (GRWLock *lock) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + if (g_thread_impl_vtable.DeleteSRWLock != NULL) + g_thread_impl_vtable.DeleteSRWLock (lock); + } +@@ -235,36 +285,54 @@ g_rw_lock_clear (GRWLock *lock) + void + g_rw_lock_writer_lock (GRWLock *lock) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.AcquireSRWLockExclusive (lock); + } + + gboolean + g_rw_lock_writer_trylock (GRWLock *lock) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + return g_thread_impl_vtable.TryAcquireSRWLockExclusive (lock); + } + + void + g_rw_lock_writer_unlock (GRWLock *lock) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.ReleaseSRWLockExclusive (lock); + } + + void + g_rw_lock_reader_lock (GRWLock *lock) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.AcquireSRWLockShared (lock); + } + + gboolean + g_rw_lock_reader_trylock (GRWLock *lock) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + return g_thread_impl_vtable.TryAcquireSRWLockShared (lock); + } + + void + g_rw_lock_reader_unlock (GRWLock *lock) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.ReleaseSRWLockShared (lock); + } + +@@ -272,12 +340,18 @@ g_rw_lock_reader_unlock (GRWLock *lock) + void + g_cond_init (GCond *cond) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.InitializeConditionVariable (cond); + } + + void + g_cond_clear (GCond *cond) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + if (g_thread_impl_vtable.DeleteConditionVariable) + g_thread_impl_vtable.DeleteConditionVariable (cond); + } +@@ -285,12 +359,18 @@ g_cond_clear (GCond *cond) + void + g_cond_signal (GCond *cond) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.WakeConditionVariable (cond); + } + + void + g_cond_broadcast (GCond *cond) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.WakeAllConditionVariable (cond); + } + +@@ -298,6 +378,9 @@ void + g_cond_wait (GCond *cond, + GMutex *entered_mutex) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + g_thread_impl_vtable.SleepConditionVariableSRW (cond, entered_mutex, INFINITE, 0); + } + +@@ -308,6 +391,9 @@ g_cond_wait_until (GCond *cond, + { + gint64 span; + ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + span = end_time - g_get_monotonic_time (); + + if G_UNLIKELY (span < 0) +@@ -340,6 +426,9 @@ g_private_get_impl (GPrivate *key) + + if G_UNLIKELY (impl == 0) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + EnterCriticalSection (&g_private_lock); + impl = (DWORD) key->p; + if (impl == 0) +@@ -433,6 +522,9 @@ g_system_thread_free (GRealThread *thread) + { + GThreadWin32 *wt = (GThreadWin32 *) thread; + ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + win32_check_for_error (CloseHandle (wt->handle)); + g_slice_free (GThreadWin32, wt); + } +@@ -440,6 +532,9 @@ g_system_thread_free (GRealThread *thread) + void + g_system_thread_exit (void) + { ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + _endthreadex (0); + } + +@@ -448,6 +543,9 @@ g_thread_win32_proxy (gpointer data) + { + GThreadWin32 *self = data; + ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + self->proxy (self); + + g_system_thread_exit (); +@@ -465,6 +563,9 @@ g_system_thread_new (GThreadFunc func, + GThreadWin32 *thread; + guint ignore; + ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + thread = g_slice_new0 (GThreadWin32); + thread->proxy = func; + +@@ -494,6 +595,9 @@ g_system_thread_wait (GRealThread *thread) + { + GThreadWin32 *wt = (GThreadWin32 *) thread; + ++ if (!g_threads_is_initialized) ++ g_thread_win32_init (); ++ + win32_check_for_error (WAIT_FAILED != WaitForSingleObject (wt->handle, INFINITE)); + } + +@@ -985,6 +1089,8 @@ g_thread_lookup_native_funcs (void) + G_GNUC_INTERNAL void + g_thread_win32_init (void) + { ++ g_threads_is_initialized = TRUE; ++ + if (!g_thread_lookup_native_funcs ()) + g_thread_xp_init (); + +-- +1.7.10.4 -From 87931c81f6401fb0c25064ec0ba2edca9ec53924 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Sat, 25 Sep 2010 00:07:33 +0200 -Subject: [PATCH 5/5] add -ldnsapi to gio-2.0.pc +From e6c9e1075e9c176d0184cff07d6f2eef224ab608 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Mon, 18 Jun 2012 16:02:12 +0200 +Subject: [PATCH 8/8] kill docs and gtk-doc dependence (mxe-specific) +--- + Makefile.am | 5 +- + autogen.sh | 7 - + configure.ac | 2 - + docs/Makefile.am | 11 -- + docs/reference/Makefile.am | 3 - + docs/reference/gio/Makefile.am | 181 -------------------- + .../gio/gdbus-object-manager-example/Makefile.am | 68 -------- + docs/reference/glib/Makefile.am | 129 -------------- + docs/reference/gobject/Makefile.am | 103 ----------- + 9 files changed, 2 insertions(+), 507 deletions(-) + delete mode 100644 docs/Makefile.am + delete mode 100644 docs/reference/Makefile.am + delete mode 100644 docs/reference/gio/Makefile.am + delete mode 100644 docs/reference/gio/gdbus-object-manager-example/Makefile.am + delete mode 100644 docs/reference/glib/Makefile.am + delete mode 100644 docs/reference/gobject/Makefile.am -diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in -index 92cda85..7a4e224 100644 ---- a/gio-2.0.pc.in -+++ b/gio-2.0.pc.in -@@ -10,6 +10,6 @@ Name: GIO - Description: glib I/O library - Version: @VERSION@ - Requires: glib-2.0,gobject-2.0,gmodule-no-export-2.0 --Libs: -L${libdir} -lgio-2.0 -+Libs: -L${libdir} -lgio-2.0 -ldnsapi - Libs.private: @ZLIB_LIBS@ @LIBASYNCNS_LIBADD@ - Cflags: +diff --git a/Makefile.am b/Makefile.am +index f5c510d..28d77c6 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -6,7 +6,7 @@ include $(top_srcdir)/Makefile.decl + + ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS} + +-SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po docs ++SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po + DIST_SUBDIRS = $(SUBDIRS) build + + bin_SCRIPTS = glib-gettextize +@@ -62,8 +62,7 @@ BUILT_EXTRA_DIST = \ + README \ + INSTALL \ + ChangeLog \ +- config.h.win32 \ +- gtk-doc.make ++ config.h.win32 + + CONFIGURE_DEPENDENCIES = acglib.m4 + +diff --git a/autogen.sh b/autogen.sh +index 01011d9..bc0ab0b 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -7,12 +7,6 @@ test -n "$srcdir" || srcdir=. + olddir=`pwd` + cd "$srcdir" + +-GTKDOCIZE=`which gtkdocize` +-if test -z $GTKDOCIZE; then +- echo "*** No GTK-Doc found, please install it ***" +- exit 1 +-fi +- + AUTORECONF=`which autoreconf` + if test -z $AUTORECONF; then + echo "*** No autoreconf found, please install it ***" +@@ -24,7 +18,6 @@ fi + # regenerated from their corresponding *.in files by ./configure anyway. + touch README INSTALL + +-gtkdocize || exit $? + autoreconf --force --install --verbose || exit $? + + cd "$olddir" +diff --git a/configure.ac b/configure.ac +index 29b6252..24a0c3c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2598,8 +2598,6 @@ dnl ************************** + dnl *** Checks for gtk-doc *** + dnl ************************** + +-GTK_DOC_CHECK([1.15], [--flavour no-tmpl]) +- + AC_ARG_ENABLE(man, + [AC_HELP_STRING([--enable-man], + [regenerate man pages from Docbook [default=no]])],enable_man=yes, +diff --git a/docs/Makefile.am b/docs/Makefile.am +deleted file mode 100644 +index 2349f44..0000000 +--- a/docs/Makefile.am ++++ /dev/null +@@ -1,11 +0,0 @@ +-## Process this file with automake to produce Makefile.in +-include $(top_srcdir)/Makefile.decl +- +-SUBDIRS = reference +- +-EXTRA_DIST += debugging.txt macros.txt +- +-files: +- @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ +- echo $$p; \ +- done +diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am +deleted file mode 100644 +index 63cf90d..0000000 +--- a/docs/reference/Makefile.am ++++ /dev/null +@@ -1,3 +0,0 @@ +-include $(top_srcdir)/Makefile.decl +- +-SUBDIRS = glib gobject gio +diff --git a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am +deleted file mode 100644 +index 7d2d264..0000000 +--- a/docs/reference/gio/Makefile.am ++++ /dev/null +@@ -1,181 +0,0 @@ +-include $(top_srcdir)/Makefile.decl +-NULL = +- +-SUBDIRS = gdbus-object-manager-example +- +-# The name of the module. +-DOC_MODULE=gio +- +-# The top-level SGML file. +-DOC_MAIN_SGML_FILE=gio-docs.xml +- +-# Extra options to supply to gtkdoc-scan +-SCAN_OPTIONS=--deprecated-guards="G_DISABLE_DEPRECATED" \ +- --ignore-decorators="G_GNUC_WARN_UNUSED_RESULT" +- +-# The directory containing the source code. Relative to $(srcdir) +-DOC_SOURCE_DIR=$(top_srcdir)/gio +- +-BUILT_HFILES=gioenumtypes.h +-HFILE_GLOB=$(top_srcdir)/gio/*.h +-CFILE_GLOB=$(top_srcdir)/gio/*.c +- +-IGNORE_HFILES = \ +- fam \ +- fen \ +- gdbus-2.0 \ +- gvdb \ +- inotify \ +- libasyncns \ +- tests \ +- win32 \ +- xdgmime \ +- gapplicationimpl.h \ +- gasynchelper.h \ +- gcontenttypeprivate.h \ +- gdbusauth.h \ +- gdbusauthmechanismanon.h \ +- gdbusauthmechanismexternal.h \ +- gdbusauthmechanism.h \ +- gdbusauthmechanismsha1.h \ +- gdbusprivate.h \ +- gdelayedsettingsbackend.h \ +- gdummyfile.h \ +- gdummyproxyresolver.h \ +- gdummytlsbackend.h \ +- gfileattribute-priv.h \ +- gfileinfo-priv.h \ +- giomodule-priv.h \ +- glocaldirectorymonitor.h \ +- glocalfileenumerator.h \ +- glocalfile.h \ +- glocalfileinfo.h \ +- glocalfileinputstream.h \ +- glocalfileiostream.h \ +- glocalfilemonitor.h \ +- glocalfileoutputstream.h \ +- glocalvfs.h \ +- gmountprivate.h \ +- gnativevolumemonitor.h \ +- gnetworkingprivate.h \ +- gnetworkmonitorbase.h \ +- gnetworkmonitornetlink.h \ +- gpollfilemonitor.h \ +- gregistrysettingsbackend.h \ +- gsettingsbackendinternal.h \ +- gsettings-mapping.h \ +- gsettingsschema-internal.h \ +- gsocketinputstream.h \ +- gsocketoutputstream.h \ +- gsocks4aproxy.h \ +- gsocks4proxy.h \ +- gsocks5proxy.h \ +- gthreadedresolver.h \ +- gunionvolumemonitor.h \ +- gunixmount.h \ +- gunixresolver.h \ +- gunixvolume.h \ +- gunixvolumemonitor.h \ +- gwin32appinfo.h \ +- gwin32mount.h \ +- gwin32resolver.h \ +- gwin32volumemonitor.h +- +- +-# CFLAGS and LDFLAGS for compiling scan program. Only needed +-# if $(DOC_MODULE).types is non-empty. +-INCLUDES = \ +- $(gio_INCLUDES) \ +- $(GLIB_DEBUG_FLAGS) +- +-GTKDOC_LIBS = \ +- $(top_builddir)/glib/libglib-2.0.la \ +- $(top_builddir)/gobject/libgobject-2.0.la \ +- $(top_builddir)/gmodule/libgmodule-2.0.la \ +- $(top_builddir)/gio/libgio-2.0.la \ +- $(NULL) +- +-# Extra options to supply to gtkdoc-mkdb +-MKDB_OPTIONS = --output-format=xml --sgml-mode --name-space=g \ +- --ignore-files='libasyncns tests' +- +-# Images to copy into HTML directory +-HTML_IMAGES = \ +- gvfs-overview.png \ +- menu-example.png \ +- menu-model.png +- +-content_files = \ +- version.xml \ +- overview.xml \ +- migrating-posix.xml \ +- migrating-gnome-vfs.xml \ +- migrating-gconf.xml \ +- migrating-gdbus.xml \ +- gio-querymodules.xml \ +- glib-compile-schemas.xml\ +- glib-compile-resources.xml \ +- gsettings.xml \ +- gresource.xml \ +- gdbus.xml \ +- gdbus-codegen.xml \ +- $(NULL) +- +-expand_content_files = \ +- overview.xml \ +- migrating-posix.xml \ +- migrating-gnome-vfs.xml \ +- migrating-gconf.xml \ +- migrating-gdbus.xml \ +- gdbus-codegen.xml \ +- $(NULL) +- +-extra_files = \ +- version.xml.in \ +- gvfs-overview.odg +- +-# Extra options to supply to gtkdoc-fixref +-FIXXREF_OPTIONS=--extra-dir=$(srcdir)/../glib/html --extra-dir=$(srcdir)/../gobject/html +- +-include $(top_srcdir)/gtk-doc.make +- +-EXTRA_DIST += \ +- version.xml.in +- +-man_MANS = \ +- gio-querymodules.1 \ +- glib-compile-schemas.1 \ +- glib-compile-resources.1 \ +- gsettings.1 \ +- gresource.1 \ +- gdbus.1 \ +- gdbus-codegen.1 +- +-if ENABLE_MAN +- +-.xml.1: +- @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< +- +-dist-local-check-mans-enabled: +- if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi +- +-else +- +-$(man_MANS): +- echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. +- echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ +- +-dist-local-check-mans-enabled: +- echo "*** --enable-man must be used in order to make dist" +- false +- +-endif +- +-MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) +- +-EXTRA_DIST += $(man_MANS) +- +-dist-hook-local: dist-local-check-mans-enabled all-local +- +-gio-docs-clean: clean +- cd $(srcdir) && rm -rf xml html +diff --git a/docs/reference/gio/gdbus-object-manager-example/Makefile.am b/docs/reference/gio/gdbus-object-manager-example/Makefile.am +deleted file mode 100644 +index 90c10aa..0000000 +--- a/docs/reference/gio/gdbus-object-manager-example/Makefile.am ++++ /dev/null +@@ -1,68 +0,0 @@ +-include $(top_srcdir)/Makefile.decl +-NULL = +- +-# The name of the module. +-DOC_MODULE=gdbus-object-manager-example +- +-# The top-level SGML file. +-DOC_MAIN_SGML_FILE=gdbus-object-manager-example-docs.xml +- +-# Extra options to supply to gtkdoc-scan +-SCAN_OPTIONS=--deprecated-guards="G_DISABLE_DEPRECATED" +- +-# The directory containing the source code. Relative to $(srcdir) +-DOC_SOURCE_DIR=$(top_builddir)/gio/tests/gdbus-object-manager-example +- +-HFILE_GLOB=$(top_builddir)/gio/tests/gdbus-object-manager-example/*.h +-CFILE_GLOB=$(top_builddir)/gio/tests/gdbus-object-manager-example/*.c +- +-# Headers to ignore +-IGNORE_HFILES= \ +- $(NULL) +- +-# CFLAGS and LDFLAGS for compiling scan program. Only needed +-# if $(DOC_MODULE).types is non-empty. +-INCLUDES = \ +- $(gio_INCLUDES) \ +- $(GLIB_DEBUG_FLAGS) +- +-GTKDOC_LIBS = \ +- $(top_builddir)/glib/libglib-2.0.la \ +- $(top_builddir)/gobject/libgobject-2.0.la \ +- $(top_builddir)/gmodule/libgmodule-2.0.la \ +- $(top_builddir)/gio/libgio-2.0.la \ +- $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la \ +- $(NULL) +- +-# Extra options to supply to gtkdoc-mkdb +-MKDB_OPTIONS = --output-format=xml --sgml-mode --name-space=g \ +- $(NULL) +- +-# Images to copy into HTML directory +-HTML_IMAGES = \ +- $(NULL) +- +-content_files = \ +- $(NULL) +- +-expand_content_files = \ +- $(NULL) +- +-extra_files = \ +- $(NULL) +- +-include $(top_srcdir)/gtk-doc.make +- +-EXTRA_DIST += \ +- $(NULL) +- +-MAINTAINERCLEANFILES = $(BUILT_SOURCES) +- +-dist-hook-local: all-local +- +-gdbus-object-manager-example-docs-clean: clean +- cd $(srcdir) && rm -rf xml html +- +-# Nuke installed docs (don't know how to avoid installing them) +-install-data-hook : +- rm -rf $(DESTDIR)$(datadir)/gtk-doc/html/gdbus-object-manager-example +diff --git a/docs/reference/glib/Makefile.am b/docs/reference/glib/Makefile.am +deleted file mode 100644 +index 2ceae09..0000000 +--- a/docs/reference/glib/Makefile.am ++++ /dev/null +@@ -1,129 +0,0 @@ +-## Process this file with automake to produce Makefile.in +-include $(top_srcdir)/Makefile.decl +- +-AUTOMAKE_OPTIONS = 1.6 +- +-# The name of the module. +-DOC_MODULE=glib +- +-# The top-level SGML file. +-DOC_MAIN_SGML_FILE=glib-docs.sgml +- +-# The directory containing the source code. Relative to $(srcdir) +-DOC_SOURCE_DIR=$(top_srcdir)/glib $(top_srcdir)/gmodule +- +-# Extra options to supply to gtkdoc-scan +-SCAN_OPTIONS=--deprecated-guards="G_DISABLE_DEPRECATED" --ignore-decorators="GLIB_VAR|G_GNUC_WARN_UNUSED_RESULT" +- +-# Extra options to supply to gtkdoc-mkdb +-MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=g +- +-# Used for dependencies +-HFILE_GLOB=$(top_srcdir)/glib/*.h $(top_srcdir)/gmodule/*.h +-CFILE_GLOB=$(top_srcdir)/glib/*.c $(top_srcdir)/gmodule/*.c +- +-# Ignore some private headers +-IGNORE_HFILES = \ +- gallocator.h \ +- gdatasetprivate.h \ +- glibintl.h \ +- gbsearcharray.h \ +- glib-private.h \ +- gmoduleconf.h \ +- gthreadprivate.h \ +- gunibreak.h \ +- gunicomp.h \ +- gunidecomp.h \ +- gunichartables.h \ +- glib_probes.h \ +- glib_trace.h \ +- libcharset.h \ +- gdebug.h \ +- gprintfint.h \ +- gmirroringtable.h \ +- gscripttable.h \ +- glib-mirroring-tab \ +- gnulib \ +- pcre \ +- update-pcre \ +- gbytesprivate.h \ +- gvariant-internal.h \ +- gvariant-serialiser.h \ +- gvariant-core.h \ +- gvarianttypeinfo.h \ +- gwakeup.h +- +-# Images to copy into HTML directory +-HTML_IMAGES = \ +- file-name-encodings.png \ +- mainloop-states.gif +- +-# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE) +-content_files = \ +- cross.sgml \ +- running.sgml \ +- building.sgml \ +- changes.sgml \ +- compiling.sgml \ +- resources.sgml \ +- regex-syntax.sgml \ +- version.xml \ +- glib-gettextize.xml \ +- gtester.xml \ +- gtester-report.xml \ +- gvariant-varargs.xml \ +- gvariant-text.xml +- +-expand_content_files = \ +- compiling.sgml +- +-# Extra options to supply to gtkdoc-fixref +-FIXXREF_OPTIONS=--extra-dir=$(srcdir)/../gobject/html --extra-dir=$(srcdir)/../gio/html +- +-# include common portion ... +-include $(top_srcdir)/gtk-doc.make +- +-# Other files to distribute +-EXTRA_DIST += \ +- file-name-encodings.png \ +- file-name-encodings.sxd \ +- mainloop-states.fig \ +- mainloop-states.png \ +- mainloop-states.eps \ +- version.xml.in +- +-######################################################################## +- +-man_MANS = \ +- glib-gettextize.1 \ +- gtester.1 \ +- gtester-report.1 +- +-if ENABLE_MAN +- +-.xml.1: +- @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< +- +-dist-local-check-mans-enabled: +- if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi +- +-else +- +-$(man_MANS): +- echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. +- echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ +- +-dist-local-check-mans-enabled: +- echo "*** --enable-man must be used in order to make dist" +- false +- +-endif +- +-MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) +- +-EXTRA_DIST += $(man_MANS) +- +-dist-hook-local: dist-local-check-mans-enabled all-local +- +-glib-docs-clean: clean +- cd $(srcdir) && rm -rf xml html +diff --git a/docs/reference/gobject/Makefile.am b/docs/reference/gobject/Makefile.am +deleted file mode 100644 +index 3a637b7..0000000 +--- a/docs/reference/gobject/Makefile.am ++++ /dev/null +@@ -1,103 +0,0 @@ +-## Process this file with automake to produce Makefile.in +-include $(top_srcdir)/Makefile.decl +- +-AUTOMAKE_OPTIONS = 1.6 +- +-# The name of the module. +-DOC_MODULE=gobject +- +-# The top-level SGML file. +-DOC_MAIN_SGML_FILE=gobject-docs.sgml +- +-# The directory containing the source code. Relative to $(srcdir) +-DOC_SOURCE_DIR=$(top_srcdir)/gobject +- +-# Extra options to supply to gtkdoc-scan +-SCAN_OPTIONS=--deprecated-guards="G_DISABLE_DEPRECATED" \ +- --ignore-decorators="G_GNUC_INTERNAL|G_GNUC_WARN_UNUSED_RESULT" +- +-# Extra options to supply to gtkdoc-mkdb +-MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=g +- +-# Used for dependencies +-HFILE_GLOB=$(top_srcdir)/gobject/*.h +-CFILE_GLOB=$(top_srcdir)/gobject/*.c +- +-# Headers to ignore +-IGNORE_HFILES = \ +- tests \ +- gobject_trace.h \ +- gatomicarray.h +- +- +-# CFLAGS and LDFLAGS for compiling scan program. Only needed +-# if $(DOC_MODULE).types is non-empty. +-INCLUDES = \ +- -I$(srcdir) \ +- $(gobject_INCLUDES) \ +- $(GLIB_DEBUG_FLAGS) +-GTKDOC_LIBS = \ +- $(top_builddir)/glib/libglib-2.0.la \ +- $(top_builddir)/gobject/libgobject-2.0.la +- +-# Images to copy into HTML directory +-HTML_IMAGES = \ +- images/glue.png +- +-# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE) +-content_files = version.xml \ +- glib-mkenums.xml \ +- glib-genmarshal.xml \ +- gobject-query.xml \ +- tut_gobject.xml \ +- tut_gsignal.xml \ +- tut_gtype.xml \ +- tut_howto.xml \ +- tut_intro.xml \ +- tut_tools.xml +- +-# Extra options to supply to gtkdoc-fixref +-FIXXREF_OPTIONS=--extra-dir=$(srcdir)/../glib/html +- +-include $(top_srcdir)/gtk-doc.make +- +-# Other files to distribute +-EXTRA_DIST += \ +- gobject.cI \ +- version.xml.in +- +-######################################################################## +- +-man_MANS = \ +- glib-mkenums.1 \ +- glib-genmarshal.1 \ +- gobject-query.1 +- +-if ENABLE_MAN +- +-.xml.1: +- @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< +- +-dist-local-check-mans-enabled: +- if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi +- +-else +- +-$(man_MANS): +- echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. +- echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ +- +-dist-local-check-mans-enabled: +- echo "*** --enable-man must be used in order to make dist" +- false +- +-endif +- +-MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) +- +-EXTRA_DIST += $(man_MANS) +- +-dist-hook-local: dist-local-check-mans-enabled all-local +- +-gobject-docs-clean: clean +- cd $(srcdir) && rm -rf xml html -- -1.7.1 +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/glib.mk --- a/src/glib.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/glib.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,22 +3,20 @@ PKG := glib $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 20cd63705a8805260da0320c65b979233f2e3c18 +$(PKG)_CHECKSUM := 429355327aaf69d2c21cbefcb20c61db94e0acec $(PKG)_SUBDIR := glib-$($(PKG)_VERSION) -$(PKG)_FILE := glib-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := glib-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/glib/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) -$(PKG)_DEPS := gcc gettext pcre libiconv zlib dbus +$(PKG)_DEPS := gcc gettext pcre libiconv zlib libffi dbus define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/glib/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/glib/refs/tags' | \ $(SED) -n "s,.*tag/?id=\([0-9]\+\.[0-9]*[02468]\.[^']*\).*,\1,p" | \ head -1 endef define $(PKG)_BUILD - cd '$(1)' && aclocal - cd '$(1)' && $(LIBTOOLIZE) --force - cd '$(1)' && autoconf + cd '$(1)' && ./autogen.sh cp -Rp '$(1)' '$(1).native' # native build of libiconv (used by glib-genmarshal) @@ -35,6 +33,7 @@ --enable-regex \ --disable-threads \ --disable-selinux \ + --disable-inotify \ --disable-fam \ --disable-xattr \ --disable-dtrace \ @@ -45,9 +44,13 @@ $(SED) -i 's,#define G_ATOMIC.*,,' '$(1).native/config.h' $(MAKE) -C '$(1).native/glib' -j '$(JOBS)' $(MAKE) -C '$(1).native/gthread' -j '$(JOBS)' + $(MAKE) -C '$(1).native/gmodule' -j '$(JOBS)' $(MAKE) -C '$(1).native/gobject' -j '$(JOBS)' lib_LTLIBRARIES= install-exec + $(MAKE) -C '$(1).native/gio/xdgmime' -j '$(JOBS)' $(MAKE) -C '$(1).native/gio' -j '$(JOBS)' glib-compile-schemas + $(MAKE) -C '$(1).native/gio' -j '$(JOBS)' glib-compile-resources $(INSTALL) -m755 '$(1).native/gio/glib-compile-schemas' '$(PREFIX)/$(TARGET)/bin/' + $(INSTALL) -m755 '$(1).native/gio/glib-compile-resources' '$(PREFIX)/$(TARGET)/bin/' # cross build cd '$(1)' && ./configure \ @@ -58,10 +61,12 @@ --with-threads=win32 \ --with-pcre=system \ --with-libiconv=gnu \ + --disable-inotify \ CXX='$(TARGET)-c++' \ PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' \ GLIB_GENMARSHAL='$(PREFIX)/$(TARGET)/bin/glib-genmarshal' \ - GLIB_COMPILE_SCHEMAS='$(PREFIX)/$(TARGET)/bin/glib-compile-schemas' + GLIB_COMPILE_SCHEMAS='$(PREFIX)/$(TARGET)/bin/glib-compile-schemas' \ + GLIB_COMPILE_RESOURCES='$(PREFIX)/$(TARGET)/bin/glib-compile-resources' $(MAKE) -C '$(1)/glib' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= $(MAKE) -C '$(1)/gmodule' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= $(MAKE) -C '$(1)/gthread' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= diff -r 1d1285b1f6a0 -r d733a98b84d6 src/glibmm.mk --- a/src/glibmm.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/glibmm.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := glibmm $(PKG)_IGNORE := -$(PKG)_CHECKSUM := d15bc0fed7dea6fec73746370653687f74e02592 +$(PKG)_CHECKSUM := 2928a334664433186d92d9099b9bbf3f051a2645 $(PKG)_SUBDIR := glibmm-$($(PKG)_VERSION) -$(PKG)_FILE := glibmm-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := glibmm-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/glibmm/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_DEPS := gcc glib libsigc++ define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/glibmm/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/glibmm/refs/tags' | \ grep ']*>\([0-9]*\.[0-9]*[02468]\.[^<]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gmp.mk --- a/src/gmp.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gmp.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,7 +3,7 @@ PKG := gmp $(PKG)_IGNORE := -$(PKG)_CHECKSUM := ea4ea7c3f10436ef5ae7a75b3fad163a8b86edc0 +$(PKG)_CHECKSUM := 12a662456033e21aed3e318aef4177f4000afe3b $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := ftp://ftp.gmplib.org/pub/$(PKG)-$($(PKG)_VERSION)/$($(PKG)_FILE) @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.gmplib.org/' | \ + $(WGET) -q -O- 'http://www.gmplib.org/' | \ grep ' Date: Fri, 28 Oct 2011 09:23:41 +0200 -Subject: [PATCH 1/2] add missing static library linking +Subject: [PATCH 1/5] add missing static library linking diff --git a/lib/gnutls.pc.in b/lib/gnutls.pc.in @@ -22,13 +22,13 @@ @GNUTLS_REQUIRES_PRIVATE@ Cflags: -I${includedir} -- -1.7.9.2 +1.7.10.4 -From aa11a6f645ce93f80fbffd7e72c6964bdfd68542 Mon Sep 17 00:00:00 2001 -From: MXE +From bd254ee873a2f7d6027661beae5d88372f10aa93 Mon Sep 17 00:00:00 2001 +From: Mark Brand Date: Thu, 24 Nov 2011 15:06:06 +0100 -Subject: [PATCH 2/2] disable doc and test (MXE specific) +Subject: [PATCH 2/5] disable doc and test (mingw-cross-env specific) diff --git a/Makefile.am b/Makefile.am @@ -45,5 +45,77 @@ if HAVE_GUILE SUBDIRS += guile -- -1.7.9.2 +1.7.10.4 + + +From dce8795ce40246c87fc83d1879f02c9923dba2ed Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Tue, 3 Apr 2012 13:58:42 +0200 +Subject: [PATCH 3/5] Revert "make dist will also make lzip compressed + tarball" + +This reverts commit 97ac1bc58274f651338444693bd75441ba12f46f. + +diff --git a/configure.ac b/configure.ac +index 0ad765c..74b778e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -25,7 +25,7 @@ AC_INIT([GnuTLS], [3.0.19], [bug-gnutls@gnu.org]) + AC_CONFIG_AUX_DIR([build-aux]) + AC_CONFIG_MACRO_DIR([m4]) + +-AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz dist-lzip -Wall -Werror -Wno-override]) ++AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz -Wall -Werror -Wno-override]) + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + AM_CONFIG_HEADER(config.h) + +-- +1.7.10.4 + + +From ae55a00b99a60b65e459ebe7ada215ace70b56db Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Wed, 6 Jun 2012 09:57:24 +0200 +Subject: [PATCH 4/5] AM_PROG_AR for automake 1.12 compatibility + +Taken from +http://lists.gnu.org/archive/html/automake/2012-05/msg00014.html +diff --git a/configure.ac b/configure.ac +index 74b778e..d045aaf 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -37,6 +37,7 @@ dnl Checks for programs. + AC_PROG_CC + AM_PROG_AS + AC_PROG_CXX ++m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) + gl_EARLY + + # For includes/gnutls/gnutls.h.in. +-- +1.7.10.4 + + +From dd5b4ce15f94ba9bdbbab9d5036eea0a284e9715 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Wed, 18 Jul 2012 00:58:59 +0200 +Subject: [PATCH 5/5] relax automake + + +diff --git a/configure.ac b/configure.ac +index d045aaf..e9afeb4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -25,7 +25,7 @@ AC_INIT([GnuTLS], [3.0.19], [bug-gnutls@gnu.org]) + AC_CONFIG_AUX_DIR([build-aux]) + AC_CONFIG_MACRO_DIR([m4]) + +-AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz -Wall -Werror -Wno-override]) ++AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz -Wall -Wno-override]) + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + AM_CONFIG_HEADER(config.h) + +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gnutls.mk --- a/src/gnutls.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gnutls.mk Thu Sep 20 10:43:06 2012 +0200 @@ -2,7 +2,7 @@ # See index.html for further information. PKG := gnutls -$(PKG)_CHECKSUM := 2e2adc41e0c75d8170fdca5955bd007ae93ceada +$(PKG)_CHECKSUM := df55f60a0426de1f0efb5c1a902e209b069b3d51 $(PKG)_SUBDIR := gnutls-$($(PKG)_VERSION) $(PKG)_FILE := gnutls-$($(PKG)_VERSION).tar.xz $(PKG)_URL := ftp://ftp.gnutls.org/pub/gnutls/$($(PKG)_FILE) @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc nettle zlib define $(PKG)_UPDATE - wget -q -O- 'http://git.savannah.gnu.org/gitweb/?p=gnutls.git;a=tags' | \ + $(WGET) -q -O- 'http://git.savannah.gnu.org/gitweb/?p=gnutls.git;a=tags' | \ grep ']*>gnutls_\([0-9]*_[0-9]*[02468]_[^<]*\)<.*,\1,p' | \ $(SED) 's,_,.,g' | \ @@ -22,11 +22,12 @@ $(SED) -i 's, sed , $(SED) ,g' '$(1)/gl/tests/Makefile.am' cd '$(1)' && aclocal -I m4 -I gl/m4 -I src/libopts/m4 --install cd '$(1)' && autoconf - cd '$(1)' && automake + cd '$(1)' && automake --add-missing # AI_ADDRCONFIG referenced by src/serv.c but not provided by mingw. # Value taken from http://msdn.microsoft.com/en-us/library/windows/desktop/ms737530%28v=vs.85%29.aspx cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --enable-static \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/graphicsmagick-1-fix-xml2-config.patch --- a/src/graphicsmagick-1-fix-xml2-config.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/graphicsmagick-1-fix-xml2-config.patch Thu Sep 20 10:43:06 2012 +0200 @@ -38,9 +38,10 @@ index 5757b37..87e3fd4 100644 --- a/magick/GraphicsMagick.pc.in +++ b/magick/GraphicsMagick.pc.in -@@ -8,4 +8,5 @@ Name: GraphicsMagick +@@ -8,4 +8,6 @@ Name: GraphicsMagick Version: @PACKAGE_VERSION@ Description: GraphicsMagick image processing library ++Requires.private: libxml-2.0 Libs: -L${libdir} -lGraphicsMagick +Libs.private: @MAGICK_API_LDFLAGS@ @MAGICK_API_LIBS@ Cflags: -I${includedir} @MAGICK_API_PC_CPPFLAGS@ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/graphicsmagick.mk --- a/src/graphicsmagick.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/graphicsmagick.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := graphicsmagick $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 7ef5711a18da0a3b6b143548a2a7822597ea416d +$(PKG)_CHECKSUM := 3949030b101d66811242a0d30abc9965481ed035 $(PKG)_SUBDIR := GraphicsMagick-$($(PKG)_VERSION) -$(PKG)_FILE := GraphicsMagick-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := GraphicsMagick-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc pthreads libtool zlib bzip2 jpeg jasper lcms1 libpng tiff freetype libxml2 define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef @@ -20,6 +20,7 @@ cd '$(1)' && autoconf cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --without-modules \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gsl.mk --- a/src/gsl.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gsl.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://git.savannah.gnu.org/gitweb/?p=$(PKG).git;a=tags' | \ + $(WGET) -q -O- 'http://git.savannah.gnu.org/gitweb/?p=$(PKG).git;a=tags' | \ grep ']*>[^0-9>]*\([0-9][^<]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gsoap-1-fixes.patch --- a/src/gsoap-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gsoap-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -3,17 +3,14 @@ Contains ad hoc patches for cross building. -From a4e9166bc8d78b2aee3c25757d479d4c2e53c7be Mon Sep 17 00:00:00 2001 +From 538418ded4554eec40b6a889d58cfbb493cd9a2c Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Sun, 23 Oct 2011 21:36:53 +0200 Subject: [PATCH 1/3] support static linking to ntlm ---- - configure | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure b/configure -index ad1830d..be95edf 100755 +index 6ac9ee7..0570bb6 100755 --- a/configure +++ b/configure @@ -4822,7 +4822,7 @@ case "${host}" in @@ -26,22 +23,14 @@ *-*-freebsd*) platform=FREEBSD ;; *-*-openbsd*) platform=OPENBSD ;; -- -1.7.7 +1.7.11.4 -From da0eb2fc386be0fd914ef8f9a7d6bf73004ea230 Mon Sep 17 00:00:00 2001 +From 41c709c382a1aa268c85d98df65562eb4563d640 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 24 Oct 2011 11:17:13 +0200 Subject: [PATCH 2/3] ntlm support in .pc files ---- - gsoap++.pc.in | 2 +- - gsoap.pc.in | 2 +- - gsoapck++.pc.in | 2 +- - gsoapck.pc.in | 2 +- - gsoapssl++.pc.in | 2 +- - gsoapssl.pc.in | 2 +- - 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gsoap++.pc.in b/gsoap++.pc.in index 035afd9..3411d55 100644 @@ -104,6 +93,37 @@ -Cflags: @SOAPCPP2_IPV6@ -DWITH_OPENSSL -DWITH_DOM -DWITH_COOKIES -DWITH_GZIP -I${includedir} +Cflags: @SOAPCPP2_IPV6@ -DWITH_OPENSSL -DWITH_DOM -DWITH_NTLM -DWITH_COOKIES -DWITH_GZIP -I${includedir} -- -1.7.7 +1.7.11.4 +From 3b8d0a7db13b9c607e66c6a9d5455f26576d80fd Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Mon, 20 Aug 2012 13:12:49 +0200 +Subject: [PATCH 3/3] fix MINGW compatibility + +taken from +https://sourceforge.net/tracker/?func=detail&aid=3559816&group_id=52781&atid=468023 + +diff --git a/gsoap/stdsoap2.h b/gsoap/stdsoap2.h +index 8718592..ab5bed4 100644 +--- a/gsoap/stdsoap2.h ++++ b/gsoap/stdsoap2.h +@@ -2195,13 +2195,13 @@ soap_wchar soap_get1(struct soap*); + SOAP_FMAC1 unsigned long SOAP_FMAC2 soap_strtoul(const char *s, char **t, int b); + #endif + +-#ifdef WIN32 ++#if defined(WIN32) && !defined(__MINGW32__) + # define soap_strtoll _strtoi64 + #else + # define soap_strtoll strtoll + #endif + +-#ifdef WIN32 ++#if defined(WIN32) && !defined(__MINGW32__) + # define soap_strtoull _strtoui64 + #else + # define soap_strtoull strtoull +-- +1.7.11.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gsoap.mk --- a/src/gsoap.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gsoap.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,19 +3,22 @@ PKG := gsoap $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 011b507e667d7bb76e30fc8a31055e8cf323311d +$(PKG)_CHECKSUM := 18cedfdabb79ad4e006db64ffd24d72f0d1fd6ba $(PKG)_SUBDIR := gsoap-$(call SHORT_PKG_VERSION,$(PKG)) $(PKG)_FILE := gsoap_$($(PKG)_VERSION).zip $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/gsoap2/gSOAP/$($(PKG)_FILE) $(PKG)_DEPS := gcc gnutls libgcrypt libntlm define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/gsoap2/files/gSOAP/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/gsoap2/files/gSOAP/' | \ $(SED) -n 's,.*gsoap_\([0-9][^>]*\)\.zip.*,\1,p' | \ head -1 endef define $(PKG)_BUILD + # avoid reconfiguration + cd '$(1)' && touch configure config.h.in + # Native build to get tools wsdl2h and soapcpp2 cd '$(1)' && ./configure diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gst-plugins-base.mk --- a/src/gst-plugins-base.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gst-plugins-base.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := gst-plugins-base $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 6d7dc463fed5dd43f79a53ad523fcbd6d0916303 +$(PKG)_CHECKSUM := 2c4b34245107395bc9103649bb2af1c1088a3f7c $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) -$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://gstreamer.freedesktop.org/src/$(PKG)/$($(PKG)_FILE) $(PKG)_DEPS := gcc glib libxml2 gstreamer liboil pango ogg vorbis theora define $(PKG)_UPDATE - wget -q -O- 'http://cgit.freedesktop.org/gstreamer/gst-plugins-base/refs/tags' | \ + $(WGET) -q -O- 'http://cgit.freedesktop.org/gstreamer/gst-plugins-base/refs/tags' | \ $(SED) -n "s,.*]*>libgta-\([0-9.]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gtk2-1-fixes.patch --- a/src/gtk2-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gtk2-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -18,7 +18,7 @@ int __stdcall -DllMain (HINSTANCE hinstDLL, -+static _disabled_DllMain (HINSTANCE hinstDLL, ++gdk_DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID reserved) { @@ -31,7 +31,7 @@ BOOL WINAPI -DllMain (HINSTANCE hinstDLL, -+static _disabled_DllMain (HINSTANCE hinstDLL, ++gtk_DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gtk2.mk --- a/src/gtk2.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gtk2.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := gtk2 $(PKG)_IGNORE := -$(PKG)_CHECKSUM := c15a25ba49eb459b2c4cdc46baedf6cecf08cbcf +$(PKG)_CHECKSUM := baf5c73e186352cad767392a6b55840be0326ddc $(PKG)_SUBDIR := gtk+-$($(PKG)_VERSION) -$(PKG)_FILE := gtk+-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := gtk+-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/gtk+/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_DEPS := gcc gettext libpng jpeg tiff jasper glib atk pango cairo gdk-pixbuf define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/gtk+/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/gtk+/refs/tags' | \ grep ']*>\([0-9]*\.[0-9]*[02468]\.[^<]*\)<.*,\1,p' | \ grep -v '^2\.9' | \ @@ -25,18 +25,12 @@ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --enable-explicit-deps \ - --disable-gdiplus \ --disable-glibtest \ --disable-modules \ --disable-cups \ --disable-test-print-backend \ --disable-gtk-doc \ --disable-man \ - --with-libpng \ - --with-libjpeg \ - --with-libtiff \ - --with-libjasper \ - --with-included-loaders \ --with-included-immodules \ --without-x $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gtkglarea-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/gtkglarea-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,109 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From 8ca212a3a9fa7a034b1fa3680422e9a7cad21d4a Mon Sep 17 00:00:00 2001 +From: MXE +Date: Sun, 17 Jun 2012 09:05:56 +0200 +Subject: [PATCH] deactivates dll build which is not supported by mxe, and + introduce option --disable-shared to handle it. + +taken from +https://github.com/GNOME/gtkglarea/pull/1 + +diff --git a/configure.ac b/configure.ac +index 07be73f..2728c10 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -53,6 +53,16 @@ if test "$native_win32" = "yes"; then + fi + AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes) + ++ ++dnl ++dnl Check if shared libs are enabled ++dnl ++AC_ARG_ENABLE(shared, ++ [AS_HELP_STRING([--disable-shared],[disable support for shared libraries])], ++ [], ++ []) ++AM_CONDITIONAL(USE_SHARED, test x$enable_shared != xno) ++ + dnl + dnl Check for GTK libraries + dnl +@@ -172,7 +182,7 @@ AC_C_CONST + + dnl Checks for library functions. + +-AC_OUTPUT( ++AC_CONFIG_FILES([ + Makefile + gtkgl-2.0.pc + gtkgl/Makefile +@@ -180,8 +190,8 @@ AC_OUTPUT( + docs/Makefile + examples/Makefile + examples/makefile.mingw +-) +- ++]) ++AC_OUTPUT + + echo "---" + echo "Configuration summary" +diff --git a/gtkgl/Makefile.am b/gtkgl/Makefile.am +index c7e65cd..23d4fdb 100644 +--- a/gtkgl/Makefile.am ++++ b/gtkgl/Makefile.am +@@ -1,28 +1,28 @@ + ## gtkgl directory + ++INSTALL_EXTRA= ++UNINSTALL_EXTRA= ++ + if OS_WIN32 + export_symbols = -export-symbols gtkgl.def +- ++if USE_SHARED + install-libtool-import-lib: + $(INSTALL) .libs/libgtkgl-2.0.dll.a $(DESTDIR)$(libdir) + uninstall-libtool-import-lib: + -rm $(DESTDIR)$(libdir)/libgtkgl-2.0.dll.a +-else +-install-libtool-import-lib: +-uninstall-libtool-import-lib: ++INSTALL_EXTRA += install-libtool-import-lib ++UNINSTALL_EXTRA += uninstall-libtool-import-lib ++endif + endif + + if MS_LIB_AVAILABLE + noinst_DATA = gtkgl-2.0.lib +- + install-ms-lib: + $(INSTALL) gtkgl-2.0.lib $(DESTDIR)$(libdir) +- + uninstall-ms-lib: + -rm $(DESTDIR)$(libdir)/gtkgl-2.0.lib +-else +-install-ms-lib: +-uninstall-ms-lib: ++INSTALL_EXTRA += install-ms-lib ++UNINSTALL_EXTRA += uninstall-ms-lib + endif + + EXTRA_DIST = makefile.mingw makefile.mingw.in gtkgl.def +@@ -42,6 +42,6 @@ libgtkgl_2_0_la_LIBADD = $(GTK_LIBS) $(GL_LIBS) + gtkgl-2.0.lib: libgtkgl-2.0.la gtkgl.def + lib -name:libgtkgl-2.0-@LT_CURRENT_MINUS_AGE@.dll -def:gtkgl.def -out:$@ + +-install-data-local: install-ms-lib install-libtool-import-lib ++install-data-local: $(INSTALL_EXTRA) + +-uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib ++uninstall-local: $(UNINSTALL_EXTRA) +-- +1.7.9.5 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gtkglarea.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/gtkglarea.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,27 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := gtkglarea +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := db12f2bb9a3d28d69834832e2e04a255acfd8a6d +$(PKG)_SUBDIR := gtkglarea-$($(PKG)_VERSION) +$(PKG)_FILE := gtkglarea-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://mirrors.ircam.fr/pub/GNOME/sources/gtkglarea/2.0/$($(PKG)_FILE) +$(PKG)_DEPS := gcc gtk2 freeglut + +define $(PKG)_UPDATE + wget -q -O- 'mirrors.ircam.fr/pub/GNOME/sources/gtkglarea/2.0' | \ + $(SED) -n 's,.*gtkglarea-\(2[^>]*\)\.tar.*,\1,ip' | \ + sort | \ + tail -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && autoreconf -fi # to be removed if patch is integrated upstream + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --prefix='$(PREFIX)/$(TARGET)' \ + --disable-shared + $(MAKE) -C '$(1)' -j '$(JOBS)' install +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gtkglext.mk --- a/src/gtkglext.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gtkglext.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc gtk2 define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/cgit/gtkglext/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/cgit/gtkglext/refs/tags' | \ grep ']*>\([0-9]*\.[0-9]*[02468]\.[^<]*\)<.*,\1,p' | \ grep -v '^2\.9' | \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gtksourceview.mk --- a/src/gtksourceview.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gtksourceview.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc gtk2 libxml2 define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/gtksourceview/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/gtksourceview/refs/tags' | \ $(SED) -n 's,.*>GTKSOURCEVIEW_\([0-9]\+_[0-9]*[02468]_[^<]*\)<.*,\1,p' | \ $(SED) 's,_,.,g' | \ grep -v '^2\.9[0-9]\.' | \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/gtksourceviewmm2.mk --- a/src/gtksourceviewmm2.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/gtksourceviewmm2.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := gtksourceviewmm2 $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 7f6fb046427054d85c791a4b1fc0f742a3313c8a +$(PKG)_CHECKSUM := 17d5daf33d2b6bc21c48c5c730abaae70e027566 $(PKG)_SUBDIR := gtksourceviewmm-$($(PKG)_VERSION) -$(PKG)_FILE := $($(PKG)_SUBDIR).tar.gz +$(PKG)_FILE := $($(PKG)_SUBDIR).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/gtksourceviewmm/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_DEPS := gcc gtkmm2 gtksourceview define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/cgit/gtksourceviewmm/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/cgit/gtksourceviewmm/refs/tags' | \ grep ']*>[^0-9>]*\([0-9][^< ]*\)\.<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/hunspell-test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hunspell-test.cpp Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,37 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + std::ofstream dic ("hunspell-test.dic"); + dic << "2\nHello\nWorld"; + dic.close(); + std::ofstream aff ("hunspell-test.aff"); + aff << "SET UTF-8\nTRY loredWH\nMAXDIFF 1"; + aff.close(); + Hunspell h("hunspell-test.aff", "hunspell-test.dic"); + + if (h.spell("Hello") == 0) + { + std::cerr << "Error: hunspell marked correct word as wrong" << std::endl; + } + if (h.spell("wrld") != 0) + { + std::cerr << "Error: hunspell marked wrong word as correct" << std::endl; + } + + char ** result; + int n = h.suggest(&result, "ell"); + for (int i = 0; i < n; i++) std::cout << result[i]; + + return 0; +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/hunspell.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hunspell.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,36 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := hunspell +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 902c76d2b55a22610e2227abc4fd26cbe606a51c +$(PKG)_SUBDIR := hunspell-$($(PKG)_VERSION) +$(PKG)_FILE := hunspell-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/hunspell/Hunspell/$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc libiconv gettext readline pthreads + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://sourceforge.net/projects/hunspell/files/Hunspell/' | \ + $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + # Note: the configure file doesn't pick up pdcurses, so "ui" is disabled + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --enable-static \ + --disable-shared \ + --with-warnings \ + --without-ui \ + --with-readline \ + --prefix='$(PREFIX)/$(TARGET)' + $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + + + # Test + '$(TARGET)-g++' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-hunspell.exe' \ + `'$(TARGET)-pkg-config' hunspell --cflags --libs` +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/id3lib.mk --- a/src/id3lib.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/id3lib.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/id3lib/files/id3lib/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/id3lib/files/id3lib/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/ilmbase.mk --- a/src/ilmbase.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/ilmbase.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.openexr.com/downloads.html' | \ + $(WGET) -q -O- 'http://www.openexr.com/downloads.html' | \ grep 'ilmbase-' | \ $(SED) -n 's,.*ilmbase-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/imagemagick.mk --- a/src/imagemagick.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/imagemagick.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc bzip2 ffmpeg fftw freetype jasper jpeg lcms libpng libtool openexr pthreads tiff define $(PKG)_UPDATE - wget -q -O- 'http://www.imagemagick.org/' | \ + $(WGET) -q -O- 'http://www.imagemagick.org/' | \ $(SED) -n 's,.*

    The current release is ImageMagick \([0-9][^<]*\).

    .*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/jasper.mk --- a/src/jasper.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/jasper.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc jpeg define $(PKG)_UPDATE - wget -q -O- 'http://www.ece.uvic.ca/~mdadams/jasper/' | \ + $(WGET) -q -O- 'http://www.ece.uvic.ca/~mdadams/jasper/' | \ grep 'jasper-' | \ $(SED) -n 's,.*jasper-\([0-9][^>]*\)\.zip.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/jpeg.mk --- a/src/jpeg.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/jpeg.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.ijg.org/' | \ + $(WGET) -q -O- 'http://www.ijg.org/' | \ $(SED) -n 's,.*jpegsrc\.v\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/json-c-1-patch-missingfile.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/json-c-1-patch-missingfile.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,15 @@ +This file is part of MXE. +See index.html for further information. + +Contains a fix for issue 35 on json-c (https://github.com/json-c/json-c/issues/35) + +--- a/Makefile.am 2012-07-17 22:52:19.000000000 +0200 ++++ b/Makefile.am 2012-07-17 22:54:09.000000000 +0200 +@@ -17,6 +17,7 @@ + json_config.h \ + json_inttypes.h \ + json_object.h \ ++ json_object_iterator.h \ + json_object_private.h \ + json_tokener.h \ + json_util.h \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/json-c-2-patch-remove-rpl.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/json-c-2-patch-remove-rpl.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,16 @@ +This file is part of MXE. +See index.html for further information. + +see http://lists.fedoraproject.org/pipermail/mingw/2009-May/001567.html + +--- a/configure.in 2012-07-12 01:57:09.000000000 +0200 ++++ b/configure.in 2012-07-12 01:59:06.000000000 +0200 +@@ -25,8 +25,6 @@ + # Checks for library functions. + AC_FUNC_VPRINTF + AC_FUNC_MEMCMP +-AC_FUNC_MALLOC +-AC_FUNC_REALLOC + AC_CHECK_FUNCS(strndup strerror vsnprintf vasprintf open vsyslog strncasecmp) + + AM_PROG_LIBTOOL diff -r 1d1285b1f6a0 -r d733a98b84d6 src/json-c-test.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/json-c-test.c Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,23 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include + +int main(int argc, char *argv[]) +{ + json_object *jobj; + + (void)argc; + (void)argv; + + jobj = json_object_new_object(); + if (!jobj) { + return 1; + } + json_object_object_add(jobj, "key", json_object_new_string("value")); + printf("%s", json_object_to_json_string(jobj)); + return 0; +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/json-c.mk --- a/src/json-c.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/json-c.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,23 +3,31 @@ PKG := json-c $(PKG)_IGNORE := -$(PKG)_CHECKSUM := daaf5eb960fa98e137abc5012f569b83c79be90f +$(PKG)_CHECKSUM := f90f643c8455da21d57b3e8866868a944a93c596 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz -$(PKG)_URL := http://oss.metaparadigm.com/$(PKG)/$($(PKG)_FILE) +$(PKG)_URL := https://github.com/downloads/$(PKG)/$(PKG)/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://oss.metaparadigm.com/json-c/?C=M;O=D' | \ - $(SED) -n 's,.*json-c-\([0-9][^>]*\)\.tar.*,\1,p' | \ + $(WGET) - q -O 'https://github.com/json-c/json-c/downloads' | \ + grep '
    LAPACK, version \([0-9]\.[0-9]\.[0-9]\).*_\1_ip' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/lcms.mk --- a/src/lcms.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/lcms.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := lcms $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 67d5fabda2f5777ca8387766539b9c871d993133 +$(PKG)_CHECKSUM := 9944902864283af49e4e21a1ca456db4e04ea7c2 $(PKG)_SUBDIR := $(PKG)$(word 1,$(subst ., ,$($(PKG)_VERSION)))-$(subst a,,$($(PKG)_VERSION)) $(PKG)_FILE := $(PKG)$(word 1,$(subst ., ,$($(PKG)_VERSION)))-$(subst a,,$($(PKG)_VERSION)).tar.gz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$(subst a,,$($(PKG)_VERSION))/$($(PKG)_FILE) $(PKG)_DEPS := gcc jpeg tiff zlib define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/lcms/files/lcms/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/lcms/files/lcms/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/lcms1.mk --- a/src/lcms1.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/lcms1.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc jpeg tiff zlib define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/lcms/files/lcms/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/lcms/files/lcms/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ grep '^1\.' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/levmar.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/levmar.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,25 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := levmar +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 118bd20b55ab828d875f1b752cb5e1238258950b +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tgz +$(PKG)_URL := http://www.ics.forth.gr/~lourakis/$(PKG)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc lapack blas libf2c + +define $(PKG)_UPDATE + $(WGET) -q -O- "http://www.ics.forth.gr/~lourakis/levmar/" | \ + $(SED) -n 's_.*Latest:.*levmar-\([0-9]\.[0-9]\).*_\1_ip' | \ + head -1; +endef + +define $(PKG)_BUILD + $(MAKE) -C '$(1)' -j '$(JOBS)' liblevmar.a \ + CC=$(TARGET)-gcc \ + AR=$(TARGET)-ar \ + RANLIB=$(TARGET)-ranlib + $(INSTALL) -m644 '$(1)/levmar.h' '$(PREFIX)/$(TARGET)/include/' + $(INSTALL) -m644 '$(1)/liblevmar.a' '$(PREFIX)/$(TARGET)/lib/' +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libarchive.mk --- a/src/libarchive.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libarchive.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc bzip2 libiconv libxml2 openssl xz zlib define $(PKG)_UPDATE - wget -q -O- 'http://code.google.com/p/libarchive/downloads/list?sort=-uploaded' | \ + $(WGET) -q -O- 'http://code.google.com/p/libarchive/downloads/list?sort=-uploaded' | \ $(SED) -n 's,.*libarchive-\([0-9][^<]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libass.mk --- a/src/libass.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libass.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc freetype fontconfig fribidi define $(PKG)_UPDATE - wget -q -O- 'http://code.google.com/p/libass/downloads/list?sort=-uploaded' | \ + $(WGET) -q -O- 'http://code.google.com/p/libass/downloads/list?sort=-uploaded' | \ $(SED) -n 's,.*libass-\([0-9][^<]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libcroco.mk --- a/src/libcroco.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libcroco.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc glib libxml2 define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/libcroco/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/libcroco/refs/tags' | \ $(SED) -n 's,.*]*>LIBCROCO_\([0-9][0-9_]*\)<.*,\1,p' | \ $(SED) 's,_,.,g' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libdnet.mk --- a/src/libdnet.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libdnet.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc winpcap define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/libdnet/files/libdnet/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/libdnet/files/libdnet/' | \ $(SED) -n 's,.*/libdnet-\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libevent.mk --- a/src/libevent.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libevent.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := libevent $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 2a2cc87ce1945f43dfa5a5f9575fef3d14a8f57a +$(PKG)_CHECKSUM := 20bb4a1a296ac93c08dfc32ae19ab874cab67a0c $(PKG)_SUBDIR := libevent-$($(PKG)_VERSION)-stable $(PKG)_FILE := libevent-$($(PKG)_VERSION)-stable.tar.gz $(PKG)_URL := https://github.com/downloads/$(PKG)/$(PKG)/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://libevent.org/' | \ + $(WGET) -q -O- 'http://libevent.org/' | \ grep 'libevent-' | \ $(SED) -n 's,.*libevent-\([0-9][^>]*\)-stable\.tar.*,\1,p' | \ head -1 @@ -19,6 +19,7 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' $(MAKE) -C '$(1)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= defexec_DATA= diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libf2c-1.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libf2c-1.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,59 @@ +This file is part of MXE. +See index.html for further information. + +diff -ur libf2c.orig/makefile.u libf2c/makefile.u +--- libf2c.orig/makefile.u 2012-05-04 01:39:36.000000000 +1000 ++++ libf2c/makefile.u 2012-05-04 01:45:30.000000000 +1000 +@@ -20,7 +20,7 @@ + # compile, then strip unnecessary symbols + .c.o: + $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c +- ld -r -x -o $*.xxx $*.o ++ $(LD) -r -x -o $*.xxx $*.o + mv $*.xxx $*.o + ## Under Solaris (and other systems that do not understand ld -x), + ## omit -x in the ld line above. +@@ -72,8 +72,8 @@ + all: f2c.h signal1.h sysdep1.h libf2c.a + + libf2c.a: $(OFILES) +- ar r libf2c.a $? +- -ranlib libf2c.a ++ $(AR) r libf2c.a $? ++ -$(RANLIB) libf2c.a + + ## Shared-library variant: the following rule works on Linux + ## systems. Details are system-dependent. Under Linux, -fPIC +@@ -123,7 +123,7 @@ + + install: libf2c.a + cp libf2c.a $(LIBDIR) +- -ranlib $(LIBDIR)/libf2c.a ++ -$(RANLIB) $(LIBDIR)/libf2c.a + + clean: + rm -f libf2c.a *.o arith.h signal1.h sysdep1.h +@@ -182,12 +182,6 @@ + xwsne.o: lio.h + xwsne.o: fmt.h + +-arith.h: arithchk.c +- $(CC) $(CFLAGS) -DNO_FPINIT arithchk.c -lm ||\ +- $(CC) -DNO_LONG_LONG $(CFLAGS) -DNO_FPINIT arithchk.c -lm +- ./a.out >arith.h +- rm -f a.out arithchk.o +- + check: + xsum Notice README abort_.c arithchk.c backspac.c c_abs.c c_cos.c \ + c_div.c c_exp.c c_log.c c_sin.c c_sqrt.c cabs.c close.c comptry.bat \ + +diff -urN tmp-libf2c.orig/arith.h tmp-libf2c/arith.h +--- tmp-libf2c.orig/arith.h 1970-01-01 10:00:00.000000000 +1000 ++++ tmp-libf2c/arith.h 2012-05-04 01:16:16.000000000 +1000 +@@ -0,0 +1,5 @@ ++#define IEEE_8087 ++#define Arith_Kind_ASL 1 ++#define Double_Align ++#define QNaN0 0x0 ++#define QNaN1 0xfff80000 ++ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libf2c.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libf2c.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,25 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := libf2c +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := f71066b41695738dec2261de71eaf02a1aaffe8b +$(PKG)_SUBDIR := +$(PKG)_FILE := $(PKG).zip +$(PKG)_URL := http://www.netlib.org/f2c/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + echo 1 +endef + +define $(PKG)_BUILD + $(MAKE) -C '$(1)' -j '$(JOBS)' -f makefile.u \ + CC=$(TARGET)-gcc \ + AR=$(TARGET)-ar \ + LD=$(TARGET)-ld \ + RANLIB=$(TARGET)-ranlib \ + CFLAGS='-O -DUSE_CLOCK' + $(INSTALL) -m644 '$(1)/libf2c.a' '$(PREFIX)/$(TARGET)/lib' + $(INSTALL) -m644 '$(1)/f2c.h' '$(PREFIX)/$(TARGET)/include' +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libffi.mk --- a/src/libffi.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libffi.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := libffi $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 97abf70e6a6d315d9259d58ac463663051d471e1 +$(PKG)_CHECKSUM := bff6a6c886f90ad5e30dee0b46676e8e0297d81d $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := ftp://sourceware.org/pub/$(PKG)/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q --no-check-certificate -O- 'https://github.com/atgreen/libffi/tags' | \ + $(WGET) -q -O- 'https://github.com/atgreen/libffi/tags' | \ grep ' +#include + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + if (!gcry_check_version (GCRYPT_VERSION)) { + fputs ("libgcrypt version mismatch\n", stderr); + exit (2); + } + + gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN); + gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0); + gcry_control (GCRYCTL_RESUME_SECMEM_WARN); + gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); + + if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) { + fputs ("libgcrypt has not been initialized\n", stderr); + abort (); + } + + printf("gcrypt version: %s", GCRYPT_VERSION ); + + return 0; +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgcrypt.mk --- a/src/libgcrypt.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libgcrypt.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc libgpg_error define $(PKG)_UPDATE - wget -q -O- 'ftp://ftp.gnupg.org/gcrypt/libgcrypt/' | \ + $(WGET) -q -O- 'ftp://ftp.gnupg.org/gcrypt/libgcrypt/' | \ $(SED) -n 's,.*libgcrypt-\([0-9][^>]*\)\.tar.*,\1,p' | \ grep -v '^1\.4\.' | \ tail -1 @@ -24,4 +24,10 @@ --prefix='$(PREFIX)/$(TARGET)' \ --with-gpg-error-prefix='$(PREFIX)/$(TARGET)' $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + ln -sf '$(PREFIX)/$(TARGET)/bin/libgcrypt-config' '$(PREFIX)/bin/$(TARGET)-libgcrypt-config' + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-libgcrypt.exe' \ + `$(TARGET)-libgcrypt-config --cflags --libs` endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgda.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libgda.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,38 @@ +# This file is part of MXE. +# See index.html for further information. + +# LibGDA +PKG := libgda +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 61d0b498202b780750633cc2e957c40325d6c705 +$(PKG)_SUBDIR := libgda-$($(PKG)_VERSION) +$(PKG)_FILE := libgda-$($(PKG)_VERSION).tar.xz +$(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/libgda/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) +$(PKG)_DEPS := gcc glib libxml2 mdbtools postgresql + +define $(PKG)_UPDATE + echo 'TODO: Updates for package libgda need to be fixed.' >&2; + echo $(libgda_VERSION) +endef + +define $(PKG)_BUILD + $(SED) -i 's,glib-mkenums,'$(PREFIX)/$(TARGET)/bin/glib-mkenums',g' '$(1)/libgda/Makefile.in' + $(SED) -i 's,glib-mkenums,'$(PREFIX)/$(TARGET)/bin/glib-mkenums',g' '$(1)/libgda/sql-parser/Makefile.in' + $(SED) -i 's,glib-mkenums,'$(PREFIX)/$(TARGET)/bin/glib-mkenums',g' '$(1)/libgda-ui/Makefile.in' + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --prefix='$(PREFIX)/$(TARGET)' \ + --disable-shared \ + --disable-gtk-doc \ + --without-bdb \ + --with-mdb \ + --without-oracle \ + --without-mysql \ + --without-firebird \ + --without-java \ + --enable-binreloc \ + --disable-crypto \ + GLIB_GENMARSHAL='$(PREFIX)/$(TARGET)/bin/glib-genmarshal' + $(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgdamm.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libgdamm.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,28 @@ +# This file is part of MXE. +# See index.html for further information. + +# libgdamm +PKG := libgdamm +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := f6126d7b46720e3ea4f3d49e03add2e52da233be +$(PKG)_SUBDIR := libgdamm-$($(PKG)_VERSION) +$(PKG)_FILE := libgdamm-$($(PKG)_VERSION).tar.xz +$(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/libgdamm/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) +$(PKG)_DEPS := gcc libgda glibmm + +define $(PKG)_UPDATE + echo 'TODO: Updates for package libgdamm need to be fixed.' >&2; + echo $(libgdamm_VERSION) +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' \ + CXX='$(TARGET)-c++' \ + PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' \ + MAKE=$(MAKE) + $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgee.mk --- a/src/libgee.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libgee.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc glib define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/libgee/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/libgee/refs/tags' | \ grep ']*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libglade-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libglade-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,65 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +[master 1ae0f2e] new version + 2 files changed, 11 insertions(+), 9 deletions(-) +From 1ae0f2e805de5bee3fa36584a87a47fe11893e8f Mon Sep 17 00:00:00 2001 +From: MXE +Date: Sun, 17 Jun 2012 17:04:04 +0200 +Subject: [PATCH] new version + + +diff --git a/configure.in b/configure.in +index e0c52a8..e4691a3 100644 +--- a/configure.in ++++ b/configure.in +@@ -15,6 +15,16 @@ AC_CONFIG_HEADERS([config.h]) + + AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2]) + ++# pkg-config check put earlier in configure.in, because before LIBGLADE did not ++# use the cross-compiled-pkg-cfg. ++PKG_PROG_PKG_CONFIG ++ ++PKG_CHECK_MODULES(LIBGLADE, [dnl ++ libxml-2.0 >= required_libxml_version dnl ++ atk >= required_atk_version dnl ++ gtk+-2.0 >= required_gtk_version dnl ++ glib-2.0 >= required_glib_version]) ++ + GNOME_COMMON_INIT + + if test "$enable_debug" != "no"; then +@@ -40,14 +50,6 @@ AC_CHECK_FUNC(gtk_plug_get_type, + AC_DEFINE(HAVE_GTK_PLUG,1,[gtk has GtkPlug/GtkSocket implementation])) + LIBS=$save_LIBS + +-PKG_PROG_PKG_CONFIG +- +-PKG_CHECK_MODULES(LIBGLADE, [dnl +- libxml-2.0 >= required_libxml_version dnl +- atk >= required_atk_version dnl +- gtk+-2.0 >= required_gtk_version dnl +- glib-2.0 >= required_glib_version]) +- + AC_MSG_CHECKING([for native Win32]) + case "$host" in + *-*-mingw*) +diff --git a/glade/Makefile.am b/glade/Makefile.am +index f6271f7..0641232 100644 +--- a/glade/Makefile.am ++++ b/glade/Makefile.am +@@ -13,7 +13,7 @@ if OS_WIN32 + export_symbols = -export-symbols glade.def + + install-libtool-import-lib: +- $(INSTALL) .libs/libglade-2.0.dll.a $(DESTDIR)$(libdir) ++# $(INSTALL) .libs/libglade-2.0.dll.a $(DESTDIR)$(libdir) + + uninstall-libtool-import-lib: + -rm $(DESTDIR)$(libdir)/libglade-2.0.dll.a +-- +1.7.9.5 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libglade.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libglade.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,26 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := libglade +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 3cc65ed13c10025780488935313329170baa33c6 +$(PKG)_SUBDIR := libglade-$($(PKG)_VERSION) +$(PKG)_FILE := libglade-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://ftp.gnome.org/pub/GNOME/sources/libglade/2.6/$($(PKG)_FILE) +$(PKG)_DEPS := gcc libxml2 atk glib gtk2 + +define $(PKG)_UPDATE + wget -q -O- 'http://ftp.gnome.org/pub/GNOME/sources/libglade/2.6/' | \ + $(SED) -n 's,.*"libglade-\([0-9][^"]*\)\.tar.gz.*,\1,p' | \ + tail -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && autoreconf -fi + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' + $(MAKE) -C '$(1)' -j '$(JOBS)' install +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgnurx.mk --- a/src/libgnurx.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libgnurx.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/mingw/files/Other/UserContributed/regex/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/mingw/files/Other/UserContributed/regex/' | \ grep 'mingw-regex-' | \ $(SED) -n 's,.*mingw-regex-\([0-9\.]*\).*,\1,p' | \ sort | \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgpg_error.mk --- a/src/libgpg_error.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libgpg_error.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'ftp://ftp.gnupg.org/gcrypt/libgpg-error/' | \ + $(WGET) -q -O- 'ftp://ftp.gnupg.org/gcrypt/libgpg-error/' | \ $(SED) -n 's,.*libgpg-error-\([1-9]\.[1-9][0-9][^>]*\)\.tar.*,\1,p' | \ tail -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgsasl-1-fixes.patch --- a/src/libgsasl-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libgsasl-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -13,7 +13,7 @@ index 7fec454..d9b62cd 100644 --- a/gl/memxor.c +++ b/gl/memxor.c -@@ -23,7 +23,7 @@ +@@ -22,7 +22,7 @@ #include "memxor.h" void * diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgsasl.mk --- a/src/libgsasl.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libgsasl.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := libgsasl $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 2942886514f14801193e505fc5367330d5c6b7de +$(PKG)_CHECKSUM := 08fd5dfdd3d88154cf06cb0759a732790c47b4f7 $(PKG)_SUBDIR := libgsasl-$($(PKG)_VERSION) $(PKG)_FILE := libgsasl-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://ftp.gnu.org/gnu/gsasl/$($(PKG)_FILE) $(PKG)_DEPS := gcc libiconv libidn libntlm libgcrypt nettle define $(PKG)_UPDATE - wget -q -O- 'http://git.savannah.gnu.org/gitweb/?p=gsasl.git;a=tags' | \ + $(WGET) -q -O- 'http://git.savannah.gnu.org/gitweb/?p=gsasl.git;a=tags' | \ grep ']*>\([0-9]*\.[0-9]*[02468]\.[^<]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgsf-1-fixes.patch --- a/src/libgsf-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libgsf-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -13,7 +13,7 @@ index d7a7247..cc52d99 100644 --- a/gsf/gsf-utils.c +++ b/gsf/gsf-utils.c -@@ -119,9 +119,9 @@ static GTypeModule *static_type_module = NULL; +@@ -115,9 +115,9 @@ static GTypeModule *static_type_module = NULL; #include static HMODULE gsf_dll_hmodule; BOOL WINAPI diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libgsf.mk --- a/src/libgsf.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libgsf.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := libgsf $(PKG)_IGNORE := -$(PKG)_CHECKSUM := ca1c5aa92a840e322d7cafd9f2dede3d38a69660 +$(PKG)_CHECKSUM := 4f19933342b2d42246200e3522b0797a032fdf19 $(PKG)_SUBDIR := libgsf-$($(PKG)_VERSION) $(PKG)_FILE := libgsf-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/libgsf/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_DEPS := gcc zlib bzip2 glib libxml2 define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/libgsf/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/libgsf/refs/tags' | \ grep '> '$(1)'/libgsf-1.pc.in cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --disable-nls \ --disable-gtk-doc \ - --disable-schemas-install \ --without-python \ - --without-gnome-vfs \ - --without-bonobo \ --with-zlib \ --with-bz2 \ --with-gio \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libharu.mk --- a/src/libharu.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libharu.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc zlib libpng define $(PKG)_UPDATE - wget -q -O- 'http://libharu.org/files/?C=M;O=D' | \ + $(WGET) -q -O- 'http://libharu.org/files/?C=M;O=D' | \ $(SED) -n 's,.*libharu-\([0-9][^>]*\)\.tar.*,\1,p' | \ grep -v 'rc' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libical.mk --- a/src/libical.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libical.mk Thu Sep 20 10:43:06 2012 +0200 @@ -9,7 +9,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/freeassociation/files/$(PKG)/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/freeassociation/files/$(PKG)/' | \ $(SED) -n 's,.*/$(PKG)-\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libiconv.mk --- a/src/libiconv.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libiconv.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.gnu.org/software/libiconv/' | \ + $(WGET) -q -O- 'http://www.gnu.org/software/libiconv/' | \ grep 'libiconv-' | \ $(SED) -n 's,.*libiconv-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libidn.mk --- a/src/libidn.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libidn.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := libidn $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 4251c108966375ede4df15d76a1bd9a4440f44ee +$(PKG)_CHECKSUM := 92e64fd5a6428bda6ade2c3cde475b76455cd7dd $(PKG)_SUBDIR := libidn-$($(PKG)_VERSION) $(PKG)_FILE := libidn-$($(PKG)_VERSION).tar.gz $(PKG)_URL := ftp://ftp.gnu.org/gnu/libidn/$($(PKG)_FILE) $(PKG)_DEPS := gcc gettext libiconv define $(PKG)_UPDATE - wget -q -O- 'http://git.savannah.gnu.org/gitweb/?p=libidn.git;a=tags' | \ + $(WGET) -q -O- 'http://git.savannah.gnu.org/gitweb/?p=libidn.git;a=tags' | \ grep ']*>\([0-9][^<]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libircclient.mk --- a/src/libircclient.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libircclient.mk Thu Sep 20 10:43:06 2012 +0200 @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/libircclient/files/libircclient/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/libircclient/files/libircclient/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/liblo.mk --- a/src/liblo.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/liblo.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc pthreads define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/liblo/files/liblo/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/liblo/files/liblo/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libmad.mk --- a/src/libmad.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libmad.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/mad/files/libmad/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/mad/files/libmad/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libmikmod.mk --- a/src/libmikmod.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libmikmod.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc pthreads define $(PKG)_UPDATE - wget -q -O- 'http://mikmod.raphnet.net/' | \ + $(WGET) -q -O- 'http://mikmod.raphnet.net/' | \ $(SED) -n 's,.*libmikmod-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libmng.mk --- a/src/libmng.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libmng.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc zlib jpeg lcms1 define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/libmng/files/libmng-devel/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/libmng/files/libmng-devel/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libmodplug-test.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libmodplug-test.c Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,17 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + ModPlug_Settings settings; + ModPlug_GetSettings(&settings); + ModPlug_SetSettings(&settings); + return 0; +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libmodplug.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libmodplug.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,31 @@ +# This file is part of MXE. +# See index.html for further information. + +# libmodplug +PKG := libmodplug +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := df4deffe542b501070ccb0aee37d875ebb0c9e22 +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/modplug-xmms/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://sourceforge.net/projects/modplug-xmms/files/libmodplug/' | \ + $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --enable-static \ + --prefix='$(PREFIX)/$(TARGET)' + $(MAKE) -C '$(1)' -j '$(JOBS)' install + + '$(TARGET)-gcc' \ + -W -Wall -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-libmodplug.exe' \ + `'$(TARGET)-pkg-config' libmodplug --cflags --libs` +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libntlm.mk --- a/src/libntlm.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libntlm.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://git.savannah.gnu.org/gitweb/?p=libntlm.git;a=tags' | \ + $(WGET) -q -O- 'http://git.savannah.gnu.org/gitweb/?p=libntlm.git;a=tags' | \ grep ']*>\([0-9][^<]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/liboauth.mk --- a/src/liboauth.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/liboauth.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := liboauth $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 9182ca5d7e127589d132377b807d0c8a8878b122 +$(PKG)_CHECKSUM := a5a957ac1538b23a286de4e39a2c9f98ef4c3c0e $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://liboauth.sourceforge.net/pool/$($(PKG)_FILE) $(PKG)_DEPS := gcc curl openssl define $(PKG)_UPDATE - wget -q -O- 'http://liboauth.sourceforge.net/' | \ + $(WGET) -q -O- 'http://liboauth.sourceforge.net/' | \ $(SED) -n 's,.*liboauth-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libodbc++.mk --- a/src/libodbc++.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libodbc++.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://libodbcxx.svn.sourceforge.net/viewvc/libodbcxx/tags/?sortby=date' | \ + $(WGET) -q -O- 'http://libodbcxx.svn.sourceforge.net/viewvc/libodbcxx/tags/?sortby=date' | \ grep ']*\)\.tar.*,\1,p' | \ head -1 endef @@ -19,6 +19,7 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libpng.mk --- a/src/libpng.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libpng.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,7 +3,7 @@ PKG := libpng $(PKG)_IGNORE := -$(PKG)_CHECKSUM := bfa655f04965545a54dc974e50c2325968ca5a71 +$(PKG)_CHECKSUM := 7ea36f6b26809cd1141c155feb2ad6c1af141702 $(PKG)_SUBDIR := libpng-$($(PKG)_VERSION) $(PKG)_FILE := libpng-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)$(subst .,,$(call SHORT_PKG_VERSION,$(PKG)))/older-releases/$($(PKG)_VERSION)/$($(PKG)_FILE) @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc zlib define $(PKG)_UPDATE - wget -q -O- 'http://libpng.git.sourceforge.net/git/gitweb.cgi?p=libpng/libpng;a=tags' | \ + $(WGET) -q -O- 'http://libpng.git.sourceforge.net/git/gitweb.cgi?p=libpng/libpng;a=tags' | \ grep ']*>v\([0-9][^<]*\)<.*,\1,p' | \ grep -v alpha | \ @@ -24,6 +24,7 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= diff -r 1d1285b1f6a0 -r d733a98b84d6 src/librsvg-test.c --- a/src/librsvg-test.c Thu Sep 20 10:38:14 2012 +0200 +++ b/src/librsvg-test.c Thu Sep 20 10:43:06 2012 +0200 @@ -14,7 +14,7 @@ g_type_init(); handle = rsvg_handle_new(); - rsvg_handle_free(handle); + g_object_unref(handle); return 0; } diff -r 1d1285b1f6a0 -r d733a98b84d6 src/librsvg.mk --- a/src/librsvg.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/librsvg.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := librsvg $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 11a2dc00c813da13532d7f16a822b414201e8b1b +$(PKG)_CHECKSUM := 8ac22591c9db273355cf895f7e87aac149f64437 $(PKG)_SUBDIR := librsvg-$($(PKG)_VERSION) $(PKG)_FILE := librsvg-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/GNOME/sources/librsvg/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_DEPS := gcc glib libgsf cairo pango gtk2 libcroco define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/librsvg/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/librsvg/refs/tags' | \ $(SED) -n 's,.*]*>\([0-9][^<]*\).*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/librtmp-1-v2.4.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/librtmp-1-v2.4.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,2699 @@ +From 272a91d06d71c2a326996f62797ed9ab42f69859 Mon Sep 17 00:00:00 2001 +From: hyc +Date: Wed, 30 Jun 2010 22:34:59 +0000 +Subject: [PATCH 01/34] zlib dependency is only when CRYPTO is enabled + +git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@536 400ebc74-4327-4243-bc38-086b20814532 +--- + Makefile | 9 +++++---- + librtmp/hashswf.c | 4 ++-- + 2 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index 7470eb4..c7767b4 100644 +--- a/Makefile ++++ b/Makefile +@@ -11,9 +11,10 @@ SYS=posix + CRYPTO=OPENSSL + #CRYPTO=POLARSSL + #CRYPTO=GNUTLS +-LIB_GNUTLS=-lgnutls -lgcrypt +-LIB_OPENSSL=-lssl -lcrypto +-LIB_POLARSSL=-lpolarssl ++LIBZ=-lz ++LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ) ++LIB_OPENSSL=-lssl -lcrypto$ (LIBZ) ++LIB_POLARSSL=-lpolarssl $(LIBZ) + CRYPTO_LIB=$(LIB_$(CRYPTO)) + DEF_=-DNO_CRYPTO + CRYPTO_DEF=$(DEF_$(CRYPTO)) +@@ -33,7 +34,7 @@ MANDIR=$(DESTDIR)$(mandir) + + LIBS_posix= + LIBS_mingw=-lws2_32 -lwinmm -lgdi32 +-LIBS=$(CRYPTO_LIB) -lz $(LIBS_$(SYS)) $(XLIBS) ++LIBS=$(CRYPTO_LIB) $(LIBS_$(SYS)) $(XLIBS) + + THREADLIB_posix=-lpthread + THREADLIB_mingw= +diff --git a/librtmp/hashswf.c b/librtmp/hashswf.c +index 06d2bbb..277f21c 100644 +--- a/librtmp/hashswf.c ++++ b/librtmp/hashswf.c +@@ -66,10 +66,10 @@ + extern void RTMP_TLS_Init(); + extern TLS_CTX RTMP_TLS_ctx; + +-#endif /* CRYPTO */ +- + #include + ++#endif /* CRYPTO */ ++ + #define AGENT "Mozilla/5.0" + + HTTPResult +-- +1.7.10.4 + + +From 6556b9f9328acb1199dc1cc3f22fa82c86b51c8a Mon Sep 17 00:00:00 2001 +From: hyc +Date: Thu, 1 Jul 2010 12:00:43 +0000 +Subject: [PATCH 02/34] Fix typo + +git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@537 400ebc74-4327-4243-bc38-086b20814532 +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index c7767b4..1fcdd78 100644 +--- a/Makefile ++++ b/Makefile +@@ -13,7 +13,7 @@ CRYPTO=OPENSSL + #CRYPTO=GNUTLS + LIBZ=-lz + LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ) +-LIB_OPENSSL=-lssl -lcrypto$ (LIBZ) ++LIB_OPENSSL=-lssl -lcrypto $(LIBZ) + LIB_POLARSSL=-lpolarssl $(LIBZ) + CRYPTO_LIB=$(LIB_$(CRYPTO)) + DEF_=-DNO_CRYPTO +-- +1.7.10.4 + + +From 8a5901c8a74280c898deb4ebf1a2f5d6f68bce42 Mon Sep 17 00:00:00 2001 +From: hyc +Date: Sat, 3 Jul 2010 10:25:48 +0000 +Subject: [PATCH 03/34] Document the escape coding used for special characters + in values + +git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@538 400ebc74-4327-4243-bc38-086b20814532 +--- + librtmp/librtmp.3 | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/librtmp/librtmp.3 b/librtmp/librtmp.3 +index 055b52b..a5a7558 100644 +--- a/librtmp/librtmp.3 ++++ b/librtmp/librtmp.3 +@@ -57,14 +57,19 @@ The session handle is freed using + .BR RTMP_Free (). + + All data is transferred using FLV format. The basic session requires +-an RTMP URL. Additional options may be specified by appending +-space-separated key=value pairs to the URL. The RTMP URL format +-is of the form ++an RTMP URL. The RTMP URL format is of the form + .nf + rtmp[t][e|s]://hostname[:port][/app[/playpath]] + .fi + + Plain rtmp, as well as tunneled and encrypted sessions are supported. ++ ++Additional options may be specified by appending space-separated ++key=value pairs to the URL. Special characters in values may need ++to be escaped to prevent misinterpretation by the option parser. ++The escape encoding uses a backslash followed by two hexadecimal digits ++representing the ASCII value of the character. E.g., spaces must ++be escaped as \fB\\20\fP and backslashes must be escaped as \fB\\5c\fP. + .SH OPTIONS + .SS "Network Parameters" + These options define how to connect to the media server. +-- +1.7.10.4 + + +From c41568f57bec297581e8508a7e6a3d1e470dc81d Mon Sep 17 00:00:00 2001 +From: hyc +Date: Sat, 3 Jul 2010 10:28:57 +0000 +Subject: [PATCH 04/34] Update from prev commit + +git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@539 400ebc74-4327-4243-bc38-086b20814532 +--- + librtmp/librtmp.3 | 2 +- + librtmp/librtmp.3.html | 13 +++++++++---- + 2 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/librtmp/librtmp.3 b/librtmp/librtmp.3 +index a5a7558..66197d5 100644 +--- a/librtmp/librtmp.3 ++++ b/librtmp/librtmp.3 +@@ -1,4 +1,4 @@ +-.TH LIBRTMP 3 "2010-05-29" "RTMPDump v2.2e" ++.TH LIBRTMP 3 "2010-07-03" "RTMPDump v2.3" + .\" Copyright 2010 Howard Chu. + .\" Copying permitted according to the GNU General Public License V2. + .SH NAME +diff --git a/librtmp/librtmp.3.html b/librtmp/librtmp.3.html +index daf636f..e5e6f4b 100644 +--- a/librtmp/librtmp.3.html ++++ b/librtmp/librtmp.3.html +@@ -6,7 +6,7 @@ + LIBRTMP(3)LIBRTMP(3) + + +-RTMPDump v2.2e2010-05-29LIBRTMP(3) ++RTMPDump v2.32010-07-03LIBRTMP(3) + +

      + +
    + +@@ -238,6 +238,12 @@ authentication. + +

    +

    ++jtv=JSON ++
    ++JSON token used by legacy Justin.tv servers. Invokes NetStream.Authenticate.UsherToken ++
    ++

    ++

    + swfVfy=0|1 +
    + If the value is 1 or TRUE, the SWF player is retrieved from the +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index adcff1f..8d76164 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -484,7 +484,7 @@ static struct urlopt { + { AVC("subscribe"), OFF(Link.subscribepath), OPT_STR, 0, + "Stream to subscribe to" }, + { AVC("jtv"), OFF(Link.usherToken), OPT_STR, 0, +- "Justin.tv authentication token" }, ++ "Justin.tv authentication token" }, + { AVC("token"), OFF(Link.token), OPT_STR, 0, + "Key for SecureToken response" }, + { AVC("swfVfy"), OFF(Link.lFlags), OPT_BOOL, RTMP_LF_SWFV, +@@ -1649,8 +1649,8 @@ SendFCSubscribe(RTMP *r, AVal *subscribepath) + return RTMP_SendPacket(r, &packet, TRUE); + } + +-//Justin.tv specific authentication +-static const AVal av_NetStream_Authenticate_UsherToken = AVC("NetStream.Authenticate.UsherToken"); //SAVC() isn't suitable for that ++/* Justin.tv specific authentication */ ++static const AVal av_NetStream_Authenticate_UsherToken = AVC("NetStream.Authenticate.UsherToken"); + + static int + SendUsherToken(RTMP *r, AVal *usherToken) +diff --git a/rtmpdump.1.html b/rtmpdump.1.html +index 7f17636..826f722 100644 +--- a/rtmpdump.1.html ++++ b/rtmpdump.1.html +@@ -6,10 +6,10 @@ + RTMPDUMP(1)RTMPDUMP(1) + + +-RTMPDump v2.2e2010-05-02RTMPDUMP(1) ++RTMPDump v2.42011-07-20RTMPDUMP(1) + +

      +- +
    + +@@ -42,6 +42,7 @@ rtmpdump − RTMP streaming media client + [−b buffer] + [−m timeout] + [−T key] ++[−j JSON] + [−w swfHash] + [−x swfSize] + [−W swfUrl] +@@ -275,6 +276,12 @@ authentication. +
    +

    +

    ++−−jtv −j JSON ++
    ++JSON token used by legacy Justin.tv servers. Invokes NetStream.Authenticate.UsherToken ++
    ++

    ++

    + −−swfhash −w hexstring +
    + SHA256 hash of the decompressed SWF file. This option may be needed if +diff --git a/rtmpdump.c b/rtmpdump.c +index ec1de85..89c053a 100644 +--- a/rtmpdump.c ++++ b/rtmpdump.c +@@ -1055,9 +1055,9 @@ main(int argc, char **argv) + case 'S': + STR2AVAL(sockshost, optarg); + break; +- case 'j': +- STR2AVAL(usherToken, optarg); +- break; ++ case 'j': ++ STR2AVAL(usherToken, optarg); ++ break; + default: + RTMP_LogPrintf("unknown option: %c\n", opt); + usage(argv[0]); +diff --git a/rtmpgw.8.html b/rtmpgw.8.html +index 58b8f35..68d6734 100644 +--- a/rtmpgw.8.html ++++ b/rtmpgw.8.html +@@ -6,10 +6,10 @@ + RTMPGW(8)RTMPGW(8) + + +-RTMPDump v2.2e2010-05-02RTMPGW(8) ++RTMPDump v2.42011-07-20RTMPGW(8) + +

      +- +
    + +@@ -41,6 +41,7 @@ rtmpgw − RTMP streaming media gateway + [−b buffer] + [−m timeout] + [−T key] ++[−j JSON] + [−w swfHash] + [−x swfSize] + [−W swfUrl] +@@ -249,6 +250,12 @@ authentication. +
    +

    +

    ++−−jtv −j JSON ++
    ++JSON token used by legacy Justin.tv servers. Invokes NetStream.Authenticate.UsherToken ++
    ++

    ++

    + −−swfhash −w hexstring +
    + SHA256 hash of the decompressed SWF file. This option may be needed if +diff --git a/rtmpgw.c b/rtmpgw.c +index ce7319a..733e105 100644 +--- a/rtmpgw.c ++++ b/rtmpgw.c +@@ -1100,7 +1100,7 @@ main(int argc, char **argv) + ("--stop|-B num Stop at num seconds into stream\n"); + RTMP_LogPrintf + ("--token|-T key Key for SecureToken response\n"); +- RTMP_LogPrintf ++ RTMP_LogPrintf + ("--jtv|-j JSON Authentication token for Justin.tv legacy servers\n"); + RTMP_LogPrintf + ("--buffer|-b Buffer time in milliseconds (default: %lu)\n\n", +diff --git a/rtmpsrv.c b/rtmpsrv.c +index cf52bfa..f1b6c66 100644 +--- a/rtmpsrv.c ++++ b/rtmpsrv.c +@@ -116,7 +116,6 @@ typedef struct + AVal swfHash; + AVal flashVer; + AVal subscribepath; +- AVal usherToken; + uint32_t swfSize; + + uint32_t dStartOffset; +-- +1.7.10.4 + + +From ed99ad05b34031fac74230760c77d4d1a6a9e706 Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Sat, 30 Apr 2011 14:29:58 +0300 +Subject: [PATCH 03/33] Remove the generated pkg-config file on make clean + +--- + librtmp/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librtmp/Makefile b/librtmp/Makefile +index d61e7a4..c95c8a6 100644 +--- a/librtmp/Makefile ++++ b/librtmp/Makefile +@@ -76,7 +76,7 @@ OBJS=rtmp.o log.o amf.o hashswf.o parseurl.o + all: librtmp.a $(SO_LIB) + + clean: +- rm -f *.o *.a *.$(SOX) *.$(SO_EXT) ++ rm -f *.o *.a *.$(SOX) *.$(SO_EXT) librtmp.pc + + librtmp.a: $(OBJS) + $(AR) rs $@ $? +-- +1.7.10.4 + + +From 749018b7c7c4e0090ea17c104dc094ab74326c08 Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Sat, 30 Apr 2011 14:30:00 +0300 +Subject: [PATCH 04/33] Create the SODIR, too + +When SYS=mingw, this differs from LIBDIR. +--- + librtmp/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librtmp/Makefile b/librtmp/Makefile +index c95c8a6..aa4a339 100644 +--- a/librtmp/Makefile ++++ b/librtmp/Makefile +@@ -100,7 +100,7 @@ librtmp.pc: librtmp.pc.in Makefile + install: install_base $(SO_INST) + + install_base: librtmp.a librtmp.pc +- -mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig $(MANDIR)/man3 ++ -mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig $(MANDIR)/man3 $(SODIR) + cp amf.h http.h log.h rtmp.h $(INCDIR) + cp librtmp.a $(LIBDIR) + cp librtmp.pc $(LIBDIR)/pkgconfig +-- +1.7.10.4 + + +From 9931c44867d157621ae10cf489ba336091dfab6b Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Sat, 30 Apr 2011 14:30:01 +0300 +Subject: [PATCH 05/33] Generate and install an import lib for the built DLL + +--- + librtmp/Makefile | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/librtmp/Makefile b/librtmp/Makefile +index aa4a339..b88baf4 100644 +--- a/librtmp/Makefile ++++ b/librtmp/Makefile +@@ -54,9 +54,14 @@ SODIR=$(SODIR_$(SYS)) + SO_LDFLAGS_posix=-shared -Wl,-soname,$@ + SO_LDFLAGS_darwin=-dynamiclib -flat_namespace -undefined suppress -fno-common \ + -headerpad_max_install_names +-SO_LDFLAGS_mingw=-shared ++SO_LDFLAGS_mingw=-shared -Wl,--out-implib,librtmp.dll.a + SO_LDFLAGS=$(SO_LDFLAGS_$(SYS)) + ++INSTALL_IMPLIB_posix= ++INSTALL_IMPLIB_darwin= ++INSTALL_IMPLIB_mingw=cp librtmp.dll.a $(LIBDIR) ++INSTALL_IMPLIB=$(INSTALL_IMPLIB_$(SYS)) ++ + SHARED=yes + SODEF_yes=-fPIC + SOLIB_yes=librtmp.$(SO_EXT) +@@ -108,5 +113,6 @@ install_base: librtmp.a librtmp.pc + + install_so: librtmp.$(SO_EXT) + cp librtmp.$(SO_EXT) $(SODIR) ++ $(INSTALL_IMPLIB) + cd $(SODIR); ln -sf librtmp.$(SO_EXT) librtmp.$(SOX) + +-- +1.7.10.4 + + +From 060206d121657d7e45c01ac022dd071c877b4caa Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Fri, 15 Jul 2011 13:46:02 +0300 +Subject: [PATCH 06/33] Check the return value from RTMP_SendBytesReceived() + +This avoids double frees in RTMP_Close(), if the +RTMP_SendBytesReceived() call failed, which earlier led +to RTMP_ReadPacket() writing back an already freed buffer +(freed by RTMP_Close() within WriteN()) into m_vecChannelsIn. +--- + librtmp/rtmp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index 8d76164..f85cd83 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -1338,7 +1338,8 @@ ReadN(RTMP *r, char *buffer, int n) + r->m_nBytesIn += nRead; + if (r->m_bSendCounter + && r->m_nBytesIn > r->m_nBytesInSent + r->m_nClientBW / 2) +- SendBytesReceived(r); ++ if (!SendBytesReceived(r)) ++ return FALSE; + } + /*RTMP_Log(RTMP_LOGDEBUG, "%s: %d bytes\n", __FUNCTION__, nBytes); */ + #ifdef _DEBUG +-- +1.7.10.4 + + +From 159a06ebe6d82ef20f2c77c497d55af00d2e0b78 Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Fri, 15 Jul 2011 13:46:03 +0300 +Subject: [PATCH 07/33] Don't try to close an already closed socket + +This could happen if WriteN() (called within SendBytesReceived()) +failed. +--- + librtmp/rtmp.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index f85cd83..df2cb27 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -3626,7 +3626,9 @@ RTMPSockBuf_Close(RTMPSockBuf *sb) + sb->sb_ssl = NULL; + } + #endif +- return closesocket(sb->sb_socket); ++ if (sb->sb_socket != -1) ++ return closesocket(sb->sb_socket); ++ return 0; + } + + #define HEX2BIN(a) (((a)&0x40)?((a)&0xf)+9:((a)&0xf)) +-- +1.7.10.4 + + +From 530d02fccf24f98e2e318418b2fa3e3420056fda Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Fri, 22 Jul 2011 18:04:05 -0700 +Subject: [PATCH 08/33] Fix MDH_free() for PolarSSL + +Reported by Reijo Tomperi +--- + librtmp/dh.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librtmp/dh.h b/librtmp/dh.h +index 8e285a6..efef0fd 100644 +--- a/librtmp/dh.h ++++ b/librtmp/dh.h +@@ -53,7 +53,7 @@ typedef struct MDH { + } MDH; + + #define MDH_new() calloc(1,sizeof(MDH)) +-#define MDH_free(vp) {MDH *dh = vp; dhm_free(&dh->ctx); MP_free(dh->p); MP_free(dh->g); MP_free(dh->pub_key); MP_free(dh->priv_key); free(dh);} ++#define MDH_free(vp) {MDH *_dh = vp; dhm_free(&_dh->ctx); MP_free(_dh->p); MP_free(_dh->g); MP_free(_dh->pub_key); MP_free(_dh->priv_key); free(_dh);} + + static int MDH_generate_key(MDH *dh) + { +-- +1.7.10.4 + + +From b627335dc37fd5265ac6d23a441ee2d89ab503c8 Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Fri, 22 Jul 2011 18:06:27 -0700 +Subject: [PATCH 09/33] Plug potential memleak + +Reported by Reijo Tomperi +--- + rtmpdump.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/rtmpdump.c b/rtmpdump.c +index 89c053a..e506fa9 100644 +--- a/rtmpdump.c ++++ b/rtmpdump.c +@@ -444,7 +444,7 @@ Download(RTMP * rtmp, // connected RTMP object + { + int32_t now, lastUpdate; + int bufferSize = 64 * 1024; +- char *buffer = (char *) malloc(bufferSize); ++ char *buffer; + int nRead = 0; + off_t size = ftello(file); + unsigned long lastPercent = 0; +@@ -505,6 +505,8 @@ Download(RTMP * rtmp, // connected RTMP object + rtmp->m_read.nMetaHeaderSize = nMetaHeaderSize; + rtmp->m_read.nInitialFrameSize = nInitialFrameSize; + ++ buffer = (char *) malloc(bufferSize); ++ + now = RTMP_GetTime(); + lastUpdate = now - 1000; + do +-- +1.7.10.4 + + +From ec422962d58b8e0d9bfcf0af6e450e0e349947da Mon Sep 17 00:00:00 2001 +From: "Scott D. Davilla" +Date: Fri, 29 Jul 2011 11:26:35 -0700 +Subject: [PATCH 10/33] Darwin dylib updates + +Bring in line with current practice for Darwin dynamic libs +--- + librtmp/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/librtmp/Makefile b/librtmp/Makefile +index b88baf4..a0125f1 100644 +--- a/librtmp/Makefile ++++ b/librtmp/Makefile +@@ -52,8 +52,8 @@ SODIR_mingw=$(BINDIR) + SODIR=$(SODIR_$(SYS)) + + SO_LDFLAGS_posix=-shared -Wl,-soname,$@ +-SO_LDFLAGS_darwin=-dynamiclib -flat_namespace -undefined suppress -fno-common \ +- -headerpad_max_install_names ++SO_LDFLAGS_darwin=-dynamiclib -twolevel_namespace -undefined dynamic_lookup \ ++ -fno-common -headerpad_max_install_names -install_name $(libdir)/$@ + SO_LDFLAGS_mingw=-shared -Wl,--out-implib,librtmp.dll.a + SO_LDFLAGS=$(SO_LDFLAGS_$(SYS)) + +-- +1.7.10.4 + + +From 024d201c36e1b40f4f4d473e87d405e1b411230f Mon Sep 17 00:00:00 2001 +From: KSV +Date: Sun, 31 Jul 2011 12:33:46 -0700 +Subject: [PATCH 11/33] Justin.TV usherToken detection + +--- + rtmpsrv.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 59 insertions(+), 2 deletions(-) + +diff --git a/rtmpsrv.c b/rtmpsrv.c +index f1b6c66..805ce0d 100644 +--- a/rtmpsrv.c ++++ b/rtmpsrv.c +@@ -95,6 +95,7 @@ STREAMING_SERVER *rtmpServer = 0; // server structure pointer + + STREAMING_SERVER *startStreaming(const char *address, int port); + void stopStreaming(STREAMING_SERVER * server); ++char *strreplace(char *srcstr, int srclen, char *orig, char *repl); + + typedef struct + { +@@ -261,6 +262,7 @@ static const AVal av_NetStream_Play_Stop = AVC("NetStream.Play.Stop"); + static const AVal av_Stopped_playing = AVC("Stopped playing"); + SAVC(details); + SAVC(clientid); ++static const AVal av_NetStream_Authenticate_UsherToken = AVC("NetStream.Authenticate.UsherToken"); + + static int + SendPlayStart(RTMP *r) +@@ -575,6 +577,13 @@ ServeInvoke(STREAMING_SERVER *server, RTMP * r, RTMPPacket *packet, unsigned int + { + SendResultNumber(r, txn, 10.0); + } ++ else if (AVMATCH(&method, &av_NetStream_Authenticate_UsherToken)) ++ { ++ AMFObjectProperty *prop = AMF_GetProp(&obj, NULL, 3); ++ AMFProp_GetString(prop, &r->Link.usherToken); ++ prop->p_vu.p_aval.av_len = 0; ++ prop->p_vu.p_aval.av_val = NULL; ++ } + else if (AVMATCH(&method, &av_play)) + { + char *file, *p, *q, *cmd, *ptr; +@@ -591,10 +600,11 @@ ServeInvoke(STREAMING_SERVER *server, RTMP * r, RTMPPacket *packet, unsigned int + if (r->Link.tcUrl.av_len) + { + len = server->arglen + r->Link.playpath.av_len + 4 + +- sizeof("rtmpdump") + r->Link.playpath.av_len + 12; ++ sizeof("rtmpdump") + r->Link.playpath.av_len + 12 + ++ r->Link.usherToken.av_len + 64; + server->argc += 5; + +- cmd = malloc(len + server->argc * sizeof(AVal)); ++ cmd = malloc(len + (server->argc + 2) * sizeof(AVal)); + ptr = cmd; + argv = (AVal *)(cmd + len); + argv[0].av_val = cmd; +@@ -640,6 +650,17 @@ ServeInvoke(STREAMING_SERVER *server, RTMP * r, RTMPPacket *packet, unsigned int + ptr += sprintf(ptr, " -p \"%s\"", r->Link.pageUrl.av_val); + argv[argc++].av_len = r->Link.pageUrl.av_len; + } ++ if (r->Link.usherToken.av_val) ++ { ++ char *usherToken = strreplace(r->Link.usherToken.av_val, r->Link.usherToken.av_len, "\"", "\\\""); ++ argv[argc].av_val = ptr + 1; ++ argv[argc++].av_len = 5; ++ argv[argc].av_val = ptr + 8; ++ ptr += sprintf(ptr, " --jtv \"%s\"", usherToken); ++ argv[argc++].av_len = strlen(usherToken); ++ server->argc += 2; ++ free(usherToken); ++ } + if (r->Link.extras.o_num) { + ptr = dumpAMF(&r->Link.extras, ptr, argv, &argc); + AMF_Reset(&r->Link.extras); +@@ -1111,3 +1132,39 @@ main(int argc, char **argv) + #endif + return nStatus; + } ++ ++char * ++strreplace(char *srcstr, int srclen, char *orig, char *repl) ++{ ++ char *ptr = NULL, *srcstrstart = srcstr; ++ int origlen = strlen(orig); ++ int repllen = strlen(repl); ++ if (!srclen) ++ srclen = strlen(srcstr); ++ char *srcend = srcstr + srclen; ++ int deststrbuffer = srclen / origlen * repllen; ++ if (deststrbuffer < srclen) ++ deststrbuffer = srclen; ++ char *deststr = calloc(deststrbuffer + 1, sizeof(char)); ++ char *deststrstart = deststr; ++ ++ if ( (ptr = strstr(srcstr, orig)) ) ++ { ++ do ++ { ++ int len = ptr - srcstrstart; ++ memcpy(deststrstart, srcstrstart, len); ++ srcstrstart += len + origlen; ++ deststrstart += len; ++ memcpy(deststrstart, repl, repllen); ++ deststrstart += repllen; ++ ptr = strstr(srcstrstart, orig); ++ } ++ while (ptr && (ptr < srcend)); ++ strncpy(deststrstart, srcstrstart, srcend-srcstrstart); ++ return deststr; ++ } ++ ++ strncpy(deststr, srcstr, srclen); ++ return deststr; ++} +-- +1.7.10.4 + + +From f1abda046ca5a3f1efa63033c542e686b43dbcf3 Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Sun, 31 Jul 2011 13:21:12 -0700 +Subject: [PATCH 12/33] Cleanup previous commit + +--- + rtmpsrv.c | 111 ++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 62 insertions(+), 49 deletions(-) + +diff --git a/rtmpsrv.c b/rtmpsrv.c +index 805ce0d..b45aae3 100644 +--- a/rtmpsrv.c ++++ b/rtmpsrv.c +@@ -1,6 +1,6 @@ + /* Simple RTMP Server + * Copyright (C) 2009 Andrej Stepanchuk +- * Copyright (C) 2009 Howard Chu ++ * Copyright (C) 2009-2011 Howard Chu + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -95,7 +95,10 @@ STREAMING_SERVER *rtmpServer = 0; // server structure pointer + + STREAMING_SERVER *startStreaming(const char *address, int port); + void stopStreaming(STREAMING_SERVER * server); +-char *strreplace(char *srcstr, int srclen, char *orig, char *repl); ++void AVreplace(AVal *src, const AVal *orig, const AVal *repl); ++ ++static const AVal av_dquote = AVC("\""); ++static const AVal av_escdquote = AVC("\\\""); + + typedef struct + { +@@ -579,10 +582,12 @@ ServeInvoke(STREAMING_SERVER *server, RTMP * r, RTMPPacket *packet, unsigned int + } + else if (AVMATCH(&method, &av_NetStream_Authenticate_UsherToken)) + { +- AMFObjectProperty *prop = AMF_GetProp(&obj, NULL, 3); +- AMFProp_GetString(prop, &r->Link.usherToken); +- prop->p_vu.p_aval.av_len = 0; +- prop->p_vu.p_aval.av_val = NULL; ++ AVal usherToken; ++ AMFProp_GetString(AMF_GetProp(&obj, NULL, 3), &usherToken); ++ AVreplace(&usherToken, &av_dquote, &av_escdquote); ++ server->arglen += 6 + usherToken.av_len; ++ server->argc += 2; ++ r->Link.usherToken = usherToken; + } + else if (AVMATCH(&method, &av_play)) + { +@@ -600,11 +605,10 @@ ServeInvoke(STREAMING_SERVER *server, RTMP * r, RTMPPacket *packet, unsigned int + if (r->Link.tcUrl.av_len) + { + len = server->arglen + r->Link.playpath.av_len + 4 + +- sizeof("rtmpdump") + r->Link.playpath.av_len + 12 + +- r->Link.usherToken.av_len + 64; ++ sizeof("rtmpdump") + r->Link.playpath.av_len + 12; + server->argc += 5; + +- cmd = malloc(len + (server->argc + 2) * sizeof(AVal)); ++ cmd = malloc(len + server->argc * sizeof(AVal)); + ptr = cmd; + argv = (AVal *)(cmd + len); + argv[0].av_val = cmd; +@@ -650,17 +654,17 @@ ServeInvoke(STREAMING_SERVER *server, RTMP * r, RTMPPacket *packet, unsigned int + ptr += sprintf(ptr, " -p \"%s\"", r->Link.pageUrl.av_val); + argv[argc++].av_len = r->Link.pageUrl.av_len; + } +- if (r->Link.usherToken.av_val) +- { +- char *usherToken = strreplace(r->Link.usherToken.av_val, r->Link.usherToken.av_len, "\"", "\\\""); ++ if (r->Link.usherToken.av_val) ++ { + argv[argc].av_val = ptr + 1; +- argv[argc++].av_len = 5; +- argv[argc].av_val = ptr + 8; +- ptr += sprintf(ptr, " --jtv \"%s\"", usherToken); +- argv[argc++].av_len = strlen(usherToken); +- server->argc += 2; +- free(usherToken); +- } ++ argv[argc++].av_len = 2; ++ argv[argc].av_val = ptr + 5; ++ ptr += sprintf(ptr, " -j \"%s\"", r->Link.usherToken.av_val); ++ argv[argc++].av_len = r->Link.usherToken.av_len; ++ free(r->Link.usherToken.av_val); ++ r->Link.usherToken.av_val = NULL; ++ r->Link.usherToken.av_len = 0; ++ } + if (r->Link.extras.o_num) { + ptr = dumpAMF(&r->Link.extras, ptr, argv, &argc); + AMF_Reset(&r->Link.extras); +@@ -932,6 +936,11 @@ cleanup: + rtmp.Link.pageUrl.av_val = NULL; + rtmp.Link.app.av_val = NULL; + rtmp.Link.flashVer.av_val = NULL; ++ if (rtmp.Link.usherToken.av_val) ++ { ++ free(rtmp.Link.usherToken.av_val); ++ rtmp.Link.usherToken.av_val = NULL; ++ } + RTMP_LogPrintf("done!\n\n"); + + quit: +@@ -1133,38 +1142,42 @@ main(int argc, char **argv) + return nStatus; + } + +-char * +-strreplace(char *srcstr, int srclen, char *orig, char *repl) ++void ++AVreplace(AVal *src, const AVal *orig, const AVal *repl) + { +- char *ptr = NULL, *srcstrstart = srcstr; +- int origlen = strlen(orig); +- int repllen = strlen(repl); +- if (!srclen) +- srclen = strlen(srcstr); +- char *srcend = srcstr + srclen; +- int deststrbuffer = srclen / origlen * repllen; +- if (deststrbuffer < srclen) +- deststrbuffer = srclen; +- char *deststr = calloc(deststrbuffer + 1, sizeof(char)); +- char *deststrstart = deststr; +- +- if ( (ptr = strstr(srcstr, orig)) ) +- { +- do ++ char *srcbeg = src->av_val; ++ char *srcend = src->av_val + src->av_len; ++ char *dest, *sptr, *dptr; ++ int n = 0; ++ ++ /* count occurrences of orig in src */ ++ sptr = src->av_val; ++ while (sptr < srcend && (sptr = strstr(sptr, orig->av_val))) + { +- int len = ptr - srcstrstart; +- memcpy(deststrstart, srcstrstart, len); +- srcstrstart += len + origlen; +- deststrstart += len; +- memcpy(deststrstart, repl, repllen); +- deststrstart += repllen; +- ptr = strstr(srcstrstart, orig); ++ n++; ++ sptr += orig->av_len; + } +- while (ptr && (ptr < srcend)); +- strncpy(deststrstart, srcstrstart, srcend-srcstrstart); +- return deststr; +- } ++ if (!n) ++ return; + +- strncpy(deststr, srcstr, srclen); +- return deststr; ++ dest = malloc(src->av_len + 1 + (repl->av_len - orig->av_len) * n); ++ ++ sptr = src->av_val; ++ dptr = dest; ++ while (sptr < srcend && (sptr = strstr(sptr, orig->av_val))) ++ { ++ n = sptr - srcbeg; ++ memcpy(dptr, srcbeg, n); ++ srcbeg += n; ++ dptr += n; ++ memcpy(dptr, repl->av_val, repl->av_len); ++ dptr += repl->av_len; ++ sptr += orig->av_len; ++ } ++ n = srcend - srcbeg; ++ memcpy(dptr, srcbeg, n); ++ dptr += n; ++ *dptr = '\0'; ++ src->av_val = dest; ++ src->av_len = dptr - dest; + } +-- +1.7.10.4 + + +From 8880d1456b282ee79979adbe7b6a6eb8ad371081 Mon Sep 17 00:00:00 2001 +From: Chris Larsen +Date: Tue, 2 Aug 2011 12:33:44 -0400 +Subject: [PATCH 13/33] Unexpected BW Response Fix + +Bug: SendCheckBWResult sends an invalid bw response due to casting issues +from a double to an int. +--- + librtmp/rtmp.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index df2cb27..5311a8a 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -2339,7 +2339,7 @@ HandleInvoke(RTMP *r, const char *body, unsigned int nBodySize) + { + AMFObject obj; + AVal method; +- int txn; ++ double txn; + int ret = 0, nRes; + if (body[0] != 0x02) /* make sure it is a string method name we start with */ + { +@@ -2357,7 +2357,7 @@ HandleInvoke(RTMP *r, const char *body, unsigned int nBodySize) + + AMF_Dump(&obj); + AMFProp_GetString(AMF_GetProp(&obj, NULL, 0), &method); +- txn = (int)AMFProp_GetNumber(AMF_GetProp(&obj, NULL, 1)); ++ txn = AMFProp_GetNumber(AMF_GetProp(&obj, NULL, 1)); + RTMP_Log(RTMP_LOGDEBUG, "%s, server invoking <%s>", __FUNCTION__, method.av_val); + + if (AVMATCH(&method, &av__result)) +@@ -2366,7 +2366,7 @@ HandleInvoke(RTMP *r, const char *body, unsigned int nBodySize) + int i; + + for (i=0; im_numCalls; i++) { +- if (r->m_methodCalls[i].num == txn) { ++ if (r->m_methodCalls[i].num == (int)txn) { + methodInvoked = r->m_methodCalls[i].name; + AV_erase(r->m_methodCalls, &r->m_numCalls, i, FALSE); + break; +-- +1.7.10.4 + + +From c528451068de033d7cc76eb1c5a606c10215fcfb Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Wed, 3 Aug 2011 11:46:07 -0700 +Subject: [PATCH 14/33] Fix include order + +--- + librtmp/rtmp_sys.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librtmp/rtmp_sys.h b/librtmp/rtmp_sys.h +index 6a3f215..638374f 100644 +--- a/librtmp/rtmp_sys.h ++++ b/librtmp/rtmp_sys.h +@@ -46,10 +46,10 @@ + #include + #include + #include +-#include + #include + #include + #include ++#include + #define GetSockError() errno + #define SetSockError(e) errno = e + #undef closesocket +-- +1.7.10.4 + + +From a1114e09bf0d74ef1d575eb88f3aa36bc7c6d790 Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Tue, 9 Aug 2011 14:44:14 -0700 +Subject: [PATCH 15/33] Fix AVreplace for usherToken + +--- + rtmpsrv.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rtmpsrv.c b/rtmpsrv.c +index b45aae3..91fc4da 100644 +--- a/rtmpsrv.c ++++ b/rtmpsrv.c +@@ -1168,11 +1168,11 @@ AVreplace(AVal *src, const AVal *orig, const AVal *repl) + { + n = sptr - srcbeg; + memcpy(dptr, srcbeg, n); +- srcbeg += n; + dptr += n; + memcpy(dptr, repl->av_val, repl->av_len); + dptr += repl->av_len; + sptr += orig->av_len; ++ srcbeg = sptr; + } + n = srcend - srcbeg; + memcpy(dptr, srcbeg, n); +-- +1.7.10.4 + + +From c58cfb3e9208c6e6bc1aa18f1b1d650d799084e5 Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Thu, 11 Aug 2011 18:02:10 -0700 +Subject: [PATCH 16/33] Add RD_NO_CONNECT return code for Connect failures + +--- + rtmpdump.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rtmpdump.c b/rtmpdump.c +index e506fa9..01decf9 100644 +--- a/rtmpdump.c ++++ b/rtmpdump.c +@@ -46,6 +46,7 @@ + #define RD_SUCCESS 0 + #define RD_FAILED 1 + #define RD_INCOMPLETE 2 ++#define RD_NO_CONNECT 3 + + #define DEF_TIMEOUT 30 /* seconds */ + #define DEF_BUFTIME (10 * 60 * 60 * 1000) /* 10 hours default */ +@@ -1253,7 +1254,7 @@ main(int argc, char **argv) + + if (!RTMP_Connect(&rtmp, NULL)) + { +- nStatus = RD_FAILED; ++ nStatus = RD_NO_CONNECT; + break; + } + +-- +1.7.10.4 + + +From 6230845ab0fba07289d4b2d9b97269e4b2d90766 Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Sun, 25 Sep 2011 03:07:14 -0700 +Subject: [PATCH 17/33] PolarSSL support now requires version 1.0.0. + +--- + README | 1 + + librtmp/dh.h | 7 +++---- + librtmp/rtmp_sys.h | 3 ++- + 3 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/README b/README +index 865c6c4..dcf5f52 100644 +--- a/README ++++ b/README +@@ -50,6 +50,7 @@ library. You can also turn it off if desired + The rtmpdump programs still link to the static library, regardless. + + Note that if using OpenSSL, you must have version 0.9.8 or newer. ++For Polar SSL you must have version 1.0.0 or newer. + + Credit goes to team boxee for the XBMC RTMP code originally used in RTMPDumper. + The current code is based on the XBMC code but rewritten in C by Howard Chu. +diff --git a/librtmp/dh.h b/librtmp/dh.h +index efef0fd..a9f3763 100644 +--- a/librtmp/dh.h ++++ b/librtmp/dh.h +@@ -30,14 +30,14 @@ + #ifdef USE_POLARSSL + #include + typedef mpi * MP_t; +-#define MP_new(m) m = malloc(sizeof(mpi)); mpi_init(m, NULL) ++#define MP_new(m) m = malloc(sizeof(mpi)); mpi_init(m) + #define MP_set_w(mpi, w) mpi_lset(mpi, w) + #define MP_cmp(u, v) mpi_cmp_mpi(u, v) + #define MP_set(u, v) mpi_copy(u, v) + #define MP_sub_w(mpi, w) mpi_sub_int(mpi, mpi, w) + #define MP_cmp_1(mpi) mpi_cmp_int(mpi, 1) + #define MP_modexp(r, y, q, p) mpi_exp_mod(r, y, q, p, NULL) +-#define MP_free(mpi) mpi_free(mpi, NULL); free(mpi) ++#define MP_free(mpi) mpi_free(mpi); free(mpi) + #define MP_gethex(u, hex, res) MP_new(u); res = mpi_read_string(u, 16, hex) == 0 + #define MP_bytes(u) mpi_size(u) + #define MP_setbin(u,buf,len) mpi_write_binary(u,buf,len) +@@ -71,9 +71,8 @@ static int MDH_generate_key(MDH *dh) + + static int MDH_compute_key(uint8_t *secret, size_t len, MP_t pub, MDH *dh) + { +- int n = len; + MP_set(&dh->ctx.GY, pub); +- dhm_calc_secret(&dh->ctx, secret, &n); ++ dhm_calc_secret(&dh->ctx, secret, &len); + return 0; + } + +diff --git a/librtmp/rtmp_sys.h b/librtmp/rtmp_sys.h +index 638374f..c3fd4a6 100644 +--- a/librtmp/rtmp_sys.h ++++ b/librtmp/rtmp_sys.h +@@ -71,7 +71,8 @@ typedef struct tls_ctx { + #define TLS_CTX tls_ctx * + #define TLS_client(ctx,s) s = malloc(sizeof(ssl_context)); ssl_init(s);\ + ssl_set_endpoint(s, SSL_IS_CLIENT); ssl_set_authmode(s, SSL_VERIFY_NONE);\ +- ssl_set_rng(s, havege_rand, &ctx->hs); ssl_set_ciphers(s, ssl_default_ciphers);\ ++ ssl_set_rng(s, havege_rand, &ctx->hs);\ ++ ssl_set_ciphersuites(s, ssl_default_ciphersuites);\ + ssl_set_session(s, 1, 600, &ctx->ssn) + #define TLS_setfd(s,fd) ssl_set_bio(s, net_recv, &fd, net_send, &fd) + #define TLS_connect(s) ssl_handshake(s) +-- +1.7.10.4 + + +From 60218d0af0f4bd683ecdebe49986f188820cf8ce Mon Sep 17 00:00:00 2001 +From: Kirill Zorin +Date: Fri, 30 Sep 2011 13:38:23 -0400 +Subject: [PATCH 18/33] fixed undefined behaviour due to union assignment + +--- + librtmp/amf.c | 2 +- + librtmp/rtmp.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/librtmp/amf.c b/librtmp/amf.c +index 7fa289e..ae920e4 100644 +--- a/librtmp/amf.c ++++ b/librtmp/amf.c +@@ -1111,7 +1111,7 @@ AMF_AddProp(AMFObject *obj, const AMFObjectProperty *prop) + if (!(obj->o_num & 0x0f)) + obj->o_props = + realloc(obj->o_props, (obj->o_num + 16) * sizeof(AMFObjectProperty)); +- obj->o_props[obj->o_num++] = *prop; ++ memcpy(&obj->o_props[obj->o_num++], prop, sizeof(AMFObjectProperty)); + } + + int +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index 5311a8a..4b17a49 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -2584,7 +2584,7 @@ RTMP_FindFirstMatchingProperty(AMFObject *obj, const AVal *name, + + if (AVMATCH(&prop->p_name, name)) + { +- *p = *prop; ++ memcpy(p, prop, sizeof(*prop)); + return TRUE; + } + +@@ -2610,7 +2610,7 @@ RTMP_FindPrefixProperty(AMFObject *obj, const AVal *name, + if (prop->p_name.av_len > name->av_len && + !memcmp(prop->p_name.av_val, name->av_val, name->av_len)) + { +- *p = *prop; ++ memcpy(p, prop, sizeof(*prop)); + return TRUE; + } + +-- +1.7.10.4 + + +From c90c05892cbaebfb1b2095759597d9fb38238c64 Mon Sep 17 00:00:00 2001 +From: KSV +Date: Mon, 7 Nov 2011 11:38:27 -0800 +Subject: [PATCH 19/33] Fix bytes-received report + +--- + librtmp/rtmp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index 4b17a49..a9c1bc1 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -1337,7 +1337,7 @@ ReadN(RTMP *r, char *buffer, int n) + nBytes = nRead; + r->m_nBytesIn += nRead; + if (r->m_bSendCounter +- && r->m_nBytesIn > r->m_nBytesInSent + r->m_nClientBW / 2) ++ && r->m_nBytesIn > ( r->m_nBytesInSent + r->m_nClientBW / 10)) + if (!SendBytesReceived(r)) + return FALSE; + } +-- +1.7.10.4 + + +From b3467069ad7c26d748ca13ce0ee88a41f85b22dd Mon Sep 17 00:00:00 2001 +From: Jeff Johnson +Date: Mon, 7 Nov 2011 11:43:26 -0800 +Subject: [PATCH 20/33] Fix getting swf hash with https URLs + +--- + librtmp/hashswf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librtmp/hashswf.c b/librtmp/hashswf.c +index 3c56b69..5576730 100644 +--- a/librtmp/hashswf.c ++++ b/librtmp/hashswf.c +@@ -163,7 +163,7 @@ HTTP_get(struct HTTP_ctx *http, const char *url, HTTP_read_callback *cb) + #else + TLS_client(RTMP_TLS_ctx, sb.sb_ssl); + TLS_setfd(sb.sb_ssl, sb.sb_socket); +- if ((i = TLS_connect(sb.sb_ssl)) < 0) ++ if (TLS_connect(sb.sb_ssl) < 0) + { + RTMP_Log(RTMP_LOGERROR, "%s, TLS_Connect failed", __FUNCTION__); + ret = HTTPRES_LOST_CONNECTION; +-- +1.7.10.4 + + +From 90799efbb67f415ff930d68905e8267d5aa5dc4e Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Tue, 8 Nov 2011 02:04:01 -0800 +Subject: [PATCH 21/33] Increase tcUrl buffer size + +--- + rtmpdump.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/rtmpdump.c b/rtmpdump.c +index 01decf9..a8fa128 100644 +--- a/rtmpdump.c ++++ b/rtmpdump.c +@@ -1152,9 +1152,9 @@ main(int argc, char **argv) + + if (tcUrl.av_len == 0) + { +- char str[512] = { 0 }; ++ char str[1024]; + +- tcUrl.av_len = snprintf(str, 511, "%s://%.*s:%d/%.*s", ++ tcUrl.av_len = snprintf(str, sizeof(str), "%s://%.*s:%d/%.*s", + RTMPProtocolStringsLower[protocol], hostname.av_len, + hostname.av_val, port, app.av_len, app.av_val); + tcUrl.av_val = (char *) malloc(tcUrl.av_len + 1); +-- +1.7.10.4 + + +From 9df7959a71ec33cc9c83c9d3ef25c17b1c527f0e Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Tue, 8 Nov 2011 02:05:01 -0800 +Subject: [PATCH 22/33] Spell Referer according to RFC1945 + +--- + librtmp/hashswf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librtmp/hashswf.c b/librtmp/hashswf.c +index 5576730..0320480 100644 +--- a/librtmp/hashswf.c ++++ b/librtmp/hashswf.c +@@ -141,7 +141,7 @@ HTTP_get(struct HTTP_ctx *http, const char *url, HTTP_read_callback *cb) + return HTTPRES_LOST_CONNECTION; + i = + sprintf(sb.sb_buf, +- "GET %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\nReferrer: %.*s\r\n", ++ "GET %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\nReferer: %.*s\r\n", + path, AGENT, host, (int)(path - url + 1), url); + if (http->date[0]) + i += sprintf(sb.sb_buf + i, "If-Modified-Since: %s\r\n", http->date); +-- +1.7.10.4 + + +From 1c77ff43439068981d2ad9872952922a1ee37f89 Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Tue, 8 Nov 2011 02:13:14 -0800 +Subject: [PATCH 23/33] Calculate tcUrl length + +--- + rtmpdump.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/rtmpdump.c b/rtmpdump.c +index a8fa128..892a8bc 100644 +--- a/rtmpdump.c ++++ b/rtmpdump.c +@@ -1152,13 +1152,12 @@ main(int argc, char **argv) + + if (tcUrl.av_len == 0) + { +- char str[1024]; +- +- tcUrl.av_len = snprintf(str, sizeof(str), "%s://%.*s:%d/%.*s", ++ tcUrl.av_len = strlen(RTMPProtocolStringsLower[protocol]) + ++ hostname.av_len + app.av_len + sizeof("://:65535/"); ++ tcUrl.av_val = (char *) malloc(tcUrl.av_len); ++ tcUrl.av_len = snprintf(tcUrl.av_val, tcUrl.av_len, "%s://%.*s:%d/%.*s", + RTMPProtocolStringsLower[protocol], hostname.av_len, + hostname.av_val, port, app.av_len, app.av_val); +- tcUrl.av_val = (char *) malloc(tcUrl.av_len + 1); +- strcpy(tcUrl.av_val, str); + } + + int first = 1; +-- +1.7.10.4 + + +From 30fcf46fc82f96ca41b710fc38bbc15f2489795e Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Tue, 8 Nov 2011 02:14:21 -0800 +Subject: [PATCH 24/33] Check for malloc failure in prev commit + +--- + rtmpdump.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/rtmpdump.c b/rtmpdump.c +index 892a8bc..c37def2 100644 +--- a/rtmpdump.c ++++ b/rtmpdump.c +@@ -1155,6 +1155,8 @@ main(int argc, char **argv) + tcUrl.av_len = strlen(RTMPProtocolStringsLower[protocol]) + + hostname.av_len + app.av_len + sizeof("://:65535/"); + tcUrl.av_val = (char *) malloc(tcUrl.av_len); ++ if (!tcUrl.av_val) ++ return RD_FAILED; + tcUrl.av_len = snprintf(tcUrl.av_val, tcUrl.av_len, "%s://%.*s:%d/%.*s", + RTMPProtocolStringsLower[protocol], hostname.av_len, + hostname.av_val, port, app.av_len, app.av_val); +-- +1.7.10.4 + + +From 83e701eef0d7947713280fe3e7561bed1e7195f5 Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Mon, 14 Nov 2011 16:09:26 -0800 +Subject: [PATCH 25/33] Fix missing log message parameter + +--- + librtmp/rtmp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index a9c1bc1..4da318b 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -974,7 +974,7 @@ SocksNegotiate(RTMP *r) + } + else + { +- RTMP_Log(RTMP_LOGERROR, "%s, SOCKS returned error code %d", packet[1]); ++ RTMP_Log(RTMP_LOGERROR, "%s, SOCKS returned error code %d", __FUNCTION__, packet[1]); + return FALSE; + } + } +-- +1.7.10.4 + + +From 949da84ab1f659597d6e7fa1ef0ab8fc1ca8e246 Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Mon, 14 Nov 2011 16:11:13 -0800 +Subject: [PATCH 26/33] Tell gcc about log format strings + +--- + librtmp/log.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/librtmp/log.h b/librtmp/log.h +index 97c9aac..2adb111 100644 +--- a/librtmp/log.h ++++ b/librtmp/log.h +@@ -48,9 +48,15 @@ extern RTMP_LogLevel RTMP_debuglevel; + typedef void (RTMP_LogCallback)(int level, const char *fmt, va_list); + void RTMP_LogSetCallback(RTMP_LogCallback *cb); + void RTMP_LogSetOutput(FILE *file); ++#ifdef __GNUC__ ++void RTMP_LogPrintf(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); ++void RTMP_LogStatus(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); ++void RTMP_Log(int level, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); ++#else + void RTMP_LogPrintf(const char *format, ...); + void RTMP_LogStatus(const char *format, ...); + void RTMP_Log(int level, const char *format, ...); ++#endif + void RTMP_LogHex(int level, const uint8_t *data, unsigned long len); + void RTMP_LogHexString(int level, const uint8_t *data, unsigned long len); + void RTMP_LogSetLevel(RTMP_LogLevel lvl); +-- +1.7.10.4 + + +From 45556fb3b372402d7bd5235832176f58dede90ae Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Mon, 14 Nov 2011 16:12:26 -0800 +Subject: [PATCH 27/33] Fix mismatched format string conversions + +--- + librtmp/amf.c | 4 ++-- + librtmp/rtmp.c | 22 +++++++++++----------- + 2 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/librtmp/amf.c b/librtmp/amf.c +index ae920e4..f9ecf21 100644 +--- a/librtmp/amf.c ++++ b/librtmp/amf.c +@@ -586,7 +586,7 @@ AMF3Prop_Decode(AMFObjectProperty *prop, const char *pBuffer, int nSize, + case AMF3_ARRAY: + case AMF3_BYTE_ARRAY: + default: +- RTMP_Log(RTMP_LOGDEBUG, "%s - AMF3 unknown/unsupported datatype 0x%02x, @0x%08X", ++ RTMP_Log(RTMP_LOGDEBUG, "%s - AMF3 unknown/unsupported datatype 0x%02x, @%p", + __FUNCTION__, (unsigned char)(*pBuffer), pBuffer); + return -1; + } +@@ -772,7 +772,7 @@ AMFProp_Decode(AMFObjectProperty *prop, const char *pBuffer, int nSize, + break; + } + default: +- RTMP_Log(RTMP_LOGDEBUG, "%s - unknown datatype 0x%02x, @0x%08X", __FUNCTION__, ++ RTMP_Log(RTMP_LOGDEBUG, "%s - unknown datatype 0x%02x, @%p", __FUNCTION__, + prop->p_type, pBuffer - 1); + return -1; + } +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index 4da318b..52d0254 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -185,7 +185,7 @@ void + RTMPPacket_Dump(RTMPPacket *p) + { + RTMP_Log(RTMP_LOGDEBUG, +- "RTMP PACKET: packet type: 0x%02x. channel: 0x%02x. info 1: %d info 2: %d. Body size: %lu. body: 0x%02x", ++ "RTMP PACKET: packet type: 0x%02x. channel: 0x%02x. info 1: %d info 2: %d. Body size: %u. body: 0x%02x", + p->m_packetType, p->m_nChannel, p->m_nTimeStamp, p->m_nInfoField2, + p->m_nBodySize, p->m_body ? (unsigned char)p->m_body[0] : 0); + } +@@ -367,7 +367,7 @@ RTMP_SetupStream(RTMP *r, + RTMP_Log(RTMP_LOGDEBUG, "StopTime : %d msec", dStop); + + RTMP_Log(RTMP_LOGDEBUG, "live : %s", bLiveStream ? "yes" : "no"); +- RTMP_Log(RTMP_LOGDEBUG, "timeout : %d sec", timeout); ++ RTMP_Log(RTMP_LOGDEBUG, "timeout : %ld sec", timeout); + + #ifdef CRYPTO + if (swfSHA256Hash != NULL && swfSize > 0) +@@ -376,7 +376,7 @@ RTMP_SetupStream(RTMP *r, + r->Link.SWFSize = swfSize; + RTMP_Log(RTMP_LOGDEBUG, "SWFSHA256:"); + RTMP_LogHex(RTMP_LOGDEBUG, r->Link.SWFHash, sizeof(r->Link.SWFHash)); +- RTMP_Log(RTMP_LOGDEBUG, "SWFSize : %lu", r->Link.SWFSize); ++ RTMP_Log(RTMP_LOGDEBUG, "SWFSize : %u", r->Link.SWFSize); + } + else + { +@@ -1161,14 +1161,14 @@ RTMP_ClientPacket(RTMP *r, RTMPPacket *packet) + case RTMP_PACKET_TYPE_FLEX_STREAM_SEND: + /* flex stream send */ + RTMP_Log(RTMP_LOGDEBUG, +- "%s, flex stream send, size %lu bytes, not supported, ignoring", ++ "%s, flex stream send, size %u bytes, not supported, ignoring", + __FUNCTION__, packet->m_nBodySize); + break; + + case RTMP_PACKET_TYPE_FLEX_SHARED_OBJECT: + /* flex shared object */ + RTMP_Log(RTMP_LOGDEBUG, +- "%s, flex shared object, size %lu bytes, not supported, ignoring", ++ "%s, flex shared object, size %u bytes, not supported, ignoring", + __FUNCTION__, packet->m_nBodySize); + break; + +@@ -1176,7 +1176,7 @@ RTMP_ClientPacket(RTMP *r, RTMPPacket *packet) + /* flex message */ + { + RTMP_Log(RTMP_LOGDEBUG, +- "%s, flex message, size %lu bytes, not fully supported", ++ "%s, flex message, size %u bytes, not fully supported", + __FUNCTION__, packet->m_nBodySize); + /*RTMP_LogHex(packet.m_body, packet.m_nBodySize); */ + +@@ -1198,7 +1198,7 @@ RTMP_ClientPacket(RTMP *r, RTMPPacket *packet) + } + case RTMP_PACKET_TYPE_INFO: + /* metadata (notify) */ +- RTMP_Log(RTMP_LOGDEBUG, "%s, received: notify %lu bytes", __FUNCTION__, ++ RTMP_Log(RTMP_LOGDEBUG, "%s, received: notify %u bytes", __FUNCTION__, + packet->m_nBodySize); + if (HandleMetadata(r, packet->m_body, packet->m_nBodySize)) + bHasMediaPacket = 1; +@@ -1211,7 +1211,7 @@ RTMP_ClientPacket(RTMP *r, RTMPPacket *packet) + + case RTMP_PACKET_TYPE_INVOKE: + /* invoke */ +- RTMP_Log(RTMP_LOGDEBUG, "%s, received: invoke %lu bytes", __FUNCTION__, ++ RTMP_Log(RTMP_LOGDEBUG, "%s, received: invoke %u bytes", __FUNCTION__, + packet->m_nBodySize); + /*RTMP_LogHex(packet.m_body, packet.m_nBodySize); */ + +@@ -2373,7 +2373,7 @@ HandleInvoke(RTMP *r, const char *body, unsigned int nBodySize) + } + } + if (!methodInvoked.av_val) { +- RTMP_Log(RTMP_LOGDEBUG, "%s, received result id %d without matching request", ++ RTMP_Log(RTMP_LOGDEBUG, "%s, received result id %f without matching request", + __FUNCTION__, txn); + goto leave; + } +@@ -3055,7 +3055,7 @@ RTMP_ReadPacket(RTMP *r, RTMPPacket *packet) + + if (ReadN(r, packet->m_body + packet->m_nBytesRead, nChunk) != nChunk) + { +- RTMP_Log(RTMP_LOGERROR, "%s, failed to read RTMP packet body. len: %lu", ++ RTMP_Log(RTMP_LOGERROR, "%s, failed to read RTMP packet body. len: %u", + __FUNCTION__, packet->m_nBodySize); + return FALSE; + } +@@ -4176,7 +4176,7 @@ Read_1_Packet(RTMP *r, char *buf, unsigned int buflen) + if (pos + 11 + dataSize > nPacketLen) + { + RTMP_Log(RTMP_LOGERROR, +- "Wrong data size (%lu), stream corrupted, aborting!", ++ "Wrong data size (%u), stream corrupted, aborting!", + dataSize); + ret = RTMP_READ_ERROR; + break; +-- +1.7.10.4 + + +From 5d03a4f0d6216da92830306436eae7eb318d5115 Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Mon, 14 Nov 2011 16:17:27 -0800 +Subject: [PATCH 28/33] Fix log messages + +--- + rtmpdump.c | 4 ++-- + rtmpgw.c | 6 +++--- + rtmpsrv.c | 8 ++++---- + rtmpsuck.c | 6 +++--- + 4 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/rtmpdump.c b/rtmpdump.c +index c37def2..34bfdba 100644 +--- a/rtmpdump.c ++++ b/rtmpdump.c +@@ -686,7 +686,7 @@ void usage(char *prog) + RTMP_LogPrintf + ("--resume|-e Resume a partial RTMP download\n"); + RTMP_LogPrintf +- ("--timeout|-m num Timeout connection num seconds (default: %lu)\n", ++ ("--timeout|-m num Timeout connection num seconds (default: %u)\n", + DEF_TIMEOUT); + RTMP_LogPrintf + ("--start|-A num Start at num seconds into stream (not valid when using --live)\n"); +@@ -699,7 +699,7 @@ void usage(char *prog) + RTMP_LogPrintf + ("--hashes|-# Display progress with hashes, not with the byte counter\n"); + RTMP_LogPrintf +- ("--buffer|-b Buffer time in milliseconds (default: %lu)\n", ++ ("--buffer|-b Buffer time in milliseconds (default: %u)\n", + DEF_BUFTIME); + RTMP_LogPrintf + ("--skip|-k num Skip num keyframes when looking for last keyframe to resume from. Useful if resume fails (default: %d)\n\n", +diff --git a/rtmpgw.c b/rtmpgw.c +index 733e105..0cf56bb 100644 +--- a/rtmpgw.c ++++ b/rtmpgw.c +@@ -563,7 +563,7 @@ void processTCPrequest(STREAMING_SERVER * server, // server socket and state (ou + rtmp.Link.token = req.token; + rtmp.m_read.timestamp = dSeek; + +- RTMP_LogPrintf("Connecting ... port: %d, app: %s\n", req.rtmpport, req.app); ++ RTMP_LogPrintf("Connecting ... port: %d, app: %s\n", req.rtmpport, req.app.av_val); + if (!RTMP_Connect(&rtmp, NULL)) + { + RTMP_LogPrintf("%s, failed to connect!\n", __FUNCTION__); +@@ -738,7 +738,7 @@ stopStreaming(STREAMING_SERVER * server) + + if (closesocket(server->socket)) + RTMP_Log(RTMP_LOGERROR, "%s: Failed to close listening socket, error %d", +- GetSockError()); ++ __FUNCTION__, GetSockError()); + + server->state = STREAMING_STOPPED; + } +@@ -1103,7 +1103,7 @@ main(int argc, char **argv) + RTMP_LogPrintf + ("--jtv|-j JSON Authentication token for Justin.tv legacy servers\n"); + RTMP_LogPrintf +- ("--buffer|-b Buffer time in milliseconds (default: %lu)\n\n", ++ ("--buffer|-b Buffer time in milliseconds (default: %u)\n\n", + defaultRTMPRequest.bufferTime); + + RTMP_LogPrintf +diff --git a/rtmpsrv.c b/rtmpsrv.c +index 91fc4da..b662d54 100644 +--- a/rtmpsrv.c ++++ b/rtmpsrv.c +@@ -765,7 +765,7 @@ ServePacket(STREAMING_SERVER *server, RTMP *r, RTMPPacket *packet) + { + int ret = 0; + +- RTMP_Log(RTMP_LOGDEBUG, "%s, received packet type %02X, size %lu bytes", __FUNCTION__, ++ RTMP_Log(RTMP_LOGDEBUG, "%s, received packet type %02X, size %u bytes", __FUNCTION__, + packet->m_packetType, packet->m_nBodySize); + + switch (packet->m_packetType) +@@ -812,7 +812,7 @@ ServePacket(STREAMING_SERVER *server, RTMP *r, RTMPPacket *packet) + + case 0x11: // flex message + { +- RTMP_Log(RTMP_LOGDEBUG, "%s, flex message, size %lu bytes, not fully supported", ++ RTMP_Log(RTMP_LOGDEBUG, "%s, flex message, size %u bytes, not fully supported", + __FUNCTION__, packet->m_nBodySize); + //RTMP_LogHex(packet.m_body, packet.m_nBodySize); + +@@ -840,7 +840,7 @@ ServePacket(STREAMING_SERVER *server, RTMP *r, RTMPPacket *packet) + + case 0x14: + // invoke +- RTMP_Log(RTMP_LOGDEBUG, "%s, received: invoke %lu bytes", __FUNCTION__, ++ RTMP_Log(RTMP_LOGDEBUG, "%s, received: invoke %u bytes", __FUNCTION__, + packet->m_nBodySize); + //RTMP_LogHex(packet.m_body, packet.m_nBodySize); + +@@ -1053,7 +1053,7 @@ stopStreaming(STREAMING_SERVER * server) + + if (closesocket(server->socket)) + RTMP_Log(RTMP_LOGERROR, "%s: Failed to close listening socket, error %d", +- GetSockError()); ++ __FUNCTION__, GetSockError()); + + server->state = STREAMING_STOPPED; + } +diff --git a/rtmpsuck.c b/rtmpsuck.c +index 661e64b..e886179 100644 +--- a/rtmpsuck.c ++++ b/rtmpsuck.c +@@ -456,7 +456,7 @@ ServePacket(STREAMING_SERVER *server, int which, RTMPPacket *packet) + { + int ret = 0; + +- RTMP_Log(RTMP_LOGDEBUG, "%s, %s sent packet type %02X, size %lu bytes", __FUNCTION__, ++ RTMP_Log(RTMP_LOGDEBUG, "%s, %s sent packet type %02X, size %u bytes", __FUNCTION__, + cst[which], packet->m_packetType, packet->m_nBodySize); + + switch (packet->m_packetType) +@@ -649,7 +649,7 @@ WriteStream(char **buf, // target pointer, maybe preallocated + if (pos + 11 + dataSize > nPacketLen) + { + RTMP_Log(RTMP_LOGERROR, +- "Wrong data size (%lu), stream corrupted, aborting!", ++ "Wrong data size (%u), stream corrupted, aborting!", + dataSize); + ret = -2; + break; +@@ -1117,7 +1117,7 @@ stopStreaming(STREAMING_SERVER * server) + + if (fd && closesocket(fd)) + RTMP_Log(RTMP_LOGERROR, "%s: Failed to close listening socket, error %d", +- GetSockError()); ++ __FUNCTION__, GetSockError()); + + server->state = STREAMING_STOPPED; + } +-- +1.7.10.4 + + +From 4e06e218e230a86608637b613499984703a342cf Mon Sep 17 00:00:00 2001 +From: Antti Ajanki +Date: Thu, 22 Dec 2011 17:54:10 -0800 +Subject: [PATCH 29/33] Support decoding AMF_XML_DOC + +MF_XML_DOC data is an XML document which is encoded similarly to a +long string. +--- + librtmp/amf.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/librtmp/amf.c b/librtmp/amf.c +index f9ecf21..659421e 100644 +--- a/librtmp/amf.c ++++ b/librtmp/amf.c +@@ -735,13 +735,15 @@ AMFProp_Decode(AMFObjectProperty *prop, const char *pBuffer, int nSize, + break; + } + case AMF_LONG_STRING: ++ case AMF_XML_DOC: + { + unsigned int nStringSize = AMF_DecodeInt32(pBuffer); + if (nSize < (long)nStringSize + 4) + return -1; + AMF_DecodeLongString(pBuffer, &prop->p_vu.p_aval); + nSize -= (4 + nStringSize); +- prop->p_type = AMF_STRING; ++ if (prop->p_type == AMF_LONG_STRING) ++ prop->p_type = AMF_STRING; + break; + } + case AMF_RECORDSET: +@@ -750,12 +752,6 @@ AMFProp_Decode(AMFObjectProperty *prop, const char *pBuffer, int nSize, + return -1; + break; + } +- case AMF_XML_DOC: +- { +- RTMP_Log(RTMP_LOGERROR, "AMF_XML_DOC not supported!"); +- return -1; +- break; +- } + case AMF_TYPED_OBJECT: + { + RTMP_Log(RTMP_LOGERROR, "AMF_TYPED_OBJECT not supported!"); +-- +1.7.10.4 + + +From adb77ff4d72cea92b7c307ccb64e9aa930d866da Mon Sep 17 00:00:00 2001 +From: Joshua Allmann +Date: Fri, 24 Feb 2012 13:44:29 -0800 +Subject: [PATCH 30/33] Remove extra object end tag in Connect reply + +--- + rtmpsrv.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/rtmpsrv.c b/rtmpsrv.c +index b662d54..9aa62f3 100644 +--- a/rtmpsrv.c ++++ b/rtmpsrv.c +@@ -223,9 +223,6 @@ SendConnectResult(RTMP *r, double txn) + *enc++ = 0; + *enc++ = 0; + *enc++ = AMF_OBJECT_END; +- *enc++ = 0; +- *enc++ = 0; +- *enc++ = AMF_OBJECT_END; + + packet.m_nBodySize = enc - packet.m_body; + +-- +1.7.10.4 + + +From 2ad1d5d133a46ceeaaa05c9375e293f332871f3b Mon Sep 17 00:00:00 2001 +From: Josh Allmann +Date: Fri, 24 Feb 2012 13:46:59 -0800 +Subject: [PATCH 31/33] Fix upper bound check in AMF_GetProp + +--- + librtmp/amf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/librtmp/amf.c b/librtmp/amf.c +index 659421e..ce84f81 100644 +--- a/librtmp/amf.c ++++ b/librtmp/amf.c +@@ -1121,7 +1121,7 @@ AMF_GetProp(AMFObject *obj, const AVal *name, int nIndex) + { + if (nIndex >= 0) + { +- if (nIndex <= obj->o_num) ++ if (nIndex < obj->o_num) + return &obj->o_props[nIndex]; + } + else +-- +1.7.10.4 + + +From eea470fa5f9a5481a36dedd257549595ef7480d6 Mon Sep 17 00:00:00 2001 +From: Martin Storsjo +Date: Thu, 8 Mar 2012 23:10:11 -0800 +Subject: [PATCH 32/33] Add support for building with gnutls with nettle as + backend + +--- + Makefile | 1 + + librtmp/Makefile | 3 +++ + librtmp/dh.h | 20 +++++++++++++++++++- + librtmp/handshake.h | 20 ++++++++++++++++++++ + librtmp/hashswf.c | 11 +++++++++++ + librtmp/rtmp.c | 4 ++-- + librtmp/rtmp_sys.h | 2 +- + 7 files changed, 57 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 6ef5742..0cf41be 100644 +--- a/Makefile ++++ b/Makefile +@@ -13,6 +13,7 @@ CRYPTO=OPENSSL + #CRYPTO=GNUTLS + LIBZ=-lz + LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ) ++LIB_GNUTLS_NETTLE=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ) + LIB_OPENSSL=-lssl -lcrypto $(LIBZ) + LIB_POLARSSL=-lpolarssl $(LIBZ) + CRYPTO_LIB=$(LIB_$(CRYPTO)) +diff --git a/librtmp/Makefile b/librtmp/Makefile +index a0125f1..353c6c8 100644 +--- a/librtmp/Makefile ++++ b/librtmp/Makefile +@@ -21,14 +21,17 @@ CRYPTO=OPENSSL + DEF_POLARSSL=-DUSE_POLARSSL + DEF_OPENSSL=-DUSE_OPENSSL + DEF_GNUTLS=-DUSE_GNUTLS ++DEF_GNUTLS_NETTLE=-DUSE_GNUTLS_NETTLE + DEF_=-DNO_CRYPTO + REQ_GNUTLS=gnutls ++REQ_GNUTLS_NETTLE=gnutls + REQ_OPENSSL=libssl,libcrypto + LIBZ=-lz + LIBS_posix= + LIBS_darwin= + LIBS_mingw=-lws2_32 -lwinmm -lgdi32 + LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ) ++LIB_GNUTLS_NETTLE=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ) + LIB_OPENSSL=-lssl -lcrypto $(LIBZ) + LIB_POLARSSL=-lpolarssl $(LIBZ) + PRIVATE_LIBS=$(LIBS_$(SYS)) +diff --git a/librtmp/dh.h b/librtmp/dh.h +index a9f3763..830000e 100644 +--- a/librtmp/dh.h ++++ b/librtmp/dh.h +@@ -76,7 +76,8 @@ static int MDH_compute_key(uint8_t *secret, size_t len, MP_t pub, MDH *dh) + return 0; + } + +-#elif defined(USE_GNUTLS) ++#elif defined(USE_GNUTLS) || defined(USE_GNUTLS_NETTLE) ++#ifdef USE_GNUTLS + #include + typedef gcry_mpi_t MP_t; + #define MP_new(m) m = gcry_mpi_new(1) +@@ -91,6 +92,23 @@ typedef gcry_mpi_t MP_t; + #define MP_bytes(u) (gcry_mpi_get_nbits(u) + 7) / 8 + #define MP_setbin(u,buf,len) gcry_mpi_print(GCRYMPI_FMT_USG,buf,len,NULL,u) + #define MP_getbin(u,buf,len) gcry_mpi_scan(&u,GCRYMPI_FMT_USG,buf,len,NULL) ++#else ++#include ++#include ++typedef mpz_ptr MP_t; ++#define MP_new(m) m = malloc(sizeof(*m)); mpz_init2(m, 1) ++#define MP_set_w(mpi, w) mpz_set_ui(mpi, w) ++#define MP_cmp(u, v) mpz_cmp(u, v) ++#define MP_set(u, v) mpz_set(u, v) ++#define MP_sub_w(mpi, w) mpz_sub_ui(mpi, mpi, w) ++#define MP_cmp_1(mpi) mpz_cmp_ui(mpi, 1) ++#define MP_modexp(r, y, q, p) mpz_powm(r, y, q, p) ++#define MP_free(mpi) mpz_clear(mpi); free(mpi) ++#define MP_gethex(u, hex, res) u = malloc(sizeof(*u)); mpz_init2(u, 1); res = (mpz_set_str(u, hex, 16) == 0) ++#define MP_bytes(u) (mpz_sizeinbase(u, 2) + 7) / 8 ++#define MP_setbin(u,buf,len) nettle_mpz_get_str_256(len,buf,u) ++#define MP_getbin(u,buf,len) u = malloc(sizeof(*u)); mpz_init2(u, 1); nettle_mpz_set_str_256_u(u,len,buf) ++#endif + + typedef struct MDH { + MP_t p; +diff --git a/librtmp/handshake.h b/librtmp/handshake.h +index 98bf3c8..4c2ea7f 100644 +--- a/librtmp/handshake.h ++++ b/librtmp/handshake.h +@@ -59,6 +59,26 @@ typedef gcry_cipher_hd_t RC4_handle; + #define RC4_encrypt2(h,l,s,d) gcry_cipher_encrypt(h,(void *)d,l,(void *)s,l) + #define RC4_free(h) gcry_cipher_close(h) + ++#elif defined(USE_GNUTLS_NETTLE) ++#include ++#include ++#ifndef SHA256_DIGEST_LENGTH ++#define SHA256_DIGEST_LENGTH 32 ++#endif ++#undef HMAC_CTX ++#define HMAC_CTX struct hmac_sha256_ctx ++#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(&ctx, len, key) ++#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(&ctx, len, buf) ++#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig) ++#define HMAC_close(ctx) ++ ++typedef struct arcfour_ctx* RC4_handle; ++#define RC4_alloc(h) *h = malloc(sizeof(struct arcfour_ctx)) ++#define RC4_setkey(h,l,k) arcfour_set_key(h, l, k) ++#define RC4_encrypt(h,l,d) arcfour_crypt(h,l,(uint8_t *)d,(uint8_t *)d) ++#define RC4_encrypt2(h,l,s,d) arcfour_crypt(h,l,(uint8_t *)d,(uint8_t *)s) ++#define RC4_free(h) free(h) ++ + #else /* USE_OPENSSL */ + #include + #include +diff --git a/librtmp/hashswf.c b/librtmp/hashswf.c +index 0320480..8cefd3b 100644 +--- a/librtmp/hashswf.c ++++ b/librtmp/hashswf.c +@@ -52,6 +52,17 @@ + #define HMAC_crunch(ctx, buf, len) gcry_md_write(ctx, buf, len) + #define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; memcpy(dig, gcry_md_read(ctx, 0), dlen) + #define HMAC_close(ctx) gcry_md_close(ctx) ++#elif defined(USE_GNUTLS_NETTLE) ++#include ++#ifndef SHA256_DIGEST_LENGTH ++#define SHA256_DIGEST_LENGTH 32 ++#endif ++#undef HMAC_CTX ++#define HMAC_CTX struct hmac_sha256_ctx ++#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(&ctx, len, key) ++#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(&ctx, len, buf) ++#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig) ++#define HMAC_close(ctx) + #else /* USE_OPENSSL */ + #include + #include +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index 52d0254..5cd7b8d 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -34,7 +34,7 @@ + #ifdef CRYPTO + #ifdef USE_POLARSSL + #include +-#elif defined(USE_GNUTLS) ++#elif defined(USE_GNUTLS) || defined(USE_GNUTLS_NETTLE) + #include + #else /* USE_OPENSSL */ + #include +@@ -204,7 +204,7 @@ RTMP_TLS_Init() + /* Do this regardless of NO_SSL, we use havege for rtmpe too */ + RTMP_TLS_ctx = calloc(1,sizeof(struct tls_ctx)); + havege_init(&RTMP_TLS_ctx->hs); +-#elif defined(USE_GNUTLS) && !defined(NO_SSL) ++#elif (defined(USE_GNUTLS) || defined(USE_GNUTLS_NETTLE)) && !defined(NO_SSL) + /* Technically we need to initialize libgcrypt ourselves if + * we're not going to call gnutls_global_init(). Ignoring this + * for now. +diff --git a/librtmp/rtmp_sys.h b/librtmp/rtmp_sys.h +index c3fd4a6..478c59f 100644 +--- a/librtmp/rtmp_sys.h ++++ b/librtmp/rtmp_sys.h +@@ -81,7 +81,7 @@ typedef struct tls_ctx { + #define TLS_shutdown(s) ssl_close_notify(s) + #define TLS_close(s) ssl_free(s); free(s) + +-#elif defined(USE_GNUTLS) ++#elif defined(USE_GNUTLS) || defined(USE_GNUTLS_NETTLE) + #include + typedef struct tls_ctx { + gnutls_certificate_credentials_t cred; +-- +1.7.10.4 + + +From 7340f6dbc6b3c8e552baab2e5a891c2de75cddcc Mon Sep 17 00:00:00 2001 +From: Howard Chu +Date: Thu, 8 Mar 2012 23:19:45 -0800 +Subject: [PATCH 33/33] Cleanup prev commit, drop gcrypt support + +--- + Makefile | 3 +-- + librtmp/Makefile | 5 +---- + librtmp/dh.h | 19 +------------------ + librtmp/handshake.h | 19 +------------------ + librtmp/hashswf.c | 11 ----------- + librtmp/rtmp.c | 4 ++-- + librtmp/rtmp_sys.h | 2 +- + 7 files changed, 7 insertions(+), 56 deletions(-) + +diff --git a/Makefile b/Makefile +index 0cf41be..a1595a8 100644 +--- a/Makefile ++++ b/Makefile +@@ -12,8 +12,7 @@ CRYPTO=OPENSSL + #CRYPTO=POLARSSL + #CRYPTO=GNUTLS + LIBZ=-lz +-LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ) +-LIB_GNUTLS_NETTLE=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ) ++LIB_GNUTLS=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ) + LIB_OPENSSL=-lssl -lcrypto $(LIBZ) + LIB_POLARSSL=-lpolarssl $(LIBZ) + CRYPTO_LIB=$(LIB_$(CRYPTO)) +diff --git a/librtmp/Makefile b/librtmp/Makefile +index 353c6c8..74ee3b5 100644 +--- a/librtmp/Makefile ++++ b/librtmp/Makefile +@@ -21,17 +21,14 @@ CRYPTO=OPENSSL + DEF_POLARSSL=-DUSE_POLARSSL + DEF_OPENSSL=-DUSE_OPENSSL + DEF_GNUTLS=-DUSE_GNUTLS +-DEF_GNUTLS_NETTLE=-DUSE_GNUTLS_NETTLE + DEF_=-DNO_CRYPTO + REQ_GNUTLS=gnutls +-REQ_GNUTLS_NETTLE=gnutls + REQ_OPENSSL=libssl,libcrypto + LIBZ=-lz + LIBS_posix= + LIBS_darwin= + LIBS_mingw=-lws2_32 -lwinmm -lgdi32 +-LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ) +-LIB_GNUTLS_NETTLE=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ) ++LIB_GNUTLS=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ) + LIB_OPENSSL=-lssl -lcrypto $(LIBZ) + LIB_POLARSSL=-lpolarssl $(LIBZ) + PRIVATE_LIBS=$(LIBS_$(SYS)) +diff --git a/librtmp/dh.h b/librtmp/dh.h +index 830000e..9959532 100644 +--- a/librtmp/dh.h ++++ b/librtmp/dh.h +@@ -76,23 +76,7 @@ static int MDH_compute_key(uint8_t *secret, size_t len, MP_t pub, MDH *dh) + return 0; + } + +-#elif defined(USE_GNUTLS) || defined(USE_GNUTLS_NETTLE) +-#ifdef USE_GNUTLS +-#include +-typedef gcry_mpi_t MP_t; +-#define MP_new(m) m = gcry_mpi_new(1) +-#define MP_set_w(mpi, w) gcry_mpi_set_ui(mpi, w) +-#define MP_cmp(u, v) gcry_mpi_cmp(u, v) +-#define MP_set(u, v) gcry_mpi_set(u, v) +-#define MP_sub_w(mpi, w) gcry_mpi_sub_ui(mpi, mpi, w) +-#define MP_cmp_1(mpi) gcry_mpi_cmp_ui(mpi, 1) +-#define MP_modexp(r, y, q, p) gcry_mpi_powm(r, y, q, p) +-#define MP_free(mpi) gcry_mpi_release(mpi) +-#define MP_gethex(u, hex, res) res = (gcry_mpi_scan(&u, GCRYMPI_FMT_HEX, hex, 0, 0) == 0) +-#define MP_bytes(u) (gcry_mpi_get_nbits(u) + 7) / 8 +-#define MP_setbin(u,buf,len) gcry_mpi_print(GCRYMPI_FMT_USG,buf,len,NULL,u) +-#define MP_getbin(u,buf,len) gcry_mpi_scan(&u,GCRYMPI_FMT_USG,buf,len,NULL) +-#else ++#elif defined(USE_GNUTLS) + #include + #include + typedef mpz_ptr MP_t; +@@ -108,7 +92,6 @@ typedef mpz_ptr MP_t; + #define MP_bytes(u) (mpz_sizeinbase(u, 2) + 7) / 8 + #define MP_setbin(u,buf,len) nettle_mpz_get_str_256(len,buf,u) + #define MP_getbin(u,buf,len) u = malloc(sizeof(*u)); mpz_init2(u, 1); nettle_mpz_set_str_256_u(u,len,buf) +-#endif + + typedef struct MDH { + MP_t p; +diff --git a/librtmp/handshake.h b/librtmp/handshake.h +index 4c2ea7f..0438486 100644 +--- a/librtmp/handshake.h ++++ b/librtmp/handshake.h +@@ -43,27 +43,10 @@ typedef arc4_context * RC4_handle; + #define RC4_free(h) free(h) + + #elif defined(USE_GNUTLS) +-#include +-#ifndef SHA256_DIGEST_LENGTH +-#define SHA256_DIGEST_LENGTH 32 +-#endif +-#define HMAC_CTX gcry_md_hd_t +-#define HMAC_setup(ctx, key, len) gcry_md_open(&ctx, GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC); gcry_md_setkey(ctx, key, len) +-#define HMAC_crunch(ctx, buf, len) gcry_md_write(ctx, buf, len) +-#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; memcpy(dig, gcry_md_read(ctx, 0), dlen); gcry_md_close(ctx) +- +-typedef gcry_cipher_hd_t RC4_handle; +-#define RC4_alloc(h) gcry_cipher_open(h, GCRY_CIPHER_ARCFOUR, GCRY_CIPHER_MODE_STREAM, 0) +-#define RC4_setkey(h,l,k) gcry_cipher_setkey(h,k,l) +-#define RC4_encrypt(h,l,d) gcry_cipher_encrypt(h,(void *)d,l,NULL,0) +-#define RC4_encrypt2(h,l,s,d) gcry_cipher_encrypt(h,(void *)d,l,(void *)s,l) +-#define RC4_free(h) gcry_cipher_close(h) +- +-#elif defined(USE_GNUTLS_NETTLE) + #include + #include + #ifndef SHA256_DIGEST_LENGTH +-#define SHA256_DIGEST_LENGTH 32 ++#define SHA256_DIGEST_LENGTH 32 + #endif + #undef HMAC_CTX + #define HMAC_CTX struct hmac_sha256_ctx +diff --git a/librtmp/hashswf.c b/librtmp/hashswf.c +index 8cefd3b..9f4e2c0 100644 +--- a/librtmp/hashswf.c ++++ b/librtmp/hashswf.c +@@ -42,17 +42,6 @@ + #define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; sha2_hmac_finish(&ctx, dig) + #define HMAC_close(ctx) + #elif defined(USE_GNUTLS) +-#include +-#include +-#ifndef SHA256_DIGEST_LENGTH +-#define SHA256_DIGEST_LENGTH 32 +-#endif +-#define HMAC_CTX gcry_md_hd_t +-#define HMAC_setup(ctx, key, len) gcry_md_open(&ctx, GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC); gcry_md_setkey(ctx, key, len) +-#define HMAC_crunch(ctx, buf, len) gcry_md_write(ctx, buf, len) +-#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; memcpy(dig, gcry_md_read(ctx, 0), dlen) +-#define HMAC_close(ctx) gcry_md_close(ctx) +-#elif defined(USE_GNUTLS_NETTLE) + #include + #ifndef SHA256_DIGEST_LENGTH + #define SHA256_DIGEST_LENGTH 32 +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index 5cd7b8d..52d0254 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -34,7 +34,7 @@ + #ifdef CRYPTO + #ifdef USE_POLARSSL + #include +-#elif defined(USE_GNUTLS) || defined(USE_GNUTLS_NETTLE) ++#elif defined(USE_GNUTLS) + #include + #else /* USE_OPENSSL */ + #include +@@ -204,7 +204,7 @@ RTMP_TLS_Init() + /* Do this regardless of NO_SSL, we use havege for rtmpe too */ + RTMP_TLS_ctx = calloc(1,sizeof(struct tls_ctx)); + havege_init(&RTMP_TLS_ctx->hs); +-#elif (defined(USE_GNUTLS) || defined(USE_GNUTLS_NETTLE)) && !defined(NO_SSL) ++#elif defined(USE_GNUTLS) && !defined(NO_SSL) + /* Technically we need to initialize libgcrypt ourselves if + * we're not going to call gnutls_global_init(). Ignoring this + * for now. +diff --git a/librtmp/rtmp_sys.h b/librtmp/rtmp_sys.h +index 478c59f..c3fd4a6 100644 +--- a/librtmp/rtmp_sys.h ++++ b/librtmp/rtmp_sys.h +@@ -81,7 +81,7 @@ typedef struct tls_ctx { + #define TLS_shutdown(s) ssl_close_notify(s) + #define TLS_close(s) ssl_free(s); free(s) + +-#elif defined(USE_GNUTLS) || defined(USE_GNUTLS_NETTLE) ++#elif defined(USE_GNUTLS) + #include + typedef struct tls_ctx { + gnutls_certificate_credentials_t cred; +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/librtmp.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/librtmp.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,25 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := librtmp +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := b65ce7708ae79adb51d1f43dd0b6d987076d7c42 +$(PKG)_SUBDIR := rtmpdump-2.3 +$(PKG)_FILE := rtmpdump-2.3.tgz +$(PKG)_URL := http://rtmpdump.mplayerhq.hu/download/$($(PKG)_FILE) +$(PKG)_DEPS := gcc gnutls + +define $(PKG)_UPDATE + echo 'Warning: Updates are temporarily disabled for package librtmp.' >&2; + echo $(librtmp_VERSION) +endef + +define $(PKG)_BUILD + $(MAKE) -C '$(1)' \ + CROSS_COMPILE='$(TARGET)-' \ + prefix='$(PREFIX)/$(TARGET)' \ + SYS=mingw \ + CRYPTO=GNUTLS \ + SHARED=no \ + -j '$(JOBS)' install +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libsamplerate.mk --- a/src/libsamplerate.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libsamplerate.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.mega-nerd.com/SRC/download.html' | \ + $(WGET) -q -O- 'http://www.mega-nerd.com/SRC/download.html' | \ $(SED) -n 's,.*libsamplerate-\([0-9][^>]*\)\.tar.*,\1,p' | \ grep -v alpha | \ grep -v beta | \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libshout-1-fixes.patch --- a/src/libshout-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libshout-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -3,44 +3,17 @@ Contains ad hoc patches for cross building. -From 25255ff19813e122e6442518b29a55c15860d3a3 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Fri, 1 Oct 2010 17:20:29 +0200 +From b05b2d82333e13f637dffb93f821907f775eb585 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Sun, 20 May 2012 23:23:37 +0200 Subject: [PATCH] mingw fixes +--- + include/shout/shout.h.in | 2 ++ + 1 file changed, 2 insertions(+) -diff --git a/examples/nonblocking.c b/examples/nonblocking.c -index 0f4aa68..49a3d36 100644 ---- a/examples/nonblocking.c -+++ b/examples/nonblocking.c -@@ -68,7 +68,11 @@ int main() - - while (ret == SHOUTERR_BUSY) { - printf("Connection pending. Sleeping...\n"); -+#ifdef __MINGW32__ -+ Sleep(1000); -+#else - sleep(1); -+#endif - ret = shout_get_connected(shout); - } - -diff --git a/include/os.h b/include/os.h -index 7d065b3..d7ae425 100755 ---- a/include/os.h -+++ b/include/os.h -@@ -1,7 +1,9 @@ - #ifdef _WIN32 -+#ifndef __MINGW32__ - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - typedef unsigned __int32 uint32_t; - typedef __int32 int32_t; - typedef int ssize_t; - #endif -+#endif diff --git a/include/shout/shout.h.in b/include/shout/shout.h.in -index 43b0e7a..b026c10 100644 +index 682ad49..f412cdc 100644 --- a/include/shout/shout.h.in +++ b/include/shout/shout.h.in @@ -23,8 +23,10 @@ @@ -55,5 +28,5 @@ #define SHOUTERR_SUCCESS (0) #define SHOUTERR_INSANE (-1) -- -1.7.1 +1.7.9.2 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libshout.mk --- a/src/libshout.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libshout.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := libshout $(PKG)_IGNORE := -$(PKG)_CHECKSUM := cabc409e63f55383f4d85fac26d3056bf0365aac +$(PKG)_CHECKSUM := 147c5670939727420d0e2ad6a20468e2c2db1e20 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://downloads.us.xiph.org/releases/$(PKG)/$($(PKG)_FILE) $(PKG)_DEPS := gcc vorbis ogg theora speex define $(PKG)_UPDATE - wget -q -O- 'http://www.icecast.org/download.php' | \ + $(WGET) -q -O- 'http://www.icecast.org/download.php' | \ $(SED) -n 's,.*libshout-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef @@ -18,9 +18,9 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --prefix='$(PREFIX)/$(TARGET)' \ --disable-shared \ - --disable-debug \ --disable-thread \ --infodir='$(1)/sink' \ --mandir='$(1)/sink' diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libsigc++.mk --- a/src/libsigc++.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libsigc++.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := libsigc++ $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 240d3e0a02e764a6362f6ce1b32de71401e50844 +$(PKG)_CHECKSUM := 493d6e60c08bd8ec3688478d176e04b5713ced2a $(PKG)_SUBDIR := libsigc++-$($(PKG)_VERSION) -$(PKG)_FILE := libsigc++-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := libsigc++-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/libsigc++/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/libsigc++2/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/libsigc++2/refs/tags' | \ grep ']*>\([0-9][^<]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libsndfile.mk --- a/src/libsndfile.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libsndfile.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc sqlite flac ogg vorbis define $(PKG)_UPDATE - wget -q -O- 'http://www.mega-nerd.com/libsndfile/' | \ + $(WGET) -q -O- 'http://www.mega-nerd.com/libsndfile/' | \ grep '.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libssh2-1-fixes.patch --- a/src/libssh2-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libssh2-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -1,32 +1,52 @@ This file is part of MXE. See index.html for further information. -From b3ade9a63e881e69b4c9cfe7b5dbad78dcc4a0e0 Mon Sep 17 00:00:00 2001 -From: Peter Stuge -Date: Wed, 1 Feb 2012 09:53:44 +0100 -Subject: [PATCH] Fix undefined reference to _libssh_error in libgcrypt - backend +From 0e2179c67d0cd618be29b30425bda18c23a2ddf0 Mon Sep 17 00:00:00 2001 +From: Dmitry Smirnov +Date: Mon, 13 Aug 2012 23:34:51 +0200 +Subject: [PATCH 1/2] configure: gcrypt doesn't come with pkg-config support -Commit 209de22299b4b58e582891dfba70f57e1e0492db introduced a function -call to a non-existing function, and since then the libgcrypt backend -has not been buildable. ---- - src/libgcrypt.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) +... so use plain old -lgcrypt to the linker to link with it. + +Fixes #225 +(cherry picked from commit e470738a0cf302abfd2891b80dbac4ac3e7eedd2) -diff --git a/src/libgcrypt.c b/src/libgcrypt.c -index 1bda5ee..5c2787b 100644 ---- a/src/libgcrypt.c -+++ b/src/libgcrypt.c -@@ -581,7 +581,7 @@ _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session, - const char *privatekey, - const char *passphrase) - { -- return _libssh_error(session, LIBSSH2_ERROR_FILE, -+ return _libssh2_error(session, LIBSSH2_ERROR_FILE, - "Unable to extract public key from private key file: " - "Method unimplemented in libgcrypt backend"); - } +diff --git a/configure.ac b/configure.ac +index aa9d397..dfc6988 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -102,7 +102,7 @@ fi + # Look for libgcrypt + if test "$ac_cv_libssl" != "yes" && test "$use_libgcrypt" != "no"; then + AC_LIB_HAVE_LINKFLAGS([gcrypt], [], [#include ]) +- LIBSREQUIRED=libgcrypt ++ LIBS="$LIBS -lgcrypt" + fi + + AC_SUBST(LIBSREQUIRED) -- -1.7.8.3 +1.7.10.4 + + +From 75ecbf4e5ca3c977418f60db42ba03c13d0e68f9 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Sun, 2 Sep 2012 00:55:28 +0200 +Subject: [PATCH 2/2] include gpg-error with gcrypt for static linking + (mxe-specific) + +diff --git a/configure.ac b/configure.ac +index dfc6988..748dd21 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -103,6 +103,7 @@ fi + if test "$ac_cv_libssl" != "yes" && test "$use_libgcrypt" != "no"; then + AC_LIB_HAVE_LINKFLAGS([gcrypt], [], [#include ]) + LIBS="$LIBS -lgcrypt" ++ LIBS="$LIBS `${prefix}/bin/gpg-error-config --libs`" + fi + + AC_SUBST(LIBSREQUIRED) +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libssh2.mk --- a/src/libssh2.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libssh2.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,28 +3,28 @@ PKG := libssh2 $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 53428b4935ab6eb843d45f1593dc434cb287b93e +$(PKG)_CHECKSUM := 7fc084254dabe14a9bc90fa3d569faa7ee943e19 $(PKG)_SUBDIR := libssh2-$($(PKG)_VERSION) $(PKG)_FILE := libssh2-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://www.libssh2.org/download/$($(PKG)_FILE) $(PKG)_DEPS := gcc libgcrypt zlib define $(PKG)_UPDATE - wget -q -O- 'http://www.libssh2.org/download/?C=M;O=D' | \ + $(WGET) -q -O- 'http://www.libssh2.org/download/?C=M;O=D' | \ grep 'libssh2-' | \ $(SED) -n 's,.*libssh2-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef define $(PKG)_BUILD + cd '$(1)' && ./buildconf cd '$(1)' && ./configure \ --host='$(TARGET)' \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --without-openssl \ --with-libgcrypt \ - PKG_CONFIG='$(TARGET)-pkg-config' \ - LIBS="-lgcrypt `$(PREFIX)/$(TARGET)/bin/gpg-error-config --libs`" + PKG_CONFIG='$(TARGET)-pkg-config' $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= html_DATA= '$(TARGET)-gcc' \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libtool.mk --- a/src/libtool.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libtool.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://ftp.gnu.org/gnu/libtool/?C=M;O=D' | \ + $(WGET) -q -O- 'http://ftp.gnu.org/gnu/libtool/?C=M;O=D' | \ $(SED) -n 's,.*]*>v\([0-9][^<]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libusb.mk --- a/src/libusb.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libusb.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libvpx-1-config.patch --- a/src/libvpx-1-config.patch Thu Sep 20 10:38:14 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -# This file is part of MXE. -# See index.html for further information. - -diff --git a/configure b/configure ---- a/configure -+++ b/configure -@@ -465,9 +465,6 @@ process_detect() { - } - fi - check_header stdio.h || die "Unable to invoke compiler: ${CC} ${CFLAGS}" -- check_ld <> $@ + $(qexec)echo 'Conflicts:' >> $@ + $(qexec)echo 'Libs: -L$${libdir} -lvpx' >> $@ ++ $(qexec)echo 'Libs.private: -lpthread' >> $@ + $(qexec)echo 'Cflags: -I$${includedir}' >> $@ + INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc + INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc +-- +1.7.11.5 + + +From 73c1c32c41b75a432fbe092fb621474a760d0f51 Mon Sep 17 00:00:00 2001 +From: MXE +Date: Fri, 25 May 2012 23:40:00 +0200 +Subject: [PATCH 2/4] linking as test is not good for cross compiling + + +diff --git a/configure b/configure +index 62e1ffb..0c4faf9 100755 +--- a/configure ++++ b/configure +@@ -481,9 +481,6 @@ process_detect() { + } + fi + check_header stdio.h || die "Unable to invoke compiler: ${CC} ${CFLAGS}" +- check_ld < +Date: Sat, 16 Jun 2012 19:44:21 +0200 +Subject: [PATCH] .pc requires.private liblzma + +--- + libxml-2.0.pc.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libxml-2.0.pc.in b/libxml-2.0.pc.in +index 31a1b8c..44e3cbf 100644 +--- a/libxml-2.0.pc.in ++++ b/libxml-2.0.pc.in +@@ -8,6 +8,7 @@ Name: libXML + Version: @VERSION@ + Description: libXML library version2. + Requires: ++Requires.private: liblzma + Libs: -L${libdir} -lxml2 + Libs.private: @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ + Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/libxml2.mk --- a/src/libxml2.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/libxml2.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := libxml2 $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 859dd535edbb851cc15b64740ee06551a7a17d40 +$(PKG)_CHECKSUM := a0c553bd51ba79ab6fff26dc700004c6a41f5250 $(PKG)_SUBDIR := libxml2-$($(PKG)_VERSION) $(PKG)_FILE := libxml2-$($(PKG)_VERSION).tar.gz $(PKG)_URL := ftp://xmlsoft.org/libxml2/$($(PKG)_FILE) -$(PKG)_DEPS := gcc +$(PKG)_DEPS := gcc xz define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/libxml2/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/libxml2/refs/tags' | \ grep ' + #include + #include + #include +@@ -22,6 +23,7 @@ + #include + #include + #include ++#include + + using namespace log4cxx; + using namespace log4cxx::helpers; +diff -NBaur vanilla/src/main/cpp/inputstreamreader.cpp mingw_cross/src/main/cpp/inputstreamreader.cpp +--- vanilla/src/main/cpp/inputstreamreader.cpp 2008-04-01 07:34:09.000000000 +0900 ++++ mingw_cross/src/main/cpp/inputstreamreader.cpp 2011-05-09 10:27:27.991842868 +0900 +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + using namespace log4cxx; + using namespace log4cxx::helpers; +diff -NBaur vanilla/src/main/cpp/socketoutputstream.cpp mingw_cross/src/main/cpp/socketoutputstream.cpp +--- vanilla/src/main/cpp/socketoutputstream.cpp 2008-04-01 07:34:09.000000000 +0900 ++++ mingw_cross/src/main/cpp/socketoutputstream.cpp 2011-05-09 10:27:27.999058156 +0900 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + using namespace log4cxx; + using namespace log4cxx::helpers; diff -r 1d1285b1f6a0 -r d733a98b84d6 src/log4cxx-2-pkgconfig.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/log4cxx-2-pkgconfig.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,19 @@ +This file is part of MXE. +See index.html for further information. + +This patch ensures that the correct dependencies can always be found for +static mingw builds. Submitted upstream: + + https://issues.apache.org/jira/browse/LOGCXX-381 + +diff -NBaur vanilla/liblog4cxx.pc.in mingw_cross/liblog4cxx.pc.in +--- vanilla/liblog4cxx.pc.in 2008-04-01 07:34:52.000000000 +0900 ++++ mingw_cross/liblog4cxx.pc.in 2011-05-09 10:31:00.175584637 +0900 +@@ -20,6 +20,7 @@ + Name: log4cxx + Description: log4cxx C++ logging framework + Version: @VERSION@ ++Requires: apr-util-1, apr-1 + Libs: -L${libdir} -llog4cxx + Cflags: -I${includedir} + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/log4cxx-3-warnings.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/log4cxx-3-warnings.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,20 @@ +This file is part of MXE. +See index.html for further information. + +Already applied to log4cxx trunk. + +diff -NBaur vanilla/src/main/include/log4cxx/helpers/objectptr.h mingw_cross/src/main/include/log4cxx/helpers/objectptr.h +--- vanilla/src/main/include/log4cxx/helpers/objectptr.h 2008-04-01 07:34:26.000000000 +0900 ++++ mingw_cross/src/main/include/log4cxx/helpers/objectptr.h 2011-05-09 10:30:03.767560165 +0900 +@@ -28,9 +28,9 @@ + // switching between the initialization styles. + // + #if LOG4CXX_HELGRIND +-#define _LOG4CXX_OBJECTPTR_INIT(x) { exchange(x); ++#define _LOG4CXX_OBJECTPTR_INIT(x) : ObjectPtrBase() { exchange(x); + #else +-#define _LOG4CXX_OBJECTPTR_INIT(x) : p(x) { ++#define _LOG4CXX_OBJECTPTR_INIT(x) : ObjectPtrBase(), p(x) { + #endif + + namespace log4cxx diff -r 1d1285b1f6a0 -r d733a98b84d6 src/log4cxx-4-mingw.definitions.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/log4cxx-4-mingw.definitions.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,28 @@ +This file is part of MXE. +See index.html for further information. + +Fixes a problem with the mismatched calling conventions in apr and log4cxx. +See http://www.mail-archive.com/log4cxx-user@logging.apache.org/msg02671.html +Submitted upstream: + + https://issues.apache.org/jira/browse/LOGCXX-382 + +diff -NBaur vanilla/src/main/include/log4cxx/helpers/thread.h mingw_cross/src/main/include/log4cxx/helpers/thread.h +--- vanilla/src/main/include/log4cxx/helpers/thread.h 2008-04-01 07:34:26.000000000 +0900 ++++ mingw_cross/src/main/include/log4cxx/helpers/thread.h 2011-05-09 11:08:23.123558232 +0900 +@@ -23,9 +23,13 @@ + + #if !defined(LOG4CXX_THREAD_FUNC) + #if defined(_WIN32) +-#define LOG4CXX_THREAD_FUNC __stdcall ++ #if defined(__MINGW32__) ++ #define LOG4CXX_THREAD_FUNC ++ #else ++ #define LOG4CXX_THREAD_FUNC __stdcall ++ #endif + #else +-#define LOG4CXX_THREAD_FUNC ++ #define LOG4CXX_THREAD_FUNC + #endif + #endif + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/log4cxx-5-cmake.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/log4cxx-5-cmake.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,17 @@ +This file is part of MXE. +See index.html for further information. + +diff -NBaur vanilla/log4cxx-config.cmake mingw_cross/log4cxx-config.cmake +--- vanilla/log4cxx-config.cmake 1970-01-01 09:00:00.000000000 +0900 ++++ mingw_cross/log4cxx-config.cmake 2012-03-14 15:29:54.706247316 +0900 +@@ -0,0 +1,10 @@ ++ ++set(LOG4CXX_VERSION 0.10.0) ++ ++get_filename_component(LOG4CXX_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) ++ ++set(LOG4CXX_INCLUDE_DIR "${LOG4CXX_CMAKE_DIR}/../../../include" CACHE FILEPATH "Log4cxx include directory") ++set(LOG4CXX_INCLUDE_DIRS "${LOG4CXX_INCLUDE_DIR}") ++set(LOG4CXX_LIBRARY_DIRS "${LOG4CXX_CMAKE_DIR}/../../../lib") ++set(LOG4CXX_LIBRARIES "log4cxx;aprutil-1;iconv;expat;apr-1;rpcrt4;shell32;ws2_32;advapi32;kernel32;msvcrt") ++ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/log4cxx-test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/log4cxx-test.cpp Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,33 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include "log4cxx/logger.h" +#include "log4cxx/basicconfigurator.h" +#include "log4cxx/helpers/exception.h" + +using namespace log4cxx; +using namespace log4cxx::helpers; + +LoggerPtr logger(Logger::getLogger("MXE")); + +int main(int argc, char **argv) +{ + (void)argc; + (void)argv; + + int result = EXIT_SUCCESS; + try + { + BasicConfigurator::configure(); + LOG4CXX_INFO(logger, "Hello World!"); + } + catch(Exception&) + { + result = EXIT_FAILURE; + } + + return result; +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/log4cxx.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/log4cxx.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,37 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := log4cxx +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := d79c053e8ac90f66c5e873b712bb359fd42b648d +$(PKG)_SUBDIR := apache-log4cxx-$($(PKG)_VERSION) +$(PKG)_FILE := apache-log4cxx-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://apache.naggo.co.kr/logging/log4cxx/0.10.0/$($(PKG)_FILE) +$(PKG)_URL_2 := http://apache.mirror.cdnetworks.com//logging/log4cxx/0.10.0/$($(PKG)_FILE) +$(PKG)_DEPS := gcc apr-util + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://logging.apache.org/log4cxx/download.html' | \ + $(SED) -n 's,.*log4cxx-\([0-9.]*\)\.tar.*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --prefix='$(PREFIX)/$(TARGET)' \ + --host='$(TARGET)' \ + --disable-shared \ + --enable-static \ + --with-apr='$(PREFIX)/$(TARGET)' \ + --with-apr-util='$(PREFIX)/$(TARGET)' \ + CFLAGS=-D_WIN32_WINNT=0x0500 \ + CXXFLAGS=-D_WIN32_WINNT=0x0500 + $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= man_MANS= + mkdir -p '$(PREFIX)/$(TARGET)/share/cmake/log4cxx' + cp '$(1)/log4cxx-config.cmake' '$(PREFIX)/$(TARGET)/share/cmake/log4cxx/log4cxx-config.cmake' + + '$(TARGET)-g++' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-log4cxx.exe' \ + `$(TARGET)-pkg-config liblog4cxx --libs` +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/lua-test.c --- a/src/lua-test.c Thu Sep 20 10:38:14 2012 +0200 +++ b/src/lua-test.c Thu Sep 20 10:43:06 2012 +0200 @@ -14,7 +14,7 @@ (void)argc; (void)argv; - L = lua_open(); + L = luaL_newstate(); lua_close(L); return 0; } diff -r 1d1285b1f6a0 -r d733a98b84d6 src/lua.mk --- a/src/lua.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/lua.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := lua $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 2b11c8e60306efb7f0734b747588f57995493db7 +$(PKG)_CHECKSUM := 08f84c355cdd646f617f09cebea48bd832415829 $(PKG)_SUBDIR := lua-$($(PKG)_VERSION) $(PKG)_FILE := lua-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://www.lua.org/ftp/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.lua.org/download.html' | \ + $(WGET) -q -O- 'http://www.lua.org/download.html' | \ $(SED) -n 's,.*lua-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef @@ -29,12 +29,9 @@ TO_BIN='lua.h' \ INSTALL='$(INSTALL)' \ install - $(SED) -i 's,^prefix=.*,prefix=$(PREFIX)/$(TARGET),' '$(1)/etc/lua.pc' - $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig' - $(INSTALL) -m644 '$(1)/etc/lua.pc' '$(PREFIX)/$(TARGET)/lib/pkgconfig/lua.pc' '$(TARGET)-gcc' \ -W -Wall -Werror -ansi -pedantic \ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-lua.exe' \ - `'$(TARGET)-pkg-config' lua --cflags --libs` + -llua endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/lzo.mk --- a/src/lzo.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/lzo.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.oberhumer.com/opensource/lzo/download/' | \ + $(WGET) -q -O- 'http://www.oberhumer.com/opensource/lzo/download/' | \ grep 'lzo-' | \ grep -v 'minilzo-' | \ $(SED) -n 's,.*lzo-\([0-9][^>]*\)\.tar.*,\1,p' | \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/matio.mk --- a/src/matio.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/matio.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc zlib define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/matio/files/matio/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/matio/files/matio/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/mdbtools.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mdbtools.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,30 @@ +# This file is part of MXE. +# See index.html for further information. + +# mdbtools +PKG := mdbtools +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 62fe0703fd8691e4536e1012317406bdb72594cf +$(PKG)_SUBDIR := brianb-mdbtools-004cc9f +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://github.com/brianb/$(PKG)/tarball/$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc glib + +define $(PKG)_UPDATE + $(WGET) -q -O- 'https://github.com/brianb/mdbtools/tags' | \ + grep ']*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/muparser.mk --- a/src/muparser.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/muparser.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := muparser $(PKG)_IGNORE := -$(PKG)_CHECKSUM := d6d834d3ba2bd3c316c9b3070369d32701703f78 -$(PKG)_SUBDIR := $(PKG)_v$(subst .,,$($(PKG)_VERSION)) -$(PKG)_FILE := $(PKG)_v$(subst .,,$($(PKG)_VERSION)).tar.gz +$(PKG)_CHECKSUM := 830383b1bcfa706be5a6ac8b7ba43f32f16a1497 +$(PKG)_SUBDIR := $(PKG)_v$(subst .,_,$($(PKG)_VERSION)) +$(PKG)_FILE := $(PKG)_v$(subst .,_,$($(PKG)_VERSION)).zip $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/Version $($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/muparser/files/muparser/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/muparser/files/muparser/' | \ $(SED) -n 's,.*Version%20\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/mxml.mk --- a/src/mxml.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/mxml.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc pthreads define $(PKG)_UPDATE - wget -q -O- 'http://ftp.easysw.com/pub/mxml/?C=M;O=D' | \ + $(WGET) -q -O- 'http://ftp.easysw.com/pub/mxml/?C=M;O=D' | \ $(SED) -n 's,.*]*\)\.tar.*,\1,p' | \ grep -v 'pre' | \ tail -1 @@ -19,8 +19,9 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ - --enable-static \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' + $(MAKE) -C '$(1)' -j '$(JOBS)' getopt.o getopt1.o $(MAKE) -C '$(1)' -j '$(JOBS)' install endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/nsis-1-explicit-mingw-cross-prefix.patch --- a/src/nsis-1-explicit-mingw-cross-prefix.patch Thu Sep 20 10:38:14 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -This file is part of MXE. -See index.html for further information. - -This patch has been taken from: -http://sourceforge.net/tracker/index.php?func=detail&aid=3305366&group_id=22049&atid=373085 - ---- a/SCons/Tools/crossmingw.py -+++ b/SCons/Tools/crossmingw.py -@@ -61,6 +61,9 @@ prefixes = SCons.Util.Split(""" - """) - - def find(env): -+ if env.has_key('MINGW_CROSS_PREFIX'): -+ return env['MINGW_CROSS_PREFIX'] -+ - for prefix in prefixes: - # First search in the SCons path and then the OS path: - if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'): -diff --git a/SConstruct b/SConstruct -index 80872bc..4f113dd 100755 ---- a/SConstruct -+++ b/SConstruct -@@ -59,6 +59,7 @@ doc = [ - - path = ARGUMENTS.get('PATH', '') - toolset = ARGUMENTS.get('TOOLSET', '') -+mingw_cross_prefix = ARGUMENTS.get('MINGW_CROSS_PREFIX', '') - - if toolset and path: - defenv = Environment(ENV = {'PATH' : path}, TOOLS = toolset.split(',') + ['zip']) -@@ -69,6 +70,8 @@ else: - defenv = Environment(TOOLS = toolset.split(',') + ['zip']) - if not toolset and not path: - defenv = Environment() -+if mingw_cross_prefix: -+ defenv['MINGW_CROSS_PREFIX'] = mingw_cross_prefix - - Export('defenv') - diff -r 1d1285b1f6a0 -r d733a98b84d6 src/nsis-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/nsis-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,71 @@ +This file is part of MXE. +See index.html for further information. + +From 1cc3dd0dfd47bab82e06be916f9e57ef783406f9 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Sun, 12 Aug 2012 12:33:26 +0200 +Subject: [PATCH 1/2] explicit mingw cross prefix + +This patch has been taken from: +http://sourceforge.net/tracker/index.php?func=detail&aid=3305366&group_id=22049&atid=373085 + +diff --git a/SCons/Tools/crossmingw.py b/SCons/Tools/crossmingw.py +index d27e01c..fef9150 100755 +--- a/SCons/Tools/crossmingw.py ++++ b/SCons/Tools/crossmingw.py +@@ -61,6 +61,9 @@ prefixes = SCons.Util.Split(""" + """) + + def find(env): ++ if env.has_key('MINGW_CROSS_PREFIX'): ++ return env['MINGW_CROSS_PREFIX'] ++ + for prefix in prefixes: + # First search in the SCons path and then the OS path: + if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'): +diff --git a/SConstruct b/SConstruct +index 80872bc..4f113dd 100755 +--- a/SConstruct ++++ b/SConstruct +@@ -59,6 +59,7 @@ doc = [ + + path = ARGUMENTS.get('PATH', '') + toolset = ARGUMENTS.get('TOOLSET', '') ++mingw_cross_prefix = ARGUMENTS.get('MINGW_CROSS_PREFIX', '') + + if toolset and path: + defenv = Environment(ENV = {'PATH' : path}, TOOLS = toolset.split(',') + ['zip']) +@@ -69,6 +70,8 @@ else: + defenv = Environment(TOOLS = toolset.split(',') + ['zip']) + if not toolset and not path: + defenv = Environment() ++if mingw_cross_prefix: ++ defenv['MINGW_CROSS_PREFIX'] = mingw_cross_prefix + + Export('defenv') + +-- +1.7.10.4 + + +From 7df0fa80a65279ee7d99da8ec6abdddff7e040b0 Mon Sep 17 00:00:00 2001 +From: freeman +Date: Sun, 12 Aug 2012 12:36:39 +0200 +Subject: [PATCH 2/2] add missing header + + +diff --git a/Source/util.h b/Source/util.h +index 4259a6a..664923e 100755 +--- a/Source/util.h ++++ b/Source/util.h +@@ -25,6 +25,7 @@ + #ifndef _WIN32 + # include + # include ++# include + #endif + + +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/nsis.mk --- a/src/nsis.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/nsis.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://nsis.svn.sourceforge.net/viewvc/nsis/NSIS/tags/?sortby=date' | \ + $(WGET) -q -O- 'http://nsis.svn.sourceforge.net/viewvc/nsis/NSIS/tags/?sortby=date' | \ grep ']*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/old.mk --- a/src/old.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/old.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://blitiri.com.ar/p/old/' | \ + $(WGET) -q -O- 'http://blitiri.com.ar/p/old/' | \ grep 'old-' | \ $(SED) -n 's,.*old-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/openal-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/openal-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,29 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From b5c7c4853307964f0b8e11e2c9edb5bf0f8511f7 Mon Sep 17 00:00:00 2001 +From: Tony Theodore +Date: Tue, 3 Apr 2012 14:36:58 +0200 +Subject: [PATCH] add static private dependencies to pkg-config for cmake + +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ef3d08d..88de1e5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -543,6 +543,7 @@ IF(DSOUND) + SET(BACKENDS "${BACKENDS} DirectSound \(linked\),") + SET(EXTRA_LIBS dsound ${EXTRA_LIBS}) + ENDIF() ++ SET(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -luuid -lole32") + ENDIF() + ENDIF() + ENDIF() +-- +1.7.9.2 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/openal-1-luuid-pkg-config.patch --- a/src/openal-1-luuid-pkg-config.patch Thu Sep 20 10:38:14 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -This file is part of MXE. -See index.html for further information. - -This patch has been taken from: - - -diff -ur openal-soft-1.13.orig/CMakeLists.txt openal-soft-1.13/CMakeLists.txt ---- openal-soft-1.13.orig/CMakeLists.txt 2011-02-16 07:05:40.000000000 +1100 -+++ openal-soft-1.13/CMakeLists.txt 2011-03-02 15:40:02.000000000 +1100 -@@ -393,6 +393,7 @@ - SET(BACKENDS "${BACKENDS} DirectSound \(linked\),") - SET(EXTRA_LIBS dsound ${EXTRA_LIBS}) - ENDIF() -+ SET(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -luuid") - ENDIF() - ENDIF() - ENDIF() diff -r 1d1285b1f6a0 -r d733a98b84d6 src/openal-2-guid-static-link.patch --- a/src/openal-2-guid-static-link.patch Thu Sep 20 10:38:14 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -This file is part of MXE. -See index.html for further information. - -This patch has been taken from: - - ---- openal-soft-1.13.orig/Alc/dsound.c 2011-02-08 01:44:06.000000000 -0500 -+++ openal-soft-1.13/Alc/dsound.c 2011-03-02 22:57:58.000000000 -0500 -@@ -21,7 +21,6 @@ - #include "config.h" - - #define _WIN32_WINNT 0x0500 --#define INITGUID - #include - #include - #include -@@ -45,8 +44,8 @@ - #define DSSPEAKER_7POINT1 7 - #endif - --DEFINE_GUID(KSDATAFORMAT_SUBTYPE_PCM, 0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); --DEFINE_GUID(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); -+const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001, 0x0000, 0x0010,{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; -+const GUID KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = {0x00000003, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; - - static void *ds_handle; - static HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID pcGuidDevice, LPDIRECTSOUND *ppDS, LPUNKNOWN pUnkOuter); diff -r 1d1285b1f6a0 -r d733a98b84d6 src/openal.mk --- a/src/openal.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/openal.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := openal $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 0e2449375a12cee65a9cea354533dcaabf9d5068 +$(PKG)_CHECKSUM := e6d69db13ec15465b83a45ef89978e8a0f55beca $(PKG)_SUBDIR := openal-soft-$($(PKG)_VERSION) $(PKG)_FILE := openal-soft-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := http://kcat.strangesoft.net/openal-releases/$($(PKG)_FILE) $(PKG)_DEPS := gcc portaudio define $(PKG)_UPDATE - wget -q -O- 'http://kcat.strangesoft.net/openal-releases/?C=M;O=D' | \ + $(WGET) -q -O- 'http://kcat.strangesoft.net/openal-releases/?C=M;O=D' | \ $(SED) -n 's,.*"openal-soft-\([0-9][^"]*\)\.tar.*,\1,p' | \ head -1 endef @@ -18,7 +18,8 @@ define $(PKG)_BUILD cd '$(1)/build' && cmake .. \ -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ - -DLIBTYPE=STATIC + -DLIBTYPE=STATIC \ + -DEXAMPLES=FALSE $(MAKE) -C '$(1)/build' -j '$(JOBS)' install '$(TARGET)-gcc' \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/opencore-amr.mk --- a/src/opencore-amr.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/opencore-amr.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/opencore-amr/files/opencore-amr/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/opencore-amr/files/opencore-amr/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/opencsg.mk --- a/src/opencsg.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/opencsg.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc freeglut glew qt define $(PKG)_UPDATE - wget -q -O- 'http://www.opencsg.org/#download' | \ + $(WGET) -q -O- 'http://www.opencsg.org/#download' | \ grep 'OpenCSG-' | \ $(SED) -n 's,.*OpenCSG-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/openexr.mk --- a/src/openexr.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/openexr.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc ilmbase pthreads zlib define $(PKG)_UPDATE - wget -q -O- 'http://www.openexr.com/downloads.html' | \ + $(WGET) -q -O- 'http://www.openexr.com/downloads.html' | \ grep 'openexr-' | \ $(SED) -n 's,.*openexr-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/openscenegraph.mk --- a/src/openscenegraph.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/openscenegraph.mk Thu Sep 20 10:43:06 2012 +0200 @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc curl ffmpeg freetype gdal giflib jasper jpeg libpng openexr tiff xine-lib zlib dcmtk qt define $(PKG)_UPDATE - wget -q -O- 'http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/tags?order=date&desc=1' | \ + $(WGET) -q -O- 'http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/tags?order=date&desc=1' | \ grep 'OpenSceneGraph-\([0-9][^<]*\)<.*,\1,p' | \ grep -v '^2\.9\.' | \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/openssl.mk --- a/src/openssl.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/openssl.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,7 +3,7 @@ PKG := openssl $(PKG)_IGNORE := -$(PKG)_CHECKSUM := a6476d33fd38c2e7dfb438d1e3be178cc242c907 +$(PKG)_CHECKSUM := 91b684de947cb021ac61b8c51027cc4b63d894ce $(PKG)_SUBDIR := openssl-$($(PKG)_VERSION) $(PKG)_FILE := openssl-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://www.openssl.org/source/$($(PKG)_FILE) @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc zlib libgcrypt define $(PKG)_UPDATE - wget -q -O- 'http://www.openssl.org/source/' | \ + $(WGET) -q -O- 'http://www.openssl.org/source/' | \ $(SED) -n 's,.*openssl-\([0-9][0-9a-z.]*\)\.tar.*,\1,p' | \ grep -v '^0\.9\.' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/pango-1-fixes.patch --- a/src/pango-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/pango-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -1,178 +1,188 @@ -This file is part of MXE. -See index.html for further information. - -Contains ad hoc patches for cross building. +From 971738e2fc2bc3faae52952dd08ee08b34ff4b86 Mon Sep 17 00:00:00 2001 +From: Matthias Gehre +Date: Mon, 9 Jul 2012 13:13:49 +0200 +Subject: [PATCH 1/4] Rename DllMain to pango_DllMain -From 987d02305fd8187bd10bfd292db38f7da705a7f3 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Wed, 29 Sep 2010 00:52:59 +0200 -Subject: [PATCH 1/4] s,DllMain,static _disabled_DllMain, - +--- + pango/pango-utils.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pango/pango-utils.c b/pango/pango-utils.c -index 44ec353..72e13f1 100644 +index c68e2d4..47ca433 100644 --- a/pango/pango-utils.c +++ b/pango/pango-utils.c -@@ -658,12 +658,12 @@ pango_config_key_get (const char *key) +@@ -692,12 +692,12 @@ pango_config_key_get (const char *key) #ifdef G_OS_WIN32 -/* DllMain function needed to tuck away the DLL handle */ -+/* static _disabled_DllMain function needed to tuck away the DLL handle */ ++/* pango_DllMain function needed to tuck away the DLL handle */ static HMODULE pango_dll; BOOL WINAPI -DllMain (HINSTANCE hinstDLL, -+static _disabled_DllMain (HINSTANCE hinstDLL, ++pango_DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { -- -1.7.7.3 - - -From f0c5d358e54fd9d69133eeff972fdb05592789f3 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Wed, 29 Sep 2010 00:55:07 +0200 -Subject: [PATCH 2/4] static, not shared +1.7.9.5 -diff --git a/configure b/configure -index fb173ce..beb3290 100755 ---- a/configure -+++ b/configure -@@ -5832,9 +5832,9 @@ if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; -- no) enable_static=no ;; -+ no) enable_static=yes ;; - *) -- enable_static=no -+ enable_static=yes - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do -@@ -5847,7 +5847,7 @@ if test "${enable_static+set}" = set; then : - ;; - esac - else -- enable_static=no -+ enable_static=yes - fi - - -@@ -5861,15 +5861,15 @@ fi - - if test "$pango_os_win32" = "yes"; then - if test x$enable_static = xyes -o x$enable_static = x; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling static library build, must build as DLL on Windows." >&5 --$as_echo "$as_me: WARNING: Disabling static library build, must build as DLL on Windows." >&2;} -- enable_static=no -+ { $as_echo "(disabled warning)" >&5 -+$as_echo "(disabled warning)" >&2;} -+ enable_static=yes - fi - if test x$enable_shared = xno; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Enabling shared library build, must build as DLL on Windows." >&5 --$as_echo "$as_me: WARNING: Enabling shared library build, must build as DLL on Windows." >&2;} -+ { $as_echo "(disabled warning)" >&5 -+$as_echo "(disabled warning)" >&2;} - fi -- enable_shared=yes -+ enable_shared=no - fi - - case `pwd` in -@@ -8968,7 +8968,7 @@ func_stripname_cnf () - if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in -- yes) enable_shared=yes ;; -+ yes) enable_shared=no ;; - no) enable_shared=no ;; - *) - enable_shared=no -@@ -8977,14 +8977,14 @@ if test "${enable_shared+set}" = set; then : - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then -- enable_shared=yes -+ enable_shared=no - fi - done - IFS="$lt_save_ifs" - ;; - esac - else -- enable_shared=yes -+ enable_shared=no - fi - - -@@ -12848,7 +12848,7 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } - # are all built from PIC. - case $host_os in - aix3*) -- test "$enable_shared" = yes && enable_static=no -+ test "$enable_shared" = yes && enable_static=yes - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' -@@ -12857,7 +12857,7 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then -- test "$enable_shared" = yes && enable_static=no -+ test "$enable_shared" = yes && enable_static=yes - fi - ;; - esac --- -1.7.7.3 +From 779c533bf4354cbc747d82532f4798e6ef006d1b Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Wed, 29 Sep 2010 00:50:08 +0200 +Subject: [PATCH 2/4] add missing lib to pango.pc for static linking - -From 08292532296e3a0f135f6bcd683851d2f41836c6 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Wed, 29 Sep 2010 00:57:12 +0200 -Subject: [PATCH 3/4] no pango-querymodules - - -diff --git a/modules/Makefile.in b/modules/Makefile.in -index 49813f7..afc29c5 100644 ---- a/modules/Makefile.in -+++ b/modules/Makefile.in -@@ -647,7 +647,7 @@ uninstall-am: uninstall-local - - @CROSS_COMPILING_FALSE@all-local: pango.modules - --install-data-local: $(top_builddir)/pango/pango-querymodules$(EXEEXT) -+install-data-local: - @if $(RUN_QUERY_MODULES_TEST) && test -z "$(DESTDIR)" ; then \ - echo $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/pango \&\& \ - $(top_builddir)/pango/pango-querymodules$(EXEEXT) \ --- -1.7.7.3 - - -From c646ee7869c20a1e093f63ec8de8e83e7ca88b27 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Wed, 29 Sep 2010 00:50:08 +0200 -Subject: [PATCH 4/4] add missing lib to pango.pc for static linking - +--- + pango.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango.pc.in b/pango.pc.in -index 5cc3ef8..745b8f0 100644 +index 17a8b7a..16c5981 100644 --- a/pango.pc.in +++ b/pango.pc.in -@@ -9,5 +9,5 @@ Name: Pango - Description: Internationalized text handling +@@ -10,5 +10,5 @@ Description: Internationalized text handling Version: @VERSION@ - Requires: glib-2.0,gobject-2.0,gmodule-no-export-2.0 + Requires: glib-2.0 gobject-2.0 + Requires.private: gmodule-no-export-2.0 -Libs: -L${libdir} -lpango-@PANGO_API_VERSION@ @PKGCONFIG_MATH_LIBS@ +Libs: -L${libdir} -lpango-@PANGO_API_VERSION@ @PKGCONFIG_MATH_LIBS@ -lusp10 Cflags: -I${includedir}/pango-1.0 -- -1.7.7.3 +1.7.9.5 + + +From 4340125c6b7f26106f7f021ec4c9612f7384e6c1 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Fri, 15 Jun 2012 16:21:40 +0200 +Subject: [PATCH 3/4] do not force shared for win32 + +--- + configure.in | 14 -------------- + modules/Makefile.am | 17 +---------------- + 2 files changed, 1 insertion(+), 30 deletions(-) +diff --git a/configure.in b/configure.in +index 8362280..6a000cc 100644 +--- a/configure.in ++++ b/configure.in +@@ -147,20 +147,6 @@ CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions" + # Win32 stuff + # + +-AC_LIBTOOL_WIN32_DLL +-AM_DISABLE_STATIC +- +-if test "$pango_os_win32" = "yes"; then +- if test x$enable_static = xyes -o x$enable_static = x; then +- AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.]) +- enable_static=no +- fi +- if test x$enable_shared = xno; then +- AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.]) +- fi +- enable_shared=yes +-fi +- + AM_PROG_LIBTOOL + dnl when using libtool 2.x create libtool early, because it's used in configure + m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) +diff --git a/modules/Makefile.am b/modules/Makefile.am +index dc8a2c8..dc22e59 100644 +--- a/modules/Makefile.am ++++ b/modules/Makefile.am +@@ -26,22 +26,7 @@ RUN_QUERY_MODULES_TEST=true + all-local: pango.modules + endif + +-install-data-local: $(top_builddir)/pango/pango-querymodules$(EXEEXT) +- @if $(RUN_QUERY_MODULES_TEST) && test -z "$(DESTDIR)" ; then \ +- echo $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/pango \&\& \ +- $(top_builddir)/pango/pango-querymodules$(EXEEXT) \ +- \> $(DESTDIR)$(sysconfdir)/pango/pango.modules ; \ +- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/pango && \ +- $(top_builddir)/pango/pango-querymodules$(EXEEXT) \ +- > $(DESTDIR)$(sysconfdir)/pango/pango.modules ; \ +- else \ +- echo "***" ; \ +- echo "*** Warning: $(sysconfdir)/pango/pango.modules" ; \ +- echo "*** not created" ; \ +- echo "*** Generate this file on the target system" ; \ +- echo "*** using pango-querymodules" ; \ +- echo "***" ; \ +- fi ++install-data-local: + + uninstall-local: + $(RM) $(DESTDIR)$(sysconfdir)/pango/pango.modules +-- +1.7.9.5 + + +From ff735b2f71b07e7216856a473ed283eb24dd012a Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Mon, 18 Jun 2012 21:36:53 +0200 +Subject: [PATCH 4/4] kill gtk-doc (MXE specific) + +--- + Makefile.am | 2 +- + autogen.sh | 8 -------- + configure.in | 9 +-------- + 3 files changed, 2 insertions(+), 17 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index b0b56ec..663503c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,6 @@ + ## Process this file with automake to create Makefile.in. + +-SUBDIRS= pango modules pango-view examples docs tools tests build ++SUBDIRS= pango modules pango-view examples tools tests build + + EXTRA_DIST = \ + autogen.sh \ +diff --git a/autogen.sh b/autogen.sh +index bc7c59c..4e1918c 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -7,14 +7,6 @@ test -n "$srcdir" || srcdir=. + olddir=`pwd` + cd "$srcdir" + +-GTKDOCIZE=`which gtkdocize` +-if test -z $GTKDOCIZE; then +- echo "*** No GTK-Doc found, please install it ***" +- exit 1 +-else +- gtkdocize || exit $? +-fi +- + AUTORECONF=`which autoreconf` + if test -z $AUTORECONF; then + echo "*** No autoreconf found, please install it ***" +diff --git a/configure.in b/configure.in +index 6a000cc..e7538f6 100644 +--- a/configure.in ++++ b/configure.in +@@ -615,14 +615,7 @@ dnl ************************** + dnl *** Checks for gtk-doc *** + dnl ************************** + +-if $have_cairo ; then : ; else +- if test x$enable_gtk_doc = xyes ; then +- AC_MSG_WARN([Cairo not present, disabling doc building]) +- enable_gtk_doc=no +- fi +-fi +- +-GTK_DOC_CHECK([1.0]) ++enable_gtk_doc=no + + AC_ARG_ENABLE(man, + AC_HELP_STRING([--enable-man], +-- +1.7.9.5 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/pango.mk --- a/src/pango.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/pango.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,20 +3,22 @@ PKG := pango $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 467a3dacc0f3173e6fd457524b9ccd9772039a62 +$(PKG)_CHECKSUM := f853a35758bed6aba6101e027ba7b4411448236f $(PKG)_SUBDIR := pango-$($(PKG)_VERSION) -$(PKG)_FILE := pango-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := pango-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/pango/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_DEPS := gcc fontconfig freetype cairo glib define $(PKG)_UPDATE - wget -q -O- 'http://git.gnome.org/browse/pango/refs/tags' | \ + $(WGET) -q -O- 'http://git.gnome.org/browse/pango/refs/tags' | \ grep ' +Date: Mon, 11 Jun 2012 17:27:15 +0200 +Subject: [PATCH 1/2] fix for mingw + This patch has been taken from: http://tech.groups.yahoo.com/group/pdflib/message/20472 +--- + libs/pdcore/pc_util.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) -diff -urN a/libs/pdcore/pc_util.c b/libs/pdcore/pc_util.c ---- a/libs/pdcore/pc_util.c 2010-04-29 15:50:05.000000000 +0200 -+++ b/libs/pdcore/pc_util.c 2010-05-11 23:59:03.915954995 +0200 +diff --git a/libs/pdcore/pc_util.c b/libs/pdcore/pc_util.c +index e8d8fec..f874bad 100644 +--- a/libs/pdcore/pc_util.c ++++ b/libs/pdcore/pc_util.c @@ -30,8 +30,12 @@ #include /* for finite */ #endif @@ -21,3 +30,32 @@ #else /* isfinite */ #if defined(WIN32) +-- +1.7.10.3 + + +From 315d17f1b6d050df824a26418b191ca38ebd4602 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Mon, 11 Jun 2012 17:33:04 +0200 +Subject: [PATCH 2/2] force mingw detection + +--- + configure.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.in b/configure.in +index 3944168..de6ec09 100644 +--- a/configure.in ++++ b/configure.in +@@ -98,7 +98,7 @@ then + ac_sys_system=next && ac_sys_release=$4 + MACHDEP="$ac_sys_system$ac_sys_release$ac_sys_cpu" + else +- ac_sys_system=`uname -s` ++ ac_sys_system=MinGW + if test "$ac_sys_system" = "AIX" ; then + ac_sys_release=`uname -v` + else +-- +1.7.10.3 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/pdflib_lite.mk --- a/src/pdflib_lite.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/pdflib_lite.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,22 +3,24 @@ PKG := pdflib_lite $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 5b2bf5edc49dba3da0997ade0e191511a37fae01 +$(PKG)_CHECKSUM := 42e0605ae21f4b6d25fa2d20e78fed6df36fbaa9 $(PKG)_SUBDIR := PDFlib-Lite-$($(PKG)_VERSION) $(PKG)_FILE := PDFlib-Lite-$($(PKG)_VERSION).tar.gz -$(PKG)_URL := https://distfiles.macports.org/pdflib/$($(PKG)_FILE) +$(PKG)_URL := http://www.pdflib.com/binaries/PDFlib/$(subst .,,$(word 1,$(subst p, ,$($(PKG)_VERSION))))/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.pdflib.com/download/free-software/pdflib-lite-7/' | \ + $(WGET) -q -O- 'http://www.pdflib.com/download/free-software/pdflib-lite-7/' | \ $(SED) -n 's,.*PDFlib-Lite-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef define $(PKG)_BUILD - $(SED) -i 's,ac_sys_system=`uname -s`,ac_sys_system=MinGW,' '$(1)/configure' + cd '$(1)' && aclocal -I config --install + cd '$(1)' && autoconf cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --without-openssl \ @@ -27,7 +29,6 @@ --without-perl \ --without-ruby \ --without-tcl \ - --disable-php \ --enable-cxx \ --enable-large-files \ CFLAGS='-D_IOB_ENTRIES=20' diff -r 1d1285b1f6a0 -r d733a98b84d6 src/pfstools.mk --- a/src/pfstools.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/pfstools.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/pfstools/files/pfstools/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/pfstools/files/pfstools/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/physfs.mk --- a/src/physfs.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/physfs.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc zlib define $(PKG)_UPDATE - wget -q -O- 'http://icculus.org/physfs/downloads/?M=D' | \ + $(WGET) -q -O- 'http://icculus.org/physfs/downloads/?M=D' | \ $(SED) -n 's,.*&2; + echo $(plibc_VERSION) +endef + +define $(PKG)_BUILD + chmod 0755 '$(1)/configure' + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --prefix='$(PREFIX)/$(TARGET)' \ + --enable-static \ + --disable-shared + $(MAKE) -C '$(1)' -j '$(JOBS)' install +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/plotmm.mk --- a/src/plotmm.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/plotmm.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc gtkmm2 define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/plotmm/files/plotmm/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/plotmm/files/plotmm/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/plotutils.mk --- a/src/plotutils.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/plotutils.mk Thu Sep 20 10:43:06 2012 +0200 @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc libpng pthreads define $(PKG)_UPDATE - wget -q -O- 'http://ftp.gnu.org/gnu/plotutils/?C=M;O=D' | \ + $(WGET) -q -O- 'http://ftp.gnu.org/gnu/plotutils/?C=M;O=D' | \ grep 'getCString())) { +-- +1.7.10.4 + + +From fe1720718e224b0138f3f95c5aa0c72ac85e06b8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= +Date: Sat, 21 Apr 2012 13:19:54 +0200 +Subject: [PATCH 2/2] Don't use dllimport/dllexport + +Otherwise static linking fails +MXE workaround for https://bugs.freedesktop.org/show_bug.cgi?id=49038 (presumably would break shared linking!) + +diff --git a/cpp/poppler-global.h b/cpp/poppler-global.h +index 5650182..6c3e01b 100644 +--- a/cpp/poppler-global.h ++++ b/cpp/poppler-global.h +@@ -20,13 +20,8 @@ + #ifndef POPPLER_GLOBAL_H + #define POPPLER_GLOBAL_H + +-#if defined(_WIN32) +-# define LIB_EXPORT __declspec(dllexport) +-# define LIB_IMPORT __declspec(dllimport) +-#else + # define LIB_EXPORT + # define LIB_IMPORT +-#endif + + #if defined(poppler_cpp_EXPORTS) + # define POPPLER_CPP_EXPORT LIB_EXPORT +diff --git a/poppler/XpdfPluginAPI.h b/poppler/XpdfPluginAPI.h +index b0165c0..5a10595 100644 +--- a/poppler/XpdfPluginAPI.h ++++ b/poppler/XpdfPluginAPI.h +@@ -42,19 +42,11 @@ extern "C" { + */ + #define xpdfPluginAPIVersion 1 + +-#ifdef _WIN32 +-# ifdef __cplusplus +-# define PLUGINFUNC(retType) extern "C" __declspec(dllexport) retType +-# else +-# define PLUGINFUNC(retType) extern __declspec(dllexport) retType +-# endif +-#else + # ifdef __cplusplus + # define PLUGINFUNC(retType) extern "C" retType + # else + # define PLUGINFUNC(retType) extern retType + # endif +-#endif + + /*------------------------------------------------------------------------ + * Plugin setup/cleanup +@@ -281,22 +273,12 @@ void (*_xpdfRegisterSecurityHandler)(XpdfSecurityHandler *handler); + + } XpdfPluginVecTable; + +-#ifdef _WIN32 +- +-extern __declspec(dllexport) XpdfPluginVecTable xpdfPluginVecTable; +- +-#define xpdfPluginSetup \ +- extern __declspec(dllexport) \ +- XpdfPluginVecTable xpdfPluginVecTable = {xpdfPluginAPIVersion}; +- +-#else + + extern XpdfPluginVecTable xpdfPluginVecTable; + + #define xpdfPluginSetup \ + XpdfPluginVecTable xpdfPluginVecTable = {xpdfPluginAPIVersion}; + +-#endif + + #define xpdfGetInfoDict (*xpdfPluginVecTable._xpdfGetInfoDict) + #define xpdfGetCatalog (*xpdfPluginVecTable._xpdfGetCatalog) +diff --git a/qt4/src/poppler-export.h b/qt4/src/poppler-export.h +index 7661fe9..ebb1e18 100644 +--- a/qt4/src/poppler-export.h ++++ b/qt4/src/poppler-export.h +@@ -2,13 +2,8 @@ + * This file is used to set the poppler_qt4_EXPORT macros right. + * This is needed for setting the visibility on windows, it will have no effect on other platforms. + */ +-#if defined(_WIN32) +-# define LIB_EXPORT __declspec(dllexport) +-# define LIB_IMPORT __declspec(dllimport) +-#else + # define LIB_EXPORT + # define LIB_IMPORT +-#endif + + #ifdef poppler_qt4_EXPORTS + # define POPPLER_QT4_EXPORT LIB_EXPORT +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/poppler-test.cxx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/poppler-test.cxx Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + std::cout << "Poppler version: " << poppler::version_string() << std::endl; + + return 0; +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/poppler.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/poppler.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,59 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := poppler +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 0f745b593e764d27a0e21645e6febd6ad8ad2ab9 +$(PKG)_SUBDIR := poppler-$($(PKG)_VERSION) +$(PKG)_FILE := poppler-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://poppler.freedesktop.org/$($(PKG)_FILE) +$(PKG)_DEPS := gcc glib cairo libpng lcms jpeg tiff freetype zlib curl qt + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://poppler.freedesktop.org/' | \ + $(SED) -n 's,.*"poppler-\([0-9.]\+\)\.tar\.gz".*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + # Note: Specifying LIBS explicitly is necessary for configure to properly + # pick up libtiff (otherwise linking a minimal test program fails not + # because libtiff is not found, but because some references are + # undefined) + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --prefix='$(PREFIX)/$(TARGET)' \ + --disable-silent-rules \ + --disable-shared \ + --enable-static \ + --enable-xpdf-headers \ + --enable-poppler-qt4 \ + --enable-zlib \ + --enable-libcurl \ + --enable-libtiff \ + --enable-libjpeg \ + --enable-libpng \ + --enable-poppler-glib \ + --enable-poppler-cpp \ + --enable-cairo-output \ + --enable-splash-output \ + --enable-compile-warnings=yes \ + --enable-introspection=auto \ + --disable-libopenjpeg \ + --disable-gtk-test \ + --disable-utils \ + --disable-gtk-doc \ + --disable-gtk-doc-html \ + --disable-gtk-doc-pdf \ + --with-font-configuration=win32 \ + LIBS="`'$(TARGET)-pkg-config' zlib liblzma --libs` -ljpeg" + $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + + # Test program + '$(TARGET)-g++' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).cxx' -o '$(PREFIX)/$(TARGET)/bin/test-poppler.exe' \ + `'$(TARGET)-pkg-config' poppler poppler-cpp --cflags --libs` +endef + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/popt.mk --- a/src/popt.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/popt.mk Thu Sep 20 10:43:06 2012 +0200 @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc libiconv gettext define $(PKG)_UPDATE - wget -q -O- 'http://rpm5.org/files/popt/' | \ + $(WGET) -q -O- 'http://rpm5.org/files/popt/' | \ grep 'popt-' | \ $(SED) -n 's,.*popt-\([0-9][^>]*\)\.tar.*,\1,p' | \ tail -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/portaudio-1-win32.patch --- a/src/portaudio-1-win32.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/portaudio-1-win32.patch Thu Sep 20 10:43:06 2012 +0200 @@ -1,89 +1,73 @@ This file is part of MXE. See index.html for further information. -diff -ru portaudio-orig/configure.in portaudio/configure.in ---- portaudio-orig/configure.in 2007-11-13 22:22:56.000000000 +0100 -+++ portaudio/configure.in 2010-01-23 17:04:37.000000000 +0100 -@@ -139,6 +139,7 @@ - dnl Mac OS X configuration - - AC_DEFINE(PA_USE_COREAUDIO) -+ CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/unix" - if [[ -d /Developer/SDKs/MacOSX10.5.sdk ]] ; then - SHARED_FLAGS="-Werror -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib -arch x86_64 -arch ppc64 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3"; - CFLAGS="-Werror $CFLAGS -arch x86_64 -arch ppc64 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3"; -@@ -167,6 +168,7 @@ - dnl MingW configuration - - echo "WINAPI: $with_winapi" -+ CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/win" - if [[ $with_winapi = "directx" ]] ; then - if [[ $with_dxdir ]] ; then - DXDIR="$with_dxdir"; -@@ -174,15 +176,15 @@ - DXDIR="/usr/local/dx7sdk"; - fi - echo "DXDIR: $DXDIR" -- OTHER_OBJS="src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o"; -+ OTHER_OBJS="src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o"; - LIBS="-lwinmm -lm -ldsound -lole32"; - PADLL="portaudio.dll"; - THREAD_CFLAGS="-mthreads" - SHARED_FLAGS="-shared"; -- DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L./dx7sdk/lib -ldsound -lole32"; -+ DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L${DXDIR}/lib -ldsound -lole32"; - #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""; - #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"; -- CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO" -DPA_NO_WDMKS; -+ CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO -DPA_NO_WDMKS"; - elif [[ $with_winapi = "asio" ]] ; then - if [[ $with_asiodir ]] ; then - ASIODIR="$with_asiodir"; -@@ -228,9 +230,10 @@ +diff -aur portaudio/src/hostapi/dsound/pa_win_ds.c portaudio-patched/src/hostapi/dsound/pa_win_ds.c +--- portaudio/src/hostapi/dsound/pa_win_ds.c 2011-11-10 14:51:15.000000000 +0000 ++++ portaudio-patched/src/hostapi/dsound/pa_win_ds.c 2012-03-02 21:45:29.000000000 +0000 +@@ -860,6 +860,9 @@ + case DSSPEAKER_STEREO: count = 2; break; + case DSSPEAKER_SURROUND: count = 4; break; + case DSSPEAKER_5POINT1: count = 6; break; ++#ifndef DSSPEAKER_7POINT1 ++#define DSSPEAKER_7POINT1 0x00000007 ++#endif + case DSSPEAKER_7POINT1: count = 8; break; + #ifndef DSSPEAKER_7POINT1_SURROUND + #define DSSPEAKER_7POINT1_SURROUND 0x00000008 +diff -aur portaudio/src/hostapi/wdmks/pa_win_wdmks.c portaudio-patched/src/hostapi/wdmks/pa_win_wdmks.c +--- portaudio/src/hostapi/wdmks/pa_win_wdmks.c 2011-02-17 15:56:04.000000000 +0000 ++++ portaudio-patched/src/hostapi/wdmks/pa_win_wdmks.c 2012-03-02 21:49:13.000000000 +0000 +@@ -136,6 +136,7 @@ - cygwin* ) - dnl Cygwin configuration -- -+ CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/win" - OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o"; - CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_WDMKS -DPA_NO_ASIO -DPA_NO_WASAPI" -+ - LIBS="-lwinmm -lm"; - PADLL="portaudio.dll"; - THREAD_CFLAGS="-mthreads" -@@ -242,6 +245,7 @@ - dnl SGI IRIX audio library (AL) configuration (Pieter, oct 2-13, 2003). - dnl The 'dmedia' library is needed to read the Unadjusted System Time (UST). - dnl -+ CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/unix" - AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([IRIX posix thread library not found!])) - AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR([IRIX audio library not found!])) - AC_CHECK_LIB(dmedia, dmGetUST, , AC_MSG_ERROR([IRIX digital media library not found!])) -@@ -271,6 +275,7 @@ - , - AC_MSG_ERROR([libpthread not found!])) + #include + #include ++#define _WAVEFORMATEXTENSIBLE_ + #include + #include + #include +--- portaudio/configure.in 14:07:02.000000000 +0000 ++++ portaudio-patched/configure.in 2012-05-27 14:08:34.000000000 +0000 +@@ -247,7 +247,7 @@ + if [[ "x$with_directx" = "xyes" ]]; then + DXDIR="$with_dxdir" + add_objects src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/os/win/pa_win_waveformat.o +- LIBS="-lwinmm -lm -ldsound -lole32" ++ LIBS="$LIBS -lwinmm -lm -ldsound -lole32" + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -ldsound -lole32" + #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" + #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" +@@ -257,7 +257,7 @@ + if [[ "x$with_asio" = "xyes" ]]; then + ASIODIR="$with_asiodir" + add_objects src/hostapi/asio/pa_asio.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o +- LIBS="-lwinmm -lm -lole32 -luuid" ++ LIBS="$LIBS -lwinmm -lm -lole32 -luuid" + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lole32 -luuid" + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -UPA_USE_ASIO -DPA_USE_ASIO=1 -DWINDOWS" -+ CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/unix" - if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then - DLL_LIBS="$DLL_LIBS -lasound" - OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o" -@@ -305,6 +310,7 @@ - OTHER_OBJS="$OTHER_OBJS src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o" - esac - CFLAGS="$CFLAGS $THREAD_CFLAGS" -+echo "CFLAGS: $CFLAGS" +@@ -273,7 +273,7 @@ + if [[ "x$with_wdmks" = "xyes" ]]; then + DXDIR="$with_dxdir" + add_objects src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o +- LIBS="-lwinmm -lm -luuid -lsetupapi -lole32" ++ LIBS="$LIBS -lwinmm -lm -luuid -lsetupapi -lole32" + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -luuid -lsetupapi -lole32" + #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" + #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" +@@ -282,14 +282,14 @@ - if test "$enable_cxx" = "yes"; then - AC_CONFIG_SUBDIRS([bindings/cpp]) -diff -ru portaudio-orig/Makefile.in portaudio/Makefile.in ---- portaudio-orig/Makefile.in 2007-10-24 17:29:04.000000000 +0200 -+++ portaudio/Makefile.in 2010-01-23 17:00:40.000000000 +0100 -@@ -16,7 +16,7 @@ - libdir = @libdir@ - includedir = @includedir@ - CC = @CC@ --CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/common -I$(top_srcdir)/src/os/unix @CFLAGS@ @DEFS@ -+CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/common @CFLAGS@ @DEFS@ - LIBS = @LIBS@ - AR = @AR@ - RANLIB = @RANLIB@ + if [[ "x$with_wmme" = "xyes" ]]; then + add_objects src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o +- LIBS="-lwinmm -lm -lole32 -luuid" ++ LIBS="$LIBS -lwinmm -lm -lole32 -luuid" + DLL_LIBS="${DLL_LIBS} -lwinmm" + CFLAGS="$CFLAGS -UPA_USE_WMME -DPA_USE_WMME=1" + fi + + if [[ "x$with_wasapi" = "xyes" ]]; then + add_objects src/hostapi/wasapi/pa_win_wasapi.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/os/win/pa_win_waveformat.o +- LIBS="-lwinmm -lm -lole32 -luuid" ++ LIBS="$LIBS -lwinmm -lm -lole32 -luuid" + DLL_LIBS="${DLL_LIBS} -lwinmm -lole32" + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hostapi/wasapi/mingw-include -UPA_USE_WASAPI -DPA_USE_WASAPI=1" + fi diff -r 1d1285b1f6a0 -r d733a98b84d6 src/portaudio.mk --- a/src/portaudio.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/portaudio.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,15 +3,15 @@ PKG := portaudio $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 3841453bb7be672a15b6b632ade6f225eb0a4efc +$(PKG)_CHECKSUM := f07716c470603729a55b70f5af68f4a6807097eb $(PKG)_SUBDIR := portaudio -$(PKG)_FILE := pa_stable_v$($(PKG)_VERSION).tar.gz +$(PKG)_FILE := pa_stable_v$($(PKG)_VERSION).tgz $(PKG)_URL := http://www.portaudio.com/archives/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.portaudio.com/download.html' | \ - $(SED) -n 's,.*pa_stable_v\([0-9][^>]*\)\.tar.*,\1,p' | \ + $(WGET) -q -O- 'http://www.portaudio.com/download.html' | \ + $(SED) -n 's,.*pa_stable_v\([0-9][^>]*\)\.tgz,\1,p' | \ head -1 endef @@ -22,8 +22,9 @@ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --with-host_os=mingw \ - --with-winapi=directx \ - --with-dxdir=$(PREFIX)/$(TARGET) + --with-winapi=wmme,directx,wasapi,wdmks \ + --with-dxdir=$(PREFIX)/$(TARGET) \ + ac_cv_path_AR=$(TARGET)-ar $(MAKE) -C '$(1)' -j '$(JOBS)' SHARED_FLAGS= TESTS= $(MAKE) -C '$(1)' -j 1 install diff -r 1d1285b1f6a0 -r d733a98b84d6 src/postgresql-1-fixes.patch --- a/src/postgresql-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/postgresql-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -3,17 +3,17 @@ Contains ad hoc patches for cross building. -From 7985f049ed030c1f49927828a4b8e3d7552e52a4 Mon Sep 17 00:00:00 2001 -From: MXE +From 19c7eeda5108ff34f2c954fb974f06517ad01f7b Mon Sep 17 00:00:00 2001 +From: "a@a.org" Date: Mon, 24 Oct 2011 14:02:33 +0200 -Subject: [PATCH 1/2] use unix style names for openssl on MXE +Subject: [PATCH 1/2] use unix style names for openssl on mingw-cross-env diff --git a/configure.in b/configure.in -index 7c0e94e..2ee79c7 100644 +index 4ea90f0..be9c1d9 100644 --- a/configure.in +++ b/configure.in -@@ -943,13 +943,8 @@ fi +@@ -926,13 +926,8 @@ fi if test "$with_openssl" = yes ; then dnl Order matters! @@ -30,30 +30,30 @@ if test "$with_pam" = yes ; then -- -1.7.9 +1.7.10.4 -From 9471812a4e7021fea291469d636bdeca6078c1e5 Mon Sep 17 00:00:00 2001 -From: MXE +From 6faf5d9d9431e71758aab37c27bb422fd933fabb Mon Sep 17 00:00:00 2001 +From: "a@a.org" Date: Mon, 24 Oct 2011 14:09:38 +0200 Subject: [PATCH 2/2] do not check autoconf version diff --git a/configure.in b/configure.in -index 2ee79c7..102b95b 100644 +index be9c1d9..ee2f6bb 100644 --- a/configure.in +++ b/configure.in @@ -19,10 +19,6 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros - AC_INIT([PostgreSQL], [9.1.3], [pgsql-bugs@postgresql.org]) + AC_INIT([PostgreSQL], [9.2.0], [pgsql-bugs@postgresql.org]) -m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.63], [], [m4_fatal([Autoconf version 2.63 is required. -Untested combinations of 'autoconf' and PostgreSQL versions are not -recommended. You can remove the check from 'configure.in' but it is then -your responsibility whether the result works or not.])]) - AC_COPYRIGHT([Copyright (c) 1996-2011, PostgreSQL Global Development Group]) + AC_COPYRIGHT([Copyright (c) 1996-2012, PostgreSQL Global Development Group]) AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) AC_CONFIG_AUX_DIR(config) -- -1.7.9 +1.7.10.4 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/postgresql.mk --- a/src/postgresql.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/postgresql.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := postgresql $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 1cf3044415df807c08bb8ad8e40e24e8d375cf34 +$(PKG)_CHECKSUM := 6ab154052dd62bb9b0cf2cd666384f7b25eefaf5 $(PKG)_SUBDIR := postgresql-$($(PKG)_VERSION) $(PKG)_FILE := postgresql-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := http://ftp.postgresql.org/pub/source/v$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc zlib openssl define $(PKG)_UPDATE - wget -q -O- 'http://git.postgresql.org/gitweb?p=postgresql.git;a=tags' | \ + $(WGET) -q -O- 'http://git.postgresql.org/gitweb?p=postgresql.git;a=tags' | \ grep 'refs/tags/REL9[0-9_]*"' | \ $(SED) 's,.*refs/tags/REL\(.*\)".*,\1,g;' | \ $(SED) 's,_,.,g' | \ @@ -25,6 +25,7 @@ cd '$(1)' && ./configure \ --prefix='$(PREFIX)/$(TARGET)' \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --disable-rpath \ --without-tcl \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/proj.mk --- a/src/proj.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/proj.mk Thu Sep 20 10:43:06 2012 +0200 @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://trac.osgeo.org/proj/' | \ + $(WGET) -q -O- 'http://trac.osgeo.org/proj/' | \ $(SED) -n 's,.*proj-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/protobuf-test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/protobuf-test.cpp Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,9 @@ +#include + +int +main() +{ + GOOGLE_PROTOBUF_VERIFY_VERSION; + google::protobuf::ShutdownProtobufLibrary(); + return 0; +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/protobuf.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/protobuf.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,39 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := protobuf +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := df5867e37a4b51fb69f53a8baf5b994938691d6d +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2 +$(PKG)_URL := http://protobuf.googlecode.com/files/$($(PKG)_FILE) +$(PKG)_DEPS := gcc zlib + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://code.google.com/p/protobuf/downloads/list?sort=-uploaded' | \ + $(SED) -n 's,.*protobuf-\([0-9][^<]*\)\.tar.*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD +# First step: Build for host system in order to create "protoc" binary. + cd '$(1)' && ./configure \ + --disable-shared + $(MAKE) -C '$(1)' -j '$(JOBS)' + cp '$(1)/src/protoc' '$(1)/src/protoc_host' + $(MAKE) -C '$(1)' -j 1 distclean +# Second step: Build for target system. + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --prefix='$(PREFIX)/$(TARGET)' \ + --disable-shared \ + --with-zlib \ + --with-protoc=src/protoc_host + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install + + '$(TARGET)-g++' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-protobuf.exe' \ + `'$(TARGET)-pkg-config' protobuf --cflags --libs` +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/pthreads-1-autostatic.patch --- a/src/pthreads-1-autostatic.patch Thu Sep 20 10:38:14 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -This file is part of MXE. -See index.html for further information. - -This patch has been taken from: -http://sourceware.org/ml/pthreads-win32/2010/msg00006.html - -diff -ur pthreads-win32-20091019.orig/GNUmakefile pthreads-win32-20091019/GNUmakefile ---- pthreads-win32-20091019.orig/GNUmakefile 2009-10-19 08:07:32.000000000 -0200 -+++ pthreads-win32-20091019/GNUmakefile 2010-02-01 14:45:28.471432337 -0200 -@@ -63,7 +63,6 @@ - XOPT = - - RCFLAGS = --include-dir=. --LFLAGS = -lwsock32 - - # ---------------------------------------------------------------------- - # The library can be built with some alternative behaviour to -diff -ur pthreads-win32-20091019.orig/pthread.c pthreads-win32-20091019/pthread.c ---- pthreads-win32-20091019.orig/pthread.c 2009-10-19 08:07:32.000000000 -0200 -+++ pthreads-win32-20091019/pthread.c 2010-02-01 14:26:48.601487556 -0200 -@@ -49,6 +49,7 @@ - #include "condvar.c" - #include "create.c" - #include "dll.c" -+#include "autostatic.c" - #include "errno.c" - #include "exit.c" - #include "fork.c" -diff -ur pthreads-win32-20091019.orig/pthread_getspecific.c pthreads-win32-20091019/pthread_getspecific.c ---- pthreads-win32-20091019.orig/pthread_getspecific.c 2009-10-19 08:07:32.000000000 -0200 -+++ pthreads-win32-20091019/pthread_getspecific.c 2010-02-01 14:28:36.603981857 -0200 -@@ -72,12 +72,10 @@ - else - { - int lasterror = GetLastError (); -- int lastWSAerror = WSAGetLastError (); - - ptr = TlsGetValue (key->key); - - SetLastError (lasterror); -- WSASetLastError (lastWSAerror); - } - - return ptr; -diff -ur pthreads-win32-20091019.orig/pthread.h pthreads-win32-20091019/pthread.h ---- pthreads-win32-20091019.orig/pthread.h 2009-10-19 08:07:32.000000000 -0200 -+++ pthreads-win32-20091019/pthread.h 2010-02-02 16:51:05.047931915 -0200 -@@ -533,7 +533,7 @@ - * do NOT define PTW32_BUILD, and then the variables/functions will - * be imported correctly. - */ --#ifndef PTW32_STATIC_LIB -+#if !defined(PTW32_STATIC_LIB) && !defined(__MINGW32__) - # ifdef PTW32_BUILD - # define PTW32_DLLPORT __declspec (dllexport) - # else -diff -ur pthreads-win32-20091019.orig/sched.h pthreads-win32-20091019/sched.h ---- pthreads-win32-20091019.orig/sched.h 2009-10-19 08:07:32.000000000 -0200 -+++ pthreads-win32-20091019/sched.h 2010-02-02 16:51:00.665887720 -0200 -@@ -76,7 +76,7 @@ - * do NOT define PTW32_BUILD, and then the variables/functions will - * be imported correctly. - */ --#ifndef PTW32_STATIC_LIB -+#if !defined(PTW32_STATIC_LIB) && !defined(__MINGW32__) - # ifdef PTW32_BUILD - # define PTW32_DLLPORT __declspec (dllexport) - # else -diff -ur pthreads-win32-20091019.orig/semaphore.h pthreads-win32-20091019/semaphore.h ---- pthreads-win32-20091019.orig/semaphore.h 2009-10-19 08:07:32.000000000 -0200 -+++ pthreads-win32-20091019/semaphore.h 2010-02-02 16:50:45.916576916 -0200 -@@ -75,7 +75,7 @@ - * do NOT define PTW32_BUILD, and then the variables/functions will - * be imported correctly. - */ --#ifndef PTW32_STATIC_LIB -+#if !defined(PTW32_STATIC_LIB) && !defined(__MINGW32__) - # ifdef PTW32_BUILD - # define PTW32_DLLPORT __declspec (dllexport) - # else ---- /dev/null 2010-01-29 12:57:37.677072272 -0200 -+++ pthreads-win32-20091019/autostatic.c 2010-02-01 14:26:48.601487556 -0200 -@@ -0,0 +1,67 @@ -+/* -+ * autostatic.c -+ * -+ * Description: -+ * This translation unit implements static library initialisation. -+ * -+ * -------------------------------------------------------------------------- -+ * -+ * Pthreads-win32 - POSIX Threads Library for Win32 -+ * Copyright(C) 1998 John E. Bossom -+ * Copyright(C) 1999,2005 Pthreads-win32 contributors -+ * -+ * Contact Email: rpj@callisto.canberra.edu.au -+ * -+ * The current list of contributors is contained -+ * in the file CONTRIBUTORS included with the source -+ * code distribution. The list can also be seen at the -+ * following World Wide Web location: -+ * http://sources.redhat.com/pthreads-win32/contributors.html -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library in the file COPYING.LIB; -+ * if not, write to the Free Software Foundation, Inc., -+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA -+ */ -+ -+#ifdef PTW32_STATIC_LIB -+ -+#include "pthread.h" -+#include "implement.h" -+ -+static void on_process_init(void) -+{ -+ pthread_win32_process_attach_np (); -+} -+ -+static void on_process_exit(void) -+{ -+ pthread_win32_thread_detach_np (); -+ pthread_win32_process_detach_np (); -+} -+ -+#ifdef __MINGW32__ -+# define attribute_section(a) __attribute__((section(a))) -+#elif defined(_MSC_VER) -+# define attribute_section(a) __pragma(section(a,long,read)); __declspec(allocate(a)) -+#else -+#error compiler not supported! -+#endif -+ -+attribute_section(".CRT$XCU") void *msc_ctor = on_process_init; -+attribute_section(".CRT$XPU") void *msc_dtor = on_process_exit; -+ -+attribute_section(".ctors" ) void *gcc_ctor = on_process_init; -+attribute_section(".dtors" ) void *gcc_dtor = on_process_exit; -+ -+#endif /* PTW32_STATIC_LIB */ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/pthreads-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pthreads-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,62 @@ +This file is part of MXE. +See index.html for further information. + +From e951f784c852f4cd8298864190936fded1efceba Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Sun, 27 May 2012 22:00:19 +0200 +Subject: [PATCH] force static for convenience + +--- + pthread.h | 4 ++++ + sched.h | 4 ++++ + semaphore.h | 4 ++++ + 3 files changed, 12 insertions(+) + +diff --git a/pthread.h b/pthread.h +index b4072f7..c88c886 100755 +--- a/pthread.h ++++ b/pthread.h +@@ -547,6 +547,10 @@ extern "C" + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ ++ ++// MXE: Set this for convenience here since MXE only does static. ++#define PTW32_STATIC_LIB ++ + #if !defined(PTW32_STATIC_LIB) + # if defined(PTW32_BUILD) + # define PTW32_DLLPORT __declspec (dllexport) +diff --git a/sched.h b/sched.h +index f36a97a..1f4f401 100755 +--- a/sched.h ++++ b/sched.h +@@ -76,6 +76,10 @@ + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ ++ ++// MXE: Set this for convenience here since MXE only does static. ++#define PTW32_STATIC_LIB ++ + #if !defined(PTW32_STATIC_LIB) + # if defined(PTW32_BUILD) + # define PTW32_DLLPORT __declspec (dllexport) +diff --git a/semaphore.h b/semaphore.h +index c6e9407..2b64173 100755 +--- a/semaphore.h ++++ b/semaphore.h +@@ -75,6 +75,10 @@ + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ ++ ++// MXE: Set this for convenience here since MXE only does static. ++#define PTW32_STATIC_LIB ++ + #if !defined(PTW32_STATIC_LIB) + # if defined(PTW32_BUILD) + # define PTW32_DLLPORT __declspec (dllexport) +-- +1.7.9.2 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/pthreads.mk --- a/src/pthreads.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/pthreads.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,24 +3,20 @@ PKG := pthreads $(PKG)_IGNORE := -$(PKG)_CHECKSUM := da8371cb20e8e238f96a1d0651212f154d84a9ac +$(PKG)_CHECKSUM := 24d40e89c2e66a765733e8c98d6f94500343da86 $(PKG)_SUBDIR := pthreads-w32-$($(PKG)_VERSION)-release $(PKG)_FILE := pthreads-w32-$($(PKG)_VERSION)-release.tar.gz $(PKG)_URL := ftp://sourceware.org/pub/pthreads-win32/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'ftp://sourceware.org/pub/pthreads-win32/Release_notes' | \ + $(WGET) -q -O- 'ftp://sourceware.org/pub/pthreads-win32/Release_notes' | \ $(SED) -n 's,^RELEASE \([0-9][^[:space:]]*\).*,\1,p' | \ tr '.' '-' | \ head -1 endef define $(PKG)_BUILD - $(SED) -i '35i\#define PTW32_STATIC_LIB' '$(1)/pthread.h' - $(SED) -i '41i\#define PTW32_STATIC_LIB' '$(1)/sched.h' - $(SED) -i '41i\#define PTW32_STATIC_LIB' '$(1)/semaphore.h' - $(SED) -i 's,#include "config.h",,' '$(1)/pthread.h' $(MAKE) -C '$(1)' -j 1 GC-static CROSS='$(TARGET)-' $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib' $(INSTALL) -m644 '$(1)/libpthreadGC2.a' '$(PREFIX)/$(TARGET)/lib/libpthread.a' diff -r 1d1285b1f6a0 -r d733a98b84d6 src/qdbm-test.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/qdbm-test.c Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,51 @@ +/* + * This file is part of MXE. + * See index.html for further information. + * + * Taken from examples at http://fallabs.com/qdbm/spex.html + */ + +#include +#include +#include + +#define NAME "mikio" +#define NUMBER "000-1234-5678" +#define DBNAME "book" + +int main(int argc, char **argv){ + DEPOT *depot; + char *val; + + (void)argc; + (void)argv; + + /* open the database */ + if(!(depot = dpopen(DBNAME, DP_OWRITER | DP_OCREAT, -1))){ + fprintf(stderr, "dpopen: %s\n", dperrmsg(dpecode)); + return 1; + } + + /* store the record */ + if(!dpput(depot, NAME, -1, NUMBER, -1, DP_DOVER)){ + fprintf(stderr, "dpput: %s\n", dperrmsg(dpecode)); + } + + /* retrieve the record */ + if(!(val = dpget(depot, NAME, -1, 0, -1, NULL))){ + fprintf(stderr, "dpget: %s\n", dperrmsg(dpecode)); + } + else { + printf("Name: %s\n", NAME); + printf("Number: %s\n", val); + free(val); + } + + /* close the database */ + if(!dpclose(depot)){ + fprintf(stderr, "dpclose: %s\n", dperrmsg(dpecode)); + return 1; + } + + return 0; +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/qdbm.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/qdbm.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,44 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := qdbm +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 8c2ab938c2dad8067c29b0aa93efc6389f0e7076 +$(PKG)_SUBDIR := qdbm-$($(PKG)_VERSION) +$(PKG)_FILE := qdbm-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://fallabs.com/qdbm/qdbm-1.8.78.tar.gz +$(PKG)_DEPS := gcc bzip2 libiconv lzo zlib + +define $(PKG)_UPDATE + wget -q -O- 'http://fallabs.com/qdbm/' | \ + grep 'qdbm-' | \ + $(SED) -n 's,.*qdbm-\([0-9][^>]*\)\.tar.*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --prefix='$(PREFIX)/$(TARGET)' \ + --enable-lzo \ + --enable-bzip \ + --enable-zlib \ + --enable-iconv + $(MAKE) -C '$(1)' -j '$(JOBS)' \ + static \ + MYBINS= \ + MYLIBS=libqdbm.a \ + AR=i686-pc-mingw32-ar \ + RANLIB=i686-pc-mingw32-ranlib + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig' + $(INSTALL) -m644 '$(1)/libqdbm.a' '$(PREFIX)/$(TARGET)/lib/' + $(INSTALL) -m644 '$(1)/qdbm.pc' '$(PREFIX)/$(TARGET)/lib/pkgconfig/' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/include' + cd '$(1)' && $(INSTALL) -m644 depot.h curia.h relic.h hovel.h \ + cabin.h villa.h vista.h odeum.h '$(PREFIX)/$(TARGET)/include/' + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-qdbm.exe' \ + `'$(TARGET)-pkg-config' qdbm --cflags --libs` +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/qjson.mk --- a/src/qjson.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/qjson.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc qt define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/qjson/files/qjson/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/qjson/files/qjson/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef @@ -20,7 +20,6 @@ mkdir '$(1)/build' cd '$(1)/build' && cmake .. \ -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ - -DCMAKE_BUILD_TYPE=Release \ -DLIBTYPE=STATIC $(MAKE) -C '$(1)/build' -j '$(JOBS)' install diff -r 1d1285b1f6a0 -r d733a98b84d6 src/qt-1-cherrypicks.patch --- a/src/qt-1-cherrypicks.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/qt-1-cherrypicks.patch Thu Sep 20 10:43:06 2012 +0200 @@ -5,21 +5,18 @@ http://qt.gitorious.org/qt Also contains MXE specific fixes. -From 16a4f14e8e879a14ae5db47d0731c9199c01a816 Mon Sep 17 00:00:00 2001 +From 2a376d8ff643ec0d40fdba68a25c3a323dbd5be4 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Fri, 13 Jan 2012 00:17:48 +0100 -Subject: [PATCH 01/18] remove trailing whitespace +Subject: [PATCH 01/24] remove trailing whitespace backported from qt5/qtbase Change-Id: If53a0bd1794e69b4856f993c6e2959369bd007d6 Reviewed-by: Friedemann Kleint (cherry picked from commit 0f7a413683ab4358c4ded8bdffb7381459d98068) ---- - src/corelib/codecs/codecs.pri | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri -index 6bc2fa6..9b7967d 100644 +index 9090773..859ec8d 100644 --- a/src/corelib/codecs/codecs.pri +++ b/src/corelib/codecs/codecs.pri @@ -42,7 +42,7 @@ unix { @@ -35,10 +32,10 @@ 1.7.10.4 -From 162708efc51e40ed59d4e3397d399920c21d03a6 Mon Sep 17 00:00:00 2001 +From f9650fb05bde43a8d710469daa363383e3947e3a Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 30 Jun 2011 10:22:33 +0200 -Subject: [PATCH 02/18] do not detect or configure iconv for Windows +Subject: [PATCH 02/24] do not detect or configure iconv for Windows Qt doesn't use iconv on Windows, but configuring it will appear to work and the build will complete. The result is that character @@ -51,15 +48,12 @@ Reviewed-by: Lars Knoll Reviewed-by: Friedemann Kleint (cherry picked from commit 9fa2b641ba6ff4f4b3f474b87ddb642cfa5c3d83) ---- - configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure -index a706908..0690822 100755 +index d19f443..520ffc3 100755 --- a/configure +++ b/configure -@@ -5600,7 +5600,7 @@ fi +@@ -5682,7 +5682,7 @@ fi # auto-detect iconv(3) support if [ "$CFG_ICONV" != "no" ]; then @@ -72,21 +66,18 @@ 1.7.10.4 -From dd34e052a555203b2bfb415bd0ce348ef232aa7e Mon Sep 17 00:00:00 2001 +From 04a44c0d6b3272c6edb08d34cecf36825843c2a0 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Wed, 18 Jan 2012 11:43:10 +0100 -Subject: [PATCH 03/18] fix whitespace +Subject: [PATCH 03/24] fix whitespace backported from qt5/qtbase Change-Id: I0cfccae085c000d4368386a34f288c1e6f01a88f Reviewed-by: Lars Knoll (cherry picked from commit 10f6c5981cd2373c73873f8bace0b2df42a01db8) ---- - src/corelib/codecs/codecs.pri | 33 ++++++++++++++++----------------- - 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri -index 9b7967d..836cc34 100644 +index 859ec8d..70cd890 100644 --- a/src/corelib/codecs/codecs.pri +++ b/src/corelib/codecs/codecs.pri @@ -1,23 +1,23 @@ @@ -149,10 +140,10 @@ 1.7.10.4 -From 7f2e5f5e4bc740446f0160ae3246907fa4f6dc2f Mon Sep 17 00:00:00 2001 +From 043a2cdc024dd19685a1cd3694faa0cdbade5a82 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 4 Jul 2011 00:42:24 +0200 -Subject: [PATCH 04/18] build and load text codecs regardless of iconv and +Subject: [PATCH 04/24] build and load text codecs regardless of iconv and platform Otherwise applications linking to static Qt may have to import @@ -168,13 +159,9 @@ Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira (cherry picked from commit 7ee3d8c8ecb78dd7c5ae09b04ebf1420958f0001) ---- - src/corelib/codecs/codecs.pri | 38 ++++++++++++++++++------------------- - src/corelib/codecs/qtextcodec.cpp | 14 +++++--------- - 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri -index 836cc34..8ff9070 100644 +index 70cd890..c847264 100644 --- a/src/corelib/codecs/codecs.pri +++ b/src/corelib/codecs/codecs.pri @@ -10,6 +10,15 @@ HEADERS += \ @@ -237,10 +224,10 @@ } symbian:LIBS += -lcharconv diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp -index 74e5e90..2b3100a 100644 +index 08d954c..f267acb 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp -@@ -65,15 +65,14 @@ +@@ -66,15 +66,14 @@ # include "qtsciicodec_p.h" # include "qisciicodec_p.h" #if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY) @@ -258,7 +245,7 @@ # if defined(Q_WS_X11) && !defined(QT_BOOTSTRAPPED) # include "qfontlaocodec_p.h" # include "../../plugins/codecs/jp/qfontjpcodec.h" -@@ -759,8 +758,6 @@ static void setup() +@@ -751,8 +750,6 @@ static void setup() # if defined(Q_WS_X11) && !defined(QT_BOOTSTRAPPED) // no font codecs when bootstrapping (void)new QFontLaoCodec; @@ -267,7 +254,7 @@ (void)new QFontGb2312Codec; (void)new QFontGbkCodec; (void)new QFontGb18030_0Codec; -@@ -769,12 +766,11 @@ static void setup() +@@ -761,12 +758,11 @@ static void setup() (void)new QFontKsc5601Codec; (void)new QFontBig5hkscsCodec; (void)new QFontBig5Codec; @@ -282,7 +269,7 @@ // no asian codecs when bootstrapping, sorry (void)new QGb18030Codec; (void)new QGbkCodec; -@@ -786,7 +782,7 @@ static void setup() +@@ -778,7 +774,7 @@ static void setup() (void)new QCP949Codec; (void)new QBig5Codec; (void)new QBig5hkscsCodec; @@ -295,10 +282,10 @@ 1.7.10.4 -From 00db0d7b9b99b18fd08463f86102f1b63eb3a527 Mon Sep 17 00:00:00 2001 +From c9e946e08850c2ea92c818bcef9b4f0ec47fb86f Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Fri, 13 Jan 2012 00:24:13 +0100 -Subject: [PATCH 05/18] move plugin text codecs to QtCore +Subject: [PATCH 05/24] move plugin text codecs to QtCore Having plugin text codecs adds considerable complexity to configuring Qt. The plugin interface is designed for optional @@ -323,100 +310,9 @@ Conflicts: src/plugins/plugins.pro ---- - src/corelib/codecs/codecs.pri | 32 +- - src/corelib/codecs/cp949codetbl_p.h | 637 ++ - src/corelib/codecs/qbig5codec.cpp |12788 +++++++++++++++++++++++++++++++ - src/corelib/codecs/qbig5codec_p.h | 124 + - src/corelib/codecs/qeucjpcodec.cpp | 261 + - src/corelib/codecs/qeucjpcodec_p.h | 106 + - src/corelib/codecs/qeuckrcodec.cpp | 3571 +++++++++ - src/corelib/codecs/qeuckrcodec_p.h | 129 + - src/corelib/codecs/qfontjpcodec.cpp | 145 + - src/corelib/codecs/qfontjpcodec_p.h | 93 + - src/corelib/codecs/qgb18030codec.cpp | 9265 ++++++++++++++++++++++ - src/corelib/codecs/qgb18030codec_p.h | 159 + - src/corelib/codecs/qjiscodec.cpp | 367 + - src/corelib/codecs/qjiscodec_p.h | 106 + - src/corelib/codecs/qjpunicode.cpp |10700 ++++++++++++++++++++++++++ - src/corelib/codecs/qjpunicode_p.h | 174 + - src/corelib/codecs/qsjiscodec.cpp | 229 + - src/corelib/codecs/qsjiscodec_p.h | 106 + - src/corelib/codecs/qtextcodec.cpp | 14 +- - src/plugins/codecs/cn/cn.pro | 16 - - src/plugins/codecs/cn/main.cpp | 145 - - src/plugins/codecs/cn/qgb18030codec.cpp | 9265 ---------------------- - src/plugins/codecs/cn/qgb18030codec.h | 159 - - src/plugins/codecs/codecs.pro | 4 - - src/plugins/codecs/jp/jp.pro | 27 - - src/plugins/codecs/jp/main.cpp | 149 - - src/plugins/codecs/jp/qeucjpcodec.cpp | 261 - - src/plugins/codecs/jp/qeucjpcodec.h | 106 - - src/plugins/codecs/jp/qfontjpcodec.cpp | 145 - - src/plugins/codecs/jp/qfontjpcodec.h | 93 - - src/plugins/codecs/jp/qjiscodec.cpp | 367 - - src/plugins/codecs/jp/qjiscodec.h | 106 - - src/plugins/codecs/jp/qjpunicode.cpp |10700 -------------------------- - src/plugins/codecs/jp/qjpunicode.h | 174 - - src/plugins/codecs/jp/qsjiscodec.cpp | 229 - - src/plugins/codecs/jp/qsjiscodec.h | 106 - - src/plugins/codecs/kr/cp949codetbl.h | 637 -- - src/plugins/codecs/kr/kr.pro | 20 - - src/plugins/codecs/kr/main.cpp | 131 - - src/plugins/codecs/kr/qeuckrcodec.cpp | 3571 --------- - src/plugins/codecs/kr/qeuckrcodec.h | 129 - - src/plugins/codecs/tw/main.cpp | 138 - - src/plugins/codecs/tw/qbig5codec.cpp |12788 ------------------------------- - src/plugins/codecs/tw/qbig5codec.h | 124 - - src/plugins/codecs/tw/tw.pro | 16 - - src/plugins/plugins.pro | 5 - - 46 files changed, 38984 insertions(+), 39633 deletions(-) - create mode 100644 src/corelib/codecs/cp949codetbl_p.h - create mode 100644 src/corelib/codecs/qbig5codec.cpp - create mode 100644 src/corelib/codecs/qbig5codec_p.h - create mode 100644 src/corelib/codecs/qeucjpcodec.cpp - create mode 100644 src/corelib/codecs/qeucjpcodec_p.h - create mode 100644 src/corelib/codecs/qeuckrcodec.cpp - create mode 100644 src/corelib/codecs/qeuckrcodec_p.h - create mode 100644 src/corelib/codecs/qfontjpcodec.cpp - create mode 100644 src/corelib/codecs/qfontjpcodec_p.h - create mode 100644 src/corelib/codecs/qgb18030codec.cpp - create mode 100644 src/corelib/codecs/qgb18030codec_p.h - create mode 100644 src/corelib/codecs/qjiscodec.cpp - create mode 100644 src/corelib/codecs/qjiscodec_p.h - create mode 100644 src/corelib/codecs/qjpunicode.cpp - create mode 100644 src/corelib/codecs/qjpunicode_p.h - create mode 100644 src/corelib/codecs/qsjiscodec.cpp - create mode 100644 src/corelib/codecs/qsjiscodec_p.h - delete mode 100644 src/plugins/codecs/cn/cn.pro - delete mode 100644 src/plugins/codecs/cn/main.cpp - delete mode 100644 src/plugins/codecs/cn/qgb18030codec.cpp - delete mode 100644 src/plugins/codecs/cn/qgb18030codec.h - delete mode 100644 src/plugins/codecs/codecs.pro - delete mode 100644 src/plugins/codecs/jp/jp.pro - delete mode 100644 src/plugins/codecs/jp/main.cpp - delete mode 100644 src/plugins/codecs/jp/qeucjpcodec.cpp - delete mode 100644 src/plugins/codecs/jp/qeucjpcodec.h - delete mode 100644 src/plugins/codecs/jp/qfontjpcodec.cpp - delete mode 100644 src/plugins/codecs/jp/qfontjpcodec.h - delete mode 100644 src/plugins/codecs/jp/qjiscodec.cpp - delete mode 100644 src/plugins/codecs/jp/qjiscodec.h - delete mode 100644 src/plugins/codecs/jp/qjpunicode.cpp - delete mode 100644 src/plugins/codecs/jp/qjpunicode.h - delete mode 100644 src/plugins/codecs/jp/qsjiscodec.cpp - delete mode 100644 src/plugins/codecs/jp/qsjiscodec.h - delete mode 100644 src/plugins/codecs/kr/cp949codetbl.h - delete mode 100644 src/plugins/codecs/kr/kr.pro - delete mode 100644 src/plugins/codecs/kr/main.cpp - delete mode 100644 src/plugins/codecs/kr/qeuckrcodec.cpp - delete mode 100644 src/plugins/codecs/kr/qeuckrcodec.h - delete mode 100644 src/plugins/codecs/tw/main.cpp - delete mode 100644 src/plugins/codecs/tw/qbig5codec.cpp - delete mode 100644 src/plugins/codecs/tw/qbig5codec.h - delete mode 100644 src/plugins/codecs/tw/tw.pro diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri -index 8ff9070..02f30f5 100644 +index c847264..a1271b9 100644 --- a/src/corelib/codecs/codecs.pri +++ b/src/corelib/codecs/codecs.pri @@ -11,13 +11,14 @@ HEADERS += \ @@ -467,15 +363,14 @@ SOURCES += codecs/qfontlaocodec.cpp diff --git a/src/corelib/codecs/cp949codetbl_p.h b/src/corelib/codecs/cp949codetbl_p.h new file mode 100644 -index 0000000..25723c7 +index 0000000..8bf9204 --- /dev/null +++ b/src/corelib/codecs/cp949codetbl_p.h @@ -0,0 +1,637 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -508,6 +403,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -1110,15 +1006,14 @@ +#endif // CP494CODETBL_H diff --git a/src/corelib/codecs/qbig5codec.cpp b/src/corelib/codecs/qbig5codec.cpp new file mode 100644 -index 0000000..e30861d +index 0000000..662aee8 --- /dev/null +++ b/src/corelib/codecs/qbig5codec.cpp @@ -0,0 +1,12788 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -1151,6 +1046,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -13904,15 +13800,14 @@ +QT_END_NAMESPACE diff --git a/src/corelib/codecs/qbig5codec_p.h b/src/corelib/codecs/qbig5codec_p.h new file mode 100644 -index 0000000..f43b733 +index 0000000..eec1798 --- /dev/null +++ b/src/corelib/codecs/qbig5codec_p.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -13945,6 +13840,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -14034,15 +13930,14 @@ +#endif // QBIG5CODEC_H diff --git a/src/corelib/codecs/qeucjpcodec.cpp b/src/corelib/codecs/qeucjpcodec.cpp new file mode 100644 -index 0000000..4ff5552 +index 0000000..69e314c --- /dev/null +++ b/src/corelib/codecs/qeucjpcodec.cpp @@ -0,0 +1,261 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -14075,6 +13970,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -14301,15 +14197,14 @@ +QT_END_NAMESPACE diff --git a/src/corelib/codecs/qeucjpcodec_p.h b/src/corelib/codecs/qeucjpcodec_p.h new file mode 100644 -index 0000000..af02ed9 +index 0000000..d693e04 --- /dev/null +++ b/src/corelib/codecs/qeucjpcodec_p.h @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -14342,6 +14237,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -14413,15 +14309,14 @@ +#endif // QEUCJPCODEC_H diff --git a/src/corelib/codecs/qeuckrcodec.cpp b/src/corelib/codecs/qeuckrcodec.cpp new file mode 100644 -index 0000000..cc8fca8 +index 0000000..bef4132 --- /dev/null +++ b/src/corelib/codecs/qeuckrcodec.cpp @@ -0,0 +1,3571 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -14454,6 +14349,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -17990,15 +17886,14 @@ +QT_END_NAMESPACE diff --git a/src/corelib/codecs/qeuckrcodec_p.h b/src/corelib/codecs/qeuckrcodec_p.h new file mode 100644 -index 0000000..9408622 +index 0000000..55a1337 --- /dev/null +++ b/src/corelib/codecs/qeuckrcodec_p.h @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -18031,6 +17926,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -18125,15 +18021,14 @@ +#endif // QEUCKRCODEC_H diff --git a/src/corelib/codecs/qfontjpcodec.cpp b/src/corelib/codecs/qfontjpcodec.cpp new file mode 100644 -index 0000000..85eae20 +index 0000000..2ac3d6c --- /dev/null +++ b/src/corelib/codecs/qfontjpcodec.cpp @@ -0,0 +1,145 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -18166,6 +18061,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -18276,15 +18172,14 @@ +QT_END_NAMESPACE diff --git a/src/corelib/codecs/qfontjpcodec_p.h b/src/corelib/codecs/qfontjpcodec_p.h new file mode 100644 -index 0000000..6b2a6ee +index 0000000..dfb06bb --- /dev/null +++ b/src/corelib/codecs/qfontjpcodec_p.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -18317,6 +18212,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -18375,15 +18271,14 @@ +#endif // QFONTJPCODEC_H diff --git a/src/corelib/codecs/qgb18030codec.cpp b/src/corelib/codecs/qgb18030codec.cpp new file mode 100644 -index 0000000..760fcc0 +index 0000000..928bc52 --- /dev/null +++ b/src/corelib/codecs/qgb18030codec.cpp @@ -0,0 +1,9265 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -18416,6 +18311,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -27646,15 +27542,14 @@ +#endif // QT_NO_TEXTCODEC diff --git a/src/corelib/codecs/qgb18030codec_p.h b/src/corelib/codecs/qgb18030codec_p.h new file mode 100644 -index 0000000..85047f3 +index 0000000..3e082bf --- /dev/null +++ b/src/corelib/codecs/qgb18030codec_p.h @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -27687,6 +27582,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -27811,15 +27707,14 @@ +#endif // QGB18030CODEC_H diff --git a/src/corelib/codecs/qjiscodec.cpp b/src/corelib/codecs/qjiscodec.cpp new file mode 100644 -index 0000000..99c756e +index 0000000..dd80541 --- /dev/null +++ b/src/corelib/codecs/qjiscodec.cpp @@ -0,0 +1,367 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -27852,6 +27747,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -28184,15 +28080,14 @@ +QT_END_NAMESPACE diff --git a/src/corelib/codecs/qjiscodec_p.h b/src/corelib/codecs/qjiscodec_p.h new file mode 100644 -index 0000000..aaf02a9 +index 0000000..dcdb04d --- /dev/null +++ b/src/corelib/codecs/qjiscodec_p.h @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -28225,6 +28120,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -28296,15 +28192,14 @@ +#endif // QJISCODEC_H diff --git a/src/corelib/codecs/qjpunicode.cpp b/src/corelib/codecs/qjpunicode.cpp new file mode 100644 -index 0000000..feb0f41 +index 0000000..ffd8829 --- /dev/null +++ b/src/corelib/codecs/qjpunicode.cpp @@ -0,0 +1,10700 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -28337,6 +28232,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -39002,15 +38898,14 @@ +QT_END_NAMESPACE diff --git a/src/corelib/codecs/qjpunicode_p.h b/src/corelib/codecs/qjpunicode_p.h new file mode 100644 -index 0000000..069f49a +index 0000000..a5bdd0c --- /dev/null +++ b/src/corelib/codecs/qjpunicode_p.h @@ -0,0 +1,174 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -39043,6 +38938,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -39182,15 +39078,14 @@ +#endif // QJPUNICODE_H diff --git a/src/corelib/codecs/qsjiscodec.cpp b/src/corelib/codecs/qsjiscodec.cpp new file mode 100644 -index 0000000..ac89b33 +index 0000000..f03cd26 --- /dev/null +++ b/src/corelib/codecs/qsjiscodec.cpp @@ -0,0 +1,229 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -39223,6 +39118,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -39417,15 +39313,14 @@ +QT_END_NAMESPACE diff --git a/src/corelib/codecs/qsjiscodec_p.h b/src/corelib/codecs/qsjiscodec_p.h new file mode 100644 -index 0000000..c56a103 +index 0000000..3d3cde7 --- /dev/null +++ b/src/corelib/codecs/qsjiscodec_p.h @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -+** All rights reserved. -+** Contact: Nokia Corporation (qt-info@nokia.com) ++** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** @@ -39458,6 +39353,7 @@ +** +** +** ++** +** $QT_END_LICENSE$ +** +****************************************************************************/ @@ -39528,10 +39424,10 @@ + +#endif // QSJISCODEC_H diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp -index 2b3100a..3399034 100644 +index f267acb..b6ed5e6 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp -@@ -66,16 +66,16 @@ +@@ -67,16 +67,16 @@ # include "qisciicodec_p.h" #if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY) # if !defined(QT_BOOTSTRAPPED) @@ -39579,15 +39475,14 @@ -symbian:TARGET.UID3=0x2001E615 diff --git a/src/plugins/codecs/cn/main.cpp b/src/plugins/codecs/cn/main.cpp deleted file mode 100644 -index cf42b97..0000000 +index 93b8b72..0000000 --- a/src/plugins/codecs/cn/main.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -39620,6 +39515,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -39730,15 +39626,14 @@ -#endif // QT_NO_TEXTCODECPLUGIN diff --git a/src/plugins/codecs/cn/qgb18030codec.cpp b/src/plugins/codecs/cn/qgb18030codec.cpp deleted file mode 100644 -index 760fcc0..0000000 +index 928bc52..0000000 --- a/src/plugins/codecs/cn/qgb18030codec.cpp +++ /dev/null @@ -1,9265 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -39771,6 +39666,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -49001,15 +48897,14 @@ -#endif // QT_NO_TEXTCODEC diff --git a/src/plugins/codecs/cn/qgb18030codec.h b/src/plugins/codecs/cn/qgb18030codec.h deleted file mode 100644 -index 85047f3..0000000 +index 3e082bf..0000000 --- a/src/plugins/codecs/cn/qgb18030codec.h +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -49042,6 +48937,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -49209,15 +49105,14 @@ -symbian:TARGET.UID3=0x2001E614 diff --git a/src/plugins/codecs/jp/main.cpp b/src/plugins/codecs/jp/main.cpp deleted file mode 100644 -index b372fb6..0000000 +index 6eee02f..0000000 --- a/src/plugins/codecs/jp/main.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -49250,6 +49145,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -49364,15 +49260,14 @@ -#endif // QT_NO_TEXTCODECPLUGIN diff --git a/src/plugins/codecs/jp/qeucjpcodec.cpp b/src/plugins/codecs/jp/qeucjpcodec.cpp deleted file mode 100644 -index 4ff5552..0000000 +index 69e314c..0000000 --- a/src/plugins/codecs/jp/qeucjpcodec.cpp +++ /dev/null @@ -1,261 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -49405,6 +49300,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -49631,15 +49527,14 @@ -QT_END_NAMESPACE diff --git a/src/plugins/codecs/jp/qeucjpcodec.h b/src/plugins/codecs/jp/qeucjpcodec.h deleted file mode 100644 -index af02ed9..0000000 +index d693e04..0000000 --- a/src/plugins/codecs/jp/qeucjpcodec.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -49672,6 +49567,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -49743,15 +49639,14 @@ -#endif // QEUCJPCODEC_H diff --git a/src/plugins/codecs/jp/qfontjpcodec.cpp b/src/plugins/codecs/jp/qfontjpcodec.cpp deleted file mode 100644 -index 85eae20..0000000 +index 2ac3d6c..0000000 --- a/src/plugins/codecs/jp/qfontjpcodec.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -49784,6 +49679,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -49894,15 +49790,14 @@ -QT_END_NAMESPACE diff --git a/src/plugins/codecs/jp/qfontjpcodec.h b/src/plugins/codecs/jp/qfontjpcodec.h deleted file mode 100644 -index 6b2a6ee..0000000 +index dfb06bb..0000000 --- a/src/plugins/codecs/jp/qfontjpcodec.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -49935,6 +49830,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -49993,15 +49889,14 @@ -#endif // QFONTJPCODEC_H diff --git a/src/plugins/codecs/jp/qjiscodec.cpp b/src/plugins/codecs/jp/qjiscodec.cpp deleted file mode 100644 -index 99c756e..0000000 +index dd80541..0000000 --- a/src/plugins/codecs/jp/qjiscodec.cpp +++ /dev/null @@ -1,367 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -50034,6 +49929,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -50366,15 +50262,14 @@ -QT_END_NAMESPACE diff --git a/src/plugins/codecs/jp/qjiscodec.h b/src/plugins/codecs/jp/qjiscodec.h deleted file mode 100644 -index aaf02a9..0000000 +index dcdb04d..0000000 --- a/src/plugins/codecs/jp/qjiscodec.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -50407,6 +50302,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -50478,15 +50374,14 @@ -#endif // QJISCODEC_H diff --git a/src/plugins/codecs/jp/qjpunicode.cpp b/src/plugins/codecs/jp/qjpunicode.cpp deleted file mode 100644 -index feb0f41..0000000 +index ffd8829..0000000 --- a/src/plugins/codecs/jp/qjpunicode.cpp +++ /dev/null @@ -1,10700 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -50519,6 +50414,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -61184,15 +61080,14 @@ -QT_END_NAMESPACE diff --git a/src/plugins/codecs/jp/qjpunicode.h b/src/plugins/codecs/jp/qjpunicode.h deleted file mode 100644 -index 069f49a..0000000 +index a5bdd0c..0000000 --- a/src/plugins/codecs/jp/qjpunicode.h +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -61225,6 +61120,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -61364,15 +61260,14 @@ -#endif // QJPUNICODE_H diff --git a/src/plugins/codecs/jp/qsjiscodec.cpp b/src/plugins/codecs/jp/qsjiscodec.cpp deleted file mode 100644 -index ac89b33..0000000 +index f03cd26..0000000 --- a/src/plugins/codecs/jp/qsjiscodec.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -61405,6 +61300,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -61599,15 +61495,14 @@ -QT_END_NAMESPACE diff --git a/src/plugins/codecs/jp/qsjiscodec.h b/src/plugins/codecs/jp/qsjiscodec.h deleted file mode 100644 -index c56a103..0000000 +index 3d3cde7..0000000 --- a/src/plugins/codecs/jp/qsjiscodec.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -61640,6 +61535,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -61711,15 +61607,14 @@ -#endif // QSJISCODEC_H diff --git a/src/plugins/codecs/kr/cp949codetbl.h b/src/plugins/codecs/kr/cp949codetbl.h deleted file mode 100644 -index 25723c7..0000000 +index 8bf9204..0000000 --- a/src/plugins/codecs/kr/cp949codetbl.h +++ /dev/null @@ -1,637 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -61752,6 +61647,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -62380,15 +62276,14 @@ -symbian:TARGET.UID3=0x2001B2E5 diff --git a/src/plugins/codecs/kr/main.cpp b/src/plugins/codecs/kr/main.cpp deleted file mode 100644 -index 86cb7c2..0000000 +index cbfd133..0000000 --- a/src/plugins/codecs/kr/main.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -62421,6 +62316,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -62517,15 +62413,14 @@ -QT_END_NAMESPACE diff --git a/src/plugins/codecs/kr/qeuckrcodec.cpp b/src/plugins/codecs/kr/qeuckrcodec.cpp deleted file mode 100644 -index cc8fca8..0000000 +index bef4132..0000000 --- a/src/plugins/codecs/kr/qeuckrcodec.cpp +++ /dev/null @@ -1,3571 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -62558,6 +62453,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -66094,15 +65990,14 @@ -QT_END_NAMESPACE diff --git a/src/plugins/codecs/kr/qeuckrcodec.h b/src/plugins/codecs/kr/qeuckrcodec.h deleted file mode 100644 -index 9408622..0000000 +index 55a1337..0000000 --- a/src/plugins/codecs/kr/qeuckrcodec.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -66135,6 +66030,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -66229,15 +66125,14 @@ -#endif // QEUCKRCODEC_H diff --git a/src/plugins/codecs/tw/main.cpp b/src/plugins/codecs/tw/main.cpp deleted file mode 100644 -index 9c993e3..0000000 +index 4536e67..0000000 --- a/src/plugins/codecs/tw/main.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -66270,6 +66165,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -66373,15 +66269,14 @@ -QT_END_NAMESPACE diff --git a/src/plugins/codecs/tw/qbig5codec.cpp b/src/plugins/codecs/tw/qbig5codec.cpp deleted file mode 100644 -index e30861d..0000000 +index 662aee8..0000000 --- a/src/plugins/codecs/tw/qbig5codec.cpp +++ /dev/null @@ -1,12788 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -66414,6 +66309,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -79167,15 +79063,14 @@ -QT_END_NAMESPACE diff --git a/src/plugins/codecs/tw/qbig5codec.h b/src/plugins/codecs/tw/qbig5codec.h deleted file mode 100644 -index f43b733..0000000 +index eec1798..0000000 --- a/src/plugins/codecs/tw/qbig5codec.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** @@ -79208,6 +79103,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -79337,32 +79233,19 @@ 1.7.10.4 -From 0332650cdfb4c5847a4678a1aebfbe146c850b87 Mon Sep 17 00:00:00 2001 +From 7c457dbd99e5865f13499146e9487e9cb4b86868 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Wed, 18 Jan 2012 21:01:26 +0100 -Subject: [PATCH 06/18] update private header references +Subject: [PATCH 06/24] update private header references backported from qt5/qtbase Change-Id: I092d879653b6900532a0c4534c1eb2be84e9d0f6 Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira (cherry picked from commit 15e4df7d83fd30e16f014bc1ddc5d55884b388aa) ---- - src/corelib/codecs/qbig5codec.cpp | 2 +- - src/corelib/codecs/qeucjpcodec.cpp | 2 +- - src/corelib/codecs/qeucjpcodec_p.h | 2 +- - src/corelib/codecs/qeuckrcodec.cpp | 4 ++-- - src/corelib/codecs/qfontjpcodec.cpp | 4 ++-- - src/corelib/codecs/qgb18030codec.cpp | 2 +- - src/corelib/codecs/qjiscodec.cpp | 2 +- - src/corelib/codecs/qjiscodec_p.h | 2 +- - src/corelib/codecs/qjpunicode.cpp | 2 +- - src/corelib/codecs/qsjiscodec.cpp | 2 +- - src/corelib/codecs/qsjiscodec_p.h | 2 +- - 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/corelib/codecs/qbig5codec.cpp b/src/corelib/codecs/qbig5codec.cpp -index e30861d..c1a73f7 100644 +index 662aee8..cd39ea0 100644 --- a/src/corelib/codecs/qbig5codec.cpp +++ b/src/corelib/codecs/qbig5codec.cpp @@ -39,7 +39,7 @@ @@ -79375,7 +79258,7 @@ QT_BEGIN_NAMESPACE diff --git a/src/corelib/codecs/qeucjpcodec.cpp b/src/corelib/codecs/qeucjpcodec.cpp -index 4ff5552..f5f4285 100644 +index 69e314c..091ad4d 100644 --- a/src/corelib/codecs/qeucjpcodec.cpp +++ b/src/corelib/codecs/qeucjpcodec.cpp @@ -73,7 +73,7 @@ @@ -79388,7 +79271,7 @@ QT_BEGIN_NAMESPACE diff --git a/src/corelib/codecs/qeucjpcodec_p.h b/src/corelib/codecs/qeucjpcodec_p.h -index af02ed9..9cc7c3d 100644 +index d693e04..a5cd119 100644 --- a/src/corelib/codecs/qeucjpcodec_p.h +++ b/src/corelib/codecs/qeucjpcodec_p.h @@ -71,7 +71,7 @@ @@ -79401,7 +79284,7 @@ #include diff --git a/src/corelib/codecs/qeuckrcodec.cpp b/src/corelib/codecs/qeuckrcodec.cpp -index cc8fca8..00beebd 100644 +index bef4132..f91442f 100644 --- a/src/corelib/codecs/qeuckrcodec.cpp +++ b/src/corelib/codecs/qeuckrcodec.cpp @@ -65,8 +65,8 @@ @@ -79416,7 +79299,7 @@ QT_BEGIN_NAMESPACE diff --git a/src/corelib/codecs/qfontjpcodec.cpp b/src/corelib/codecs/qfontjpcodec.cpp -index 85eae20..6763c88 100644 +index 2ac3d6c..590d72d 100644 --- a/src/corelib/codecs/qfontjpcodec.cpp +++ b/src/corelib/codecs/qfontjpcodec.cpp @@ -39,9 +39,9 @@ @@ -79432,7 +79315,7 @@ QT_BEGIN_NAMESPACE diff --git a/src/corelib/codecs/qgb18030codec.cpp b/src/corelib/codecs/qgb18030codec.cpp -index 760fcc0..d5a40df 100644 +index 928bc52..5c0e701 100644 --- a/src/corelib/codecs/qgb18030codec.cpp +++ b/src/corelib/codecs/qgb18030codec.cpp @@ -44,7 +44,7 @@ @@ -79445,7 +79328,7 @@ #ifndef QT_NO_TEXTCODEC diff --git a/src/corelib/codecs/qjiscodec.cpp b/src/corelib/codecs/qjiscodec.cpp -index 99c756e..b311646 100644 +index dd80541..1831170 100644 --- a/src/corelib/codecs/qjiscodec.cpp +++ b/src/corelib/codecs/qjiscodec.cpp @@ -48,7 +48,7 @@ @@ -79458,7 +79341,7 @@ QT_BEGIN_NAMESPACE diff --git a/src/corelib/codecs/qjiscodec_p.h b/src/corelib/codecs/qjiscodec_p.h -index aaf02a9..3cd7c80 100644 +index dcdb04d..bb59c33 100644 --- a/src/corelib/codecs/qjiscodec_p.h +++ b/src/corelib/codecs/qjiscodec_p.h @@ -71,7 +71,7 @@ @@ -79471,7 +79354,7 @@ #include diff --git a/src/corelib/codecs/qjpunicode.cpp b/src/corelib/codecs/qjpunicode.cpp -index feb0f41..67d4630 100644 +index ffd8829..7827ef3 100644 --- a/src/corelib/codecs/qjpunicode.cpp +++ b/src/corelib/codecs/qjpunicode.cpp @@ -44,7 +44,7 @@ @@ -79484,7 +79367,7 @@ #include "qbytearray.h" #include diff --git a/src/corelib/codecs/qsjiscodec.cpp b/src/corelib/codecs/qsjiscodec.cpp -index ac89b33..b80b494 100644 +index f03cd26..97e6000 100644 --- a/src/corelib/codecs/qsjiscodec.cpp +++ b/src/corelib/codecs/qsjiscodec.cpp @@ -48,7 +48,7 @@ @@ -79497,7 +79380,7 @@ QT_BEGIN_NAMESPACE diff --git a/src/corelib/codecs/qsjiscodec_p.h b/src/corelib/codecs/qsjiscodec_p.h -index c56a103..df1449b 100644 +index 3d3cde7..4910bfd 100644 --- a/src/corelib/codecs/qsjiscodec_p.h +++ b/src/corelib/codecs/qsjiscodec_p.h @@ -71,7 +71,7 @@ @@ -79513,10 +79396,10 @@ 1.7.10.4 -From e76298384079852d9cc1e0138a10b0637f34687f Mon Sep 17 00:00:00 2001 +From 2be2accfee23fee3a9d97e5852ff9d2a01a7c33f Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Sun, 3 Jul 2011 21:53:27 +0200 -Subject: [PATCH 07/18] cosmetic adjustments for files moved to core/codecs +Subject: [PATCH 07/24] cosmetic adjustments for files moved to core/codecs -update old reference to 'plugin' -rename multiple inclusion guards @@ -79527,33 +79410,14 @@ Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira (cherry picked from commit 712cfb509484599f1586f68cc379e3e7464e9967) ---- - src/corelib/codecs/cp949codetbl_p.h | 19 +++++++++++++++---- - src/corelib/codecs/qbig5codec.cpp | 2 +- - src/corelib/codecs/qbig5codec_p.h | 19 +++++++++++++++---- - src/corelib/codecs/qeucjpcodec.cpp | 2 +- - src/corelib/codecs/qeucjpcodec_p.h | 19 +++++++++++++++---- - src/corelib/codecs/qeuckrcodec.cpp | 2 +- - src/corelib/codecs/qeuckrcodec_p.h | 19 +++++++++++++++---- - src/corelib/codecs/qfontjpcodec.cpp | 2 +- - src/corelib/codecs/qfontjpcodec_p.h | 19 +++++++++++++++---- - src/corelib/codecs/qgb18030codec.cpp | 2 +- - src/corelib/codecs/qgb18030codec_p.h | 19 +++++++++++++++---- - src/corelib/codecs/qjiscodec.cpp | 2 +- - src/corelib/codecs/qjiscodec_p.h | 19 +++++++++++++++---- - src/corelib/codecs/qjpunicode.cpp | 2 +- - src/corelib/codecs/qjpunicode_p.h | 19 +++++++++++++++---- - src/corelib/codecs/qsjiscodec.cpp | 2 +- - src/corelib/codecs/qsjiscodec_p.h | 19 +++++++++++++++---- - 17 files changed, 143 insertions(+), 44 deletions(-) diff --git a/src/corelib/codecs/cp949codetbl_p.h b/src/corelib/codecs/cp949codetbl_p.h -index 25723c7..0e608fa 100644 +index 8bf9204..228c5ad 100644 --- a/src/corelib/codecs/cp949codetbl_p.h +++ b/src/corelib/codecs/cp949codetbl_p.h -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79589,12 +79453,12 @@ -#endif // CP494CODETBL_H +#endif // CP494CODETBL_P_H diff --git a/src/corelib/codecs/qbig5codec.cpp b/src/corelib/codecs/qbig5codec.cpp -index c1a73f7..ecdc84d 100644 +index cd39ea0..13b317f 100644 --- a/src/corelib/codecs/qbig5codec.cpp +++ b/src/corelib/codecs/qbig5codec.cpp -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79602,12 +79466,12 @@ ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/corelib/codecs/qbig5codec_p.h b/src/corelib/codecs/qbig5codec_p.h -index f43b733..849ff9d 100644 +index eec1798..674c513 100644 --- a/src/corelib/codecs/qbig5codec_p.h +++ b/src/corelib/codecs/qbig5codec_p.h -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79643,12 +79507,12 @@ -#endif // QBIG5CODEC_H +#endif // QBIG5CODEC_P_H diff --git a/src/corelib/codecs/qeucjpcodec.cpp b/src/corelib/codecs/qeucjpcodec.cpp -index f5f4285..c681492 100644 +index 091ad4d..773c473 100644 --- a/src/corelib/codecs/qeucjpcodec.cpp +++ b/src/corelib/codecs/qeucjpcodec.cpp -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79656,12 +79520,12 @@ ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/corelib/codecs/qeucjpcodec_p.h b/src/corelib/codecs/qeucjpcodec_p.h -index 9cc7c3d..d34ac7c 100644 +index a5cd119..97d8523 100644 --- a/src/corelib/codecs/qeucjpcodec_p.h +++ b/src/corelib/codecs/qeucjpcodec_p.h -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79697,12 +79561,12 @@ -#endif // QEUCJPCODEC_H +#endif // QEUCJPCODEC_P_H diff --git a/src/corelib/codecs/qeuckrcodec.cpp b/src/corelib/codecs/qeuckrcodec.cpp -index 00beebd..2cd472b 100644 +index f91442f..8417bf0 100644 --- a/src/corelib/codecs/qeuckrcodec.cpp +++ b/src/corelib/codecs/qeuckrcodec.cpp -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79710,12 +79574,12 @@ ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/corelib/codecs/qeuckrcodec_p.h b/src/corelib/codecs/qeuckrcodec_p.h -index 9408622..f498d7c 100644 +index 55a1337..79647b1 100644 --- a/src/corelib/codecs/qeuckrcodec_p.h +++ b/src/corelib/codecs/qeuckrcodec_p.h -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79751,12 +79615,12 @@ -#endif // QEUCKRCODEC_H +#endif // QEUCKRCODEC_P_H diff --git a/src/corelib/codecs/qfontjpcodec.cpp b/src/corelib/codecs/qfontjpcodec.cpp -index 6763c88..156ec3a 100644 +index 590d72d..3d39524 100644 --- a/src/corelib/codecs/qfontjpcodec.cpp +++ b/src/corelib/codecs/qfontjpcodec.cpp -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79764,12 +79628,12 @@ ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/corelib/codecs/qfontjpcodec_p.h b/src/corelib/codecs/qfontjpcodec_p.h -index 6b2a6ee..981a086 100644 +index dfb06bb..9e9b8dd 100644 --- a/src/corelib/codecs/qfontjpcodec_p.h +++ b/src/corelib/codecs/qfontjpcodec_p.h -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79805,12 +79669,12 @@ -#endif // QFONTJPCODEC_H +#endif // QFONTJPCODEC_P_H diff --git a/src/corelib/codecs/qgb18030codec.cpp b/src/corelib/codecs/qgb18030codec.cpp -index d5a40df..2b56018 100644 +index 5c0e701..c5daef6 100644 --- a/src/corelib/codecs/qgb18030codec.cpp +++ b/src/corelib/codecs/qgb18030codec.cpp -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79818,12 +79682,12 @@ ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/corelib/codecs/qgb18030codec_p.h b/src/corelib/codecs/qgb18030codec_p.h -index 85047f3..6c3cb31 100644 +index 3e082bf..0f66211 100644 --- a/src/corelib/codecs/qgb18030codec_p.h +++ b/src/corelib/codecs/qgb18030codec_p.h -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79859,12 +79723,12 @@ -#endif // QGB18030CODEC_H +#endif // QGB18030CODEC_P_H diff --git a/src/corelib/codecs/qjiscodec.cpp b/src/corelib/codecs/qjiscodec.cpp -index b311646..7b5fb4e 100644 +index 1831170..83c4329 100644 --- a/src/corelib/codecs/qjiscodec.cpp +++ b/src/corelib/codecs/qjiscodec.cpp -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79872,12 +79736,12 @@ ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/corelib/codecs/qjiscodec_p.h b/src/corelib/codecs/qjiscodec_p.h -index 3cd7c80..4a0fc43 100644 +index bb59c33..daccf57 100644 --- a/src/corelib/codecs/qjiscodec_p.h +++ b/src/corelib/codecs/qjiscodec_p.h -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79913,12 +79777,12 @@ -#endif // QJISCODEC_H +#endif // QJISCODEC_P_H diff --git a/src/corelib/codecs/qjpunicode.cpp b/src/corelib/codecs/qjpunicode.cpp -index 67d4630..03db950 100644 +index 7827ef3..1e4883f 100644 --- a/src/corelib/codecs/qjpunicode.cpp +++ b/src/corelib/codecs/qjpunicode.cpp -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79926,12 +79790,12 @@ ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/corelib/codecs/qjpunicode_p.h b/src/corelib/codecs/qjpunicode_p.h -index 069f49a..82b3d2c 100644 +index a5bdd0c..07b5b25 100644 --- a/src/corelib/codecs/qjpunicode_p.h +++ b/src/corelib/codecs/qjpunicode_p.h -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79967,12 +79831,12 @@ -#endif // QJPUNICODE_H +#endif // QJPUNICODE_P_H diff --git a/src/corelib/codecs/qsjiscodec.cpp b/src/corelib/codecs/qsjiscodec.cpp -index b80b494..c4438e3 100644 +index 97e6000..27121ad 100644 --- a/src/corelib/codecs/qsjiscodec.cpp +++ b/src/corelib/codecs/qsjiscodec.cpp -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -79980,12 +79844,12 @@ ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/src/corelib/codecs/qsjiscodec_p.h b/src/corelib/codecs/qsjiscodec_p.h -index df1449b..f8efcae 100644 +index 4910bfd..d57f94b 100644 --- a/src/corelib/codecs/qsjiscodec_p.h +++ b/src/corelib/codecs/qsjiscodec_p.h -@@ -4,7 +4,7 @@ - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) +@@ -3,7 +3,7 @@ + ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). + ** Contact: http://www.qt-project.org/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. @@ -80024,10 +79888,10 @@ 1.7.10.4 -From 16ea320980842c9c16d380f3bdd84c5a413dbd21 Mon Sep 17 00:00:00 2001 +From eeecdea8f15353aa0461ec09f7064f456849a3c3 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 12 Jan 2012 10:43:29 +0100 -Subject: [PATCH 08/18] remove obsolete codec plugin loading code +Subject: [PATCH 08/24] remove obsolete codec plugin loading code backported from qt5/qtbase Change-Id: I1f3dbb5c10009413f701947b1b89ed3dbc94bf3d @@ -80038,22 +79902,9 @@ Conflicts: dist/changes-5.0.0 ---- - src/corelib/codecs/codecs.pri | 8 +- - src/corelib/codecs/qtextcodec.cpp | 87 +---------------- - src/corelib/codecs/qtextcodecplugin.cpp | 161 ------------------------------- - src/corelib/codecs/qtextcodecplugin.h | 96 ------------------ - src/corelib/global/qconfig-medium.h | 3 - - src/corelib/global/qconfig-minimal.h | 3 - - src/corelib/global/qconfig-nacl.h | 3 - - src/corelib/global/qconfig-small.h | 3 - - src/corelib/global/qfeatures.h | 5 - - 9 files changed, 4 insertions(+), 365 deletions(-) - delete mode 100644 src/corelib/codecs/qtextcodecplugin.cpp - delete mode 100644 src/corelib/codecs/qtextcodecplugin.h diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri -index 02f30f5..76e8d5e 100644 +index a1271b9..9274eda 100644 --- a/src/corelib/codecs/codecs.pri +++ b/src/corelib/codecs/codecs.pri @@ -7,11 +7,9 @@ HEADERS += \ @@ -80083,13 +79934,13 @@ codecs/qjpunicode.cpp \ codecs/qeucjpcodec.cpp \ diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp -index 3399034..552a195 100644 +index b6ed5e6..55e5b83 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp -@@ -47,11 +47,6 @@ - +@@ -48,11 +48,6 @@ #include "qlist.h" #include "qfile.h" + #include "qvarlengtharray.h" -#ifndef QT_NO_LIBRARY -# include "qcoreapplication.h" -# include "qtextcodecplugin.h" @@ -80098,7 +79949,7 @@ #include "qstringlist.h" #ifdef Q_OS_UNIX -@@ -104,11 +99,6 @@ +@@ -105,11 +100,6 @@ QT_BEGIN_NAMESPACE @@ -80110,7 +79961,7 @@ //Cache for QTextCodec::codecForName and codecForMib. typedef QHash QTextCodecCache; Q_GLOBAL_STATIC(QTextCodecCache, qTextCodecCache) -@@ -150,39 +140,6 @@ static bool nameMatch(const QByteArray &name, const QByteArray &test) +@@ -151,39 +141,6 @@ static bool nameMatch(const QByteArray &name, const QByteArray &test) } @@ -80150,7 +80001,7 @@ static QList *all = 0; #ifdef Q_DEBUG_TEXTCODEC static bool destroying_is_ok = false; -@@ -967,10 +924,6 @@ QTextCodec::ConverterState::~ConverterState() +@@ -959,10 +916,6 @@ QTextCodec::ConverterState::~ConverterState() \o Converts a Unicode string to an 8-bit character string. \endtable @@ -80161,7 +80012,7 @@ \sa QTextStream, QTextDecoder, QTextEncoder, {Codecs Example} */ -@@ -1063,10 +1016,7 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name) +@@ -1055,10 +1008,7 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name) } } @@ -80173,7 +80024,7 @@ } -@@ -1103,16 +1053,7 @@ QTextCodec* QTextCodec::codecForMib(int mib) +@@ -1095,16 +1045,7 @@ QTextCodec* QTextCodec::codecForMib(int mib) } } @@ -80191,7 +80042,7 @@ } /*! -@@ -1145,18 +1086,6 @@ QList QTextCodec::availableCodecs() +@@ -1137,18 +1078,6 @@ QList QTextCodec::availableCodecs() locker.unlock(); #endif @@ -80210,7 +80061,7 @@ return codecs; } -@@ -1185,18 +1114,6 @@ QList QTextCodec::availableMibs() +@@ -1177,18 +1106,6 @@ QList QTextCodec::availableMibs() locker.unlock(); #endif @@ -80231,15 +80082,14 @@ diff --git a/src/corelib/codecs/qtextcodecplugin.cpp b/src/corelib/codecs/qtextcodecplugin.cpp deleted file mode 100644 -index 4eb075c..0000000 +index b164f31..0000000 --- a/src/corelib/codecs/qtextcodecplugin.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the QtCore module of the Qt Toolkit. -** @@ -80272,6 +80122,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -80398,15 +80249,14 @@ -#endif // QT_NO_TEXTCODECPLUGIN diff --git a/src/corelib/codecs/qtextcodecplugin.h b/src/corelib/codecs/qtextcodecplugin.h deleted file mode 100644 -index 9a00bbc..0000000 +index 2873b0e..0000000 --- a/src/corelib/codecs/qtextcodecplugin.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). --** All rights reserved. --** Contact: Nokia Corporation (qt-info@nokia.com) +-** Contact: http://www.qt-project.org/ -** -** This file is part of the QtCore module of the Qt Toolkit. -** @@ -80439,6 +80289,7 @@ -** -** -** +-** -** $QT_END_LICENSE$ -** -****************************************************************************/ @@ -80499,7 +80350,7 @@ - -#endif // QTEXTCODECPLUGIN_H diff --git a/src/corelib/global/qconfig-medium.h b/src/corelib/global/qconfig-medium.h -index 96207d1..779d4ef 100644 +index 170b2c3..9ed73aa 100644 --- a/src/corelib/global/qconfig-medium.h +++ b/src/corelib/global/qconfig-medium.h @@ -91,9 +91,6 @@ @@ -80513,7 +80364,7 @@ # define QT_NO_TRANSLATION #endif diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h -index da2bf14..dc963a7 100644 +index 6781c60..707e6b1 100644 --- a/src/corelib/global/qconfig-minimal.h +++ b/src/corelib/global/qconfig-minimal.h @@ -167,9 +167,6 @@ @@ -80527,7 +80378,7 @@ # define QT_NO_TRANSLATION #endif diff --git a/src/corelib/global/qconfig-nacl.h b/src/corelib/global/qconfig-nacl.h -index d97e666..ecaad4f 100644 +index eb4632f..7fecfec 100644 --- a/src/corelib/global/qconfig-nacl.h +++ b/src/corelib/global/qconfig-nacl.h @@ -128,9 +128,6 @@ @@ -80541,7 +80392,7 @@ # define QT_NO_TRANSLATION #endif diff --git a/src/corelib/global/qconfig-small.h b/src/corelib/global/qconfig-small.h -index fefbfb6..d0a7029 100644 +index 988dc6f..dda6567 100644 --- a/src/corelib/global/qconfig-small.h +++ b/src/corelib/global/qconfig-small.h @@ -128,9 +128,6 @@ @@ -80555,7 +80406,7 @@ # define QT_NO_TRANSLATION #endif diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h -index 844101a..4ea4227 100644 +index 9612778..493269d 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -643,11 +643,6 @@ @@ -80574,10 +80425,10 @@ 1.7.10.4 -From 5a5ae1066dbcf8a663e7f292d8679aae2ccd7b73 Mon Sep 17 00:00:00 2001 +From c94d9111ef83683ea2b7db6e4070594c4a332f1c Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 23 Jan 2012 23:12:46 +0100 -Subject: [PATCH 09/18] remove vestiges of text codec plugins +Subject: [PATCH 09/24] remove vestiges of text codec plugins follow-up to 3a3356a85079d734dfa57205a00e1996afc033df @@ -80585,9 +80436,6 @@ Change-Id: Iba84958cbcd105ec702568752090719cc108e101 Reviewed-by: Lars Knoll (cherry picked from commit 38d4618eb5f9b7293513267f9f5749aa2568e08c) ---- - src/corelib/global/qfeatures.txt | 7 ------- - 1 file changed, 7 deletions(-) diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index dea05e0..12cd8ea 100644 @@ -80611,15 +80459,12 @@ 1.7.10.4 -From 90daa3f753c91a3efde3dfdc9151f9a639c653d0 Mon Sep 17 00:00:00 2001 +From 415466a4ac2a87522569544a9b9ba7115fc4acf7 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 3 Nov 2011 15:10:26 +0100 -Subject: [PATCH 10/18] use pkg-config for libmng (MXE specific) +Subject: [PATCH 10/24] use pkg-config for libmng (MXE specific) Change-Id: Ifce956d5cad06d5273088656b8500b87980063f4 ---- - src/gui/image/qmnghandler.pri | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qmnghandler.pri b/src/gui/image/qmnghandler.pri index ffb98de..6aab68f 100644 @@ -80640,15 +80485,12 @@ 1.7.10.4 -From 1d4c3643de6eea011e74ed73dc2290c58f41d865 Mon Sep 17 00:00:00 2001 +From 1cac3150930d5353455b560792f7e76fe180ad26 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 3 Nov 2011 14:11:02 +0100 -Subject: [PATCH 11/18] use pkg-config for libtiff-4 (MXE specific) +Subject: [PATCH 11/24] use pkg-config for libtiff-4 (MXE specific) Change-Id: I5e89e66fc1606d425553e781c9e62db703136957 ---- - src/gui/image/qtiffhandler.pri | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qtiffhandler.pri b/src/gui/image/qtiffhandler.pri index e1cc3ee..71cbab1 100644 @@ -80669,10 +80511,10 @@ 1.7.10.4 -From a3c87e93fd4aa06163eb157b060e155c44fbbe14 Mon Sep 17 00:00:00 2001 +From 28ad5f9d9c70feba6475652c6445bbe263998d3d Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Sat, 5 Jun 2010 23:41:04 +0200 -Subject: [PATCH 12/18] restore support for static linking of QtWebKit (MXE +Subject: [PATCH 12/24] restore support for static linking of QtWebKit (MXE specific) Support was removed by 4221d629e2cf37ee8c5ba7cb595b05ab8c82f113. @@ -80684,19 +80526,12 @@ Don't build Qt WebKit tests to avoid static linking problems. Change-Id: Ia969b8e3f2b656a5057c7ebf748f272d74f014da ---- - configure | 6 ------ - .../webkit/Source/JavaScriptCore/JavaScriptCore.pri | 12 ++++++++++++ - src/3rdparty/webkit/Source/WebCore/WebCore.pri | 12 ++++++++++++ - src/3rdparty/webkit/Source/WebCore/WebCore.pro | 2 +- - src/3rdparty/webkit/Source/WebKit.pro | 2 +- - 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/configure b/configure -index 0690822..2837eec 100755 +index 520ffc3..e018443 100755 --- a/configure +++ b/configure -@@ -7599,12 +7599,6 @@ if [ "$CFG_GUI" = "no" ]; then +@@ -7683,12 +7683,6 @@ if [ "$CFG_GUI" = "no" ]; then canBuildWebKit="no" fi @@ -80779,10 +80614,10 @@ 1.7.10.4 -From 0f6cab5fff9eb2e0cfc173eaf71e068f9b82e9d3 Mon Sep 17 00:00:00 2001 +From ab04bc59d7caf5d04bb87bd75d2bbe98da89d599 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Thu, 1 Sep 2011 13:47:10 +0200 -Subject: [PATCH 13/18] fix building on GNU/kFreeBSD (MXE specific) +Subject: [PATCH 13/24] fix building on GNU/kFreeBSD (MXE specific) This patch has been taken from: @@ -80792,12 +80627,9 @@ Author: Pino Toscano Description: Fixes FTBFS on GNU/kFreeBSD by creating new Q_OS_FREEBSD_KERNEL. Last-Update: 2010-10-06 ---- - src/corelib/global/qglobal.h | 2 ++ - 1 file changed, 2 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h -index ed8f9eb..e571c4e 100644 +index b3d4852..1a6a4a4 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -226,6 +226,8 @@ namespace QT_NAMESPACE {} @@ -80813,10 +80645,10 @@ 1.7.10.4 -From 3b9839cc26fc7997b043a74c7d30fc3b0b81ad83 Mon Sep 17 00:00:00 2001 +From 28bf082efa51789d404e33bfbfdbe17a8261af87 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Thu, 1 Sep 2011 13:49:47 +0200 -Subject: [PATCH 14/18] fix missing platform when building on GNU/kFreeBSD +Subject: [PATCH 14/24] fix missing platform when building on GNU/kFreeBSD (MXE specific) This patch is inspired by: @@ -80825,15 +80657,12 @@ For the time being, glibc-g++ is simply a copy of linux-g++. Change-Id: I1bebe2e6eef878318142ca5ed3525afc167b0a95 ---- - configure | 3 +++ - 1 file changed, 3 insertions(+) diff --git a/configure b/configure -index 2837eec..8b4e5e8 100755 +index e018443..b600744 100755 --- a/configure +++ b/configure -@@ -2749,6 +2749,9 @@ if [ -z "$PLATFORM" ]; then +@@ -2845,6 +2845,9 @@ if [ -z "$PLATFORM" ]; then GNU:*) PLATFORM=hurd-g++ ;; @@ -80847,24 +80676,21 @@ 1.7.10.4 -From e15286869c4e9b5714209ec38686f63c8b2ff44c Mon Sep 17 00:00:00 2001 +From f32c0852485615d6938d1cde1e0b4dc4e6262a7e Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Thu, 1 Sep 2011 13:51:50 +0200 -Subject: [PATCH 15/18] fix building on dragonfly (MXE specific) +Subject: [PATCH 15/24] fix building on dragonfly (MXE specific) This patch is inspired by: http://cvsweb.NetBSD.org/bsdweb.cgi/pkgsrc/x11/qt4-libs/Makefile.common?rev=1.27&content-type=text/x-cvsweb-markup Change-Id: I9743a39ac35950cb15af915c3ae527433bc6b56d ---- - configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure -index 8b4e5e8..99948d1 100755 +index b600744..599203d 100755 --- a/configure +++ b/configure -@@ -2761,7 +2761,7 @@ if [ -z "$PLATFORM" ]; then +@@ -2857,7 +2857,7 @@ if [ -z "$PLATFORM" ]; then ULTRIX:*) PLATFORM=ultrix-g++ ;; @@ -80877,89 +80703,380 @@ 1.7.10.4 -From 87952077f0d192d2ce15ea111be3f320bc03be40 Mon Sep 17 00:00:00 2001 -From: Mark Brand -Date: Fri, 23 Mar 2012 16:29:57 +0100 -Subject: [PATCH 16/18] gcc 4.7.0 compatibility fix for javascript - -taken from http://qt-project.org/forums/viewthread/15071 - -Change-Id: I701fb5a8d754afe9fcd6b327d779365673e07b5d ---- - src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h | 2 +- - .../javascriptcore/JavaScriptCore/runtime/JSStaticScopeObject.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h -index 7c20272..9eb86e7 100644 ---- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h -+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h -@@ -59,7 +59,7 @@ namespace JSC { - protected: - using JSVariableObject::JSVariableObjectData; - -- struct JSGlobalObjectData : public JSVariableObjectData { -+ struct JSGlobalObjectData : public JSVariableObject::JSVariableObjectData { - // We use an explicit destructor function pointer instead of a - // virtual destructor because we want to avoid adding a vtable - // pointer to this struct. Adding a vtable pointer would force the -diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSStaticScopeObject.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSStaticScopeObject.h -index 2542878..3cb66a0 100644 ---- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSStaticScopeObject.h -+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSStaticScopeObject.h -@@ -33,7 +33,7 @@ namespace JSC{ - class JSStaticScopeObject : public JSVariableObject { - protected: - using JSVariableObject::JSVariableObjectData; -- struct JSStaticScopeObjectData : public JSVariableObjectData { -+ struct JSStaticScopeObjectData : public JSVariableObject::JSVariableObjectData { - JSStaticScopeObjectData() - : JSVariableObjectData(&symbolTable, ®isterStore + 1) - { +From 67da309cbc542e765d2254bd2e2c64a78c7cd35f Mon Sep 17 00:00:00 2001 +From: Yuchen Deng +Date: Sun, 19 Aug 2012 15:38:44 +0800 +Subject: [PATCH 16/24] Add -pipe option of win32-g++'s QMAKE_CFLAGS + +cherry-picked from qt5/qtbase commit 2b57a8ebfeb6e3495b63fac619631896ca670f11 + +Change-Id: Idccab648df1a9456a4ee19f1acfdb0544d40a928 +Reviewed-by: Oswald Buddenhagen +(cherry picked from commit 9fbdb93d3aa1cad8859325814e28f014acd18f10) + +diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf +index d174634..6d631fc 100644 +--- a/mkspecs/win32-g++/qmake.conf ++++ b/mkspecs/win32-g++/qmake.conf +@@ -25,7 +25,7 @@ QMAKE_LEX = flex + QMAKE_LEXFLAGS = + QMAKE_YACC = byacc + QMAKE_YACCFLAGS = -d +-QMAKE_CFLAGS = ++QMAKE_CFLAGS = -pipe + QMAKE_CFLAGS_DEPS = -M + QMAKE_CFLAGS_WARN_ON = -Wall -Wextra + QMAKE_CFLAGS_WARN_OFF = -w -- 1.7.10.4 -From 4de5298ed5b06dea106f054ef110146a45f06b6f Mon Sep 17 00:00:00 2001 -From: Mark Brand -Date: Thu, 19 Apr 2012 14:48:34 +0200 -Subject: [PATCH 17/18] fix static library names when generating .pc files for - pkgconfig - -c354d16cc64cf516a0b5149cdc9ef74de096a998 added the version extension -which only occurs on the DLL import library. - -cherry-picked from qt5/qtbase 8e053a5dfc9b4c8f100b1e77335439774f52fc61 -Change-Id: Ie913adf039d7f3a9aadf43f4af014289a8aeacbe +From eeeadca6963f3dedd6ea3626409199f49afa839f Mon Sep 17 00:00:00 2001 +From: Oswald Buddenhagen +Date: Mon, 10 Sep 2012 12:08:51 +0200 +Subject: [PATCH 17/24] find qdevice.pri even for installed qt builds + +Change-Id: Ife18068974227d70c52e7cb0d06e6136827ac562 Reviewed-by: Mark Brand -Reviewed-by: Girish Ramakrishnan -(cherry picked from commit 51a2b0fde9bf635482fd2463b901139c82ed0dc4) ---- - qmake/generators/makefile.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp -index 66c6d49..447943a 100644 ---- a/qmake/generators/makefile.cpp -+++ b/qmake/generators/makefile.cpp -@@ -3258,7 +3258,8 @@ MakefileGenerator::writePkgConfigFile() - } else { - pkgConfiglibDir = "-L${libdir}"; - pkgConfiglibName = "-l" + lname.left(lname.length()-Option::libtool_ext.length()); -- pkgConfiglibName += project->first("TARGET_VERSION_EXT"); -+ if (project->isActiveConfig("shared")) -+ pkgConfiglibName += project->first("TARGET_VERSION_EXT"); - } - t << pkgConfiglibDir << " " << pkgConfiglibName << " " << endl; +(cherry picked from commit ffac77f7de433f67570ff0da9656bce6481be920) + +diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf +index f7aeb07..7da3fe5 100644 +--- a/mkspecs/features/device_config.prf ++++ b/mkspecs/features/device_config.prf +@@ -1,6 +1,6 @@ + # Load generated qdevice.pri + isEmpty(QT_BUILD_TREE): QT_BUILD_TREE = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE) +-isEmpty(QT_BUILD_TREE): QT_BUILD_TREE = . # where to get? ++isEmpty(QT_BUILD_TREE): QT_BUILD_TREE = $$[QT_INSTALL_DATA] + + DEVICE_PRI = $$QT_BUILD_TREE/mkspecs/qdevice.pri -- 1.7.10.4 -From ba6f43c6ab66d00fb11e83a00e5e4364cf664131 Mon Sep 17 00:00:00 2001 +From 2519a7dd92f14031c7d11775caa0645384febd87 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Wed, 12 Sep 2012 00:22:28 +0200 +Subject: [PATCH 18/24] Partial Revert "Disable pkg-config, when x-compiling + for mingw" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This partially reverts commit c7d5071afc6c76925c90ff35041dc4eb86511271. + +Despite what the commit message said, pkg-config previously worked +and was useful, particularly for static Qt. Qt itself even installs +its own .pc files. + +Note: The mkspec win32-g++-cross had a PKG_CONFIG definition to avoid +using the pkg-config installation on the build machine. + +cherry-picked from qt5/qtbase commit 7d9b5e8e7d2094dedbe7e3e2f961544f233ce57e +Change-Id: I6c6ed81b2ab42c9cf7f7e250feeeb9c34c8877e7 +Reviewed-by: Peter Kümmel +Reviewed-by: Oswald Buddenhagen +(cherry picked from commit 57069f1bd5e8cd5450f1d1ceae0d6d315b4a66c8) + +diff --git a/configure b/configure +index 599203d..a0786da 100755 +--- a/configure ++++ b/configure +@@ -1684,7 +1684,6 @@ while [ "$#" -gt 0 ]; do + case `basename "$XPLATFORM"` in win32-g++*) + XPLATFORM_MINGW=yes + CFG_RPATH=no +- PKG_CONFIG=no + CFG_REDUCE_EXPORTS=no + ;; + esac +-- +1.7.10.4 + + +From 03f7a56af4020aaead73c9d0de389d32fd4ddb24 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Peter=20K=C3=BCmmel?= +Date: Wed, 12 Sep 2012 11:13:44 +0200 +Subject: [PATCH 19/24] When x-compiling on Linux the host tools doesn't have + Windows' executable suffix + +patch not needed for Qt5 + +Change-Id: I26a6cd8de91dc6df7d31a9f38187f7b1e8209cc1 +Reviewed-by: Oswald Buddenhagen +(cherry picked from commit 95c55b8a913fd7aaa23a44f1f9aa568342b25e07) + +diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf +index 6d631fc..2cd2214 100644 +--- a/mkspecs/win32-g++/qmake.conf ++++ b/mkspecs/win32-g++/qmake.conf +@@ -11,6 +11,8 @@ MAKEFILE_GENERATOR = MINGW + + load(device_config) + ++equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe ++ + TEMPLATE = app + CONFIG += qt warn_on release link_prl copy_dir_files debug_and_release debug_and_release_target precompile_header + QT += core gui +@@ -101,9 +103,9 @@ QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain + QMAKE_CHK_DIR_EXISTS = if not exist + } + +-QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe +-QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe +-QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe ++QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc$${EXE_SUFFIX} ++QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic$${EXE_SUFFIX} ++QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc$${EXE_SUFFIX} + + QMAKE_IDL = midl + QMAKE_LIB = $${CROSS_COMPILE}ar -ru +-- +1.7.10.4 + + +From 32415e3cb482c55b16d5953e37865ded1885869d Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Tue, 11 Sep 2012 23:45:02 +0200 +Subject: [PATCH 20/24] smuggle QT_BUILD_TREE to device_config.prf even during + tests + +Otherwise CROSS_COMPILE is not available for config.tests +because qdevice.pri is not found in such configurations as: + +./configure -xplatform win32-g++-4.6 \ + -device-option CROSS_COMPILE=$TARGET \ + -prefix=$PREFIX/$TARGET \ + -prefix-install + +Normally, we don't want to use .qmake.cache during tests, +but we need that mechanism here. + +Change-Id: If255f9657fa4206c4875a730f467d58b8a1c6ac1 +Reviewed-by: Oswald Buddenhagen +(cherry picked from commit a0c6987dbb139829f9ea61a66cb863b1baa1f183) + +diff --git a/config.tests/unix/compile.test b/config.tests/unix/compile.test +index f4a7f29..b8f6743 100755 +--- a/config.tests/unix/compile.test ++++ b/config.tests/unix/compile.test +@@ -68,7 +68,8 @@ test -r Makefile && $MAKE distclean >/dev/null 2>&1 + # Make sure output from possible previous tests is gone + rm -f "$EXE" "${EXE}.exe" + +-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" ++echo "QT_BUILD_TREE = $OUTDIR" > "$OUTDIR/$TEST/.qmake.cache" ++"$OUTDIR/bin/qmake" -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" + + if [ "$VERBOSE" = "yes" ]; then + $MAKE +-- +1.7.10.4 + + +From b0481b3c70c42136df1904de68a8f8fc797591e2 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Sun, 16 Sep 2012 00:12:53 +0200 +Subject: [PATCH 21/24] configure: postpone pkg-config detection until after + qmake is built +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +pkg-config isn't used before qmake is built, so these tests can take +place afterward. + +This is preparation for using qmake to resolve PKG_CONFIG in mkspecs. + +Change-Id: Icedf9ebd80bbac3fe1e5d7eeca358cb0fc9de072 +Reviewed-by: Peter Kümmel +Reviewed-by: Oswald Buddenhagen +(cherry picked from commit 1861f0317d4058482667154131f8eb6488db407e) + +diff --git a/configure b/configure +index a0786da..53d0506 100755 +--- a/configure ++++ b/configure +@@ -3330,64 +3330,9 @@ if [ "$OPT_VERBOSE" = "yes" ]; then + fi + + #------------------------------------------------------------------------------- +-# write out device config before we run the test. +-#------------------------------------------------------------------------------- +-DEVICE_VARS_OUTFILE="$outpath/mkspecs/qdevice.pri" +-if cmp -s "$DEVICE_VARS_FILE" "$DEVICE_VARS_OUTFILE"; then +- rm -f "$DEVICE_VARS_FILE" +-else +- mv -f $DEVICE_VARS_FILE "$DEVICE_VARS_OUTFILE" +- DEVICE_VARS_FILE="$DEVICE_VARS_OUTFILE" +-fi +- +-#------------------------------------------------------------------------------- + # tests that don't need qmake (must be run before displaying help) + #------------------------------------------------------------------------------- + +-if [ -z "$PKG_CONFIG" ]; then +- # See if PKG_CONFIG is set in the mkspec: +- PKG_CONFIG=`getXQMakeConf PKG_CONFIG` +-fi +-if [ -z "$PKG_CONFIG" ]; then +- PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null` +-fi +- +-# Work out if we can use pkg-config +-if [ "$QT_CROSS_COMPILE" = "yes" ]; then +- if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then +- echo >&2 "" +- echo >&2 "You have asked to use pkg-config and are cross-compiling." +- echo >&2 "Please make sure you have a correctly set-up pkg-config" +- echo >&2 "environment!" +- echo >&2 "" +- if [ -z "$PKG_CONFIG_PATH" ]; then +- echo >&2 "" +- echo >&2 "Warning: PKG_CONFIG_PATH has not been set. This could mean" +- echo >&2 "the host compiler's .pc files will be used. This is probably" +- echo >&2 "not what you want." +- echo >&2 "" +- elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then +- echo >&2 "" +- echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not" +- echo >&2 "been set. This means your toolchain's .pc files must contain" +- echo >&2 "the paths to the toolchain's libraries & headers. If configure" +- echo >&2 "tests are failing, please check these files." +- echo >&2 "" +- fi +- else +- echo >&2 "" +- echo >&2 "You have not explicitly asked to use pkg-config and are cross-compiling." +- echo >&2 "pkg-config will not be used to automatically query cflag/lib parameters for" +- echo >&2 "dependencies" +- echo >&2 "" +- PKG_CONFIG="" +- fi +-fi +- +-if [ ! -n "$PKG_CONFIG" ]; then +- QT_CONFIG="$QT_CONFIG no-pkg-config" +-fi +- + # process CFG_MAC_ARCHS + if [ "$PLATFORM_MAC" = "yes" ]; then + # check -arch arguments for validity. +@@ -5058,6 +5003,61 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; + fi # Build qmake + + #------------------------------------------------------------------------------- ++# write out device config before we run the test. ++#------------------------------------------------------------------------------- ++DEVICE_VARS_OUTFILE="$outpath/mkspecs/qdevice.pri" ++if cmp -s "$DEVICE_VARS_FILE" "$DEVICE_VARS_OUTFILE"; then ++ rm -f "$DEVICE_VARS_FILE" ++else ++ mv -f $DEVICE_VARS_FILE "$DEVICE_VARS_OUTFILE" ++ DEVICE_VARS_FILE="$DEVICE_VARS_OUTFILE" ++fi ++ ++if [ -z "$PKG_CONFIG" ]; then ++ # See if PKG_CONFIG is set in the mkspec: ++ PKG_CONFIG=`getXQMakeConf PKG_CONFIG` ++fi ++if [ -z "$PKG_CONFIG" ]; then ++ PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null` ++fi ++ ++# Work out if we can use pkg-config ++if [ "$QT_CROSS_COMPILE" = "yes" ]; then ++ if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then ++ echo >&2 "" ++ echo >&2 "You have asked to use pkg-config and are cross-compiling." ++ echo >&2 "Please make sure you have a correctly set-up pkg-config" ++ echo >&2 "environment!" ++ echo >&2 "" ++ if [ -z "$PKG_CONFIG_PATH" ]; then ++ echo >&2 "" ++ echo >&2 "Warning: PKG_CONFIG_PATH has not been set. This could mean" ++ echo >&2 "the host compiler's .pc files will be used. This is probably" ++ echo >&2 "not what you want." ++ echo >&2 "" ++ elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then ++ echo >&2 "" ++ echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not" ++ echo >&2 "been set. This means your toolchain's .pc files must contain" ++ echo >&2 "the paths to the toolchain's libraries & headers. If configure" ++ echo >&2 "tests are failing, please check these files." ++ echo >&2 "" ++ fi ++ else ++ echo >&2 "" ++ echo >&2 "You have not explicitly asked to use pkg-config and are cross-compiling." ++ echo >&2 "pkg-config will not be used to automatically query cflag/lib parameters for" ++ echo >&2 "dependencies" ++ echo >&2 "" ++ PKG_CONFIG="" ++ fi ++fi ++ ++if [ ! -n "$PKG_CONFIG" ]; then ++ QT_CONFIG="$QT_CONFIG no-pkg-config" ++fi ++ ++#------------------------------------------------------------------------------- + # tests that need qmake + #------------------------------------------------------------------------------- + +-- +1.7.10.4 + + +From b0638daae7481b9770e4a88bb7509f6cbbfee0e8 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Fri, 14 Sep 2012 10:03:18 +0200 +Subject: [PATCH 22/24] use qmake to get PKG_CONFIG in configure script + +The value of PKG_CONFIG might depend on device options. +For example, "-device-option PKG_CONFIG" might be used with configure +or a mkspec might prefix PKG_CONFIG with CROSS_COMPILE which is +specified as a device option. + +The shell functions of configure for parsing mkspecs do not take +device options into account, but qmake is pretty good at it now. + +backport of qt5/qtbase 01864d4854557d2cf8b067e229d77cd7c9c553ee + +Change-Id: I1c9558e550c48e8441ebdac34b82066473c2ce3a +Reviewed-by: Oswald Buddenhagen +(cherry picked from commit d8f1f7a29c277c9a643fd048b87f530e37773676) + +diff --git a/configure b/configure +index 53d0506..723502e 100755 +--- a/configure ++++ b/configure +@@ -5014,8 +5014,12 @@ else + fi + + if [ -z "$PKG_CONFIG" ]; then +- # See if PKG_CONFIG is set in the mkspec: +- PKG_CONFIG=`getXQMakeConf PKG_CONFIG` ++ # See if PKG_CONFIG is set in the mkspec or device options ++ (echo TEMPLATE = subdirs ++ echo 'message($$PKG_CONFIG)') > "$outpath/dummy.pro" ++ echo "QT_BUILD_TREE = $outpath" > "$outpath/.qmake.cache.pkgconfig" ++ PKG_CONFIG=`"$outpath/bin/qmake" -cache "$outpath/.qmake.cache.pkgconfig" -spec "$XQMAKESPEC" "$outpath/dummy.pro" -o /dev/null 2>&1 > /dev/null | sed -n -e 's,Project MESSAGE: \(.*\),\1,p'` ++ rm "$outpath/.qmake.cache.pkgconfig" "$outpath/dummy.pro" + fi + if [ -z "$PKG_CONFIG" ]; then + PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null` +-- +1.7.10.4 + + +From 4814e4ff8a6d245eff8761113ac2ae8f37abf71a Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Fri, 14 Sep 2012 00:13:08 +0100 -Subject: [PATCH 18/18] Disable SSL compression by default. +Subject: [PATCH 23/24] Disable SSL compression by default. Disable SSL compression by default since this appears to be the a likely cause of the currently hyped CRIME attack. @@ -80970,14 +81087,9 @@ Reviewed-by: Thiago Macieira Reviewed-by: Peter Hartmann (cherry picked from commit d41dc3e101a694dec98d7bbb582d428d209e5401) ---- - src/network/ssl/qssl.cpp | 5 +++-- - src/network/ssl/qsslconfiguration.cpp | 4 +++- - src/network/ssl/qsslconfiguration_p.h | 4 +++- - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp -index e225984..322bbae 100644 +index 49e086f..9578178 100644 --- a/src/network/ssl/qssl.cpp +++ b/src/network/ssl/qssl.cpp @@ -148,8 +148,9 @@ QT_BEGIN_NAMESPACE @@ -80993,7 +81105,7 @@ Note: Availability of above options depends on the version of the SSL backend in use. diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp -index 0eb01b8..968b3f6 100644 +index 24c7b77..3a05f54 100644 --- a/src/network/ssl/qsslconfiguration.cpp +++ b/src/network/ssl/qsslconfiguration.cpp @@ -201,7 +201,9 @@ bool QSslConfiguration::isNull() const @@ -81008,7 +81120,7 @@ /*! diff --git a/src/network/ssl/qsslconfiguration_p.h b/src/network/ssl/qsslconfiguration_p.h -index b2a76d4..7ee34ea 100644 +index 74f17cd..c36b651 100644 --- a/src/network/ssl/qsslconfiguration_p.h +++ b/src/network/ssl/qsslconfiguration_p.h @@ -83,7 +83,9 @@ public: @@ -81025,3 +81137,40 @@ -- 1.7.10.4 + +From 08f8d25243a021fb17bfce06cd2b1f96dea7454d Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Tue, 18 Sep 2012 21:40:22 +0200 +Subject: [PATCH 24/24] configure: mac features don't belong on cross mingw + target + +CFG_MAC_DWARF2 and CFG_MAC_XARCH options are for targetting macs, not +bulding on them. + +qt5/qtbase commit 7a67c822e3e552d0d881f0409a5316de07dbb8c7 +removed CFG_MAC_DWARF2. + +qt5/qtbase commit 59d5c26075724a581ed276d62d884b44d2ca4489 +removed CFG_MAC_XARCH. + +Change-Id: Idb789ed9a8aa9b824a4c2191a9c39e741ca49574 + +diff --git a/configure b/configure +index 723502e..0978939 100755 +--- a/configure ++++ b/configure +@@ -3421,6 +3421,11 @@ elif [ "$CFG_PRECOMPILE" = "yes" ] && [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; + CFG_PRECOMPILE=no + fi + ++if [ "$XPLATFORM_MINGW" = "yes" ]; then ++ CFG_MAC_DWARF2=no ++ CFG_MAC_XARCH=no ++fi ++ + #auto-detect DWARF2 on the mac + if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "auto" ]; then + if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/qt.mk --- a/src/qt.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/qt.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := qt $(PKG)_IGNORE := -$(PKG)_CHECKSUM := a074d0f605f009e23c63e0a4cb9b71c978146ffc +$(PKG)_CHECKSUM := bc352a283610e0cd2fe0dbedbc45613844090fcb $(PKG)_SUBDIR := $(PKG)-everywhere-opensource-src-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-everywhere-opensource-src-$($(PKG)_VERSION).tar.gz -$(PKG)_URL := http://get.qt.nokia.com/qt/source/$($(PKG)_FILE) +$(PKG)_URL := http://releases.qt-project.org/qt4/source/$($(PKG)_FILE) $(PKG)_DEPS := gcc libodbc++ postgresql freetds openssl zlib libpng jpeg libmng tiff sqlite dbus define $(PKG)_UPDATE - wget -q -O- 'http://qt.gitorious.org/qt/qt/commits' | \ + $(WGET) -q -O- 'http://qt.gitorious.org/qt/qt/commits' | \ grep '
  • ]*\)\.tar.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sdl.mk --- a/src/sdl.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/sdl.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc libiconv define $(PKG)_UPDATE - wget -q -O- 'http://hg.libsdl.org/SDL/tags' | \ + $(WGET) -q -O- 'http://hg.libsdl.org/SDL/tags' | \ $(SED) -n 's,.*release-\([0-9][^<]*\).*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sdl_image.mk --- a/src/sdl_image.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/sdl_image.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc sdl jpeg libpng tiff define $(PKG)_UPDATE - wget -q -O- 'http://hg.libsdl.org/SDL_image/tags' | \ + $(WGET) -q -O- 'http://hg.libsdl.org/SDL_image/tags' | \ $(SED) -n 's,.*release-\([0-9][^<]*\).*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sdl_mixer.mk --- a/src/sdl_mixer.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/sdl_mixer.mk Thu Sep 20 10:43:06 2012 +0200 @@ -7,10 +7,10 @@ $(PKG)_SUBDIR := SDL_mixer-$($(PKG)_VERSION) $(PKG)_FILE := SDL_mixer-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://www.libsdl.org/projects/SDL_mixer/release/$($(PKG)_FILE) -$(PKG)_DEPS := gcc sdl libmikmod ogg vorbis smpeg +$(PKG)_DEPS := gcc sdl libmodplug ogg vorbis smpeg define $(PKG)_UPDATE - wget -q -O- 'http://hg.libsdl.org/SDL_mixer/tags' | \ + $(WGET) -q -O- 'http://hg.libsdl.org/SDL_mixer/tags' | \ $(SED) -n 's,.*release-\([0-9][^<]*\).*,\1,p' | \ head -1 endef @@ -19,7 +19,7 @@ $(SED) -i 's,^\(Requires:.*\),\1 vorbisfile,' '$(1)/SDL_mixer.pc.in' echo \ 'Libs.private:' \ - "`$(PREFIX)/$(TARGET)/bin/libmikmod-config --libs`" \ + "`$(TARGET)-pkg-config libmodplug --libs`" \ "`$(PREFIX)/$(TARGET)/bin/smpeg-config --libs`" \ >> '$(1)/SDL_mixer.pc.in' $(SED) -i 's,for path in /usr/local; do,for path in; do,' '$(1)/configure' @@ -29,7 +29,8 @@ --prefix='$(PREFIX)/$(TARGET)' \ --with-sdl-prefix='$(PREFIX)/$(TARGET)' \ --disable-sdltest \ - --enable-music-mod \ + --disable-music-mod \ + --enable-music-mod-modplug \ --enable-music-ogg \ --disable-music-flac \ --enable-music-mp3 \ @@ -39,7 +40,6 @@ --disable-music-mp3-shared \ --disable-smpegtest \ --with-smpeg-prefix='$(PREFIX)/$(TARGET)' \ - LIBMIKMOD_CONFIG='$(PREFIX)/$(TARGET)/bin/libmikmod-config' \ LIBS='-lvorbis -logg' $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sdl_net.mk --- a/src/sdl_net.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/sdl_net.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc sdl define $(PKG)_UPDATE - wget -q -O- 'http://www.libsdl.org/projects/SDL_net/release/?C=M;O=D' | \ + $(WGET) -q -O- 'http://www.libsdl.org/projects/SDL_net/release/?C=M;O=D' | \ $(SED) -n 's,.*SDL_net-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sdl_pango.mk --- a/src/sdl_pango.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/sdl_pango.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc sdl pango define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/sdlpango/files/SDL_Pango/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/sdlpango/files/SDL_Pango/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sdl_sound.mk --- a/src/sdl_sound.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/sdl_sound.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc sdl libmikmod ogg vorbis flac speex define $(PKG)_UPDATE - wget -q -O- 'http://hg.icculus.org/icculus/SDL_sound/tags' | \ + $(WGET) -q -O- 'http://hg.icculus.org/icculus/SDL_sound/tags' | \ $(SED) -n 's,.*release-\([0-9][^<]*\).*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sdl_ttf.mk --- a/src/sdl_ttf.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/sdl_ttf.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc sdl freetype define $(PKG)_UPDATE - wget -q -O- 'http://hg.libsdl.org/SDL_ttf/tags' | \ + $(WGET) -q -O- 'http://hg.libsdl.org/SDL_ttf/tags' | \ $(SED) -n 's,.*release-\([0-9][^<]*\).*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/smpeg.mk --- a/src/smpeg.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/smpeg.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc sdl define $(PKG)_UPDATE - wget -q -O- 'http://packages.debian.org/unstable/source/smpeg' | \ + $(WGET) -q -O- 'http://packages.debian.org/unstable/source/smpeg' | \ $(SED) -n 's,.*smpeg_\([0-9][^>]*\)\.orig\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sox-test.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sox-test.c Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,15 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + sox_format_init(); + return(0); +} diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sox.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sox.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,39 @@ +# This file is part of MXE. +# See index.html for further information. + +# sox +PKG := sox +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := d809cab382c7a9d015491c69051a9d1c1a1a44f1 +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc ffmpeg flac lame libgomp libmad libsndfile vorbis + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://sourceforge.net/projects/sox/files/sox/' | \ + $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + # set pkg-config cflags and libs + $(SED) -i 's,^\(Cflags:.*\),\1 -fopenmp,' '$(1)/sox.pc.in' + $(SED) -i '/Libs.private/d' '$(1)/sox.pc.in' + echo Libs.private: `grep sox_LDADD '$(1)/src/optional-fmts.am' | \ + $(SED) 's, sox_LDADD += ,,g' | tr -d '\n'` >>'$(1)/sox.pc.in' + + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --prefix='$(PREFIX)/$(TARGET)' \ + --build="`config.guess`" \ + --disable-shared + + $(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= EXTRA_PROGRAMS= + $(MAKE) -C '$(1)' -j 1 install + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-sox.exe' \ + `'$(TARGET)-pkg-config' sox --cflags --libs` +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/speex.mk --- a/src/speex.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/speex.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://git.xiph.org/?p=speex.git;a=tags' | \ + $(WGET) -q -O- 'http://git.xiph.org/?p=speex.git;a=tags' | \ grep ']*>Speex-\([0-9][^<]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/sqlite.mk --- a/src/sqlite.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/sqlite.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := sqlite $(PKG)_IGNORE := -$(PKG)_CHECKSUM := a768f76b10df84d6a2c66178544d42725a8fdaf0 +$(PKG)_CHECKSUM := 7b429809918201555f4c0fa639183a1c663d3fe0 $(PKG)_SUBDIR := $(PKG)-autoconf-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-autoconf-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://www.sqlite.org/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.sqlite.org/download.html' | \ + $(WGET) -q -O- 'http://www.sqlite.org/download.html' | \ $(SED) -n 's,.*sqlite-autoconf-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef @@ -18,6 +18,7 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --disable-readline \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/suitesparse-1.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/suitesparse-1.patch Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,42 @@ +This file is part of MXE. +See index.html for further information. + +From 169f88aef7ff1d302aa3eac48d779d009780b87f Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Sun, 20 May 2012 23:41:27 +0200 +Subject: [PATCH] build lib not demo + +--- + CHOLMOD/Makefile | 2 +- + UMFPACK/Makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CHOLMOD/Makefile b/CHOLMOD/Makefile +index 97911ef..4a3bcae 100644 +--- a/CHOLMOD/Makefile ++++ b/CHOLMOD/Makefile +@@ -14,7 +14,7 @@ include ../SuiteSparse_config/SuiteSparse_config.mk + + # Compile the C-callable libraries and the Demo programs. + all: +- ( cd Demo ; $(MAKE) ) ++ ( cd Lib ; $(MAKE) ) + + # Compile the C-callable libraries only. + library: +diff --git a/UMFPACK/Makefile b/UMFPACK/Makefile +index 622ee39..e19cd2f 100644 +--- a/UMFPACK/Makefile ++++ b/UMFPACK/Makefile +@@ -12,7 +12,7 @@ include ../SuiteSparse_config/SuiteSparse_config.mk + + # compile all C code (except hb, fortran, and fortran64), incl. AMD and demos + all: +- ( cd Demo ; $(MAKE) ) ++ ( cd Lib ; $(MAKE) ) + + # compile just the C-callable UMFPACK library + library: +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/suitesparse.mk --- a/src/suitesparse.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/suitesparse.mk Thu Sep 20 10:43:06 2012 +0200 @@ -2,14 +2,15 @@ # See index.html for further information. PKG := suitesparse -$(PKG)_CHECKSUM := d0eb24b43ee2f7def032e80eaa7a589f94f546fc +$(PKG)_CHECKSUM := 46b24a28eef4b040ea5a02d2c43e82e28b7d6195 $(PKG)_SUBDIR := SuiteSparse $(PKG)_FILE := SuiteSparse-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://www.cise.ufl.edu/research/sparse/SuiteSparse/$($(PKG)_FILE) +$(PKG)_URL_2 := https://distfiles.macports.org/SuiteSparse/$($(PKG)_FILE) $(PKG)_DEPS := gcc blas lapack define $(PKG)_UPDATE - wget -q -O- 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/' | \ + $(WGET) -q -O- 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/' | \ $(SED) -n 's,.*SuiteSparse-\([0-9][^"]*\)\.tar.*,\1,p' | \ head -1 endef @@ -24,7 +25,7 @@ CC='$(TARGET)-gcc' \ CPLUSPLUS='$(TARGET)-g++' \ F77='$(TARGET)-gfortran' \ - AR='$(TARGET)-ar cr' \ + AR='$(TARGET)-ar' \ RANLIB='$(TARGET)-ranlib' \ BLAS='-lblas -lgfortran -lgfortranbegin' \ CHOLMOD_CONFIG='-DNPARTITION' @@ -36,16 +37,17 @@ # install include files $(INSTALL) -d '$(PREFIX)/$(TARGET)/include/suitesparse/' + $(INSTALL) -m644 '$(1)/SuiteSparse_config/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/AMD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/BTF/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/CAMD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/CCOLAMD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/CHOLMOD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/COLAMD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' + $(INSTALL) -m644 '$(1)/CSparse/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/CXSparse/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/KLU/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/LDL/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/SPQR/Include/'* '$(PREFIX)/$(TARGET)/include/suitesparse/' - $(INSTALL) -m644 '$(1)/UFconfig/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' $(INSTALL) -m644 '$(1)/UMFPACK/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/' endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/t4k_common.mk --- a/src/t4k_common.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/t4k_common.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc sdl sdl_mixer sdl_image sdl_net sdl_pango sdl_ttf libpng librsvg libxml2 pthreads define $(PKG)_UPDATE - wget -q -O- 'http://alioth.debian.org/frs/?group_id=31080' | \ + $(WGET) -q -O- 'http://alioth.debian.org/frs/?group_id=31080' | \ $(SED) -n 's,.*t4k_common-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/taglib.mk --- a/src/taglib.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/taglib.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := taglib $(PKG)_IGNORE := -$(PKG)_CHECKSUM := bafe0958eb884981cade83d45c18ee34165479b8 +$(PKG)_CHECKSUM := e657384ccf3284db2daba32dccece74534286012 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://developer.kde.org/~wheeler/files/src/$($(PKG)_FILE) $(PKG)_DEPS := gcc zlib define $(PKG)_UPDATE - wget -q -O- 'http://developer.kde.org/~wheeler/files/src/?C=M;O=D' | \ + $(WGET) -q -O- 'http://developer.kde.org/~wheeler/files/src/?C=M;O=D' | \ $(SED) -n 's,.*"taglib-\([0-9][^"]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/theora.mk --- a/src/theora.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/theora.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc ogg vorbis define $(PKG)_UPDATE - wget -q -O- 'http://www.xiph.org/downloads/' | \ + $(WGET) -q -O- 'http://www.xiph.org/downloads/' | \ $(SED) -n 's,.*libtheora-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/tiff.mk --- a/src/tiff.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/tiff.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,7 +3,7 @@ PKG := tiff $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 8baf382231c9051a1b3eb294581289aa21447171 +$(PKG)_CHECKSUM := d84b7b33a6cfb3d15ca386c8c16b05047f8b5352 $(PKG)_SUBDIR := tiff-$($(PKG)_VERSION) $(PKG)_FILE := tiff-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://download.osgeo.org/libtiff/$($(PKG)_FILE) @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc zlib jpeg xz define $(PKG)_UPDATE - wget -q -O- 'http://www.remotesensing.org/libtiff/' | \ + $(WGET) -q -O- 'http://www.remotesensing.org/libtiff/' | \ $(SED) -n 's,.*>v\([0-9][^<]*\)<.*,\1,p' | \ head -1 endef @@ -19,6 +19,7 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --without-x diff -r 1d1285b1f6a0 -r d733a98b84d6 src/tinyxml.mk --- a/src/tinyxml.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/tinyxml.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/tinyxml/files/tinyxml/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/tinyxml/files/tinyxml/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/tre.mk --- a/src/tre.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/tre.mk Thu Sep 20 10:43:06 2012 +0200 @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://laurikari.net/tre/download.html' | \ + $(WGET) -q -O- 'http://laurikari.net/tre/download.html' | \ $(SED) -n 's,.*tre-\([a-z0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/vigra.mk --- a/src/vigra.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/vigra.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc jpeg tiff libpng openexr define $(PKG)_UPDATE - wget -q -O- 'http://hci.iwr.uni-heidelberg.de/vigra/' | \ + $(WGET) -q -O- 'http://hci.iwr.uni-heidelberg.de/vigra/' | \ grep 'Sources' | \ grep ' src/vmime-1-fixes.patch - -# setup git svn clone -#cd ~/projects/vmime/git -#git svn clone -s https://vmime.svn.sourceforge.net/svnroot/vmime -#git reset --hard -# get updates -#git svn fetch -#git svn rebase - -GITDIR=~/projects/vmime/git/vmime - -( - cd $GITDIR - echo - git format-patch -p --relative=vmime --stdout ":/Version 0.9.1"..master-fixed -) >> src/vmime-1-fixes.patch -#--------------------------------------------------------------------# - -From ed4451fd3c86faf9ecc03a59ba9f1ad78417a9f9 Mon Sep 17 00:00:00 2001 -From: vincent-richard +Commits from master branch of git://github.com/kisli/vmime +rebased onto version 0.9.1 tarball files. + +From 17ff5157ffdc749f60b8285f84e64ac5e06d4283 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Tue, 16 Nov 2010 13:28:05 +0000 -Subject: [PATCH 01/27] Started version 0.9.2. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@576 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 01/42] Started version 0.9.2. + diff --git a/ChangeLog b/ChangeLog index 871d055..8fdcdb0 100644 @@ -76,15 +41,14 @@ # API version number (libtool) # -- -1.7.7.3 - - -From bf282a05cdbbb538a1cafbd7305cece14f5b1571 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From c12ee2b267b9dcfd092a298dfd9a8eec81ab3a0b Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Tue, 30 Nov 2010 14:57:03 +0000 -Subject: [PATCH 02/27] Initialize and delete object. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@577 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 02/42] Initialize and delete object. + diff --git a/vmime/net/imap/IMAPParser.hpp b/vmime/net/imap/IMAPParser.hpp index 0f3e9ec..d71c3ca 100644 @@ -110,29 +74,16 @@ void go(IMAPParser& parser, string& line, string::size_type* currentPos) -- -1.7.7.3 - - -From 941b10bca8e89ca61eebee1345ee3e5cbebd7530 Mon Sep 17 00:00:00 2001 -From: vincent-richard -Date: Mon, 6 Dec 2010 11:57:44 +0000 -Subject: [PATCH 03/27] Updated deprecated function. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@578 5301114d-f842-0410-bbdd-996ee0417009 - -SKIPPED --- -1.7.7.3 - - -From 4a4c3a94db671ff7750b32ebf2c998a914717367 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From fd277afe87485c9d3377964794b76006c6d36a56 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Wed, 8 Dec 2010 08:52:54 +0000 -Subject: [PATCH 04/27] No extra space between ':' and '<' in MAIL FROM and +Subject: [PATCH 03/42] No extra space between ':' and '<' in MAIL FROM and RCPT TO. Wait for server response after QUIT and before closing connection. -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@579 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp index 204daae..d9fb7b8 100644 @@ -165,15 +116,14 @@ if ((resp = readResponse())->getCode() != 250) { -- -1.7.7.3 - - -From 4ea325c953f0cdc669b932aa4961a434656f3ecf Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From d64da50e879c0e480d2e65c43e3b903c3e80101f Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Fri, 10 Dec 2010 16:24:06 +0000 -Subject: [PATCH 05/27] Fixed unit test after bug fix. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@580 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 04/42] Fixed unit test after bug fix. + diff --git a/tests/net/smtp/SMTPTransportTest.cpp b/tests/net/smtp/SMTPTransportTest.cpp index 5015552..6552f9e 100644 @@ -189,16 +139,15 @@ localSend("250 OK\r\n"); } -- -1.7.7.3 - - -From ff207927a5aab002f38af0224133b345ab458144 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 130d0aabda2a9988913ad201390796775dc16a65 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Fri, 10 Dec 2010 16:54:38 +0000 -Subject: [PATCH 06/27] Fixed boundary parsing (thanks to John van der Kamp, +Subject: [PATCH 05/42] Fixed boundary parsing (thanks to John van der Kamp, Zarafa). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@581 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/body.cpp b/src/body.cpp index 13dff6b..738d3e7 100644 @@ -278,16 +227,15 @@ vmime::bodyPart p; -- -1.7.7.3 - - -From 3f5172e47f75f64952adef349bec875416ae9b89 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From c63f37c888798f0e7e99aa03afda16445a72b7b2 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Fri, 21 Jan 2011 15:28:06 +0000 -Subject: [PATCH 07/27] Fixed possible infinite loop (thanks to John van der +Subject: [PATCH 06/42] Fixed possible infinite loop (thanks to John van der Kamp, Zarafa). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@582 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/word.cpp b/src/word.cpp index db720dc..1c1c1a6 100644 @@ -331,16 +279,15 @@ VMIME_TEST_SUITE_END -- -1.7.7.3 - - -From 4e9eb3191066dec7f17592c2ce099b16e6329941 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 1fafad8f913e700b350e6915de8be710fc2d1ced Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Fri, 28 Jan 2011 12:11:08 +0000 -Subject: [PATCH 08/27] Fixed possible read to invalid memory location (thanks +Subject: [PATCH 07/42] Fixed possible read to invalid memory location (thanks to Alexander Konovalov). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@583 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/word.cpp b/src/word.cpp index 1c1c1a6..fa08d33 100644 @@ -356,17 +303,16 @@ else state->lastCharIsSpace = false; -- -1.7.7.3 - - -From 07ebf241115eba44675223e307d212c772e1cc08 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 73298423f695d7c4441d44619e4b7f9de75f566e Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Wed, 9 Mar 2011 18:03:31 +0000 -Subject: [PATCH 09/27] Fixed bug #3174903. Fixed word parsing when buffer +Subject: [PATCH 08/42] Fixed bug #3174903. Fixed word parsing when buffer does not end with NL. Fixed 'no encoding' when forced. -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@584 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/body.cpp b/src/body.cpp index 738d3e7..8596833 100644 @@ -563,16 +509,15 @@ VMIME_TEST_SUITE_END -- -1.7.7.3 - - -From 22ca7dc23b6bbbc8cc6aedd569ec938ecae96e92 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 5f5757b9d4bb0febb1e2183578eb91e801a08038 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 27 Mar 2011 11:26:55 +0000 -Subject: [PATCH 10/27] Allow static linking in MXE. Added 'iconv' +Subject: [PATCH 09/42] Allow static linking in mingw-cross-env. Added 'iconv' and uses 'ws2_32' instead of 'winsock32' (#3213487). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@585 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/SConstruct b/SConstruct index 55f9223..177f5b4 100644 @@ -597,16 +542,15 @@ # -- getaddrinfo (POSIX) -- -1.7.7.3 - - -From 9e06cc39d47e2eba8f554b337d472cc995be0d9d Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 2b48b4a68ce3e9b9b1a3f485123af5938a568324 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Thu, 31 Mar 2011 19:13:03 +0000 -Subject: [PATCH 11/27] Flush stateful data from iconv (thanks to John van der +Subject: [PATCH 10/42] Flush stateful data from iconv (thanks to John van der Kamp, Zarafa). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@586 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/charsetConverter.cpp b/src/charsetConverter.cpp index 38b9e5e..2135788 100644 @@ -679,15 +623,14 @@ // Conversion to hexadecimal for easier debugging static const vmime::string toHex(const vmime::string str) -- -1.7.7.3 - - -From 418a39a7d33921672bd1c4beb31c8a31bc87d8dd Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 8d2e039c5201e144ff08e2ff7cf9efe77fe4b3d0 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Fri, 10 Jun 2011 19:39:09 +0000 -Subject: [PATCH 12/27] Requested email change. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@587 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 11/42] Requested email change. + diff --git a/AUTHORS b/AUTHORS index 20a0181..bbddb30 100644 @@ -703,15 +646,14 @@ - Georg Sauthoff - Pierre Thierry (patches for STL algorithms) -- -1.7.7.3 - - -From 4008955783ef566b98b16762c7bfa28df26e9198 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From cc6317f28ae0b61fea36e1bc78b09dc8300579f8 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Tue, 14 Jun 2011 18:37:54 +0000 -Subject: [PATCH 13/27] Fixed compilation issue following namespace change. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@588 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 12/42] Fixed compilation issue following namespace change. + diff --git a/examples/example7.cpp b/examples/example7.cpp index 1ddb3d0..243b1da 100644 @@ -740,16 +682,15 @@ std::vector props = e->getAvailableProperties(); -- -1.7.7.3 - - -From e80db1ce802a45b71659d16d77ea47368beeabc1 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From a916d12d44ac43fc8e4729e0a91f4d6243f29a11 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 19 Jun 2011 17:51:33 +0000 -Subject: [PATCH 14/27] Fixed parsing of an attachment filename that is +Subject: [PATCH 13/42] Fixed parsing of an attachment filename that is between 66 and 76 characters long (Zarafa). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@589 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/parameter.cpp b/src/parameter.cpp index 91a7e5c..f59d5ab 100644 @@ -766,16 +707,15 @@ switch (value[i]) { -- -1.7.7.3 - - -From 58316dddddbfe8a7c582aa52e9abff8ca3a227b6 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 9735165c57000a6368e91ce8852206a20930c1ca Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 19 Jun 2011 18:08:12 +0000 -Subject: [PATCH 15/27] Correctly generate attachment names which are long and +Subject: [PATCH 14/42] Correctly generate attachment names which are long and have high characters for Outlook Express (Zarafa). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@590 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/parameter.cpp b/src/parameter.cpp index f59d5ab..d757e1b 100644 @@ -906,15 +846,14 @@ #endif // !VMIME_ALWAYS_GENERATE_7BIT_PARAMETER -- -1.7.7.3 - - -From f7ad17cffea462faf8cbe4f785644da0f3ee812a Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 8d69ad6849d8d6b211674942157f2af8bcd51c26 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 19 Jun 2011 18:16:49 +0000 -Subject: [PATCH 16/27] Alias for UTF-7 charset. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@591 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 15/42] Alias for UTF-7 charset. + diff --git a/src/charset.cpp b/src/charset.cpp index e043186..0fda450 100644 @@ -942,17 +881,16 @@ if (newPosition) -- -1.7.7.3 - - -From eac20f47a33a7fdd617f9fd905b8029621259269 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From ccd95daf9cdd7171fc2027afa5d0ad80b0475ded Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 19 Jun 2011 18:39:35 +0000 -Subject: [PATCH 17/27] Fixed messageBuilder to accept an empty mailbox group +Subject: [PATCH 16/42] Fixed messageBuilder to accept an empty mailbox group in 'To:' field, to allow for undisclosed-recipients (Zarafa). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@592 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/messageBuilder.cpp b/src/messageBuilder.cpp index 870d59e..3597b3a 100644 @@ -980,17 +918,16 @@ if (!m_to.isEmpty()) msg->getHeader()->To()->setValue(m_to); -- -1.7.7.3 - - -From 1e5dfa80a63b0a7fe90406ce4a3de1593f2e4045 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 583e25bcdee132e53e0792cd8f0d8e535cabb743 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 19 Jun 2011 18:49:55 +0000 -Subject: [PATCH 18/27] Added support for mailboxes that specify an (encoded) +Subject: [PATCH 17/42] Added support for mailboxes that specify an (encoded) full name with an empty email address, set by a <> marker (Zarafa). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@593 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/mailbox.cpp b/src/mailbox.cpp index 5cb0139..fea7479 100644 @@ -1054,15 +991,14 @@ VMIME_TEST_SUITE_END -- -1.7.7.3 - - -From 960f2195516eb776eea7b7e4f92612192edfdcd9 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 461b92f84d5c16b297d33610fcd89fc7ca5a161a Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Fri, 24 Jun 2011 15:46:23 +0000 -Subject: [PATCH 19/27] Added missing libs in pkg-config file. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@594 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 18/42] Added missing libs in pkg-config file. + diff --git a/SConstruct b/SConstruct index 177f5b4..37c0ac6 100644 @@ -1078,16 +1014,15 @@ vmime_pc_in.write("Cflags: -I${includedir}/ @LIBGNUTLS_CFLAGS@\n") vmime_pc_in.close() -- -1.7.7.3 - - -From 9f9084b71b4e3c96edc6513020984ef76fe26e0c Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 2b2c0abd02a17ccff7d49e266b9854f4ea47f8e4 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sat, 25 Jun 2011 17:07:53 +0000 -Subject: [PATCH 20/27] Fixed parsing of empty body parts (thanks to John van +Subject: [PATCH 19/42] Fixed parsing of empty body parts (thanks to John van der Kamp, from Zarafa). -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@595 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/body.cpp b/src/body.cpp index 8596833..9d7d57f 100644 @@ -1142,16 +1077,15 @@ VMIME_TEST_SUITE_END -- -1.7.7.3 - - -From 318848aa87761214a6f21c1ea1a9776a7bcbf83c Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 2648d744da0e2e744c7959999ac513c3016072b4 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 26 Jun 2011 08:19:11 +0000 -Subject: [PATCH 21/27] Use gnutls_priority_set_direct() instead of GNUTLS +Subject: [PATCH 20/42] Use gnutls_priority_set_direct() instead of GNUTLS deprecated functions. -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@596 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/SConstruct b/SConstruct index 37c0ac6..01ad3f3 100644 @@ -1252,15 +1186,14 @@ gnutls_credentials_set(*m_gnutlsSession, GNUTLS_CRD_ANON, g_gnutlsGlobal.anonCred); -- -1.7.7.3 - - -From 70a0282a3f96febf973475a298ac95ffaab82c3c Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 1060121ffd4315c3158ffc001040f4f705514e7a Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 26 Jun 2011 12:47:25 +0000 -Subject: [PATCH 22/27] Fixed encoding of whitespace. Fixed old test case. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@597 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 21/42] Fixed encoding of whitespace. Fixed old test case. + diff --git a/src/text.cpp b/src/text.cpp index 2454456..66c3b35 100644 @@ -1346,15 +1279,14 @@ VMIME_TEST_SUITE_END -- -1.7.7.3 - - -From 7d399583a458abe5cd16ce0974bd4dc11daba9f6 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From dc6dc039fc0edccf4630894fa6ed8cd4bf3bb3ce Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sat, 20 Aug 2011 06:35:06 +0000 -Subject: [PATCH 23/27] Use gnutls_strerror() for reporting errors. - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@598 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 22/42] Use gnutls_strerror() for reporting errors. + diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp index af73a05..7426a73 100644 @@ -1497,16 +1429,15 @@ -- -1.7.7.3 - - -From aae321dede5e725140534a08a8b2ee997faa30be Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From 7ea6fc3737ef36407e1c90f3aa05f89a39bdefb7 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 21 Aug 2011 08:55:46 +0000 -Subject: [PATCH 24/27] Removed dependency on gcrypt for gnutls version >= +Subject: [PATCH 23/42] Removed dependency on gcrypt for gnutls version >= 2.12. -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@599 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp index 7426a73..d3f6d49 100644 @@ -1551,16 +1482,15 @@ gnutls_global_init(); -- -1.7.7.3 - - -From af1e5664afb663fb7d26d468adf675fb1b3f8737 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From f21c55be642b166a2f0518ace2b179bed3916b23 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Sun, 21 Aug 2011 09:04:46 +0000 -Subject: [PATCH 25/27] Fixed HAVE_GNUTLS_PRIORITY_FUNCS never defined when +Subject: [PATCH 24/42] Fixed HAVE_GNUTLS_PRIORITY_FUNCS never defined when configured with no TLS support. -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@600 5301114d-f842-0410-bbdd-996ee0417009 diff --git a/SConstruct b/SConstruct index 01ad3f3..11e884b 100644 @@ -1584,15 +1514,14 @@ AC_SUBST(LIBGNUTLS_CFLAGS) -- -1.7.7.3 - - -From 41079b2f188bb4a6d8aea9ec1328653faee3e2c9 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From d4e66226a696745adafa1767210580f8fbb7ae00 Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Tue, 15 Nov 2011 11:40:42 +0000 -Subject: [PATCH 26/27] GNU TLS 3 has no 'extra' (thanks to mabrand). - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@601 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 25/42] GNU TLS 3 has no 'extra' (thanks to mabrand). + diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp index d3f6d49..cb50acc 100644 @@ -1609,15 +1538,14 @@ #include "vmime/config.hpp" -- -1.7.7.3 - - -From eafae52d9b8ec9682c229090b6208092b1d1e6f1 Mon Sep 17 00:00:00 2001 -From: vincent-richard +1.7.10.4 + + +From bacbe512e406d22f6acc83597fcdfc2d624cf82b Mon Sep 17 00:00:00 2001 +From: Vincent Richard Date: Tue, 15 Nov 2011 11:46:07 +0000 -Subject: [PATCH 27/27] Set Diffie-Hellman prime size (bug SF#3434852). - -git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@602 5301114d-f842-0410-bbdd-996ee0417009 +Subject: [PATCH 26/42] Set Diffie-Hellman prime size (bug SF#3434852). + diff --git a/src/net/tls/TLSSession.cpp b/src/net/tls/TLSSession.cpp index cb50acc..0606808 100644 @@ -1632,5 +1560,8757 @@ if ((res = gnutls_priority_set_direct (*m_gnutlsSession, "NORMAL:%SSL3_RECORD_VERSION", NULL)) != 0) -- -1.7.7.3 - +1.7.10.4 + + +From 6574b60a303c5d864e840aa23959656bb2803485 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Thu, 22 Dec 2011 08:51:28 +0000 +Subject: [PATCH 27/42] Updated coding conventions. + + +diff --git a/HACKING b/HACKING +index 4f35a53..f51d738 100644 +--- a/HACKING ++++ b/HACKING +@@ -1,10 +1,10 @@ + +-This file contains coding guidelines for VMime. You should follow these +-guidelines if you want to contribute to VMime. It guarantees some minimal +-quality of the code. ++This file contains coding guidelines for VMime. You should follow them ++if you want to contribute to VMime. The rules below are not guidelines ++or recommendations, but strict rules. + + +-1. General guidelines ++1. General rules + 1.1. Language + 1.2. Unit tests + 1.3. CVS +@@ -18,19 +18,22 @@ quality of the code. + 2.5. Line length + 2.6. Spaces and parentheses + 2.7. End-of-line character ++ 2.8. Short functions ++ 2.9. Limit Variable Scope + 3. Naming conventions + 3.1. Classes + 3.2. Variables/parameters/member variables + 3.3. Member variables + 3.4. Files + 3.5. Namespaces ++ 3.6. Constants + 4. Comments + 5. Miscellaneous + + + +-1. General guidelines +-===================== ++1. General rules ++================ + + 1.1. Language + ------------- +@@ -50,7 +53,7 @@ When you fix a bug, also add a new test case to ensure the bug will not + happen anymore. + + +-1.3. CVS ++1.3. SVN + -------- + + Each commit MUST be done with a message ('-m' flag) that briefly describes what +@@ -154,7 +157,11 @@ Except when body spans over multiple lines: + 2.5. Line length + ---------------- + +-Line length should not exceed 80 characters. ++Each line of text should not exceed 80 characters. ++ ++Exception: if a comment line contains an example command or a literal URL ++longer than 100 characters, that line may be longer than 100 characters ++for ease of cut and paste. + + + 2.6. Spaces and parentheses +@@ -193,6 +200,30 @@ Configure your editor to use "\n" (UNIX convention) for end-of-line sequence, + and not "\r\n" (Windows), nor "\n\r", nor any other combination. + + ++2.8. Short functions ++-------------------- ++ ++To the extent that it is feasible, functions should be kept small and focused. ++It is, however, recognized that long functions are sometimes appropriate, so no ++hard limit is placed on method length. If a function exceeds 40 lines or so, ++think about whether it can be broken up without harming the structure of the ++program. ++ ++ ++2.9. Limit Variable Scope ++------------------------- ++ ++The scope of local variables should be kept to a minimum. By doing so, you ++increase the readability and maintainability of your code and reduce the ++likelihood of error. Each variable should be declared in the innermost block ++that encloses all uses of the variable. ++ ++Local variables should be declared at the point they are first used. Nearly ++every local variable declaration should contain an initializer. If you don't ++yet have enough information to initialize a variable sensibly, you should ++postpone the declaration until you do. ++ ++ + + 3. Naming conventions + ===================== +@@ -255,6 +286,12 @@ Implementation files must be placed in 'src/' directory. + Namespaces are named exactly like variables. + + ++3.6. Constants ++-------------- ++ ++Constants are ALL_CAPS_WITH_UNDERSCORES. ++ ++ + + 4. Comments + =========== +-- +1.7.10.4 + + +From 130e5223dea0af2f8d9d01cca7845be4e1a08d13 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Thu, 5 Apr 2012 11:46:39 +0200 +Subject: [PATCH 28/42] Added function to retrieve sequence numbers of + messages whose UID is greater or equal than a + specified UID (thanks to Zahi Mashael). + + +diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp +index 0122d21..50a2f2b 100644 +--- a/src/net/imap/IMAPFolder.cpp ++++ b/src/net/imap/IMAPFolder.cpp +@@ -1772,6 +1772,62 @@ void IMAPFolder::status(int& count, int& unseen) + } + + ++std::vector IMAPFolder::getMessageNumbersStartingOnUID(const message::uid& uid) ++{ ++ std::vector v; ++ ++ std::ostringstream command; ++ command.imbue(std::locale::classic()); ++ ++ command << "SEARCH UID " << uid; ++ ++ // Send the request ++ m_connection->send(true, command.str(), true); ++ ++ // Get the response ++ utility::auto_ptr resp(m_connection->readResponse()); ++ ++ if (resp->isBad() || ++ resp->response_done()->response_tagged()->resp_cond_state()->status() != IMAPParser::resp_cond_state::OK) ++ { ++ throw exceptions::command_error("SEARCH", ++ m_connection->getParser()->lastLine(), "bad response"); ++ } ++ ++ const std::vector & respDataList = resp->continue_req_or_response_data(); ++ ++ for (std::vector ::const_iterator ++ it = respDataList.begin() ; it != respDataList.end() ; ++it) ++ { ++ if ((*it)->response_data() == NULL) ++ { ++ throw exceptions::command_error("SEARCH", ++ m_connection->getParser()->lastLine(), "invalid response"); ++ } ++ ++ const IMAPParser::mailbox_data* mailboxData = ++ (*it)->response_data()->mailbox_data(); ++ ++ // We are only interested in responses of type "SEARCH" ++ if (mailboxData == NULL || ++ mailboxData->type() != IMAPParser::mailbox_data::SEARCH) ++ { ++ continue; ++ } ++ ++ for (std::vector ::const_iterator ++ it = mailboxData->search_nz_number_list().begin() ; ++ it != mailboxData->search_nz_number_list().end(); ++ ++it) ++ { ++ v.push_back((*it)->value()); ++ } ++ } ++ ++ return v; ++} ++ ++ + } // imap + } // net + } // vmime +diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp +index dd680c9..d11ae3b 100644 +--- a/src/net/maildir/maildirFolder.cpp ++++ b/src/net/maildir/maildirFolder.cpp +@@ -1363,6 +1363,12 @@ const utility::file::path maildirFolder::getMessageFSPath(const int number) cons + } + + ++std::vector maildirFolder::getMessageNumbersStartingOnUID(const message::uid& /* uid */) ++{ ++ throw exceptions::operation_not_supported(); ++} ++ ++ + } // maildir + } // net + } // vmime +diff --git a/src/net/pop3/POP3Folder.cpp b/src/net/pop3/POP3Folder.cpp +index d5fc687..e085609 100644 +--- a/src/net/pop3/POP3Folder.cpp ++++ b/src/net/pop3/POP3Folder.cpp +@@ -843,6 +843,12 @@ void POP3Folder::expunge() + } + + ++std::vector POP3Folder::getMessageNumbersStartingOnUID(const message::uid& /* uid */) ++{ ++ throw exceptions::operation_not_supported(); ++} ++ ++ + } // pop3 + } // net + } // vmime +diff --git a/vmime/net/folder.hpp b/vmime/net/folder.hpp +index b20e9c9..df9cbaf 100644 +--- a/vmime/net/folder.hpp ++++ b/vmime/net/folder.hpp +@@ -383,6 +383,13 @@ public: + */ + virtual int getFetchCapabilities() const = 0; + ++ /** Return the sequence numbers of messages whose UID equal or greater than uid ++ * ++ * @param uid the uid of the first message ++ * @throw net_exception if an error occurs ++ */ ++ virtual std::vector getMessageNumbersStartingOnUID(const message::uid& uid) = 0; ++ + // Event listeners + void addMessageChangedListener(events::messageChangedListener* l); + void removeMessageChangedListener(events::messageChangedListener* l); +diff --git a/vmime/net/imap/IMAPFolder.hpp b/vmime/net/imap/IMAPFolder.hpp +index dec3878..cc52596 100644 +--- a/vmime/net/imap/IMAPFolder.hpp ++++ b/vmime/net/imap/IMAPFolder.hpp +@@ -120,6 +120,8 @@ public: + + int getFetchCapabilities() const; + ++ std::vector getMessageNumbersStartingOnUID(const message::uid& uid); ++ + private: + + void registerMessage(IMAPMessage* msg); +diff --git a/vmime/net/maildir/maildirFolder.hpp b/vmime/net/maildir/maildirFolder.hpp +index 7474b1a..68b5b89 100644 +--- a/vmime/net/maildir/maildirFolder.hpp ++++ b/vmime/net/maildir/maildirFolder.hpp +@@ -121,6 +121,8 @@ public: + + int getFetchCapabilities() const; + ++ std::vector getMessageNumbersStartingOnUID(const message::uid& uid); ++ + private: + + void scanFolder(); +diff --git a/vmime/net/pop3/POP3Folder.hpp b/vmime/net/pop3/POP3Folder.hpp +index abaa8eb..c482908 100644 +--- a/vmime/net/pop3/POP3Folder.hpp ++++ b/vmime/net/pop3/POP3Folder.hpp +@@ -119,6 +119,8 @@ public: + + int getFetchCapabilities() const; + ++ std::vector getMessageNumbersStartingOnUID(const message::uid& uid); ++ + private: + + void registerMessage(POP3Message* msg); +-- +1.7.10.4 + + +From 3f1a565b8b532f0d11a13d3f6d763b00c8ce625b Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Thu, 5 Apr 2012 11:55:07 +0200 +Subject: [PATCH 29/42] Added .gitignore. + + +diff --git a/.gitignore b/.gitignore +new file mode 100644 +index 0000000..44e03a8 +--- /dev/null ++++ b/.gitignore +@@ -0,0 +1,11 @@ ++*.o ++*.swp ++build/ ++ ++/libvmime.a ++/vmime.pc ++/vmime/config.hpp ++ ++# SConstruct ++.sconsign.dblite ++/options.cache +-- +1.7.10.4 + + +From 5937bcda0fac9cb80d0cecbaa663ecdfe2839c09 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Thu, 5 Apr 2012 12:08:01 +0200 +Subject: [PATCH 30/42] Added check before dereferencing. + + +diff --git a/vmime/utility/smartPtr.hpp b/vmime/utility/smartPtr.hpp +index c448632..df63685 100644 +--- a/vmime/utility/smartPtr.hpp ++++ b/vmime/utility/smartPtr.hpp +@@ -338,7 +338,9 @@ protected: + { + if (m_ptr) + { +- m_ptr->getRefManager()->releaseStrong(); ++ if (m_ptr->getRefManager()) ++ m_ptr->getRefManager()->releaseStrong(); ++ + m_ptr = 0; + } + } +-- +1.7.10.4 + + +From b0d74ce63ea9563ef4b218bce2497bd668dfad29 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Thu, 5 Apr 2012 12:34:51 +0200 +Subject: [PATCH 31/42] Updated README. + + +diff --git a/README b/README +index 6921cea..7db9175 100644 +--- a/README ++++ b/README +@@ -1,2 +1,30 @@ + +-TODO ++VMime is a powerful C++ class library for working with RFC-822 and MIME messages ++and Internet messaging services like IMAP, POP or SMTP. ++ ++With VMime you can parse, generate and modify messages, and also connect to store ++and transport services to receive or send messages over the Internet. The library ++offers all the features to build a complete mail client. ++ ++Key Features ++------------ ++ ++* it is free software! GNU GPL license (Commercial licenses available!) ++* fully RFC-compliant implementation ++* object-oriented and modular design ++* very easy-to-use (intuitive design) ++* well documented code ++* very high reliability ++* maximum portability ++ ++Features Overview ++----------------- ++ ++* RFC-2822 and multipart messages ++* aggregate documents and embedded objects ++* 8-bit MIME and encoded word extensions ++* full support for attachments ++* POP3, IMAP, SMTP, maildir and sendmail ++* SSL/TLS security layer and X.509 certificates (using GNU TLS) ++* SASL authentication (using GNU SASL) ++ +-- +1.7.10.4 + + +From 350fada21a4f11c2f633a3cde1f2195efefe7e32 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Thu, 5 Apr 2012 22:10:54 +0200 +Subject: [PATCH 32/42] Added test: Ensure '7bit' encoding is used when body + is 7-bit only. + + +diff --git a/tests/parser/bodyPartTest.cpp b/tests/parser/bodyPartTest.cpp +index 075b8f9..e1d47a3 100644 +--- a/tests/parser/bodyPartTest.cpp ++++ b/tests/parser/bodyPartTest.cpp +@@ -37,6 +37,7 @@ VMIME_TEST_SUITE_BEGIN + VMIME_TEST(testPrologEpilog) + VMIME_TEST(testPrologEncoding) + VMIME_TEST(testSuccessiveBoundaries) ++ VMIME_TEST(testGenerate7bit) + VMIME_TEST_LIST_END + + +@@ -200,5 +201,18 @@ VMIME_TEST_SUITE_BEGIN + VASSERT_EQ("part2-body", "", extractContents(p.getBody()->getPartAt(1)->getBody()->getContents())); + } + ++ /** Ensure '7bit' encoding is used when body is 7-bit only. */ ++ void testGenerate7bit() ++ { ++ vmime::ref p1 = vmime::create (); ++ p1->setText(vmime::create ("Part1 is US-ASCII only.")); ++ ++ vmime::ref msg = vmime::create (); ++ p1->generateIn(msg, msg); ++ ++ vmime::ref header1 = msg->getBody()->getPartAt(0)->getHeader(); ++ VASSERT_EQ("1", "7bit", header1->ContentTransferEncoding()->getValue()->generate()); ++ } ++ + VMIME_TEST_SUITE_END + +-- +1.7.10.4 + + +From 6c877ea41a2e408df61ac6f988c3bae7e0821141 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Thu, 5 Apr 2012 22:29:32 +0200 +Subject: [PATCH 33/42] Added tests for Quoted-Printable encoding. + + +diff --git a/tests/utility/encoderTest.cpp b/tests/utility/encoderTest.cpp +index f2d42b6..b2d6bc8 100644 +--- a/tests/utility/encoderTest.cpp ++++ b/tests/utility/encoderTest.cpp +@@ -33,6 +33,8 @@ VMIME_TEST_SUITE_BEGIN + VMIME_TEST_LIST_BEGIN + VMIME_TEST(testBase64) + VMIME_TEST(testQuotedPrintable) ++ VMIME_TEST(testQuotedPrintable_SoftLineBreaks) ++ VMIME_TEST(testQuotedPrintable_CRLF) + VMIME_TEST(testQuotedPrintable_RFC2047) + VMIME_TEST_LIST_END + +@@ -288,6 +290,35 @@ VMIME_TEST_SUITE_BEGIN + } + } + ++ /** Tests Soft Line Breaks (RFC-2047/6.7(5). */ ++ void testQuotedPrintable_SoftLineBreaks() ++ { ++ VASSERT_EQ("1", "Now's the time=\r\n" ++ " for all folk =\r\n" ++ "to come to the=\r\n" ++ " aid of their =\r\n" ++ "country.", ++ encode("quoted-printable", "Now's the time for all folk " ++ "to come to the aid of their country.", 15)); ++ } ++ ++ /** In text mode, ensure line breaks in QP-encoded text are represented ++ * by a CRLF sequence, as per RFC-2047/6.7(4). */ ++ void testQuotedPrintable_CRLF() ++ { ++ vmime::propertySet encProps; ++ ++ // in "text" mode ++ encProps["text"] = true; ++ VASSERT_EQ("text", "line1\r\nline2", ++ encode("quoted-printable", "line1\r\nline2", 80, encProps)); ++ ++ // in "binary" mode ++ encProps["text"] = false; ++ VASSERT_EQ("binary", "line1=0D=0Aline2", ++ encode("quoted-printable", "line1\r\nline2", 80, encProps)); ++ } ++ + void testQuotedPrintable_RFC2047() + { + /* +-- +1.7.10.4 + + +From e88f062ab58654aee3cf45f94e8a5dd6c1256279 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Thu, 5 Apr 2012 23:15:04 +0200 +Subject: [PATCH 34/42] Fixed wrong encoding of line breaks in QP-encoded text + (issue #7). + + +diff --git a/src/encoding.cpp b/src/encoding.cpp +index 0919d44..b4e79db 100644 +--- a/src/encoding.cpp ++++ b/src/encoding.cpp +@@ -34,19 +34,28 @@ namespace vmime + + + encoding::encoding() +- : m_name(encodingTypes::SEVEN_BIT) ++ : m_name(encodingTypes::SEVEN_BIT), ++ m_usage(USAGE_UNKNOWN) + { + } + + + encoding::encoding(const string& name) +- : m_name(utility::stringUtils::toLower(name)) ++ : m_name(utility::stringUtils::toLower(name)), ++ m_usage(USAGE_UNKNOWN) ++{ ++} ++ ++ ++encoding::encoding(const string& name, const EncodingUsage usage) ++ : m_name(utility::stringUtils::toLower(name)), ++ m_usage(usage) + { + } + + + encoding::encoding(const encoding& enc) +- : headerFieldValue(), m_name(enc.m_name) ++ : headerFieldValue(), m_name(enc.m_name), m_usage(enc.m_usage) + { + } + +@@ -54,6 +63,8 @@ encoding::encoding(const encoding& enc) + void encoding::parse(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { ++ m_usage = USAGE_UNKNOWN; ++ + m_name = utility::stringUtils::toLower(utility::stringUtils::trim + (utility::stringUtils::unquote(utility::stringUtils::trim + (string(buffer.begin() + position, buffer.begin() + end))))); +@@ -80,7 +91,14 @@ void encoding::generate(utility::outputStream& os, const string::size_type /* ma + + ref encoding::getEncoder() const + { +- return (utility::encoder::encoderFactory::getInstance()->create(generate())); ++ ref encoder = ++ utility::encoder::encoderFactory::getInstance()->create(generate()); ++ ++ // FIXME: this should not be here (move me into QP encoder instead?) ++ if (m_usage == USAGE_TEXT && m_name == encodingTypes::QUOTED_PRINTABLE) ++ encoder->getProperties()["text"] = true; ++ ++ return encoder; + } + + +@@ -94,6 +112,7 @@ encoding& encoding::operator=(const encoding& other) + encoding& encoding::operator=(const string& name) + { + m_name = utility::stringUtils::toLower(name); ++ m_usage = USAGE_UNKNOWN; + return (*this); + } + +@@ -167,6 +186,8 @@ const encoding encoding::decideImpl + const encoding encoding::decide + (ref data, const EncodingUsage usage) + { ++ encoding enc; ++ + if (usage == USAGE_TEXT && data->isBuffered() && + data->getLength() > 0 && data->getLength() < 32768) + { +@@ -177,12 +198,16 @@ const encoding encoding::decide + data->extract(os); + os.flush(); + +- return decideImpl(buffer.begin(), buffer.end()); ++ enc = decideImpl(buffer.begin(), buffer.end()); + } + else + { +- return encoding(encodingTypes::BASE64); ++ enc = encoding(encodingTypes::BASE64); + } ++ ++ enc.setUsage(usage); ++ ++ return enc; + } + + +@@ -194,7 +219,10 @@ const encoding encoding::decide(ref data, + encoding recEncoding; + + if (chset.getRecommendedEncoding(recEncoding)) ++ { ++ recEncoding.setUsage(usage); + return recEncoding; ++ } + } + + return decide(data, usage); +@@ -227,6 +255,18 @@ void encoding::setName(const string& name) + } + + ++encoding::EncodingUsage encoding::getUsage() const ++{ ++ return m_usage; ++} ++ ++ ++void encoding::setUsage(const EncodingUsage usage) ++{ ++ m_usage = usage; ++} ++ ++ + const std::vector > encoding::getChildComponents() const + { + return std::vector >(); +diff --git a/src/utility/encoder/qpEncoder.cpp b/src/utility/encoder/qpEncoder.cpp +index aa95022..ab8db2e 100644 +--- a/src/utility/encoder/qpEncoder.cpp ++++ b/src/utility/encoder/qpEncoder.cpp +@@ -292,14 +292,15 @@ utility::stream::size_type qpEncoder::encode(utility::inputStream& in, + case 13: // CR + case 10: // LF + { +- // Text mode (where using CRLF or LF or ... does not +- // care for a new line...) +- if (text) ++ // RFC-2045/6.7(4) ++ ++ // Text data ++ if (text && !rfc2047) + { + outBuffer[outBufferPos++] = c; + ++curCol; + } +- // Binary mode (where CR and LF bytes are important!) ++ // Binary data + else + { + QP_ENCODE_HEX(c); +diff --git a/tests/parser/bodyPartTest.cpp b/tests/parser/bodyPartTest.cpp +index e1d47a3..9d51262 100644 +--- a/tests/parser/bodyPartTest.cpp ++++ b/tests/parser/bodyPartTest.cpp +@@ -38,6 +38,7 @@ VMIME_TEST_SUITE_BEGIN + VMIME_TEST(testPrologEncoding) + VMIME_TEST(testSuccessiveBoundaries) + VMIME_TEST(testGenerate7bit) ++ VMIME_TEST(testTextUsageForQPEncoding) + VMIME_TEST_LIST_END + + +@@ -214,5 +215,28 @@ VMIME_TEST_SUITE_BEGIN + VASSERT_EQ("1", "7bit", header1->ContentTransferEncoding()->getValue()->generate()); + } + ++ void testTextUsageForQPEncoding() ++ { ++ vmime::ref part = vmime::create (); ++ part->setText(vmime::create ("Part1-line1\r\nPart1-line2\r\n\x89")); ++ ++ vmime::ref msg = vmime::create (); ++ part->generateIn(msg, msg); ++ ++ vmime::ref body = msg->getBody()->getPartAt(0)->getBody(); ++ vmime::ref header = msg->getBody()->getPartAt(0)->getHeader(); ++ ++ std::ostringstream oss; ++ vmime::utility::outputStreamAdapter os(oss); ++ body->generate(os, 80); ++ ++ VASSERT_EQ("1", "quoted-printable", header->ContentTransferEncoding()->getValue()->generate()); ++ ++ // This should *NOT* be: ++ // Part1-line1=0D=0APart1-line2=0D=0A=89 ++ VASSERT_EQ("2", "Part1-line1\r\nPart1-line2\r\n=89", oss.str()); ++ } ++ ++ + VMIME_TEST_SUITE_END + +diff --git a/vmime/encoding.hpp b/vmime/encoding.hpp +index ba78081..42f5246 100644 +--- a/vmime/encoding.hpp ++++ b/vmime/encoding.hpp +@@ -47,6 +47,7 @@ public: + + enum EncodingUsage + { ++ USAGE_UNKNOWN, + USAGE_TEXT, /**< Use for body text. */ + USAGE_BINARY_DATA /**< Use for attachment, image... */ + }; +@@ -54,6 +55,7 @@ public: + + encoding(); + explicit encoding(const string& name); ++ encoding(const string& name, const EncodingUsage usage); + encoding(const encoding& enc); + + public: +@@ -72,6 +74,19 @@ public: + */ + void setName(const string& name); + ++ /** Return the type of contents this encoding is used for. ++ * See the EncodingUsage enum. ++ */ ++ EncodingUsage getUsage() const; ++ ++ /** Set the type of contents this encoding is used for. ++ * See the EncodingUsage enum. ++ * ++ * @param usage type of contents ++ */ ++ void setUsage(const EncodingUsage usage); ++ ++ + encoding& operator=(const encoding& other); + encoding& operator=(const string& name); + +@@ -113,6 +128,7 @@ public: + private: + + string m_name; ++ EncodingUsage m_usage; + + /** Decide which encoding to use based on the specified data. + * +-- +1.7.10.4 + + +From ea77bdba96588345090e3de81d9d6af116edeeb5 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Fri, 6 Apr 2012 22:26:18 +0200 +Subject: [PATCH 35/42] Fixed memory leak. + + +diff --git a/src/net/tls/TLSSocket.cpp b/src/net/tls/TLSSocket.cpp +index dab0338..3cccc1e 100644 +--- a/src/net/tls/TLSSocket.cpp ++++ b/src/net/tls/TLSSocket.cpp +@@ -50,6 +50,12 @@ TLSSocket::TLSSocket(ref session, ref sok) + + TLSSocket::~TLSSocket() + { ++ if (m_ex) ++ { ++ delete m_ex; ++ m_ex = NULL; ++ } ++ + try + { + disconnect(); +-- +1.7.10.4 + + +From 440d491fd6da134fcb5f19416743e8f2044556bf Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Sat, 14 Apr 2012 13:46:05 +0200 +Subject: [PATCH 36/42] Split stream.hpp/.cpp into multiple source files. + + +diff --git a/SConstruct b/SConstruct +index 11e884b..ea5c4eb 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -144,6 +144,20 @@ libvmime_sources = [ + 'utility/smartPtr.cpp', 'utility/smartPtr.hpp', + 'utility/smartPtrInt.cpp', 'utility/smartPtrInt.hpp', + 'utility/stream.cpp', 'utility/stream.hpp', ++ 'utility/streamUtils.cpp', 'utility/streamUtils.hpp', ++ 'utility/filteredStream.cpp', 'utility/filteredStream.hpp', ++ 'utility/inputStream.cpp', 'utility/inputStream.hpp', ++ 'utility/inputStreamAdapter.cpp', 'utility/inputStreamAdapter.hpp', ++ 'utility/inputStreamByteBufferAdapter.cpp', 'utility/inputStreamByteBufferAdapter.hpp', ++ 'utility/inputStreamPointerAdapter.cpp', 'utility/inputStreamPointerAdapter.hpp', ++ 'utility/inputStreamSocketAdapter.cpp', 'utility/inputStreamSocketAdapter.hpp', ++ 'utility/inputStreamStringAdapter.cpp', 'utility/inputStreamStringAdapter.hpp', ++ 'utility/inputStreamStringProxyAdapter.cpp', 'utility/inputStreamStringProxyAdapter.hpp', ++ 'utility/outputStream.cpp', 'utility/outputStream.hpp', ++ 'utility/outputStreamAdapter.cpp', 'utility/outputStreamAdapter.hpp', ++ 'utility/outputStreamByteArrayAdapter.cpp', 'utility/outputStreamByteArrayAdapter.hpp', ++ 'utility/outputStreamSocketAdapter.cpp', 'utility/outputStreamSocketAdapter.hpp', ++ 'utility/outputStreamStringAdapter.cpp', 'utility/outputStreamStringAdapter.hpp', + 'utility/stringProxy.cpp', 'utility/stringProxy.hpp', + 'utility/stringUtils.cpp', 'utility/stringUtils.hpp', + 'utility/url.cpp', 'utility/url.hpp', +diff --git a/src/charsetConverter.cpp b/src/charsetConverter.cpp +index 2135788..cf75bdd 100644 +--- a/src/charsetConverter.cpp ++++ b/src/charsetConverter.cpp +@@ -23,6 +23,8 @@ + + #include "vmime/charsetConverter.hpp" + #include "vmime/exception.hpp" ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++#include "vmime/utility/outputStreamStringAdapter.hpp" + + + extern "C" +diff --git a/src/component.cpp b/src/component.cpp +index fbf677b..139cf66 100644 +--- a/src/component.cpp ++++ b/src/component.cpp +@@ -23,6 +23,7 @@ + + #include "vmime/component.hpp" + #include "vmime/base.hpp" ++#include "vmime/utility/outputStreamAdapter.hpp" + + #include + +diff --git a/src/encoding.cpp b/src/encoding.cpp +index b4e79db..5d99ab6 100644 +--- a/src/encoding.cpp ++++ b/src/encoding.cpp +@@ -24,6 +24,7 @@ + #include "vmime/encoding.hpp" + #include "vmime/contentHandler.hpp" + ++#include "vmime/utility/outputStreamStringAdapter.hpp" + #include "vmime/utility/encoder/encoderFactory.hpp" + + #include +diff --git a/src/fileAttachment.cpp b/src/fileAttachment.cpp +index da7c4b7..cb23cd0 100644 +--- a/src/fileAttachment.cpp ++++ b/src/fileAttachment.cpp +@@ -28,6 +28,7 @@ + #include "vmime/exception.hpp" + + #include "vmime/streamContentHandler.hpp" ++#include "vmime/utility/inputStreamPointerAdapter.hpp" + + #include "vmime/contentDispositionField.hpp" + +diff --git a/src/generatedMessageAttachment.cpp b/src/generatedMessageAttachment.cpp +index e9bd1a6..443a9d3 100644 +--- a/src/generatedMessageAttachment.cpp ++++ b/src/generatedMessageAttachment.cpp +@@ -23,6 +23,8 @@ + + #include "vmime/generatedMessageAttachment.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + + namespace vmime + { +diff --git a/src/htmlTextPart.cpp b/src/htmlTextPart.cpp +index c845b57..98524af 100644 +--- a/src/htmlTextPart.cpp ++++ b/src/htmlTextPart.cpp +@@ -31,6 +31,8 @@ + #include "vmime/emptyContentHandler.hpp" + #include "vmime/stringContentHandler.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + + namespace vmime + { +diff --git a/src/mdn/MDNHelper.cpp b/src/mdn/MDNHelper.cpp +index b419b85..1dd7ff3 100644 +--- a/src/mdn/MDNHelper.cpp ++++ b/src/mdn/MDNHelper.cpp +@@ -31,6 +31,8 @@ + #include "vmime/path.hpp" + #include "vmime/dateTime.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + + namespace vmime { + namespace mdn { +diff --git a/src/mdn/receivedMDNInfos.cpp b/src/mdn/receivedMDNInfos.cpp +index cff211c..f97a58d 100644 +--- a/src/mdn/receivedMDNInfos.cpp ++++ b/src/mdn/receivedMDNInfos.cpp +@@ -23,6 +23,8 @@ + + #include "vmime/mdn/receivedMDNInfos.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + + namespace vmime { + namespace mdn { +diff --git a/src/message.cpp b/src/message.cpp +index 6f4b046..1b4f086 100644 +--- a/src/message.cpp ++++ b/src/message.cpp +@@ -24,6 +24,8 @@ + #include "vmime/message.hpp" + #include "vmime/options.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + #include + + +diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp +index 50a2f2b..81bf386 100644 +--- a/src/net/imap/IMAPFolder.cpp ++++ b/src/net/imap/IMAPFolder.cpp +@@ -34,6 +34,8 @@ + #include "vmime/exception.hpp" + #include "vmime/utility/smartPtr.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + #include + #include + +diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp +index bc661ed..702d5f2 100644 +--- a/src/net/imap/IMAPMessage.cpp ++++ b/src/net/imap/IMAPMessage.cpp +@@ -31,6 +31,8 @@ + #include "vmime/net/imap/IMAPPart.hpp" + #include "vmime/net/imap/IMAPMessagePartContentHandler.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + #include + #include + #include +diff --git a/src/net/imap/IMAPMessagePartContentHandler.cpp b/src/net/imap/IMAPMessagePartContentHandler.cpp +index 4e6ba97..85c6ec2 100644 +--- a/src/net/imap/IMAPMessagePartContentHandler.cpp ++++ b/src/net/imap/IMAPMessagePartContentHandler.cpp +@@ -23,6 +23,9 @@ + + #include "vmime/net/imap/IMAPMessagePartContentHandler.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++#include "vmime/utility/inputStreamStringProxyAdapter.hpp" ++ + + namespace vmime { + namespace net { +diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp +index d11ae3b..8c4b275 100644 +--- a/src/net/maildir/maildirFolder.cpp ++++ b/src/net/maildir/maildirFolder.cpp +@@ -35,6 +35,9 @@ + #include "vmime/exception.hpp" + #include "vmime/platform.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++ + + namespace vmime { + namespace net { +diff --git a/src/net/maildir/maildirMessage.cpp b/src/net/maildir/maildirMessage.cpp +index 51cd1ba..4ab75e7 100644 +--- a/src/net/maildir/maildirMessage.cpp ++++ b/src/net/maildir/maildirMessage.cpp +@@ -31,6 +31,8 @@ + #include "vmime/exception.hpp" + #include "vmime/platform.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + + namespace vmime { + namespace net { +diff --git a/src/net/pop3/POP3Message.cpp b/src/net/pop3/POP3Message.cpp +index 50f4f87..69ef004 100644 +--- a/src/net/pop3/POP3Message.cpp ++++ b/src/net/pop3/POP3Message.cpp +@@ -25,6 +25,8 @@ + #include "vmime/net/pop3/POP3Folder.hpp" + #include "vmime/net/pop3/POP3Store.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + #include + + +diff --git a/src/net/pop3/POP3Store.cpp b/src/net/pop3/POP3Store.cpp +index 9d554c6..793112a 100644 +--- a/src/net/pop3/POP3Store.cpp ++++ b/src/net/pop3/POP3Store.cpp +@@ -30,6 +30,7 @@ + #include "vmime/security/digest/messageDigestFactory.hpp" + #include "vmime/utility/filteredStream.hpp" + #include "vmime/utility/stringUtils.hpp" ++#include "vmime/utility/inputStreamSocketAdapter.hpp" + + #include "vmime/net/defaultConnectionInfos.hpp" + +diff --git a/src/net/sendmail/sendmailTransport.cpp b/src/net/sendmail/sendmailTransport.cpp +index 53ff0d1..e7762cc 100644 +--- a/src/net/sendmail/sendmailTransport.cpp ++++ b/src/net/sendmail/sendmailTransport.cpp +@@ -32,6 +32,8 @@ + #include "vmime/utility/childProcess.hpp" + #include "vmime/utility/smartPtr.hpp" + ++#include "vmime/utility/streamUtils.hpp" ++ + #include "vmime/net/defaultConnectionInfos.hpp" + + #include "vmime/config.hpp" +diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp +index d9fb7b8..bbbea75 100644 +--- a/src/net/smtp/SMTPTransport.cpp ++++ b/src/net/smtp/SMTPTransport.cpp +@@ -30,6 +30,8 @@ + + #include "vmime/utility/filteredStream.hpp" + #include "vmime/utility/stringUtils.hpp" ++#include "vmime/utility/outputStreamSocketAdapter.hpp" ++#include "vmime/utility/streamUtils.hpp" + + #include "vmime/net/defaultConnectionInfos.hpp" + +diff --git a/src/net/transport.cpp b/src/net/transport.cpp +index dd4663d..f8ca7b7 100644 +--- a/src/net/transport.cpp ++++ b/src/net/transport.cpp +@@ -27,6 +27,9 @@ + #include "vmime/mailboxList.hpp" + #include "vmime/message.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++ + + namespace vmime { + namespace net { +diff --git a/src/parameter.cpp b/src/parameter.cpp +index d757e1b..ccbe1a5 100644 +--- a/src/parameter.cpp ++++ b/src/parameter.cpp +@@ -27,6 +27,9 @@ + #include "vmime/text.hpp" + #include "vmime/encoding.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++#include "vmime/utility/outputStreamStringAdapter.hpp" ++ + + namespace vmime + { +diff --git a/src/parsedMessageAttachment.cpp b/src/parsedMessageAttachment.cpp +index bde56aa..cb7d71d 100644 +--- a/src/parsedMessageAttachment.cpp ++++ b/src/parsedMessageAttachment.cpp +@@ -26,6 +26,8 @@ + #include "vmime/stringContentHandler.hpp" + #include "vmime/contentDisposition.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + + namespace vmime + { +diff --git a/src/security/cert/X509Certificate.cpp b/src/security/cert/X509Certificate.cpp +index 1cd079c..8df4e5e 100644 +--- a/src/security/cert/X509Certificate.cpp ++++ b/src/security/cert/X509Certificate.cpp +@@ -28,6 +28,8 @@ + + #include "vmime/security/cert/X509Certificate.hpp" + ++#include "vmime/utility/outputStreamByteArrayAdapter.hpp" ++ + + namespace vmime { + namespace security { +diff --git a/src/security/sasl/SASLContext.cpp b/src/security/sasl/SASLContext.cpp +index 51c2bed..4bb33c1 100644 +--- a/src/security/sasl/SASLContext.cpp ++++ b/src/security/sasl/SASLContext.cpp +@@ -33,6 +33,9 @@ + #include "vmime/utility/encoder/encoderFactory.hpp" + + #include "vmime/utility/stream.hpp" ++#include "vmime/utility/outputStreamStringAdapter.hpp" ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++#include "vmime/utility/inputStreamByteBufferAdapter.hpp" + + + namespace vmime { +diff --git a/src/streamContentHandler.cpp b/src/streamContentHandler.cpp +index 2ebd073..89a36b4 100644 +--- a/src/streamContentHandler.cpp ++++ b/src/streamContentHandler.cpp +@@ -23,6 +23,10 @@ + + #include "vmime/streamContentHandler.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++#include "vmime/utility/streamUtils.hpp" ++ + + namespace vmime + { +diff --git a/src/stringContentHandler.cpp b/src/stringContentHandler.cpp +index 4e85a6c..5a1e72c 100644 +--- a/src/stringContentHandler.cpp ++++ b/src/stringContentHandler.cpp +@@ -23,6 +23,10 @@ + + #include "vmime/stringContentHandler.hpp" + ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++#include "vmime/utility/inputStreamStringProxyAdapter.hpp" ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + + namespace vmime + { +diff --git a/src/utility/encoder/defaultEncoder.cpp b/src/utility/encoder/defaultEncoder.cpp +index 4d0ffb5..e2d226e 100644 +--- a/src/utility/encoder/defaultEncoder.cpp ++++ b/src/utility/encoder/defaultEncoder.cpp +@@ -23,6 +23,8 @@ + + #include "vmime/utility/encoder/defaultEncoder.hpp" + ++#include "vmime/utility/streamUtils.hpp" ++ + + namespace vmime { + namespace utility { +diff --git a/src/utility/inputStream.cpp b/src/utility/inputStream.cpp +new file mode 100644 +index 0000000..dd0adf4 +--- /dev/null ++++ b/src/utility/inputStream.cpp +@@ -0,0 +1,33 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/inputStream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/inputStreamAdapter.cpp b/src/utility/inputStreamAdapter.cpp +new file mode 100644 +index 0000000..b44b084 +--- /dev/null ++++ b/src/utility/inputStreamAdapter.cpp +@@ -0,0 +1,70 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/inputStreamAdapter.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++inputStreamAdapter::inputStreamAdapter(std::istream& is) ++ : m_stream(is) ++{ ++} ++ ++ ++bool inputStreamAdapter::eof() const ++{ ++ return (m_stream.eof()); ++} ++ ++ ++void inputStreamAdapter::reset() ++{ ++ m_stream.exceptions(std::ios_base::badbit); ++ m_stream.seekg(0, std::ios::beg); ++ m_stream.clear(); ++} ++ ++ ++stream::size_type inputStreamAdapter::read ++ (value_type* const data, const size_type count) ++{ ++ m_stream.exceptions(std::ios_base::badbit); ++ m_stream.read(data, count); ++ return (m_stream.gcount()); ++} ++ ++ ++stream::size_type inputStreamAdapter::skip(const size_type count) ++{ ++ m_stream.exceptions(std::ios_base::badbit); ++ m_stream.ignore(count); ++ return (m_stream.gcount()); ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/inputStreamByteBufferAdapter.cpp b/src/utility/inputStreamByteBufferAdapter.cpp +new file mode 100644 +index 0000000..92e779f +--- /dev/null ++++ b/src/utility/inputStreamByteBufferAdapter.cpp +@@ -0,0 +1,90 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/inputStreamByteBufferAdapter.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++inputStreamByteBufferAdapter::inputStreamByteBufferAdapter(const byte_t* buffer, const size_type length) ++ : m_buffer(buffer), m_length(length), m_pos(0) ++{ ++} ++ ++ ++bool inputStreamByteBufferAdapter::eof() const ++{ ++ return m_pos >= m_length; ++} ++ ++ ++void inputStreamByteBufferAdapter::reset() ++{ ++ m_pos = 0; ++} ++ ++ ++stream::size_type inputStreamByteBufferAdapter::read ++ (value_type* const data, const size_type count) ++{ ++ const size_type remaining = m_length - m_pos; ++ ++ if (remaining < count) ++ { ++ std::copy(m_buffer + m_pos, m_buffer + m_pos + remaining, data); ++ m_pos += remaining; ++ ++ return remaining; ++ } ++ else ++ { ++ std::copy(m_buffer + m_pos, m_buffer + m_pos + count, data); ++ m_pos += count; ++ ++ return count; ++ } ++} ++ ++ ++stream::size_type inputStreamByteBufferAdapter::skip(const size_type count) ++{ ++ const size_type remaining = m_length - m_pos; ++ ++ if (remaining < count) ++ { ++ m_pos += remaining; ++ return remaining; ++ } ++ else ++ { ++ m_pos += count; ++ return count; ++ } ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/inputStreamPointerAdapter.cpp b/src/utility/inputStreamPointerAdapter.cpp +new file mode 100644 +index 0000000..4d03e30 +--- /dev/null ++++ b/src/utility/inputStreamPointerAdapter.cpp +@@ -0,0 +1,46 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/inputStreamPointerAdapter.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++inputStreamPointerAdapter::inputStreamPointerAdapter(std::istream* is, const bool own) ++ : inputStreamAdapter(*is), m_stream(is), m_own(own) ++{ ++} ++ ++ ++inputStreamPointerAdapter::~inputStreamPointerAdapter() ++{ ++ if (m_own) ++ delete (m_stream); ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/inputStreamSocketAdapter.cpp b/src/utility/inputStreamSocketAdapter.cpp +new file mode 100644 +index 0000000..b93cc3c +--- /dev/null ++++ b/src/utility/inputStreamSocketAdapter.cpp +@@ -0,0 +1,82 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/inputStreamSocketAdapter.hpp" ++ ++ ++#if VMIME_HAVE_MESSAGING_FEATURES ++ ++ ++#include "vmime/net/socket.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++inputStreamSocketAdapter::inputStreamSocketAdapter(net::socket& sok) ++ : m_socket(sok) ++{ ++} ++ ++ ++bool inputStreamSocketAdapter::eof() const ++{ ++ // Can't know... ++ return false; ++} ++ ++ ++void inputStreamSocketAdapter::reset() ++{ ++ // Not supported ++} ++ ++ ++stream::size_type inputStreamSocketAdapter::read ++ (value_type* const data, const size_type count) ++{ ++ return m_socket.receiveRaw(data, count); ++} ++ ++ ++stream::size_type inputStreamSocketAdapter::skip ++ (const size_type /* count */) ++{ ++ // Not supported ++ return 0; ++} ++ ++ ++stream::size_type inputStreamSocketAdapter::getBlockSize() ++{ ++ return m_socket.getBlockSize(); ++} ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_HAVE_MESSAGING_FEATURES ++ +diff --git a/src/utility/inputStreamStringAdapter.cpp b/src/utility/inputStreamStringAdapter.cpp +new file mode 100644 +index 0000000..31c9fda +--- /dev/null ++++ b/src/utility/inputStreamStringAdapter.cpp +@@ -0,0 +1,94 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++inputStreamStringAdapter::inputStreamStringAdapter(const string& buffer) ++ : m_buffer(buffer), m_begin(0), m_end(buffer.length()), m_pos(0) ++{ ++} ++ ++ ++inputStreamStringAdapter::inputStreamStringAdapter(const string& buffer, ++ const string::size_type begin, const string::size_type end) ++ : m_buffer(buffer), m_begin(begin), m_end(end), m_pos(begin) ++{ ++} ++ ++ ++bool inputStreamStringAdapter::eof() const ++{ ++ return (m_pos >= m_end); ++} ++ ++ ++void inputStreamStringAdapter::reset() ++{ ++ m_pos = m_begin; ++} ++ ++ ++stream::size_type inputStreamStringAdapter::read ++ (value_type* const data, const size_type count) ++{ ++ if (m_pos + count >= m_end) ++ { ++ const size_type remaining = m_end - m_pos; ++ ++ std::copy(m_buffer.begin() + m_pos, m_buffer.end(), data); ++ m_pos = m_end; ++ return (remaining); ++ } ++ else ++ { ++ std::copy(m_buffer.begin() + m_pos, m_buffer.begin() + m_pos + count, data); ++ m_pos += count; ++ return (count); ++ } ++} ++ ++ ++stream::size_type inputStreamStringAdapter::skip(const size_type count) ++{ ++ if (m_pos + count >= m_end) ++ { ++ const size_type remaining = m_end - m_pos; ++ m_pos = m_end; ++ return (remaining); ++ } ++ else ++ { ++ m_pos += count; ++ return (count); ++ } ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/inputStreamStringProxyAdapter.cpp b/src/utility/inputStreamStringProxyAdapter.cpp +new file mode 100644 +index 0000000..5e4b60b +--- /dev/null ++++ b/src/utility/inputStreamStringProxyAdapter.cpp +@@ -0,0 +1,89 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/inputStreamStringProxyAdapter.hpp" ++#include "vmime/utility/stringProxy.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++inputStreamStringProxyAdapter::inputStreamStringProxyAdapter(const stringProxy& buffer) ++ : m_buffer(buffer), m_pos(0) ++{ ++} ++ ++ ++bool inputStreamStringProxyAdapter::eof() const ++{ ++ return (m_pos >= m_buffer.length()); ++} ++ ++ ++void inputStreamStringProxyAdapter::reset() ++{ ++ m_pos = 0; ++} ++ ++ ++stream::size_type inputStreamStringProxyAdapter::read ++ (value_type* const data, const size_type count) ++{ ++ const size_type remaining = m_buffer.length() - m_pos; ++ ++ if (count > remaining) ++ { ++ std::copy(m_buffer.it_begin() + m_pos, m_buffer.it_end(), data); ++ m_pos = m_buffer.length(); ++ return (remaining); ++ } ++ else ++ { ++ std::copy(m_buffer.it_begin() + m_pos, m_buffer.it_begin() + m_pos + count, data); ++ m_pos += count; ++ return (count); ++ } ++} ++ ++ ++stream::size_type inputStreamStringProxyAdapter::skip(const size_type count) ++{ ++ const size_type remaining = m_buffer.length() - m_pos; ++ ++ if (count > remaining) ++ { ++ m_pos = m_buffer.length(); ++ return (remaining); ++ } ++ else ++ { ++ m_pos += count; ++ return (count); ++ } ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/outputStream.cpp b/src/utility/outputStream.cpp +new file mode 100644 +index 0000000..8a65db5 +--- /dev/null ++++ b/src/utility/outputStream.cpp +@@ -0,0 +1,33 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/outputStream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/outputStreamAdapter.cpp b/src/utility/outputStreamAdapter.cpp +new file mode 100644 +index 0000000..2da94f1 +--- /dev/null ++++ b/src/utility/outputStreamAdapter.cpp +@@ -0,0 +1,54 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/outputStreamAdapter.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++outputStreamAdapter::outputStreamAdapter(std::ostream& os) ++ : m_stream(os) ++{ ++} ++ ++ ++void outputStreamAdapter::write ++ (const value_type* const data, const size_type count) ++{ ++ m_stream.exceptions(std::ios_base::badbit); ++ m_stream.write(data, count); ++} ++ ++ ++void outputStreamAdapter::flush() ++{ ++ m_stream.exceptions(std::ios_base::badbit); ++ m_stream.flush(); ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/outputStreamByteArrayAdapter.cpp b/src/utility/outputStreamByteArrayAdapter.cpp +new file mode 100644 +index 0000000..97b27d2 +--- /dev/null ++++ b/src/utility/outputStreamByteArrayAdapter.cpp +@@ -0,0 +1,51 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/outputStreamByteArrayAdapter.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++outputStreamByteArrayAdapter::outputStreamByteArrayAdapter(byteArray& array) ++ : m_array(array) ++{ ++} ++ ++ ++void outputStreamByteArrayAdapter::write(const value_type* const data, const size_type count) ++{ ++ m_array.insert(m_array.end(), data, data + count); ++} ++ ++ ++void outputStreamByteArrayAdapter::flush() ++{ ++ // Do nothing ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/outputStreamSocketAdapter.cpp b/src/utility/outputStreamSocketAdapter.cpp +new file mode 100644 +index 0000000..d933e73 +--- /dev/null ++++ b/src/utility/outputStreamSocketAdapter.cpp +@@ -0,0 +1,68 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/outputStreamSocketAdapter.hpp" ++ ++ ++#if VMIME_HAVE_MESSAGING_FEATURES ++ ++ ++#include "vmime/net/socket.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++outputStreamSocketAdapter::outputStreamSocketAdapter(net::socket& sok) ++ : m_socket(sok) ++{ ++} ++ ++ ++void outputStreamSocketAdapter::write ++ (const value_type* const data, const size_type count) ++{ ++ m_socket.sendRaw(data, count); ++} ++ ++ ++void outputStreamSocketAdapter::flush() ++{ ++ // Do nothing ++} ++ ++ ++stream::size_type outputStreamSocketAdapter::getBlockSize() ++{ ++ return m_socket.getBlockSize(); ++} ++ ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_HAVE_MESSAGING_FEATURES ++ +diff --git a/src/utility/outputStreamStringAdapter.cpp b/src/utility/outputStreamStringAdapter.cpp +new file mode 100644 +index 0000000..62b2a72 +--- /dev/null ++++ b/src/utility/outputStreamStringAdapter.cpp +@@ -0,0 +1,51 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/outputStreamStringAdapter.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++outputStreamStringAdapter::outputStreamStringAdapter(string& buffer) ++ : m_buffer(buffer) ++{ ++} ++ ++ ++void outputStreamStringAdapter::write(const value_type* const data, const size_type count) ++{ ++ m_buffer.append(data, count); ++} ++ ++ ++void outputStreamStringAdapter::flush() ++{ ++ // Do nothing ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/stream.cpp b/src/utility/stream.cpp +index ec30b7d..1c940c2 100644 +--- a/src/utility/stream.cpp ++++ b/src/utility/stream.cpp +@@ -22,503 +22,18 @@ + // + + #include "vmime/utility/stream.hpp" +-#include "vmime/utility/stringProxy.hpp" + +-#include // for std::copy +-#include // for std::back_inserter +- +-#if VMIME_HAVE_MESSAGING_FEATURES +- #include "vmime/net/socket.hpp" +-#endif + + + namespace vmime { + namespace utility { + + +-// stream +- + stream::size_type stream::getBlockSize() + { + return 32768; // 32 KB + } + + +-// Helpers +- +-outputStream& operator<<(outputStream& os, const stream::value_type c) +-{ +- os.write(&c, 1); +- return (os); +-} +- +- +-outputStream& operator<<(outputStream& os, const string& str) +-{ +- os.write(str.data(), str.length()); +- return (os); +-} +- +- +-stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os) +-{ +- return bufferedStreamCopy(is, os, 0, NULL); +-} +- +- +-stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os, +- const stream::size_type length, progressListener* progress) +-{ +- const stream::size_type blockSize = +- std::min(is.getBlockSize(), os.getBlockSize()); +- +- std::vector vbuffer(blockSize); +- +- stream::value_type* buffer = &vbuffer.front(); +- stream::size_type total = 0; +- +- if (progress != NULL) +- progress->start(length); +- +- while (!is.eof()) +- { +- const stream::size_type read = is.read(buffer, blockSize); +- +- if (read != 0) +- { +- os.write(buffer, read); +- total += read; +- +- if (progress != NULL) +- progress->progress(total, std::max(total, length)); +- } +- } +- +- if (progress != NULL) +- progress->stop(total); +- +- return (total); +-} +- +- +- +-// outputStreamAdapter +- +-outputStreamAdapter::outputStreamAdapter(std::ostream& os) +- : m_stream(os) +-{ +-} +- +- +-void outputStreamAdapter::write +- (const value_type* const data, const size_type count) +-{ +- m_stream.exceptions(std::ios_base::badbit); +- m_stream.write(data, count); +-} +- +- +-void outputStreamAdapter::flush() +-{ +- m_stream.exceptions(std::ios_base::badbit); +- m_stream.flush(); +-} +- +- +- +-// outputStreamStringAdapter +- +-outputStreamStringAdapter::outputStreamStringAdapter(string& buffer) +- : m_buffer(buffer) +-{ +-} +- +- +-void outputStreamStringAdapter::write(const value_type* const data, const size_type count) +-{ +- m_buffer.append(data, count); +-} +- +- +-void outputStreamStringAdapter::flush() +-{ +- // Do nothing +-} +- +- +- +-// outputStreamByteArrayAdapter +- +-outputStreamByteArrayAdapter::outputStreamByteArrayAdapter(byteArray& array) +- : m_array(array) +-{ +-} +- +- +-void outputStreamByteArrayAdapter::write(const value_type* const data, const size_type count) +-{ +- m_array.insert(m_array.end(), data, data + count); +-} +- +- +-void outputStreamByteArrayAdapter::flush() +-{ +- // Do nothing +-} +- +- +- +-// inputStreamAdapter +- +-inputStreamAdapter::inputStreamAdapter(std::istream& is) +- : m_stream(is) +-{ +-} +- +- +-bool inputStreamAdapter::eof() const +-{ +- return (m_stream.eof()); +-} +- +- +-void inputStreamAdapter::reset() +-{ +- m_stream.exceptions(std::ios_base::badbit); +- m_stream.seekg(0, std::ios::beg); +- m_stream.clear(); +-} +- +- +-stream::size_type inputStreamAdapter::read +- (value_type* const data, const size_type count) +-{ +- m_stream.exceptions(std::ios_base::badbit); +- m_stream.read(data, count); +- return (m_stream.gcount()); +-} +- +- +-stream::size_type inputStreamAdapter::skip(const size_type count) +-{ +- m_stream.exceptions(std::ios_base::badbit); +- m_stream.ignore(count); +- return (m_stream.gcount()); +-} +- +- +- +-// inputStreamStringAdapter +- +-inputStreamStringAdapter::inputStreamStringAdapter(const string& buffer) +- : m_buffer(buffer), m_begin(0), m_end(buffer.length()), m_pos(0) +-{ +-} +- +- +-inputStreamStringAdapter::inputStreamStringAdapter(const string& buffer, +- const string::size_type begin, const string::size_type end) +- : m_buffer(buffer), m_begin(begin), m_end(end), m_pos(begin) +-{ +-} +- +- +-bool inputStreamStringAdapter::eof() const +-{ +- return (m_pos >= m_end); +-} +- +- +-void inputStreamStringAdapter::reset() +-{ +- m_pos = m_begin; +-} +- +- +-stream::size_type inputStreamStringAdapter::read +- (value_type* const data, const size_type count) +-{ +- if (m_pos + count >= m_end) +- { +- const size_type remaining = m_end - m_pos; +- +- std::copy(m_buffer.begin() + m_pos, m_buffer.end(), data); +- m_pos = m_end; +- return (remaining); +- } +- else +- { +- std::copy(m_buffer.begin() + m_pos, m_buffer.begin() + m_pos + count, data); +- m_pos += count; +- return (count); +- } +-} +- +- +-stream::size_type inputStreamStringAdapter::skip(const size_type count) +-{ +- if (m_pos + count >= m_end) +- { +- const size_type remaining = m_end - m_pos; +- m_pos = m_end; +- return (remaining); +- } +- else +- { +- m_pos += count; +- return (count); +- } +-} +- +- +- +-// inputStreamStringProxyAdapter +- +-inputStreamStringProxyAdapter::inputStreamStringProxyAdapter(const stringProxy& buffer) +- : m_buffer(buffer), m_pos(0) +-{ +-} +- +- +-bool inputStreamStringProxyAdapter::eof() const +-{ +- return (m_pos >= m_buffer.length()); +-} +- +- +-void inputStreamStringProxyAdapter::reset() +-{ +- m_pos = 0; +-} +- +- +-stream::size_type inputStreamStringProxyAdapter::read +- (value_type* const data, const size_type count) +-{ +- const size_type remaining = m_buffer.length() - m_pos; +- +- if (count > remaining) +- { +- std::copy(m_buffer.it_begin() + m_pos, m_buffer.it_end(), data); +- m_pos = m_buffer.length(); +- return (remaining); +- } +- else +- { +- std::copy(m_buffer.it_begin() + m_pos, m_buffer.it_begin() + m_pos + count, data); +- m_pos += count; +- return (count); +- } +-} +- +- +-stream::size_type inputStreamStringProxyAdapter::skip(const size_type count) +-{ +- const size_type remaining = m_buffer.length() - m_pos; +- +- if (count > remaining) +- { +- m_pos = m_buffer.length(); +- return (remaining); +- } +- else +- { +- m_pos += count; +- return (count); +- } +-} +- +- +- +-// inputStreamPointerAdapter +- +-inputStreamPointerAdapter::inputStreamPointerAdapter(std::istream* is, const bool own) +- : m_stream(is), m_own(own) +-{ +-} +- +- +-inputStreamPointerAdapter::inputStreamPointerAdapter(const inputStreamPointerAdapter&) +- : inputStream(), m_stream(NULL), m_own(false) +-{ +- // Not copiable +-} +- +- +-inputStreamPointerAdapter::~inputStreamPointerAdapter() +-{ +- if (m_own) +- delete (m_stream); +-} +- +- +-bool inputStreamPointerAdapter::eof() const +-{ +- return (m_stream->eof()); +-} +- +- +-void inputStreamPointerAdapter::reset() +-{ +- m_stream->exceptions(std::ios_base::badbit); +- m_stream->seekg(0, std::ios::beg); +- m_stream->clear(); +-} +- +- +-stream::size_type inputStreamPointerAdapter::read +- (value_type* const data, const size_type count) +-{ +- m_stream->exceptions(std::ios_base::badbit); +- m_stream->read(data, count); +- return (m_stream->gcount()); +-} +- +- +-stream::size_type inputStreamPointerAdapter::skip(const size_type count) +-{ +- m_stream->exceptions(std::ios_base::badbit); +- m_stream->ignore(count); +- return (m_stream->gcount()); +-} +- +- +- +-// inputStreamByteBufferAdapter +- +-inputStreamByteBufferAdapter::inputStreamByteBufferAdapter(const byte_t* buffer, const size_type length) +- : m_buffer(buffer), m_length(length), m_pos(0) +-{ +-} +- +- +-bool inputStreamByteBufferAdapter::eof() const +-{ +- return m_pos >= m_length; +-} +- +- +-void inputStreamByteBufferAdapter::reset() +-{ +- m_pos = 0; +-} +- +- +-stream::size_type inputStreamByteBufferAdapter::read +- (value_type* const data, const size_type count) +-{ +- const size_type remaining = m_length - m_pos; +- +- if (remaining < count) +- { +- std::copy(m_buffer + m_pos, m_buffer + m_pos + remaining, data); +- m_pos += remaining; +- +- return remaining; +- } +- else +- { +- std::copy(m_buffer + m_pos, m_buffer + m_pos + count, data); +- m_pos += count; +- +- return count; +- } +-} +- +- +-stream::size_type inputStreamByteBufferAdapter::skip(const size_type count) +-{ +- const size_type remaining = m_length - m_pos; +- +- if (remaining < count) +- { +- m_pos += remaining; +- return remaining; +- } +- else +- { +- m_pos += count; +- return count; +- } +-} +- +- +- +-#ifdef VMIME_HAVE_MESSAGING_FEATURES +- +- +-// outputStreamSocketAdapter +- +-outputStreamSocketAdapter::outputStreamSocketAdapter(net::socket& sok) +- : m_socket(sok) +-{ +-} +- +- +-void outputStreamSocketAdapter::write +- (const value_type* const data, const size_type count) +-{ +- m_socket.sendRaw(data, count); +-} +- +- +-void outputStreamSocketAdapter::flush() +-{ +- // Do nothing +-} +- +- +-stream::size_type outputStreamSocketAdapter::getBlockSize() +-{ +- return m_socket.getBlockSize(); +-} +- +- +- +-// inputStreamSocketAdapter +- +-inputStreamSocketAdapter::inputStreamSocketAdapter(net::socket& sok) +- : m_socket(sok) +-{ +-} +- +- +-bool inputStreamSocketAdapter::eof() const +-{ +- // Can't know... +- return false; +-} +- +- +-void inputStreamSocketAdapter::reset() +-{ +- // Not supported +-} +- +- +-stream::size_type inputStreamSocketAdapter::read +- (value_type* const data, const size_type count) +-{ +- return m_socket.receiveRaw(data, count); +-} +- +- +-stream::size_type inputStreamSocketAdapter::skip +- (const size_type /* count */) +-{ +- // Not supported +- return 0; +-} +- +- +-stream::size_type inputStreamSocketAdapter::getBlockSize() +-{ +- return m_socket.getBlockSize(); +-} +- +- +-#endif // VMIME_HAVE_MESSAGING_FEATURES +- +- + } // utility + } // vmime +diff --git a/src/utility/streamUtils.cpp b/src/utility/streamUtils.cpp +new file mode 100644 +index 0000000..f1d3b9d +--- /dev/null ++++ b/src/utility/streamUtils.cpp +@@ -0,0 +1,92 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/streamUtils.hpp" ++ ++#include // for std::copy ++#include // for std::back_inserter ++ ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++outputStream& operator<<(outputStream& os, const stream::value_type c) ++{ ++ os.write(&c, 1); ++ return (os); ++} ++ ++ ++outputStream& operator<<(outputStream& os, const string& str) ++{ ++ os.write(str.data(), str.length()); ++ return (os); ++} ++ ++ ++stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os) ++{ ++ return bufferedStreamCopy(is, os, 0, NULL); ++} ++ ++ ++stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os, ++ const stream::size_type length, progressListener* progress) ++{ ++ const stream::size_type blockSize = ++ std::min(is.getBlockSize(), os.getBlockSize()); ++ ++ std::vector vbuffer(blockSize); ++ ++ stream::value_type* buffer = &vbuffer.front(); ++ stream::size_type total = 0; ++ ++ if (progress != NULL) ++ progress->start(length); ++ ++ while (!is.eof()) ++ { ++ const stream::size_type read = is.read(buffer, blockSize); ++ ++ if (read != 0) ++ { ++ os.write(buffer, read); ++ total += read; ++ ++ if (progress != NULL) ++ progress->progress(total, std::max(total, length)); ++ } ++ } ++ ++ if (progress != NULL) ++ progress->stop(total); ++ ++ return (total); ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/stringProxy.cpp b/src/utility/stringProxy.cpp +index a4ba6d2..74344b5 100644 +--- a/src/utility/stringProxy.cpp ++++ b/src/utility/stringProxy.cpp +@@ -23,6 +23,8 @@ + + #include "vmime/utility/stringProxy.hpp" + ++#include "vmime/utility/outputStreamAdapter.hpp" ++ + #include + #include + +diff --git a/src/word.cpp b/src/word.cpp +index aeaa737..79060a1 100644 +--- a/src/word.cpp ++++ b/src/word.cpp +@@ -28,6 +28,9 @@ + #include "vmime/utility/smartPtr.hpp" + #include "vmime/parserHelpers.hpp" + ++#include "vmime/utility/outputStreamStringAdapter.hpp" ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++ + #include "vmime/utility/encoder/encoder.hpp" + #include "vmime/utility/encoder/b64Encoder.hpp" + #include "vmime/utility/encoder/qpEncoder.hpp" +diff --git a/src/wordEncoder.cpp b/src/wordEncoder.cpp +index 67bd7a1..194a189 100644 +--- a/src/wordEncoder.cpp ++++ b/src/wordEncoder.cpp +@@ -33,6 +33,9 @@ + + #include "vmime/utility/stringUtils.hpp" + ++#include "vmime/utility/outputStreamStringAdapter.hpp" ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++ + + namespace vmime + { +diff --git a/vmime/base.hpp b/vmime/base.hpp +index 60e637d..b794031 100644 +--- a/vmime/base.hpp ++++ b/vmime/base.hpp +@@ -35,7 +35,6 @@ + #include "vmime/config.hpp" + #include "vmime/types.hpp" + #include "vmime/constants.hpp" +-#include "vmime/utility/stream.hpp" + #include "vmime/utility/smartPtr.hpp" + + +@@ -255,7 +254,26 @@ namespace vmime + return y.dynamicCast (); + } + ++ /** Inherit from this class to indicate the subclass is not copyable, ++ * ie. you want to prohibit copy construction and copy assignment. ++ */ ++ class noncopyable ++ { ++ protected: ++ ++ noncopyable() { } ++ virtual ~noncopyable() { } ++ ++ private: ++ ++ noncopyable(const noncopyable&); ++ void operator=(const noncopyable&); ++ }; ++ + } // vmime + + ++#include "vmime/utility/stream.hpp" ++ ++ + #endif // VMIME_BASE_HPP_INCLUDED +diff --git a/vmime/charset.hpp b/vmime/charset.hpp +index b2e241c..5f5e8e5 100644 +--- a/vmime/charset.hpp ++++ b/vmime/charset.hpp +@@ -26,6 +26,8 @@ + + + #include "vmime/base.hpp" ++#include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/outputStream.hpp" + #include "vmime/component.hpp" + + +diff --git a/vmime/component.hpp b/vmime/component.hpp +index b38127f..12b0406 100644 +--- a/vmime/component.hpp ++++ b/vmime/component.hpp +@@ -26,6 +26,8 @@ + + + #include "vmime/base.hpp" ++#include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/outputStream.hpp" + + + namespace vmime +diff --git a/vmime/net/imap/IMAPParser.hpp b/vmime/net/imap/IMAPParser.hpp +index d71c3ca..f430510 100644 +--- a/vmime/net/imap/IMAPParser.hpp ++++ b/vmime/net/imap/IMAPParser.hpp +@@ -37,6 +37,9 @@ + #include "vmime/utility/encoder/b64Encoder.hpp" + #include "vmime/utility/encoder/qpEncoder.hpp" + ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++#include "vmime/utility/outputStreamStringAdapter.hpp" ++ + #include "vmime/platform.hpp" + + #include "vmime/net/timeoutHandler.hpp" +@@ -3825,7 +3828,7 @@ public: + : m_date_time(NULL), m_number(NULL), m_envelope(NULL), + m_uniqueid(NULL), m_nstring(NULL), m_body(NULL), m_flag_list(NULL), + m_section(NULL) +- ++ + { + } + +diff --git a/vmime/utility/filteredStream.hpp b/vmime/utility/filteredStream.hpp +index 00be785..2a55edd 100644 +--- a/vmime/utility/filteredStream.hpp ++++ b/vmime/utility/filteredStream.hpp +@@ -27,7 +27,8 @@ + + #include + +-#include "vmime/utility/stream.hpp" ++#include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/outputStream.hpp" + + + namespace vmime { +diff --git a/vmime/utility/inputStream.hpp b/vmime/utility/inputStream.hpp +new file mode 100644 +index 0000000..4a76a7d +--- /dev/null ++++ b/vmime/utility/inputStream.hpp +@@ -0,0 +1,76 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_INPUTSTREAM_HPP_INCLUDED ++#define VMIME_UTILITY_INPUTSTREAM_HPP_INCLUDED ++ ++ ++#include "vmime/utility/stream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** Simple input stream. ++ */ ++ ++class inputStream : public stream ++{ ++public: ++ ++ /** Test for end of stream (no more data to read). ++ * ++ * @return true if we have reached the end of stream, false otherwise ++ */ ++ virtual bool eof() const = 0; ++ ++ /** Set the read pointer to the beginning of the stream. ++ * ++ * @warning WARNING: this may not work for all stream types. ++ */ ++ virtual void reset() = 0; ++ ++ /** Read data from the stream. ++ * ++ * @param data will receive the data read ++ * @param count maximum number of bytes to read ++ * @return number of bytes read ++ */ ++ virtual size_type read(value_type* const data, const size_type count) = 0; ++ ++ /** Skip a number of bytes. ++ * ++ * @param count maximum number of bytes to ignore ++ * @return number of bytes skipped ++ */ ++ virtual size_type skip(const size_type count) = 0; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_INPUTSTREAM_HPP_INCLUDED ++ +diff --git a/vmime/utility/inputStreamAdapter.hpp b/vmime/utility/inputStreamAdapter.hpp +new file mode 100644 +index 0000000..278ab52 +--- /dev/null ++++ b/vmime/utility/inputStreamAdapter.hpp +@@ -0,0 +1,64 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_INPUTSTREAMADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_INPUTSTREAMADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/inputStream.hpp" ++ ++#include ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An adapter class for C++ standard input streams. ++ */ ++ ++class inputStreamAdapter : public inputStream ++{ ++public: ++ ++ /** @param is input stream to wrap ++ */ ++ inputStreamAdapter(std::istream& is); ++ ++ bool eof() const; ++ void reset(); ++ size_type read(value_type* const data, const size_type count); ++ size_type skip(const size_type count); ++ ++private: ++ ++ std::istream& m_stream; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_INPUTSTREAMADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/inputStreamByteBufferAdapter.hpp b/vmime/utility/inputStreamByteBufferAdapter.hpp +new file mode 100644 +index 0000000..0f6a442 +--- /dev/null ++++ b/vmime/utility/inputStreamByteBufferAdapter.hpp +@@ -0,0 +1,63 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_INPUTSTREAMBYTEBUFFERADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_INPUTSTREAMBYTEBUFFERADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/inputStream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An adapter class for reading from an array of bytes. ++ */ ++ ++class inputStreamByteBufferAdapter : public inputStream ++{ ++public: ++ ++ inputStreamByteBufferAdapter(const byte_t* buffer, size_type length); ++ ++ bool eof() const; ++ void reset(); ++ size_type read(value_type* const data, const size_type count); ++ size_type skip(const size_type count); ++ ++private: ++ ++ const byte_t* m_buffer; ++ const size_type m_length; ++ ++ size_type m_pos; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_INPUTSTREAMBYTEBUFFERADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/inputStreamPointerAdapter.hpp b/vmime/utility/inputStreamPointerAdapter.hpp +new file mode 100644 +index 0000000..44e9bad +--- /dev/null ++++ b/vmime/utility/inputStreamPointerAdapter.hpp +@@ -0,0 +1,63 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_INPUTSTREAMPOINTERADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_INPUTSTREAMPOINTERADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/inputStreamAdapter.hpp" ++ ++#include ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An adapter class for pointer to C++ standard input stream. ++ */ ++ ++class inputStreamPointerAdapter : public inputStreamAdapter ++{ ++public: ++ ++ /** @param is input stream to wrap ++ * @param own if set to 'true', the pointer will be deleted when ++ * this object is destroyed ++ */ ++ inputStreamPointerAdapter(std::istream* is, const bool own = true); ++ ~inputStreamPointerAdapter(); ++ ++private: ++ ++ std::istream* m_stream; ++ const bool m_own; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_INPUTSTREAMPOINTERADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/inputStreamSocketAdapter.hpp b/vmime/utility/inputStreamSocketAdapter.hpp +new file mode 100644 +index 0000000..0f99c21 +--- /dev/null ++++ b/vmime/utility/inputStreamSocketAdapter.hpp +@@ -0,0 +1,77 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_INPUTSTREAMSOCKETADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_INPUTSTREAMSOCKETADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/inputStream.hpp" ++ ++ ++#if VMIME_HAVE_MESSAGING_FEATURES ++ ++ ++namespace vmime { ++namespace net { ++ class socket; // forward reference ++} // net ++} // vmime ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An input stream that is connected to a socket. ++ */ ++ ++class inputStreamSocketAdapter : public inputStream ++{ ++public: ++ ++ inputStreamSocketAdapter(net::socket& sok); ++ ++ bool eof() const; ++ void reset(); ++ size_type read(value_type* const data, const size_type count); ++ size_type skip(const size_type count); ++ ++ size_type getBlockSize(); ++ ++private: ++ ++ inputStreamSocketAdapter(const inputStreamSocketAdapter&); ++ ++ net::socket& m_socket; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_HAVE_MESSAGING_FEATURES ++ ++ ++#endif // VMIME_UTILITY_INPUTSTREAMSOCKETADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/inputStreamStringAdapter.hpp b/vmime/utility/inputStreamStringAdapter.hpp +new file mode 100644 +index 0000000..a7d986f +--- /dev/null ++++ b/vmime/utility/inputStreamStringAdapter.hpp +@@ -0,0 +1,66 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_INPUTSTREAMSTRINGADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_INPUTSTREAMSTRINGADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/inputStream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An adapter class for string input. ++ */ ++ ++class inputStreamStringAdapter : public inputStream ++{ ++public: ++ ++ inputStreamStringAdapter(const string& buffer); ++ inputStreamStringAdapter(const string& buffer, const string::size_type begin, const string::size_type end); ++ ++ bool eof() const; ++ void reset(); ++ size_type read(value_type* const data, const size_type count); ++ size_type skip(const size_type count); ++ ++private: ++ ++ inputStreamStringAdapter(const inputStreamStringAdapter&); ++ ++ const string m_buffer; // do _NOT_ keep a reference... ++ const string::size_type m_begin; ++ const string::size_type m_end; ++ string::size_type m_pos; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_INPUTSTREAMSTRINGADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/inputStreamStringProxyAdapter.hpp b/vmime/utility/inputStreamStringProxyAdapter.hpp +new file mode 100644 +index 0000000..74b3f60 +--- /dev/null ++++ b/vmime/utility/inputStreamStringProxyAdapter.hpp +@@ -0,0 +1,68 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_INPUTSTREAMSTRINGPROXYADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_INPUTSTREAMSTRINGPROXYADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/inputStream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++class stringProxy; ++ ++ ++/** An adapter class for stringProxy input. ++ */ ++ ++class inputStreamStringProxyAdapter : public inputStream ++{ ++public: ++ ++ /** @param buffer stringProxy object to wrap ++ */ ++ inputStreamStringProxyAdapter(const stringProxy& buffer); ++ ++ bool eof() const; ++ void reset(); ++ size_type read(value_type* const data, const size_type count); ++ size_type skip(const size_type count); ++ ++private: ++ ++ inputStreamStringProxyAdapter(const inputStreamStringProxyAdapter&); ++ ++ const stringProxy& m_buffer; ++ string::size_type m_pos; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_INPUTSTREAMSTRINGPROXYADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/outputStream.hpp b/vmime/utility/outputStream.hpp +new file mode 100644 +index 0000000..7372d20 +--- /dev/null ++++ b/vmime/utility/outputStream.hpp +@@ -0,0 +1,107 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_OUTPUTSTREAM_HPP_INCLUDED ++#define VMIME_UTILITY_OUTPUTSTREAM_HPP_INCLUDED ++ ++ ++#include "vmime/utility/stream.hpp" ++ ++ ++#if defined(_MSC_VER) && (_MSC_VER <= 1200) // VC++6 ++# include ++#endif ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** Simple output stream. ++ */ ++ ++class outputStream : public stream ++{ ++public: ++ ++ /** Write data to the stream. ++ * ++ * @param data buffer containing data to write ++ * @param count number of bytes to write ++ */ ++ virtual void write(const value_type* const data, const size_type count) = 0; ++ ++ /** Flush this output stream and forces any buffered output ++ * bytes to be written out to the stream. ++ */ ++ virtual void flush() = 0; ++}; ++ ++ ++// Helpers functions ++ ++outputStream& operator<<(outputStream& os, const string& str); ++outputStream& operator<<(outputStream& os, const stream::value_type c); ++ ++ ++#if defined(_MSC_VER) && (_MSC_VER <= 1200) // Internal compiler error with VC++6 ++ ++inline outputStream& operator<<(outputStream& os, const char* str) ++{ ++ os.write(str, ::strlen(str)); ++ return (os); ++} ++ ++#else ++ ++template ++outputStream& operator<<(outputStream& os, const char (&str)[N]) ++{ ++ os.write(str, N - 1); ++ return (os); ++} ++ ++#endif // defined(_MSC_VER) && (_MSC_VER <= 1200) ++ ++ ++template ++outputStream& operator<<(outputStream& os, const T& t) ++{ ++ std::ostringstream oss; ++ oss.imbue(std::locale::classic()); // no formatting ++ ++ oss << t; ++ ++ os << oss.str(); ++ ++ return (os); ++} ++ ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_OUTPUTSTREAM_HPP_INCLUDED ++ +diff --git a/vmime/utility/outputStreamAdapter.hpp b/vmime/utility/outputStreamAdapter.hpp +new file mode 100644 +index 0000000..be55d8d +--- /dev/null ++++ b/vmime/utility/outputStreamAdapter.hpp +@@ -0,0 +1,62 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_OUTPUTSTREAMADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_OUTPUTSTREAMADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/outputStream.hpp" ++ ++#include ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An adapter class for C++ standard output streams. ++ */ ++ ++class outputStreamAdapter : public outputStream ++{ ++public: ++ ++ /** @param os output stream to wrap ++ */ ++ outputStreamAdapter(std::ostream& os); ++ ++ void write(const value_type* const data, const size_type count); ++ void flush(); ++ ++private: ++ ++ std::ostream& m_stream; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_OUTPUTSTREAMADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/outputStreamByteArrayAdapter.hpp b/vmime/utility/outputStreamByteArrayAdapter.hpp +new file mode 100644 +index 0000000..bf7d839 +--- /dev/null ++++ b/vmime/utility/outputStreamByteArrayAdapter.hpp +@@ -0,0 +1,58 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_OUTPUTSTREAMBYTEARRAYADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_OUTPUTSTREAMBYTEARRAYADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/outputStream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An adapter class for byte array output. ++ */ ++ ++class outputStreamByteArrayAdapter : public outputStream ++{ ++public: ++ ++ outputStreamByteArrayAdapter(byteArray& array); ++ ++ void write(const value_type* const data, const size_type count); ++ void flush(); ++ ++private: ++ ++ byteArray& m_array; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_OUTPUTSTREAMBYTEARRAYADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/outputStreamSocketAdapter.hpp b/vmime/utility/outputStreamSocketAdapter.hpp +new file mode 100644 +index 0000000..e3d3eb0 +--- /dev/null ++++ b/vmime/utility/outputStreamSocketAdapter.hpp +@@ -0,0 +1,75 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_OUTPUTSTREAMSOCKETADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_OUTPUTSTREAMSOCKETADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/outputStream.hpp" ++ ++ ++#if VMIME_HAVE_MESSAGING_FEATURES ++ ++ ++namespace vmime { ++namespace net { ++ class socket; // forward reference ++} // net ++} // vmime ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An output stream that is connected to a socket. ++ */ ++ ++class outputStreamSocketAdapter : public outputStream ++{ ++public: ++ ++ outputStreamSocketAdapter(net::socket& sok); ++ ++ void write(const value_type* const data, const size_type count); ++ void flush(); ++ ++ size_type getBlockSize(); ++ ++private: ++ ++ outputStreamSocketAdapter(const outputStreamSocketAdapter&); ++ ++ net::socket& m_socket; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_HAVE_MESSAGING_FEATURES ++ ++ ++#endif // VMIME_UTILITY_OUTPUTSTREAMSOCKETADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/outputStreamStringAdapter.hpp b/vmime/utility/outputStreamStringAdapter.hpp +new file mode 100644 +index 0000000..8c8b304 +--- /dev/null ++++ b/vmime/utility/outputStreamStringAdapter.hpp +@@ -0,0 +1,59 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_OUTPUTSTREAMSTRINGADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_OUTPUTSTREAMSTRINGADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/outputStream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An adapter class for string output. ++ */ ++ ++class outputStreamStringAdapter : public outputStream ++{ ++public: ++ ++ outputStreamStringAdapter(string& buffer); ++ ++ void write(const value_type* const data, const size_type count); ++ void flush(); ++ ++size_type getBlockSize(){return 8192;} ++private: ++ ++ string& m_buffer; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_OUTPUTSTREAMSTRINGADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/stream.hpp b/vmime/utility/stream.hpp +index 1faab55..566ab9d 100644 +--- a/vmime/utility/stream.hpp ++++ b/vmime/utility/stream.hpp +@@ -25,40 +25,22 @@ + #define VMIME_UTILITY_STREAM_HPP_INCLUDED + + +-#include +-#include + #include + + #include "vmime/config.hpp" + #include "vmime/types.hpp" +- +-#include "vmime/utility/progressListener.hpp" +- +- +-#if VMIME_HAVE_MESSAGING_FEATURES +- namespace vmime { +- namespace net { +- class socket; // forward reference +- } // net +- } // vmime +-#endif +- +-#if defined(_MSC_VER) && (_MSC_VER <= 1200) // VC++6 +-# include +-#endif ++#include "vmime/base.hpp" + + + namespace vmime { + namespace utility { + + +-class stringProxy; +- + + /** Base class for input/output stream. + */ + +-class stream : public object ++class stream : public object, private noncopyable + { + public: + +@@ -81,365 +63,6 @@ public: + }; + + +- +-/** Simple output stream. +- */ +- +-class outputStream : public stream +-{ +-public: +- +- /** Write data to the stream. +- * +- * @param data buffer containing data to write +- * @param count number of bytes to write +- */ +- virtual void write(const value_type* const data, const size_type count) = 0; +- +- /** Flush this output stream and forces any buffered output +- * bytes to be written out to the stream. +- */ +- virtual void flush() = 0; +-}; +- +- +- +-/** Simple input stream. +- */ +- +-class inputStream : public stream +-{ +-public: +- +- /** Test for end of stream (no more data to read). +- * +- * @return true if we have reached the end of stream, false otherwise +- */ +- virtual bool eof() const = 0; +- +- /** Set the read pointer to the beginning of the stream. +- * +- * @warning WARNING: this may not work for all stream types. +- */ +- virtual void reset() = 0; +- +- /** Read data from the stream. +- * +- * @param data will receive the data read +- * @param count maximum number of bytes to read +- * @return number of bytes read +- */ +- virtual size_type read(value_type* const data, const size_type count) = 0; +- +- /** Skip a number of bytes. +- * +- * @param count maximum number of bytes to ignore +- * @return number of bytes skipped +- */ +- virtual size_type skip(const size_type count) = 0; +-}; +- +- +- +-// Helpers functions +- +-outputStream& operator<<(outputStream& os, const string& str); +-outputStream& operator<<(outputStream& os, const stream::value_type c); +- +- +-#if defined(_MSC_VER) && (_MSC_VER <= 1200) // Internal compiler error with VC++6 +- +-inline outputStream& operator<<(outputStream& os, const char* str) +-{ +- os.write(str, ::strlen(str)); +- return (os); +-} +- +-#else +- +-template +-outputStream& operator<<(outputStream& os, const char (&str)[N]) +-{ +- os.write(str, N - 1); +- return (os); +-} +- +-#endif // defined(_MSC_VER) && (_MSC_VER <= 1200) +- +- +-template +-outputStream& operator<<(outputStream& os, const T& t) +-{ +- std::ostringstream oss; +- oss.imbue(std::locale::classic()); // no formatting +- +- oss << t; +- +- os << oss.str(); +- +- return (os); +-} +- +- +-/** Copy data from one stream into another stream using a buffered method. +- * +- * @param is input stream (source data) +- * @param os output stream (destination for data) +- * @return number of bytes copied +- */ +- +-stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os); +- +-/** Copy data from one stream into another stream using a buffered method +- * and notify progress state of the operation. +- * +- * @param is input stream (source data) +- * @param os output stream (destination for data) +- * @param length predicted number of bytes to copy +- * @param progress listener to notify +- * @return number of bytes copied +- */ +- +-stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os, +- const stream::size_type length, progressListener* progress); +- +- +-// Adapters +- +- +-/** An adapter class for C++ standard output streams. +- */ +- +-class outputStreamAdapter : public outputStream +-{ +-public: +- +- /** @param os output stream to wrap +- */ +- outputStreamAdapter(std::ostream& os); +- +- void write(const value_type* const data, const size_type count); +- void flush(); +- +-private: +- +- std::ostream& m_stream; +-}; +- +- +-/** An adapter class for string output. +- */ +- +-class outputStreamStringAdapter : public outputStream +-{ +-public: +- +- outputStreamStringAdapter(string& buffer); +- +- void write(const value_type* const data, const size_type count); +- void flush(); +- +-size_type getBlockSize(){return 8192;} +-private: +- +- string& m_buffer; +-}; +- +- +-/** An adapter class for byte array output. +- */ +- +-class outputStreamByteArrayAdapter : public outputStream +-{ +-public: +- +- outputStreamByteArrayAdapter(byteArray& array); +- +- void write(const value_type* const data, const size_type count); +- void flush(); +- +-private: +- +- byteArray& m_array; +-}; +- +- +-/** An adapter class for C++ standard input streams. +- */ +- +-class inputStreamAdapter : public inputStream +-{ +-public: +- +- /** @param is input stream to wrap +- */ +- inputStreamAdapter(std::istream& is); +- +- bool eof() const; +- void reset(); +- size_type read(value_type* const data, const size_type count); +- size_type skip(const size_type count); +- +-private: +- +- std::istream& m_stream; +-}; +- +- +-/** An adapter class for string input. +- */ +- +-class inputStreamStringAdapter : public inputStream +-{ +-public: +- +- inputStreamStringAdapter(const string& buffer); +- inputStreamStringAdapter(const string& buffer, const string::size_type begin, const string::size_type end); +- +- bool eof() const; +- void reset(); +- size_type read(value_type* const data, const size_type count); +- size_type skip(const size_type count); +- +-private: +- +- inputStreamStringAdapter(const inputStreamStringAdapter&); +- +- const string m_buffer; // do _NOT_ keep a reference... +- const string::size_type m_begin; +- const string::size_type m_end; +- string::size_type m_pos; +-}; +- +- +-/** An adapter class for stringProxy input. +- */ +- +-class inputStreamStringProxyAdapter : public inputStream +-{ +-public: +- +- /** @param buffer stringProxy object to wrap +- */ +- inputStreamStringProxyAdapter(const stringProxy& buffer); +- +- bool eof() const; +- void reset(); +- size_type read(value_type* const data, const size_type count); +- size_type skip(const size_type count); +- +-private: +- +- inputStreamStringProxyAdapter(const inputStreamStringProxyAdapter&); +- +- const stringProxy& m_buffer; +- string::size_type m_pos; +-}; +- +- +-/** An adapter class for pointer to C++ standard input stream. +- */ +- +-class inputStreamPointerAdapter : public inputStream +-{ +-public: +- +- /** @param is input stream to wrap +- * @param own if set to 'true', the pointer will be deleted when +- * this object is destroyed +- */ +- inputStreamPointerAdapter(std::istream* is, const bool own = true); +- ~inputStreamPointerAdapter(); +- +- bool eof() const; +- void reset(); +- size_type read(value_type* const data, const size_type count); +- size_type skip(const size_type count); +- +-private: +- +- inputStreamPointerAdapter(const inputStreamPointerAdapter&); +- +- std::istream* m_stream; +- const bool m_own; +-}; +- +- +-/** An adapter class for reading from an array of bytes. +- */ +- +-class inputStreamByteBufferAdapter : public inputStream +-{ +-public: +- +- inputStreamByteBufferAdapter(const byte_t* buffer, size_type length); +- +- bool eof() const; +- void reset(); +- size_type read(value_type* const data, const size_type count); +- size_type skip(const size_type count); +- +-private: +- +- const byte_t* m_buffer; +- const size_type m_length; +- +- size_type m_pos; +-}; +- +- +-#if VMIME_HAVE_MESSAGING_FEATURES +- +- +-/** An output stream that is connected to a socket. +- */ +- +-class outputStreamSocketAdapter : public outputStream +-{ +-public: +- +- outputStreamSocketAdapter(net::socket& sok); +- +- void write(const value_type* const data, const size_type count); +- void flush(); +- +- size_type getBlockSize(); +- +-private: +- +- outputStreamSocketAdapter(const outputStreamSocketAdapter&); +- +- net::socket& m_socket; +-}; +- +- +-/** An input stream that is connected to a socket. +- */ +- +-class inputStreamSocketAdapter : public inputStream +-{ +-public: +- +- inputStreamSocketAdapter(net::socket& sok); +- +- bool eof() const; +- void reset(); +- size_type read(value_type* const data, const size_type count); +- size_type skip(const size_type count); +- +- size_type getBlockSize(); +- +-private: +- +- inputStreamSocketAdapter(const inputStreamSocketAdapter&); +- +- net::socket& m_socket; +-}; +- +- +-#endif // VMIME_HAVE_MESSAGING_FEATURES +- +- + } // utility + } // vmime + +diff --git a/vmime/utility/streamUtils.hpp b/vmime/utility/streamUtils.hpp +new file mode 100644 +index 0000000..cdf70aa +--- /dev/null ++++ b/vmime/utility/streamUtils.hpp +@@ -0,0 +1,66 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_STREAMUTILS_HPP_INCLUDED ++#define VMIME_UTILITY_STREAMUTILS_HPP_INCLUDED ++ ++ ++#include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/outputStream.hpp" ++ ++#include "vmime/utility/progressListener.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** Copy data from one stream into another stream using a buffered method. ++ * ++ * @param is input stream (source data) ++ * @param os output stream (destination for data) ++ * @return number of bytes copied ++ */ ++ ++stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os); ++ ++/** Copy data from one stream into another stream using a buffered method ++ * and notify progress state of the operation. ++ * ++ * @param is input stream (source data) ++ * @param os output stream (destination for data) ++ * @param length predicted number of bytes to copy ++ * @param progress listener to notify ++ * @return number of bytes copied ++ */ ++ ++stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os, ++ const stream::size_type length, progressListener* progress); ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_STREAMUTILS_HPP_INCLUDED ++ +diff --git a/vmime/utility/stringProxy.hpp b/vmime/utility/stringProxy.hpp +index 21c65ea..66a6dfd 100644 +--- a/vmime/utility/stringProxy.hpp ++++ b/vmime/utility/stringProxy.hpp +@@ -29,6 +29,7 @@ + + #include "vmime/types.hpp" + #include "vmime/utility/stream.hpp" ++#include "vmime/utility/outputStream.hpp" + #include "vmime/utility/progressListener.hpp" + + +diff --git a/vmime/vmime.hpp b/vmime/vmime.hpp +index f187b9e..fd04853 100644 +--- a/vmime/vmime.hpp ++++ b/vmime/vmime.hpp +@@ -68,6 +68,22 @@ + // Encoders + #include "vmime/utility/encoder/encoderFactory.hpp" + ++// Streams ++#include "vmime/utility/filteredStream.hpp" ++#include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/inputStreamAdapter.hpp" ++#include "vmime/utility/inputStreamByteBufferAdapter.hpp" ++#include "vmime/utility/inputStreamPointerAdapter.hpp" ++#include "vmime/utility/inputStreamSocketAdapter.hpp" ++#include "vmime/utility/inputStreamStringAdapter.hpp" ++#include "vmime/utility/inputStreamStringProxyAdapter.hpp" ++#include "vmime/utility/outputStream.hpp" ++#include "vmime/utility/outputStreamAdapter.hpp" ++#include "vmime/utility/outputStreamByteArrayAdapter.hpp" ++#include "vmime/utility/outputStreamSocketAdapter.hpp" ++#include "vmime/utility/outputStreamStringAdapter.hpp" ++#include "vmime/utility/streamUtils.hpp" ++ + // Message builder/parser + #include "vmime/messageBuilder.hpp" + #include "vmime/messageParser.hpp" +-- +1.7.10.4 + + +From be30b47f09c5358db2ac8e42fa2bb4a14ec24c51 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Mon, 16 Apr 2012 22:32:33 +0200 +Subject: [PATCH 37/42] Added ability to parse directly from an input stream + (eg. file). This allows very big messages to be + parsed without loading the whole message data into + memory. + + +diff --git a/ChangeLog b/ChangeLog +index 8fdcdb0..1b5b2cf 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -2,6 +2,12 @@ + VERSION 0.9.2svn + ================ + ++2012-04-16 Vincent Richard ++ ++ * MIME Parser can now operate directly on an input stream (eg. file). ++ This allows very big messages to be parsed without loading the whole ++ message data into memory. ++ + 2010-11-16 Vincent Richard + + * Started version 0.9.2. +diff --git a/SConstruct b/SConstruct +index ea5c4eb..2690172 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -153,11 +153,14 @@ libvmime_sources = [ + 'utility/inputStreamSocketAdapter.cpp', 'utility/inputStreamSocketAdapter.hpp', + 'utility/inputStreamStringAdapter.cpp', 'utility/inputStreamStringAdapter.hpp', + 'utility/inputStreamStringProxyAdapter.cpp', 'utility/inputStreamStringProxyAdapter.hpp', ++ 'utility/seekableInputStream.hpp', ++ 'utility/seekableInputStreamRegionAdapter.cpp', 'utility/seekableInputStreamRegionAdapter.hpp', + 'utility/outputStream.cpp', 'utility/outputStream.hpp', + 'utility/outputStreamAdapter.cpp', 'utility/outputStreamAdapter.hpp', + 'utility/outputStreamByteArrayAdapter.cpp', 'utility/outputStreamByteArrayAdapter.hpp', + 'utility/outputStreamSocketAdapter.cpp', 'utility/outputStreamSocketAdapter.hpp', + 'utility/outputStreamStringAdapter.cpp', 'utility/outputStreamStringAdapter.hpp', ++ 'utility/parserInputStreamAdapter.cpp', 'utility/parserInputStreamAdapter.hpp', + 'utility/stringProxy.cpp', 'utility/stringProxy.hpp', + 'utility/stringUtils.cpp', 'utility/stringUtils.hpp', + 'utility/url.cpp', 'utility/url.hpp', +diff --git a/src/addressList.cpp b/src/addressList.cpp +index 31a2a3d..f06460d 100644 +--- a/src/addressList.cpp ++++ b/src/addressList.cpp +@@ -50,7 +50,7 @@ addressList::~addressList() + } + + +-void addressList::parse(const string& buffer, const string::size_type position, ++void addressList::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + removeAllAddresses(); +@@ -72,7 +72,7 @@ void addressList::parse(const string& buffer, const string::size_type position, + } + + +-void addressList::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void addressList::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + string::size_type pos = curLinePos; +@@ -248,9 +248,9 @@ const std::vector > addressList::getAddressList() + } + + +-const std::vector > addressList::getChildComponents() const ++const std::vector > addressList::getChildComponents() + { +- std::vector > list; ++ std::vector > list; + + copy_vector(m_list, list); + +diff --git a/src/body.cpp b/src/body.cpp +index 9d7d57f..732fa8b 100644 +--- a/src/body.cpp ++++ b/src/body.cpp +@@ -31,10 +31,13 @@ + + #include "vmime/utility/random.hpp" + ++#include "vmime/utility/seekableInputStreamRegionAdapter.hpp" ++ + #include "vmime/parserHelpers.hpp" + + #include "vmime/emptyContentHandler.hpp" + #include "vmime/stringContentHandler.hpp" ++#include "vmime/streamContentHandler.hpp" + + + namespace vmime +@@ -52,11 +55,28 @@ body::~body() + } + + +-void body::parse(const string& buffer, const string::size_type position, +- const string::size_type end, string::size_type* newPosition) ++void body::parseImpl ++ (ref parser, ++ const utility::stream::size_type position, ++ const utility::stream::size_type end, ++ utility::stream::size_type* newPosition) + { + removeAllParts(); + ++ m_prologText.clear(); ++ m_epilogText.clear(); ++ ++ if (end == position) ++ { ++ ++ setParsedBounds(position, end); ++ ++ if (newPosition) ++ *newPosition = end; ++ ++ return; ++ } ++ + // Check whether the body is a MIME-multipart + bool isMultipart = false; + string boundary; +@@ -80,37 +100,61 @@ void body::parse(const string& buffer, const string::size_type position, + { + // No "boundary" parameter specified: we can try to + // guess it by scanning the body contents... +- string::size_type pos = buffer.find("\n--", position); ++ utility::stream::size_type pos = position; ++ ++ parser->seek(pos); ++ ++ if (pos + 2 < end && parser->matchBytes("--", 2)) ++ { ++ pos += 2; ++ } ++ else ++ { ++ pos = parser->findNext("\n--", position); + +- if ((pos != string::npos) && (pos < end)) ++ if ((pos != utility::stream::npos) && (pos + 3 < end)) ++ pos += 3; // skip \n-- ++ } ++ ++ if ((pos != utility::stream::npos) && (pos < end)) + { +- pos += 3; ++ parser->seek(pos); + +- const string::size_type start = pos; ++ // Read some bytes after boundary separator ++ utility::stream::value_type buffer[256]; ++ const utility::stream::size_type bufferLen = ++ parser->read(buffer, std::min(end - pos, sizeof(buffer) / sizeof(buffer[0]))); + +- char_t c = buffer[pos]; +- string::size_type length = 0; ++ buffer[sizeof(buffer) / sizeof(buffer[0]) - 1] = '\0'; + ++ // Extract boundary from buffer (stop at first CR or LF). + // We have to stop after a reasonnably long boundary length (100) + // not to take the whole body contents for a boundary... +- while (pos < end && length < 100 && !(c == '\r' || c == '\n')) ++ string::value_type boundaryBytes[100]; ++ string::size_type boundaryLen = 0; ++ ++ for (string::value_type c = buffer[0] ; ++ boundaryLen < bufferLen && boundaryLen < 100 && !(c == '\r' || c == '\n') ; ++ c = buffer[++boundaryLen]) + { +- ++length; +- c = buffer[pos++]; ++ boundaryBytes[boundaryLen] = buffer[boundaryLen]; + } + +- if (pos < end && length < 100) ++ if (boundaryLen >= 1 && boundaryLen < 100) + { + // RFC #1521, Page 31: + // "...the boundary parameter, which consists of 1 to 70 + // characters from a set of characters known to be very + // robust through email gateways, and NOT ending with + // white space..." +- while (pos != start && parserHelpers::isSpace(buffer[pos - 1])) +- --pos; +- +- boundary = string(buffer.begin() + start, +- buffer.begin() + pos); ++ while (boundaryLen != 0 && ++ parserHelpers::isSpace(boundaryBytes[boundaryLen - 1])) ++ { ++ boundaryLen--; ++ } ++ ++ if (boundaryLen >= 1) ++ boundary = string(boundaryBytes, boundaryBytes + boundaryLen); + } + } + } +@@ -126,51 +170,79 @@ void body::parse(const string& buffer, const string::size_type position, + { + const string boundarySep("--" + boundary); + +- string::size_type partStart = position; +- string::size_type pos = position; ++ utility::stream::size_type partStart = position; ++ utility::stream::size_type pos = position; + + bool lastPart = false; + +- while (pos != string::npos && pos < end) ++ while (pos != utility::stream::npos && pos < end) + { +- pos = buffer.find(boundarySep, pos); +- +- if (pos == string::npos || +- ((pos == 0 || buffer[pos - 1] == '\n') && +- (buffer[pos + boundarySep.length()] == '\r' || +- buffer[pos + boundarySep.length()] == '\n' || +- buffer[pos + boundarySep.length()] == '-' +- ) +- ) +- ) ++ pos = parser->findNext(boundarySep, pos); ++ ++ if (pos == utility::stream::npos) ++ break; // not found ++ ++ if (pos != 0) + { +- break; ++ parser->seek(pos - 1); ++ ++ if (parser->peekByte() != '\n') ++ { ++ // Boundary is not at a beginning of a line ++ pos++; ++ continue; ++ } ++ ++ parser->skip(1 + boundarySep.length()); ++ } ++ else ++ { ++ parser->seek(pos + boundarySep.length()); + } + +- // boundary not a beginning of line, or just a prefix of another, continue the search. ++ const utility::stream::value_type next = parser->peekByte(); ++ ++ if (next == '\r' || next == '\n' || next == '-') ++ break; ++ ++ // Boundary is a prefix of another, continue the search + pos++; + } + +- if (pos != string::npos && pos < end) ++ if (pos != utility::stream::npos && pos < end) + { + vmime::text text; +- text.parse(buffer, position, pos); ++ text.parse(parser, position, pos); + + m_prologText = text.getWholeBuffer(); + } + +- for (int index = 0 ; !lastPart && (pos != string::npos) && (pos < end) ; ++index) ++ for (int index = 0 ; !lastPart && (pos != utility::stream::npos) && (pos < end) ; ++index) + { +- string::size_type partEnd = pos; ++ utility::stream::size_type partEnd = pos; + + // Get rid of the [CR]LF just before the boundary string +- if (pos >= (position + 1) && buffer[pos - 1] == '\n') --partEnd; +- if (pos >= (position + 2) && buffer[pos - 2] == '\r') --partEnd; ++ if (pos >= (position + 1)) ++ { ++ parser->seek(pos - 1); ++ ++ if (parser->peekByte() == '\n') ++ --partEnd; ++ } ++ ++ if (pos >= (position + 2)) ++ { ++ parser->seek(pos - 2); ++ ++ if (parser->peekByte() == '\r') ++ --partEnd; ++ } + + // Check whether it is the last part (boundary terminated by "--") + pos += boundarySep.length(); ++ parser->seek(pos); + +- if (pos + 1 < end && buffer[pos] == '-' && buffer[pos + 1] == '-') ++ if (pos + 1 < end && parser->matchBytes("--", 2)) + { + lastPart = true; + pos += 2; +@@ -180,15 +252,15 @@ void body::parse(const string& buffer, const string::size_type position, + // "...(If a boundary appears to end with white space, the + // white space must be presumed to have been added by a + // gateway, and must be deleted.)..." +- while (pos < end && (buffer[pos] == ' ' || buffer[pos] == '\t')) +- ++pos; ++ parser->seek(pos); ++ pos += parser->skipIf(parserHelpers::isSpaceOrTab, end); + + // End of boundary line +- if (pos + 1 < end && buffer[pos] == '\r' && buffer[pos + 1] =='\n') ++ if (pos + 1 < end && parser->matchBytes("\r\n", 2)) + { + pos += 2; + } +- else if (pos < end && buffer[pos] == '\n') ++ else if (pos < end && parser->peekByte() == '\n') + { + ++pos; + } +@@ -202,7 +274,7 @@ void body::parse(const string& buffer, const string::size_type position, + if (partEnd < partStart) + std::swap(partStart, partEnd); + +- part->parse(buffer, partStart, partEnd, NULL); ++ part->parse(parser, partStart, partEnd, NULL); + part->m_parent = m_part; + + m_parts.push_back(part); +@@ -210,23 +282,37 @@ void body::parse(const string& buffer, const string::size_type position, + + partStart = pos; + +- while (pos != string::npos && pos < end) ++ while (pos != utility::stream::npos && pos < end) + { +- pos = buffer.find(boundarySep, pos); +- +- if (pos == string::npos || +- ((pos == 0 || buffer[pos - 1] == '\n') && +- (buffer[pos + boundarySep.length()] == '\r' || +- buffer[pos + boundarySep.length()] == '\n' || +- buffer[pos + boundarySep.length()] == '-' +- ) +- ) +- ) ++ pos = parser->findNext(boundarySep, pos); ++ ++ if (pos == utility::stream::npos) ++ break; // not found ++ ++ if (pos != 0) + { +- break; ++ parser->seek(pos - 1); ++ ++ if (parser->peekByte() != '\n') ++ { ++ // Boundary is not at a beginning of a line ++ pos++; ++ continue; ++ } ++ ++ parser->skip(1 + boundarySep.length()); ++ } ++ else ++ { ++ parser->seek(pos + boundarySep.length()); + } + +- // boundary not a beginning of line, or just a prefix of another, continue the search. ++ const utility::stream::value_type next = parser->peekByte(); ++ ++ if (next == '\r' || next == '\n' || next == '-') ++ break; ++ ++ // Boundary is a prefix of another, continue the search + pos++; + } + } +@@ -234,13 +320,13 @@ void body::parse(const string& buffer, const string::size_type position, + m_contents = vmime::create (); + + // Last part was not found: recover from missing boundary +- if (!lastPart && pos == string::npos) ++ if (!lastPart && pos == utility::stream::npos) + { + ref part = vmime::create (); + + try + { +- part->parse(buffer, partStart, end); ++ part->parse(parser, partStart, end); + } + catch (std::exception&) + { +@@ -255,7 +341,7 @@ void body::parse(const string& buffer, const string::size_type position, + else if (partStart < end) + { + vmime::text text; +- text.parse(buffer, partStart, end); ++ text.parse(parser, partStart, end); + + m_epilogText = text.getWholeBuffer(); + } +@@ -282,7 +368,13 @@ void body::parse(const string& buffer, const string::size_type position, + } + + // Extract the (encoded) contents +- m_contents = vmime::create (buffer, position, end, enc); ++ const utility::stream::size_type length = end - position; ++ ++ ref contentStream = ++ vmime::create ++ (parser->getUnderlyingStream(), position, length); ++ ++ m_contents = vmime::create (contentStream, length, enc); + } + + setParsedBounds(position, end); +@@ -292,7 +384,7 @@ void body::parse(const string& buffer, const string::size_type position, + } + + +-void body::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void body::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type /* curLinePos */, string::size_type* newLinePos) const + { + // MIME-Multipart +@@ -862,9 +954,9 @@ const std::vector > body::getPartList() + } + + +-const std::vector > body::getChildComponents() const ++const std::vector > body::getChildComponents() + { +- std::vector > list; ++ std::vector > list; + + copy_vector(m_parts, list); + +diff --git a/src/bodyPart.cpp b/src/bodyPart.cpp +index 7d60461..522cbb2 100644 +--- a/src/bodyPart.cpp ++++ b/src/bodyPart.cpp +@@ -46,15 +46,18 @@ bodyPart::bodyPart(weak_ref parentPart) + } + + +-void bodyPart::parse(const string& buffer, const string::size_type position, +- const string::size_type end, string::size_type* newPosition) ++void bodyPart::parseImpl ++ (ref parser, ++ const utility::stream::size_type position, ++ const utility::stream::size_type end, ++ utility::stream::size_type* newPosition) + { + // Parse the headers + string::size_type pos = position; +- m_header->parse(buffer, pos, end, &pos); ++ m_header->parse(parser, pos, end, &pos); + + // Parse the body contents +- m_body->parse(buffer, pos, end, NULL); ++ m_body->parse(parser, pos, end, NULL); + + setParsedBounds(position, end); + +@@ -63,7 +66,7 @@ void bodyPart::parse(const string& buffer, const string::size_type position, + } + + +-void bodyPart::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void bodyPart::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type /* curLinePos */, string::size_type* newLinePos) const + { + m_header->generate(os, maxLineLength); +@@ -142,9 +145,9 @@ ref bodyPart::getParentPart() const + } + + +-const std::vector > bodyPart::getChildComponents() const ++const std::vector > bodyPart::getChildComponents() + { +- std::vector > list; ++ std::vector > list; + + list.push_back(m_header); + list.push_back(m_body); +diff --git a/src/charset.cpp b/src/charset.cpp +index 0fda450..705664f 100644 +--- a/src/charset.cpp ++++ b/src/charset.cpp +@@ -57,7 +57,7 @@ charset::charset(const char* name) + } + + +-void charset::parse(const string& buffer, const string::size_type position, ++void charset::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + m_name = utility::stringUtils::trim +@@ -74,7 +74,7 @@ void charset::parse(const string& buffer, const string::size_type position, + } + + +-void charset::generate(utility::outputStream& os, const string::size_type /* maxLineLength */, ++void charset::generateImpl(utility::outputStream& os, const string::size_type /* maxLineLength */, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + os << m_name; +@@ -142,9 +142,9 @@ void charset::copyFrom(const component& other) + } + + +-const std::vector > charset::getChildComponents() const ++const std::vector > charset::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +diff --git a/src/component.cpp b/src/component.cpp +index 139cf66..e93aacf 100644 +--- a/src/component.cpp ++++ b/src/component.cpp +@@ -23,6 +23,9 @@ + + #include "vmime/component.hpp" + #include "vmime/base.hpp" ++ ++#include "vmime/utility/streamUtils.hpp" ++#include "vmime/utility/inputStreamStringAdapter.hpp" + #include "vmime/utility/outputStreamAdapter.hpp" + + #include +@@ -43,9 +46,102 @@ component::~component() + } + + ++void component::parse ++ (ref inputStream, const utility::stream::size_type length) ++{ ++ parse(inputStream, 0, length, NULL); ++} ++ ++ ++void component::parse ++ (ref inputStream, const utility::stream::size_type position, ++ const utility::stream::size_type end, utility::stream::size_type* newPosition) ++{ ++ m_parsedOffset = m_parsedLength = 0; ++ ++ ref seekableStream = ++ inputStream.dynamicCast (); ++ ++ if (seekableStream == NULL || end == 0) ++ { ++ // Read the whole stream into a buffer ++ std::ostringstream oss; ++ utility::outputStreamAdapter ossAdapter(oss); ++ ++ utility::bufferedStreamCopyRange(*inputStream, ossAdapter, position, end - position); ++ ++ const string buffer = oss.str(); ++ parseImpl(buffer, 0, buffer.length(), NULL); ++ } ++ else ++ { ++ ref parser = ++ vmime::create (seekableStream); ++ ++ parseImpl(parser, position, end, newPosition); ++ } ++} ++ ++ + void component::parse(const string& buffer) + { +- parse(buffer, 0, buffer.length(), NULL); ++ m_parsedOffset = m_parsedLength = 0; ++ ++ parseImpl(buffer, 0, buffer.length(), NULL); ++} ++ ++ ++void component::parse ++ (const string& buffer, const string::size_type position, ++ const string::size_type end, string::size_type* newPosition) ++{ ++ m_parsedOffset = m_parsedLength = 0; ++ ++ parseImpl(buffer, position, end, newPosition); ++} ++ ++ ++void component::offsetParsedBounds(const utility::stream::size_type offset) ++{ ++ // Offset parsed bounds of this component ++ if (m_parsedLength != 0) ++ m_parsedOffset += offset; ++ ++ // Offset parsed bounds of our children ++ std::vector > children = getChildComponents(); ++ ++ for (unsigned int i = 0, n = children.size() ; i < n ; ++i) ++ children[i]->offsetParsedBounds(offset); ++} ++ ++ ++void component::parseImpl ++ (ref parser, const utility::stream::size_type position, ++ const utility::stream::size_type end, utility::stream::size_type* newPosition) ++{ ++ const std::string buffer = parser->extract(position, end); ++ parseImpl(buffer, 0, buffer.length(), newPosition); ++ ++ // Recursivey offset parsed bounds on children ++ if (position != 0) ++ offsetParsedBounds(position); ++ ++ if (newPosition != NULL) ++ *newPosition += position; ++} ++ ++ ++void component::parseImpl ++ (const string& buffer, const string::size_type position, ++ const string::size_type end, string::size_type* newPosition) ++{ ++ ref stream = ++ vmime::create (buffer); ++ ++ ref parser = ++ vmime::create (stream); ++ ++ parseImpl(parser, position, end, newPosition); + } + + +@@ -61,6 +157,26 @@ const string component::generate(const string::size_type maxLineLength, + } + + ++void component::generate ++ (utility::outputStream& os, ++ const string::size_type maxLineLength, ++ const string::size_type curLinePos, ++ string::size_type* newLinePos) const ++{ ++ generateImpl(os, maxLineLength, curLinePos, newLinePos); ++} ++ ++ ++void component::generate ++ (ref os, ++ const string::size_type maxLineLength, ++ const string::size_type curLinePos, ++ string::size_type* newLinePos) const ++{ ++ generateImpl(*os, maxLineLength, curLinePos, newLinePos); ++} ++ ++ + string::size_type component::getParsedOffset() const + { + return (m_parsedOffset); +@@ -80,22 +196,5 @@ void component::setParsedBounds(const string::size_type start, const string::siz + } + + +-const std::vector > component::getChildComponents() +-{ +- const std::vector > constList = +- const_cast (this)->getChildComponents(); +- +- std::vector > list; +- +- const std::vector >::size_type count = constList.size(); ++} // vmime + +- list.resize(count); +- +- for (std::vector >::size_type i = 0 ; i < count ; ++i) +- list[i] = constList[i].constCast (); +- +- return (list); +-} +- +- +-} +diff --git a/src/contentDisposition.cpp b/src/contentDisposition.cpp +index 0ab7c45..253dbba 100644 +--- a/src/contentDisposition.cpp ++++ b/src/contentDisposition.cpp +@@ -47,7 +47,7 @@ contentDisposition::contentDisposition(const contentDisposition& type) + } + + +-void contentDisposition::parse(const string& buffer, const string::size_type position, ++void contentDisposition::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + m_name = utility::stringUtils::trim(utility::stringUtils::toLower +@@ -60,7 +60,7 @@ void contentDisposition::parse(const string& buffer, const string::size_type pos + } + + +-void contentDisposition::generate(utility::outputStream& os, const string::size_type /* maxLineLength */, ++void contentDisposition::generateImpl(utility::outputStream& os, const string::size_type /* maxLineLength */, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + os << m_name; +@@ -122,9 +122,9 @@ void contentDisposition::setName(const string& name) + } + + +-const std::vector > contentDisposition::getChildComponents() const ++const std::vector > contentDisposition::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +diff --git a/src/dateTime.cpp b/src/dateTime.cpp +index 089a900..0d97b2f 100644 +--- a/src/dateTime.cpp ++++ b/src/dateTime.cpp +@@ -67,7 +67,7 @@ zone = "UT" / "GMT" ; Universal Time + */ + + +-void datetime::parse(const string& buffer, const string::size_type position, ++void datetime::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + const string::value_type* const pend = buffer.data() + end; +@@ -588,7 +588,7 @@ void datetime::parse(const string& buffer, const string::size_type position, + } + + +-void datetime::generate(utility::outputStream& os, const string::size_type /* maxLineLength */, ++void datetime::generateImpl(utility::outputStream& os, const string::size_type /* maxLineLength */, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + static const string::value_type* dayNames[] = +@@ -784,9 +784,9 @@ ref datetime::clone() const + } + + +-const std::vector > datetime::getChildComponents() const ++const std::vector > datetime::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +diff --git a/src/disposition.cpp b/src/disposition.cpp +index b8059a7..24a4579 100644 +--- a/src/disposition.cpp ++++ b/src/disposition.cpp +@@ -79,9 +79,9 @@ disposition& disposition::operator=(const disposition& other) + } + + +-const std::vector > disposition::getChildComponents() const ++const std::vector > disposition::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +@@ -171,7 +171,7 @@ const std::vector disposition::getModifierList() const + } + + +-void disposition::parse(const string& buffer, const string::size_type position, ++void disposition::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + // disposition-mode ";" disposition-type +@@ -276,7 +276,7 @@ void disposition::parse(const string& buffer, const string::size_type position, + } + + +-void disposition::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void disposition::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + string::size_type pos = curLinePos; +diff --git a/src/encoding.cpp b/src/encoding.cpp +index 5d99ab6..343a822 100644 +--- a/src/encoding.cpp ++++ b/src/encoding.cpp +@@ -61,7 +61,7 @@ encoding::encoding(const encoding& enc) + } + + +-void encoding::parse(const string& buffer, const string::size_type position, ++void encoding::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + m_usage = USAGE_UNKNOWN; +@@ -80,7 +80,7 @@ void encoding::parse(const string& buffer, const string::size_type position, + } + + +-void encoding::generate(utility::outputStream& os, const string::size_type /* maxLineLength */, ++void encoding::generateImpl(utility::outputStream& os, const string::size_type /* maxLineLength */, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + os << m_name; +@@ -268,9 +268,9 @@ void encoding::setUsage(const EncodingUsage usage) + } + + +-const std::vector > encoding::getChildComponents() const ++const std::vector > encoding::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +diff --git a/src/header.cpp b/src/header.cpp +index 443aab8..fcdca2c 100644 +--- a/src/header.cpp ++++ b/src/header.cpp +@@ -61,7 +61,7 @@ field-body-contents = + specials tokens, or else consisting of texts> + */ + +-void header::parse(const string& buffer, const string::size_type position, ++void header::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + string::size_type pos = position; +@@ -83,7 +83,7 @@ void header::parse(const string& buffer, const string::size_type position, + } + + +-void header::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void header::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type /* curLinePos */, string::size_type* newLinePos) const + { + // Generate the fields +@@ -337,9 +337,9 @@ const std::vector > header::getFieldList() + } + + +-const std::vector > header::getChildComponents() const ++const std::vector > header::getChildComponents() + { +- std::vector > list; ++ std::vector > list; + + copy_vector(m_fields, list); + +diff --git a/src/headerField.cpp b/src/headerField.cpp +index d1d4236..a8460aa 100644 +--- a/src/headerField.cpp ++++ b/src/headerField.cpp +@@ -262,14 +262,14 @@ ref headerField::parseNext(const string& buffer, const string::siz + } + + +-void headerField::parse(const string& buffer, const string::size_type position, const string::size_type end, ++void headerField::parseImpl(const string& buffer, const string::size_type position, const string::size_type end, + string::size_type* newPosition) + { + m_value->parse(buffer, position, end, newPosition); + } + + +-void headerField::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void headerField::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + os << m_name + ": "; +@@ -296,9 +296,9 @@ bool headerField::isCustom() const + } + + +-const std::vector > headerField::getChildComponents() const ++const std::vector > headerField::getChildComponents() + { +- std::vector > list; ++ std::vector > list; + + if (m_value) + list.push_back(m_value); +diff --git a/src/mailbox.cpp b/src/mailbox.cpp +index fea7479..dfdccad 100644 +--- a/src/mailbox.cpp ++++ b/src/mailbox.cpp +@@ -65,7 +65,7 @@ angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr + + */ + +-void mailbox::parse(const string& buffer, const string::size_type position, ++void mailbox::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + const string::value_type* const pend = buffer.data() + end; +@@ -343,7 +343,7 @@ void mailbox::parse(const string& buffer, const string::size_type position, + } + + +-void mailbox::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void mailbox::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + if (m_name.isEmpty()) +@@ -514,9 +514,9 @@ void mailbox::setEmail(const string& email) + } + + +-const std::vector > mailbox::getChildComponents() const ++const std::vector > mailbox::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +diff --git a/src/mailboxGroup.cpp b/src/mailboxGroup.cpp +index 94f7ba6..c37444a 100644 +--- a/src/mailboxGroup.cpp ++++ b/src/mailboxGroup.cpp +@@ -54,7 +54,7 @@ mailboxGroup::~mailboxGroup() + } + + +-void mailboxGroup::parse(const string& buffer, const string::size_type position, ++void mailboxGroup::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + const string::value_type* const pend = buffer.data() + end; +@@ -111,7 +111,7 @@ void mailboxGroup::parse(const string& buffer, const string::size_type position, + } + + +-void mailboxGroup::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void mailboxGroup::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + // We have to encode the name: +@@ -348,9 +348,9 @@ const std::vector > mailboxGroup::getMailboxList() + } + + +-const std::vector > mailboxGroup::getChildComponents() const ++const std::vector > mailboxGroup::getChildComponents() + { +- std::vector > list; ++ std::vector > list; + + copy_vector(m_list, list); + +diff --git a/src/mailboxList.cpp b/src/mailboxList.cpp +index 0023d9d..f87fb48 100644 +--- a/src/mailboxList.cpp ++++ b/src/mailboxList.cpp +@@ -190,20 +190,20 @@ mailboxList& mailboxList::operator=(const mailboxList& other) + } + + +-const std::vector > mailboxList::getChildComponents() const ++const std::vector > mailboxList::getChildComponents() + { + return (m_list.getChildComponents()); + } + + +-void mailboxList::parse(const string& buffer, const string::size_type position, ++void mailboxList::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + m_list.parse(buffer, position, end, newPosition); + } + + +-void mailboxList::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void mailboxList::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + m_list.generate(os, maxLineLength, curLinePos, newLinePos); +diff --git a/src/mediaType.cpp b/src/mediaType.cpp +index 725f933..627b276 100644 +--- a/src/mediaType.cpp ++++ b/src/mediaType.cpp +@@ -48,7 +48,7 @@ mediaType::mediaType(const string& type, const string& subType) + } + + +-void mediaType::parse(const string& buffer, const string::size_type position, ++void mediaType::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + const string::value_type* const pend = buffer.data() + end; +@@ -82,7 +82,7 @@ void mediaType::parse(const string& buffer, const string::size_type position, + } + + +-void mediaType::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void mediaType::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + const string value = m_type + "/" + m_subType; +@@ -176,9 +176,9 @@ void mediaType::setFromString(const string& type) + } + + +-const std::vector > mediaType::getChildComponents() const ++const std::vector > mediaType::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +diff --git a/src/message.cpp b/src/message.cpp +index 1b4f086..3fa9b6a 100644 +--- a/src/message.cpp ++++ b/src/message.cpp +@@ -61,9 +61,14 @@ const string message::generate(const string::size_type maxLineLength, + } + + +-void message::parse(const string& buffer) ++ ++void message::generate ++ (ref os, ++ const string::size_type maxLineLength, ++ const string::size_type curLinePos, ++ string::size_type* newLinePos) const + { +- bodyPart::parse(buffer); ++ bodyPart::generate(os, maxLineLength, curLinePos, newLinePos); + } + + +diff --git a/src/messageId.cpp b/src/messageId.cpp +index 961fb63..1f4b186 100644 +--- a/src/messageId.cpp ++++ b/src/messageId.cpp +@@ -61,7 +61,7 @@ messageId::messageId(const string& left, const string& right) + msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS] + */ + +-void messageId::parse(const string& buffer, const string::size_type position, ++void messageId::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + const string::value_type* const pend = buffer.data() + end; +@@ -185,7 +185,7 @@ const string messageId::getId() const + } + + +-void messageId::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void messageId::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + string::size_type pos = curLinePos; +@@ -288,9 +288,9 @@ void messageId::setRight(const string& right) + } + + +-const std::vector > messageId::getChildComponents() const ++const std::vector > messageId::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +diff --git a/src/messageIdSequence.cpp b/src/messageIdSequence.cpp +index 08103d0..0a5c9a0 100644 +--- a/src/messageIdSequence.cpp ++++ b/src/messageIdSequence.cpp +@@ -74,9 +74,9 @@ messageIdSequence& messageIdSequence::operator=(const messageIdSequence& other) + } + + +-const std::vector > messageIdSequence::getChildComponents() const ++const std::vector > messageIdSequence::getChildComponents() + { +- std::vector > res; ++ std::vector > res; + + copy_vector(m_list, res); + +@@ -84,7 +84,7 @@ const std::vector > messageIdSequence::getChildComponents + } + + +-void messageIdSequence::parse(const string& buffer, const string::size_type position, ++void messageIdSequence::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + removeAllMessageIds(); +@@ -106,7 +106,7 @@ void messageIdSequence::parse(const string& buffer, const string::size_type posi + } + + +-void messageIdSequence::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void messageIdSequence::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + string::size_type pos = curLinePos; +diff --git a/src/parameter.cpp b/src/parameter.cpp +index ccbe1a5..58d9a3e 100644 +--- a/src/parameter.cpp ++++ b/src/parameter.cpp +@@ -36,19 +36,19 @@ namespace vmime + + + parameter::parameter(const string& name) +- : m_name(name) ++ : m_name(name), m_value(vmime::create ()) + { + } + + + parameter::parameter(const string& name, const word& value) +- : m_name(name), m_value(value) ++ : m_name(name), m_value(vmime::create (value)) + { + } + + + parameter::parameter(const string& name, const string& value) +- : m_name(name), m_value(value) ++ : m_name(name), m_value(vmime::create (value)) + { + } + +@@ -73,7 +73,7 @@ void parameter::copyFrom(const component& other) + const parameter& param = dynamic_cast (other); + + m_name = param.m_name; +- m_value.copyFrom(param.m_value); ++ m_value->copyFrom(*param.m_value); + } + + +@@ -92,7 +92,7 @@ const string& parameter::getName() const + + const word& parameter::getValue() const + { +- return m_value; ++ return *m_value; + } + + +@@ -109,15 +109,15 @@ void parameter::setValue(const component& value) + + void parameter::setValue(const word& value) + { +- m_value = value; ++ *m_value = value; + } + + +-void parameter::parse(const string& buffer, const string::size_type position, ++void parameter::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { +- m_value.setBuffer(string(buffer.begin() + position, buffer.begin() + end)); +- m_value.setCharset(charset(charsets::US_ASCII)); ++ m_value->setBuffer(string(buffer.begin() + position, buffer.begin() + end)); ++ m_value->setCharset(charset(charsets::US_ASCII)); + + if (newPosition) + *newPosition = end; +@@ -248,16 +248,16 @@ void parameter::parse(const std::vector & chunks) + } + } + +- m_value.setBuffer(value.str()); +- m_value.setCharset(ch); ++ m_value->setBuffer(value.str()); ++ m_value->setCharset(ch); + } + + +-void parameter::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void parameter::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + const string& name = m_name; +- const string& value = m_value.getBuffer(); ++ const string& value = m_value->getBuffer(); + + // For compatibility with implementations that do not understand RFC-2231, + // also generate a normal "7bit/us-ascii" parameter +@@ -344,7 +344,7 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL + // 7-bit (ASCII) bytes in the input will be used to determine if + // we need to encode the whole buffer. + encoding recommendedEnc; +- const bool alwaysEncode = m_value.getCharset().getRecommendedEncoding(recommendedEnc); ++ const bool alwaysEncode = m_value->getCharset().getRecommendedEncoding(recommendedEnc); + bool extended = alwaysEncode; + + if (needQuotedPrintable) +@@ -352,7 +352,7 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL + // Send the name in quoted-printable, so outlook express et.al. + // will understand the real filename + size_t oldLen = sevenBitBuffer.length(); +- m_value.generate(sevenBitStream); ++ m_value->generate(sevenBitStream); + pos += sevenBitBuffer.length() - oldLen; + extended = true; // also send with RFC-2231 encoding + } +@@ -429,7 +429,7 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL + // + at least 5 characters for the value + const string::size_type firstSectionLength = + name.length() + 4 /* *0*= */ + 2 /* '' */ +- + m_value.getCharset().getName().length(); ++ + m_value->getCharset().getName().length(); + + if (pos + firstSectionLength + 5 >= maxLineLength) + { +@@ -539,7 +539,7 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL + + if (sectionNumber == 0) + { +- os << m_value.getCharset().getName(); ++ os << m_value->getCharset().getName(); + os << '\'' << /* No language */ '\''; + } + +@@ -570,11 +570,11 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL + } + + +-const std::vector > parameter::getChildComponents() const ++const std::vector > parameter::getChildComponents() + { +- std::vector > list; ++ std::vector > list; + +- list.push_back(ref ::fromPtr(&m_value)); ++ list.push_back(m_value); + + return list; + } +diff --git a/src/parameterizedHeaderField.cpp b/src/parameterizedHeaderField.cpp +index 464990e..756d02f 100644 +--- a/src/parameterizedHeaderField.cpp ++++ b/src/parameterizedHeaderField.cpp +@@ -78,7 +78,7 @@ struct paramInfo + #endif // VMIME_BUILDING_DOC + + +-void parameterizedHeaderField::parse(const string& buffer, const string::size_type position, ++void parameterizedHeaderField::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + const string::value_type* const pend = buffer.data() + end; +@@ -328,13 +328,13 @@ void parameterizedHeaderField::parse(const string& buffer, const string::size_ty + } + + +-void parameterizedHeaderField::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void parameterizedHeaderField::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + string::size_type pos = curLinePos; + + // Parent header field +- headerField::generate(os, maxLineLength, pos, &pos); ++ headerField::generateImpl(os, maxLineLength, pos, &pos); + + // Parameters + for (std::vector >::const_iterator +@@ -552,11 +552,11 @@ const std::vector > parameterizedHeaderField::getParameterList( + } + + +-const std::vector > parameterizedHeaderField::getChildComponents() const ++const std::vector > parameterizedHeaderField::getChildComponents() + { +- std::vector > list = headerField::getChildComponents(); ++ std::vector > list = headerField::getChildComponents(); + +- for (std::vector >::const_iterator it = m_params.begin() ; ++ for (std::vector >::iterator it = m_params.begin() ; + it != m_params.end() ; ++it) + { + list.push_back(*it); +diff --git a/src/path.cpp b/src/path.cpp +index 37a4090..d92bb0a 100644 +--- a/src/path.cpp ++++ b/src/path.cpp +@@ -106,14 +106,14 @@ path& path::operator=(const path& other) + } + + +-const std::vector > path::getChildComponents() const ++const std::vector > path::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +-void path::parse(const string& buffer, const string::size_type position, +- const string::size_type end, string::size_type* newPosition) ++void path::parseImpl(const string& buffer, const string::size_type position, ++ const string::size_type end, string::size_type* newPosition) + { + string::size_type pos = position; + +@@ -165,8 +165,8 @@ void path::parse(const string& buffer, const string::size_type position, + } + + +-void path::generate(utility::outputStream& os, const string::size_type /* maxLineLength */, +- const string::size_type curLinePos, string::size_type* newLinePos) const ++void path::generateImpl(utility::outputStream& os, const string::size_type /* maxLineLength */, ++ const string::size_type curLinePos, string::size_type* newLinePos) const + { + if (m_localPart.empty() && m_domain.empty()) + { +diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp +index ec529eb..4087a21 100644 +--- a/src/platforms/posix/posixFile.cpp ++++ b/src/platforms/posix/posixFile.cpp +@@ -224,6 +224,26 @@ vmime::utility::stream::size_type posixFileReaderInputStream::skip(const size_ty + } + + ++vmime::utility::stream::size_type posixFileReaderInputStream::getPosition() const ++{ ++ const off_t curPos = ::lseek(m_fd, 0, SEEK_CUR); ++ ++ if (curPos == off_t(-1)) ++ posixFileSystemFactory::reportError(m_path, errno); ++ ++ return static_cast (curPos); ++} ++ ++ ++void posixFileReaderInputStream::seek(const size_type pos) ++{ ++ const off_t newPos = ::lseek(m_fd, pos, SEEK_SET); ++ ++ if (newPos == off_t(-1)) ++ posixFileSystemFactory::reportError(m_path, errno); ++} ++ ++ + + // + // posixFileWriter +diff --git a/src/platforms/windows/windowsFile.cpp b/src/platforms/windows/windowsFile.cpp +index 624612a..5da786e 100644 +--- a/src/platforms/windows/windowsFile.cpp ++++ b/src/platforms/windows/windowsFile.cpp +@@ -479,6 +479,24 @@ vmime::utility::stream::size_type windowsFileReaderInputStream::skip(const size_ + return (dwNewPos - dwCurPos); + } + ++vmime::utility::stream::size_type windowsFileReaderInputStream::getPosition() const ++{ ++ DWORD dwCurPos = SetFilePointer(m_hFile, 0, NULL, FILE_CURRENT); ++ ++ if (dwCurPos == INVALID_SET_FILE_POINTER) ++ windowsFileSystemFactory::reportError(m_path, GetLastError()); ++ ++ return static_cast (dwCurPos); ++} ++ ++void windowsFileReaderInputStream::seek(const size_type pos) ++{ ++ DWORD dwNewPos = SetFilePointer(m_hFile, (LONG)pos, NULL, FILE_BEGIN); ++ ++ if (dwNewPos == INVALID_SET_FILE_POINTER) ++ windowsFileSystemFactory::reportError(m_path, GetLastError()); ++} ++ + windowsFileWriter::windowsFileWriter(const vmime::utility::file::path& path, const vmime::string& nativePath) + : m_path(path), m_nativePath(nativePath) + { +diff --git a/src/relay.cpp b/src/relay.cpp +index 5cd454f..97f793d 100644 +--- a/src/relay.cpp ++++ b/src/relay.cpp +@@ -57,7 +57,7 @@ relay::relay(const relay& r) + ["for" addr-spec] ; initial form + */ + +-void relay::parse(const string& buffer, const string::size_type position, ++void relay::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + const string::value_type* const pend = buffer.data() + end; +@@ -198,7 +198,7 @@ void relay::parse(const string& buffer, const string::size_type position, + } + + +-void relay::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void relay::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + std::ostringstream oss; +@@ -338,10 +338,10 @@ std::vector & relay::getWithList() + } + + +-const std::vector > relay::getChildComponents() const ++const std::vector > relay::getChildComponents() + { + // TODO: should fields inherit from 'component'? (using typeAdapter) +- return std::vector >(); ++ return std::vector >(); + } + + +diff --git a/src/streamContentHandler.cpp b/src/streamContentHandler.cpp +index 89a36b4..14837d2 100644 +--- a/src/streamContentHandler.cpp ++++ b/src/streamContentHandler.cpp +@@ -25,6 +25,7 @@ + + #include "vmime/utility/outputStreamAdapter.hpp" + #include "vmime/utility/inputStreamStringAdapter.hpp" ++#include "vmime/utility/seekableInputStream.hpp" + #include "vmime/utility/streamUtils.hpp" + + +@@ -207,6 +208,9 @@ const vmime::encoding& streamContentHandler::getEncoding() const + + bool streamContentHandler::isBuffered() const + { ++ if (m_stream.dynamicCast () != NULL) ++ return true; ++ + // FIXME: some streams can be resetted + return false; + } +diff --git a/src/text.cpp b/src/text.cpp +index 66c3b35..91b81e1 100644 +--- a/src/text.cpp ++++ b/src/text.cpp +@@ -67,7 +67,7 @@ text::~text() + } + + +-void text::parse(const string& buffer, const string::size_type position, ++void text::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + removeAllWords(); +@@ -85,7 +85,7 @@ void text::parse(const string& buffer, const string::size_type position, + } + + +-void text::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void text::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + encodeAndFold(os, maxLineLength, curLinePos, newLinePos, 0); +@@ -389,9 +389,9 @@ text* text::decodeAndUnfold(const string& in, text* generateInExisting) + } + + +-const std::vector > text::getChildComponents() const ++const std::vector > text::getChildComponents() + { +- std::vector > list; ++ std::vector > list; + + copy_vector(m_words, list); + +diff --git a/src/utility/inputStreamAdapter.cpp b/src/utility/inputStreamAdapter.cpp +index b44b084..441307b 100644 +--- a/src/utility/inputStreamAdapter.cpp ++++ b/src/utility/inputStreamAdapter.cpp +@@ -65,6 +65,18 @@ stream::size_type inputStreamAdapter::skip(const size_type count) + } + + ++stream::size_type inputStreamAdapter::getPosition() const ++{ ++ return m_stream.tellg(); ++} ++ ++ ++void inputStreamAdapter::seek(const size_type pos) ++{ ++ m_stream.seekg(pos, std::ios_base::beg); ++} ++ ++ + } // utility + } // vmime + +diff --git a/src/utility/inputStreamByteBufferAdapter.cpp b/src/utility/inputStreamByteBufferAdapter.cpp +index 92e779f..907f1ee 100644 +--- a/src/utility/inputStreamByteBufferAdapter.cpp ++++ b/src/utility/inputStreamByteBufferAdapter.cpp +@@ -85,6 +85,19 @@ stream::size_type inputStreamByteBufferAdapter::skip(const size_type count) + } + + ++stream::size_type inputStreamByteBufferAdapter::getPosition() const ++{ ++ return m_pos; ++} ++ ++ ++void inputStreamByteBufferAdapter::seek(const size_type pos) ++{ ++ if (pos <= m_length) ++ m_pos = pos; ++} ++ ++ + } // utility + } // vmime + +diff --git a/src/utility/inputStreamStringAdapter.cpp b/src/utility/inputStreamStringAdapter.cpp +index 31c9fda..9b8fb0c 100644 +--- a/src/utility/inputStreamStringAdapter.cpp ++++ b/src/utility/inputStreamStringAdapter.cpp +@@ -89,6 +89,19 @@ stream::size_type inputStreamStringAdapter::skip(const size_type count) + } + + ++stream::size_type inputStreamStringAdapter::getPosition() const ++{ ++ return m_pos - m_begin; ++} ++ ++ ++void inputStreamStringAdapter::seek(const size_type pos) ++{ ++ if (m_begin + pos <= m_end) ++ m_pos = m_begin + pos; ++} ++ ++ + } // utility + } // vmime + +diff --git a/src/utility/inputStreamStringProxyAdapter.cpp b/src/utility/inputStreamStringProxyAdapter.cpp +index 5e4b60b..feecddd 100644 +--- a/src/utility/inputStreamStringProxyAdapter.cpp ++++ b/src/utility/inputStreamStringProxyAdapter.cpp +@@ -84,6 +84,19 @@ stream::size_type inputStreamStringProxyAdapter::skip(const size_type count) + } + + ++stream::size_type inputStreamStringProxyAdapter::getPosition() const ++{ ++ return m_pos; ++} ++ ++ ++void inputStreamStringProxyAdapter::seek(const size_type pos) ++{ ++ if (pos <= m_buffer.length()) ++ m_pos = pos; ++} ++ ++ + } // utility + } // vmime + +diff --git a/src/utility/parserInputStreamAdapter.cpp b/src/utility/parserInputStreamAdapter.cpp +new file mode 100644 +index 0000000..7a38ef1 +--- /dev/null ++++ b/src/utility/parserInputStreamAdapter.cpp +@@ -0,0 +1,162 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/parserInputStreamAdapter.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++parserInputStreamAdapter::parserInputStreamAdapter(ref stream) ++ : m_stream(stream) ++{ ++} ++ ++ ++bool parserInputStreamAdapter::eof() const ++{ ++ return m_stream->eof(); ++} ++ ++ ++void parserInputStreamAdapter::reset() ++{ ++ m_stream->reset(); ++} ++ ++ ++stream::size_type parserInputStreamAdapter::read ++ (value_type* const data, const size_type count) ++{ ++ return m_stream->read(data, count); ++} ++ ++ ++ref parserInputStreamAdapter::getUnderlyingStream() ++{ ++ return m_stream; ++} ++ ++ ++const string parserInputStreamAdapter::extract(const size_type begin, const size_type end) const ++{ ++ const size_type initialPos = m_stream->getPosition(); ++ ++ try ++ { ++ value_type *buffer = new value_type[end - begin + 1]; ++ ++ m_stream->seek(begin); ++ ++ const size_type readBytes = m_stream->read(buffer, end - begin); ++ buffer[readBytes] = '\0'; ++ ++ m_stream->seek(initialPos); ++ ++ string str(buffer, buffer + readBytes); ++ delete [] buffer; ++ ++ return str; ++ } ++ catch (...) ++ { ++ m_stream->seek(initialPos); ++ throw; ++ } ++} ++ ++ ++stream::size_type parserInputStreamAdapter::findNext ++ (const std::string& token, const size_type startPosition) ++{ ++ static const unsigned int BUFFER_SIZE = 4096; ++ ++ // Token must not be longer than BUFFER_SIZE/2 ++ if (token.empty() || token.length() > BUFFER_SIZE / 2) ++ return npos; ++ ++ const size_type initialPos = getPosition(); ++ ++ seek(startPosition); ++ ++ try ++ { ++ value_type findBuffer[BUFFER_SIZE]; ++ value_type* findBuffer1 = findBuffer; ++ value_type* findBuffer2 = findBuffer + (BUFFER_SIZE / 2) * sizeof(value_type); ++ ++ size_type findBufferLen = 0; ++ size_type findBufferOffset = 0; ++ ++ // Fill in initial buffer ++ findBufferLen = read(findBuffer, BUFFER_SIZE * sizeof(value_type)); ++ ++ for (;;) ++ { ++ // Find token ++ for (value_type *begin = findBuffer, *end = findBuffer + findBufferLen - token.length() ; ++ begin <= end ; ++begin) ++ { ++ if (begin[0] == token[0] && ++ (token.length() == 1 || ++ memcmp(static_cast (&begin[1]), ++ static_cast (token.data() + 1), ++ token.length() - 1) == 0)) ++ { ++ seek(initialPos); ++ return startPosition + findBufferOffset + (begin - findBuffer); ++ } ++ } ++ ++ // Rotate buffer ++ memcpy(findBuffer1, findBuffer2, (BUFFER_SIZE / 2) * sizeof(value_type)); ++ ++ // Read more bytes ++ if (findBufferLen < BUFFER_SIZE && eof()) ++ { ++ break; ++ } ++ else ++ { ++ const size_type bytesRead = read(findBuffer2, (BUFFER_SIZE / 2) * sizeof(value_type)); ++ findBufferLen = (BUFFER_SIZE / 2) + bytesRead; ++ findBufferOffset += (BUFFER_SIZE / 2); ++ } ++ } ++ ++ seek(initialPos); ++ } ++ catch (...) ++ { ++ seek(initialPos); ++ throw; ++ } ++ ++ return npos; ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/seekableInputStreamRegionAdapter.cpp b/src/utility/seekableInputStreamRegionAdapter.cpp +new file mode 100644 +index 0000000..348618c +--- /dev/null ++++ b/src/utility/seekableInputStreamRegionAdapter.cpp +@@ -0,0 +1,95 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#include "vmime/utility/seekableInputStreamRegionAdapter.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++seekableInputStreamRegionAdapter::seekableInputStreamRegionAdapter ++ (ref stream, const size_type begin, const size_type length) ++ : m_stream(stream), m_begin(begin), m_length(length) ++{ ++} ++ ++ ++bool seekableInputStreamRegionAdapter::eof() const ++{ ++ return getPosition() >= m_length; ++} ++ ++ ++void seekableInputStreamRegionAdapter::reset() ++{ ++ m_stream->seek(m_begin); ++} ++ ++ ++stream::size_type seekableInputStreamRegionAdapter::read ++ (value_type* const data, const size_type count) ++{ ++ if (getPosition() + count >= m_length) ++ { ++ const size_type remaining = m_length - getPosition(); ++ return m_stream->read(data, remaining); ++ } ++ else ++ { ++ return m_stream->read(data, count); ++ } ++} ++ ++ ++stream::size_type seekableInputStreamRegionAdapter::skip(const size_type count) ++{ ++ if (getPosition() + count >= m_length) ++ { ++ const size_type remaining = m_length - getPosition(); ++ m_stream->skip(remaining); ++ return remaining; ++ } ++ else ++ { ++ m_stream->skip(count); ++ return count; ++ } ++} ++ ++ ++stream::size_type seekableInputStreamRegionAdapter::getPosition() const ++{ ++ return m_stream->getPosition() - m_begin; ++} ++ ++ ++void seekableInputStreamRegionAdapter::seek(const size_type pos) ++{ ++ m_stream->seek(m_begin + pos); ++} ++ ++ ++} // utility ++} // vmime ++ +diff --git a/src/utility/stream.cpp b/src/utility/stream.cpp +index 1c940c2..67c1f33 100644 +--- a/src/utility/stream.cpp ++++ b/src/utility/stream.cpp +@@ -29,6 +29,9 @@ namespace vmime { + namespace utility { + + ++const stream::size_type stream::npos = static_cast (vmime::string::npos); ++ ++ + stream::size_type stream::getBlockSize() + { + return 32768; // 32 KB +@@ -37,3 +40,4 @@ stream::size_type stream::getBlockSize() + + } // utility + } // vmime ++ +diff --git a/src/utility/streamUtils.cpp b/src/utility/streamUtils.cpp +index f1d3b9d..f7ea62f 100644 +--- a/src/utility/streamUtils.cpp ++++ b/src/utility/streamUtils.cpp +@@ -52,6 +52,35 @@ stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os) + } + + ++stream::size_type bufferedStreamCopyRange(inputStream& is, outputStream& os, ++ const stream::size_type start, const stream::size_type length) ++{ ++ const stream::size_type blockSize = ++ std::min(is.getBlockSize(), os.getBlockSize()); ++ ++ is.skip(start); ++ ++ std::vector vbuffer(blockSize); ++ ++ stream::value_type* buffer = &vbuffer.front(); ++ stream::size_type total = 0; ++ ++ while (!is.eof() && total < length) ++ { ++ const stream::size_type remaining = std::min(length - total, blockSize); ++ const stream::size_type read = is.read(buffer, blockSize); ++ ++ if (read != 0) ++ { ++ os.write(buffer, read); ++ total += read; ++ } ++ } ++ ++ return total; ++} ++ ++ + stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os, + const stream::size_type length, progressListener* progress) + { +diff --git a/src/word.cpp b/src/word.cpp +index 79060a1..2876ddf 100644 +--- a/src/word.cpp ++++ b/src/word.cpp +@@ -241,7 +241,7 @@ const std::vector > word::parseMultiple(const string& buffer, const + } + + +-void word::parse(const string& buffer, const string::size_type position, ++void word::parseImpl(const string& buffer, const string::size_type position, + const string::size_type end, string::size_type* newPosition) + { + if (position + 6 < end && // 6 = "=?(.+)?(.*)?=" +@@ -324,7 +324,7 @@ void word::parse(const string& buffer, const string::size_type position, + } + + +-void word::generate(utility::outputStream& os, const string::size_type maxLineLength, ++void word::generateImpl(utility::outputStream& os, const string::size_type maxLineLength, + const string::size_type curLinePos, string::size_type* newLinePos) const + { + generate(os, maxLineLength, curLinePos, newLinePos, 0, NULL); +@@ -743,9 +743,9 @@ void word::setBuffer(const string& buffer) + } + + +-const std::vector > word::getChildComponents() const ++const std::vector > word::getChildComponents() + { +- return std::vector >(); ++ return std::vector >(); + } + + +diff --git a/tests/parser/bodyPartTest.cpp b/tests/parser/bodyPartTest.cpp +index 9d51262..deb4b9c 100644 +--- a/tests/parser/bodyPartTest.cpp ++++ b/tests/parser/bodyPartTest.cpp +@@ -33,12 +33,14 @@ VMIME_TEST_SUITE_BEGIN + VMIME_TEST_LIST_BEGIN + VMIME_TEST(testParse) + VMIME_TEST(testGenerate) ++ VMIME_TEST(testParseGuessBoundary) + VMIME_TEST(testParseMissingLastBoundary) + VMIME_TEST(testPrologEpilog) + VMIME_TEST(testPrologEncoding) + VMIME_TEST(testSuccessiveBoundaries) + VMIME_TEST(testGenerate7bit) + VMIME_TEST(testTextUsageForQPEncoding) ++ VMIME_TEST(testParseVeryBigMessage) + VMIME_TEST_LIST_END + + +@@ -237,6 +239,93 @@ VMIME_TEST_SUITE_BEGIN + VASSERT_EQ("2", "Part1-line1\r\nPart1-line2\r\n=89", oss.str()); + } + ++ void testParseGuessBoundary() ++ { ++ // Boundary is not specified in "Content-Type" field ++ // Parser will try to guess it from message contents. ++ ++ vmime::string str = ++ "Content-Type: multipart/mixed" ++ "\r\n\r\n" ++ "--UNKNOWN-BOUNDARY\r\nHEADER1\r\n\r\nBODY1\r\n" ++ "--UNKNOWN-BOUNDARY\r\nHEADER2\r\n\r\nBODY2\r\n" ++ "--UNKNOWN-BOUNDARY--"; ++ ++ vmime::bodyPart p; ++ p.parse(str); ++ ++ VASSERT_EQ("count", 2, p.getBody()->getPartCount()); ++ ++ VASSERT_EQ("part1-body", "BODY1", extractContents(p.getBody()->getPartAt(0)->getBody()->getContents())); ++ VASSERT_EQ("part2-body", "BODY2", extractContents(p.getBody()->getPartAt(1)->getBody()->getContents())); ++ } ++ ++ void testParseVeryBigMessage() ++ { ++ // When parsing from a seekable input stream, body contents should not ++ // be kept in memory in a "stringContentHandler" object. Instead, content ++ // should be accessible via a "streamContentHandler" object. ++ ++ static const std::string BODY1_BEGIN = "BEGIN1BEGIN1BEGIN1"; ++ static const std::string BODY1_LINE = "BODY1BODY1BODY1BODY1BODY1BODY1BODY1BODY1BODY1BODY1BODY1BODY1BODY1"; ++ static const std::string BODY1_END = "END1END1"; ++ static const unsigned int BODY1_REPEAT = 35000; ++ static const unsigned int BODY1_LENGTH = ++ BODY1_BEGIN.length() + BODY1_LINE.length() * BODY1_REPEAT + BODY1_END.length(); ++ ++ static const std::string BODY2_LINE = "BODY2BODY2BODY2BODY2BODY2BODY2BODY2BODY2BODY2BODY2BODY2BODY2BODY2"; ++ static const unsigned int BODY2_REPEAT = 20000; ++ ++ std::ostringstream oss; ++ oss << "Content-Type: multipart/mixed; boundary=\"MY-BOUNDARY\"" ++ << "\r\n\r\n" ++ << "--MY-BOUNDARY\r\n" ++ << "HEADER1\r\n" ++ << "\r\n"; ++ ++ oss << BODY1_BEGIN; ++ ++ for (unsigned int i = 0 ; i < BODY1_REPEAT ; ++i) ++ oss << BODY1_LINE; ++ ++ oss << BODY1_END; ++ ++ oss << "\r\n" ++ << "--MY-BOUNDARY\r\n" ++ << "HEADER2\r\n" ++ << "\r\n"; ++ ++ for (unsigned int i = 0 ; i < BODY2_REPEAT ; ++i) ++ oss << BODY2_LINE; ++ ++ oss << "\r\n" ++ << "--MY-BOUNDARY--\r\n"; ++ ++ vmime::ref is = ++ vmime::create (oss.str()); ++ ++ vmime::ref msg = vmime::create (); ++ msg->parse(is, oss.str().length()); ++ ++ vmime::ref body1 = msg->getBody()->getPartAt(0)->getBody(); ++ vmime::ref body1Cts = body1->getContents(); ++ ++ vmime::ref body2 = msg->getBody()->getPartAt(1)->getBody(); ++ vmime::ref body2Cts = body2->getContents(); ++ ++ vmime::string body1CtsExtracted; ++ vmime::utility::outputStreamStringAdapter body1CtsExtractStream(body1CtsExtracted); ++ body1Cts->extract(body1CtsExtractStream); ++ ++ VASSERT_EQ("1.1", BODY1_LENGTH, body1Cts->getLength()); ++ VASSERT("1.2", body1Cts.dynamicCast () != NULL); ++ VASSERT_EQ("1.3", BODY1_LENGTH, body1CtsExtracted.length()); ++ VASSERT_EQ("1.4", BODY1_BEGIN, body1CtsExtracted.substr(0, BODY1_BEGIN.length())); ++ VASSERT_EQ("1.5", BODY1_END, body1CtsExtracted.substr(BODY1_LENGTH - BODY1_END.length(), BODY1_END.length())); ++ ++ VASSERT_EQ("2.1", BODY2_LINE.length() * BODY2_REPEAT, body2Cts->getLength()); ++ VASSERT("2.2", body2Cts.dynamicCast () != NULL); ++ } + + VMIME_TEST_SUITE_END + +diff --git a/vmime/addressList.hpp b/vmime/addressList.hpp +index 2e537c0..9dc283c 100644 +--- a/vmime/addressList.hpp ++++ b/vmime/addressList.hpp +@@ -56,7 +56,7 @@ public: + addressList& operator=(const addressList& other); + addressList& operator=(const mailboxList& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + + /** Add a address at the end of the list. +@@ -163,14 +163,20 @@ private: + + std::vector > m_list; + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/body.hpp b/vmime/body.hpp +index 9e83d6b..bd5bbb9 100644 +--- a/vmime/body.hpp ++++ b/vmime/body.hpp +@@ -278,7 +278,7 @@ public: + void copyFrom(const component& other); + body& operator=(const body& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + private: + +@@ -299,14 +299,20 @@ private: + + void initNewPart(ref part); + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (ref parser, ++ const utility::stream::size_type position, ++ const utility::stream::size_type end, ++ utility::stream::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/bodyPart.hpp b/vmime/bodyPart.hpp +index aa0f040..5f36d90 100644 +--- a/vmime/bodyPart.hpp ++++ b/vmime/bodyPart.hpp +@@ -89,7 +89,7 @@ public: + void copyFrom(const component& other); + bodyPart& operator=(const bodyPart& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + private: + +@@ -98,14 +98,20 @@ private: + + weak_ref m_parent; + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (ref parser, ++ const utility::stream::size_type position, ++ const utility::stream::size_type end, ++ utility::stream::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/charset.hpp b/vmime/charset.hpp +index 5f5e8e5..26abb4f 100644 +--- a/vmime/charset.hpp ++++ b/vmime/charset.hpp +@@ -62,7 +62,7 @@ public: + bool operator==(const charset& value) const; + bool operator!=(const charset& value) const; + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + /** Gets the recommended encoding for this charset. + * Note: there may be no recommended encoding. +@@ -117,14 +117,20 @@ private: + + string m_name; + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/component.hpp b/vmime/component.hpp +index 12b0406..5e6f393 100644 +--- a/vmime/component.hpp ++++ b/vmime/component.hpp +@@ -27,6 +27,8 @@ + + #include "vmime/base.hpp" + #include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/seekableInputStream.hpp" ++#include "vmime/utility/parserInputStreamAdapter.hpp" + #include "vmime/utility/outputStream.hpp" + + +@@ -51,6 +53,12 @@ public: + */ + void parse(const string& buffer); + ++ /** Parse RFC-822/MIME data for this component. If stream is not seekable, ++ * or if length is not specified, entire contents of the stream will ++ * be loaded into memory before parsing. ++ */ ++ void parse(ref inputStream, const utility::stream::size_type length); ++ + /** Parse RFC-822/MIME data for this component. + * + * @param buffer input buffer +@@ -58,7 +66,26 @@ public: + * @param end end position in the input buffer + * @param newPosition will receive the new position in the input buffer + */ +- virtual void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL) = 0; ++ void parse ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ /** Parse RFC-822/MIME data for this component. If stream is not seekable, ++ * or if end position is not specified, entire contents of the stream will ++ * be loaded into memory before parsing. ++ * ++ * @param inputStream stream from which to read data ++ * @param position current position in the input stream ++ * @param end end position in the input stream ++ * @param newPosition will receive the new position in the input stream ++ */ ++ void parse ++ (ref inputStream, ++ const utility::stream::size_type position, ++ const utility::stream::size_type end, ++ utility::stream::size_type* newPosition = NULL); + + /** Generate RFC-2822/MIME data for this component. + * +@@ -68,16 +95,35 @@ public: + * @param curLinePos length of the current line in the output buffer + * @return generated data + */ +- const string generate(const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0) const; ++ virtual const string generate ++ (const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0) const; + + /** Generate RFC-2822/MIME data for this component. + * +- * @param os output stream ++ * @param outputStream output stream + * @param maxLineLength maximum line length for output + * @param curLinePos length of the current line in the output buffer + * @param newLinePos will receive the new line position (length of the last line written) + */ +- virtual void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const = 0; ++ virtual void generate ++ (utility::outputStream& outputStream, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; ++ ++ /** Generate RFC-2822/MIME data for this component. ++ * ++ * @param outputStream output stream ++ * @param maxLineLength maximum line length for output ++ * @param curLinePos length of the current line in the output buffer ++ * @param newLinePos will receive the new line position (length of the last line written) ++ */ ++ virtual void generate ++ (ref outputStream, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + + /** Clone this component. + * +@@ -95,41 +141,56 @@ public: + virtual void copyFrom(const component& other) = 0; + + /** Return the start position of this component in the +- * parsed message contents. ++ * parsed message contents. Use for debugging only. + * + * @return start position in parsed buffer + * or 0 if this component has not been parsed + */ +- string::size_type getParsedOffset() const; ++ utility::stream::size_type getParsedOffset() const; + + /** Return the length of this component in the +- * parsed message contents. ++ * parsed message contents. Use for debugging only. + * + * @return length of the component in parsed buffer + * or 0 if this component has not been parsed + */ +- string::size_type getParsedLength() const; ++ utility::stream::size_type getParsedLength() const; + + /** Return the list of children of this component. + * + * @return list of child components + */ +- const std::vector > getChildComponents(); +- +- /** Return the list of children of this component (const version). +- * +- * @return list of child components +- */ +- virtual const std::vector > getChildComponents() const = 0; ++ virtual const std::vector > getChildComponents() = 0; + + protected: + +- void setParsedBounds(const string::size_type start, const string::size_type end); ++ void setParsedBounds(const utility::stream::size_type start, const utility::stream::size_type end); ++ ++ // AT LEAST ONE of these parseImpl() functions MUST be implemented in derived class ++ virtual void parseImpl ++ (ref parser, ++ const utility::stream::size_type position, ++ const utility::stream::size_type end, ++ utility::stream::size_type* newPosition = NULL); ++ ++ virtual void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ virtual void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const = 0; + + private: + +- string::size_type m_parsedOffset; +- string::size_type m_parsedLength; ++ void offsetParsedBounds(const utility::stream::size_type offset); ++ ++ utility::stream::size_type m_parsedOffset; ++ utility::stream::size_type m_parsedLength; + }; + + +diff --git a/vmime/contentDisposition.hpp b/vmime/contentDisposition.hpp +index 9d1749b..abd2e1a 100644 +--- a/vmime/contentDisposition.hpp ++++ b/vmime/contentDisposition.hpp +@@ -63,7 +63,7 @@ public: + void copyFrom(const component& other); + contentDisposition& operator=(const contentDisposition& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + + contentDisposition& operator=(const string& name); +@@ -75,14 +75,20 @@ private: + + string m_name; + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/dateTime.hpp b/vmime/dateTime.hpp +index 8e99640..053f4a6 100644 +--- a/vmime/dateTime.hpp ++++ b/vmime/dateTime.hpp +@@ -237,16 +237,22 @@ public: + // Current date and time + static const datetime now(); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/disposition.hpp b/vmime/disposition.hpp +index 05bfca2..7bdc832 100644 +--- a/vmime/disposition.hpp ++++ b/vmime/disposition.hpp +@@ -50,7 +50,7 @@ public: + void copyFrom(const component& other); + disposition& operator=(const disposition& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + + /** Set the disposition action mode. +@@ -134,14 +134,20 @@ private: + + std::vector m_modifiers; + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/encoding.hpp b/vmime/encoding.hpp +index 42f5246..4322b29 100644 +--- a/vmime/encoding.hpp ++++ b/vmime/encoding.hpp +@@ -93,7 +93,7 @@ public: + bool operator==(const encoding& value) const; + bool operator!=(const encoding& value) const; + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + /** Decide which encoding to use based on the specified data. + * +@@ -141,14 +141,20 @@ private: + */ + static const encoding decideImpl(const string::const_iterator begin, const string::const_iterator end); + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/header.hpp b/vmime/header.hpp +index 95a9326..ed555b0 100644 +--- a/vmime/header.hpp ++++ b/vmime/header.hpp +@@ -220,7 +220,7 @@ public: + void copyFrom(const component& other); + header& operator=(const header& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + private: + +@@ -251,14 +251,20 @@ private: + string m_name; + }; + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/headerField.hpp b/vmime/headerField.hpp +index 50494c9..61e01ee 100644 +--- a/vmime/headerField.hpp ++++ b/vmime/headerField.hpp +@@ -59,7 +59,7 @@ public: + void copyFrom(const component& other); + headerField& operator=(const headerField& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + /** Sets the name of this field. + * +@@ -118,15 +118,26 @@ public: + void setValue(const string& value); + + +- using component::parse; +- using component::generate; ++protected: + +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + +-protected: + +- static ref parseNext(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); ++ static ref parseNext ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); + + + string m_name; +diff --git a/vmime/mailbox.hpp b/vmime/mailbox.hpp +index 2072be8..2099355 100644 +--- a/vmime/mailbox.hpp ++++ b/vmime/mailbox.hpp +@@ -85,7 +85,7 @@ public: + + void clear(); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + + bool isGroup() const; +@@ -101,8 +101,17 @@ public: + using address::generate; + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/mailboxGroup.hpp b/vmime/mailboxGroup.hpp +index 0061d5b..1433141 100644 +--- a/vmime/mailboxGroup.hpp ++++ b/vmime/mailboxGroup.hpp +@@ -52,7 +52,7 @@ public: + ref clone() const; + mailboxGroup& operator=(const component& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + /** Return the name of the group. + * +@@ -165,14 +165,20 @@ private: + text m_name; + std::vector > m_list; + +-public: +- +- using address::parse; +- using address::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/mailboxList.hpp b/vmime/mailboxList.hpp +index 11e4e79..1b480c1 100644 +--- a/vmime/mailboxList.hpp ++++ b/vmime/mailboxList.hpp +@@ -51,7 +51,7 @@ public: + void copyFrom(const component& other); + mailboxList& operator=(const mailboxList& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + /** Add a mailbox at the end of the list. + * +@@ -155,14 +155,20 @@ private: + + addressList m_list; + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/mediaType.hpp b/vmime/mediaType.hpp +index 658b21f..18182f0 100644 +--- a/vmime/mediaType.hpp ++++ b/vmime/mediaType.hpp +@@ -55,7 +55,7 @@ public: + void copyFrom(const component& other); + mediaType& operator=(const mediaType& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + /** Return the media type. + * See the constants in vmime::mediaTypes. +@@ -97,14 +97,18 @@ protected: + string m_type; + string m_subType; + +-public: +- +- using component::parse; +- using component::generate; +- + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/message.hpp b/vmime/message.hpp +index f3be229..9767564 100644 +--- a/vmime/message.hpp ++++ b/vmime/message.hpp +@@ -43,12 +43,25 @@ public: + message(); + + +- // Component parsing & assembling +- void generate(utility::outputStream& os, const string::size_type maxLineLength = options::getInstance()->message.maxLineLength(), const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; +- +- const string generate(const string::size_type maxLineLength = options::getInstance()->message.maxLineLength(), const string::size_type curLinePos = 0) const; ++public: + +- void parse(const string& buffer); ++ // Override default generate() functions so that we can change ++ // the default 'maxLineLength' value ++ void generate ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = options::getInstance()->message.maxLineLength(), ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; ++ ++ const string generate ++ (const string::size_type maxLineLength = options::getInstance()->message.maxLineLength(), ++ const string::size_type curLinePos = 0) const; ++ ++ void generate ++ (ref os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/messageId.hpp b/vmime/messageId.hpp +index 3686b11..ac408e6 100644 +--- a/vmime/messageId.hpp ++++ b/vmime/messageId.hpp +@@ -97,23 +97,27 @@ public: + void copyFrom(const component& other); + messageId& operator=(const messageId& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + private: + + string m_left; + string m_right; + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; +- +-protected: ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + + /** Parse a message-id from an input buffer. + * +@@ -123,7 +127,11 @@ protected: + * @param newPosition will receive the new position in the input buffer + * @return a new message-id object, or null if no more message-id can be parsed from the input buffer + */ +- static ref parseNext(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition); ++ static ref parseNext ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition); + }; + + +diff --git a/vmime/messageIdSequence.hpp b/vmime/messageIdSequence.hpp +index 5dfb840..6736d0a 100644 +--- a/vmime/messageIdSequence.hpp ++++ b/vmime/messageIdSequence.hpp +@@ -49,7 +49,7 @@ public: + void copyFrom(const component& other); + messageIdSequence& operator=(const messageIdSequence& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + + /** Add a message-id at the end of the list. +@@ -148,14 +148,20 @@ private: + + std::vector > m_list; + +-public: +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/parameter.hpp b/vmime/parameter.hpp +index e1b13a1..0773ea6 100644 +--- a/vmime/parameter.hpp ++++ b/vmime/parameter.hpp +@@ -67,7 +67,7 @@ public: + void copyFrom(const component& other); + parameter& operator=(const parameter& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + /** Return the name of this parameter. + * +@@ -104,7 +104,7 @@ public: + const T getValueAs() const + { + T ret; +- ret.parse(m_value.getBuffer()); ++ ret.parse(m_value->getBuffer()); + + return ret; + } +@@ -122,11 +122,19 @@ public: + void setValue(const word& value); + + +- using component::parse; +- using component::generate; ++protected: + +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + + private: + +@@ -134,7 +142,7 @@ private: + + + string m_name; +- word m_value; ++ ref m_value; + }; + + +diff --git a/vmime/parameterizedHeaderField.hpp b/vmime/parameterizedHeaderField.hpp +index 2940ca3..d2c934f 100644 +--- a/vmime/parameterizedHeaderField.hpp ++++ b/vmime/parameterizedHeaderField.hpp +@@ -172,19 +172,25 @@ public: + */ + const std::vector > getParameterList(); + ++ const std::vector > getChildComponents(); ++ + private: + + std::vector > m_params; + +-public: +- +- using headerField::parse; +- using headerField::generate; +- +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++protected: + +- const std::vector > getChildComponents() const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/parserHelpers.hpp b/vmime/parserHelpers.hpp +index 9b075f7..d4f1246 100644 +--- a/vmime/parserHelpers.hpp ++++ b/vmime/parserHelpers.hpp +@@ -45,6 +45,10 @@ public: + return (c == ' ' || c == '\t' || c == '\n' || c == '\r'); + } + ++ static bool isSpaceOrTab(const char_t c) ++ { ++ return (c == ' ' || c == '\t'); ++ } + + static bool isDigit(const char_t c) + { +diff --git a/vmime/path.hpp b/vmime/path.hpp +index beaa72b..eec8dfc 100644 +--- a/vmime/path.hpp ++++ b/vmime/path.hpp +@@ -76,21 +76,26 @@ public: + ref clone() const; + path& operator=(const path& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + protected: + + string m_localPart; + string m_domain; + +-public: +- +- using component::parse; +- using component::generate; + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/platforms/posix/posixFile.hpp b/vmime/platforms/posix/posixFile.hpp +index 70986df..704b7b0 100644 +--- a/vmime/platforms/posix/posixFile.hpp ++++ b/vmime/platforms/posix/posixFile.hpp +@@ -26,6 +26,7 @@ + + + #include "vmime/utility/file.hpp" ++#include "vmime/utility/seekableInputStream.hpp" + + + #if VMIME_HAVE_FILESYSTEM_FEATURES +@@ -57,7 +58,7 @@ private: + + + +-class posixFileReaderInputStream : public vmime::utility::inputStream ++class posixFileReaderInputStream : public vmime::utility::seekableInputStream + { + public: + +@@ -72,6 +73,9 @@ public: + + size_type skip(const size_type count); + ++ size_type getPosition() const; ++ void seek(const size_type pos); ++ + private: + + const vmime::utility::file::path m_path; +diff --git a/vmime/platforms/windows/windowsFile.hpp b/vmime/platforms/windows/windowsFile.hpp +index 6e1c8fb..f417032 100644 +--- a/vmime/platforms/windows/windowsFile.hpp ++++ b/vmime/platforms/windows/windowsFile.hpp +@@ -26,6 +26,7 @@ + + + #include "vmime/utility/file.hpp" ++#include "vmime/utility/seekableInputStream.hpp" + + #include + +@@ -157,6 +158,8 @@ public: + void reset(); + size_type read(value_type* const data, const size_type count); + size_type skip(const size_type count); ++ size_type getPosition() const; ++ void seek(const size_type pos); + + private: + +diff --git a/vmime/relay.hpp b/vmime/relay.hpp +index 583ad80..dbaedf2 100644 +--- a/vmime/relay.hpp ++++ b/vmime/relay.hpp +@@ -51,7 +51,7 @@ public: + void copyFrom(const component& other); + relay& operator=(const relay& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + const string& getFrom() const; + void setFrom(const string& from); +@@ -85,13 +85,19 @@ private: + + datetime m_date; + +-public: ++protected: + +- using component::parse; +- using component::generate; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); + +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + }; + + +diff --git a/vmime/text.hpp b/vmime/text.hpp +index 15e11ae..778ce86 100644 +--- a/vmime/text.hpp ++++ b/vmime/text.hpp +@@ -58,7 +58,7 @@ public: + text& operator=(const component& other); + text& operator=(const text& other); + +- const std::vector > getChildComponents() const; ++ const std::vector > getChildComponents(); + + /** Add a word at the end of the list. + * +@@ -226,13 +226,20 @@ public: + */ + static text* decodeAndUnfold(const string& in, text* generateInExisting); + +- +- using component::parse; +- using component::generate; ++protected: + + // Component parsing & assembling +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); ++ ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + + private: + +diff --git a/vmime/utility/inputStreamAdapter.hpp b/vmime/utility/inputStreamAdapter.hpp +index 278ab52..bd4d21e 100644 +--- a/vmime/utility/inputStreamAdapter.hpp ++++ b/vmime/utility/inputStreamAdapter.hpp +@@ -25,7 +25,7 @@ + #define VMIME_UTILITY_INPUTSTREAMADAPTER_HPP_INCLUDED + + +-#include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/seekableInputStream.hpp" + + #include + +@@ -37,7 +37,7 @@ namespace utility { + /** An adapter class for C++ standard input streams. + */ + +-class inputStreamAdapter : public inputStream ++class inputStreamAdapter : public seekableInputStream + { + public: + +@@ -49,6 +49,8 @@ public: + void reset(); + size_type read(value_type* const data, const size_type count); + size_type skip(const size_type count); ++ size_type getPosition() const; ++ void seek(const size_type pos); + + private: + +diff --git a/vmime/utility/inputStreamByteBufferAdapter.hpp b/vmime/utility/inputStreamByteBufferAdapter.hpp +index 0f6a442..b3dafd9 100644 +--- a/vmime/utility/inputStreamByteBufferAdapter.hpp ++++ b/vmime/utility/inputStreamByteBufferAdapter.hpp +@@ -25,7 +25,7 @@ + #define VMIME_UTILITY_INPUTSTREAMBYTEBUFFERADAPTER_HPP_INCLUDED + + +-#include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/seekableInputStream.hpp" + + + namespace vmime { +@@ -35,7 +35,7 @@ namespace utility { + /** An adapter class for reading from an array of bytes. + */ + +-class inputStreamByteBufferAdapter : public inputStream ++class inputStreamByteBufferAdapter : public seekableInputStream + { + public: + +@@ -45,6 +45,8 @@ public: + void reset(); + size_type read(value_type* const data, const size_type count); + size_type skip(const size_type count); ++ size_type getPosition() const; ++ void seek(const size_type pos); + + private: + +diff --git a/vmime/utility/inputStreamStringAdapter.hpp b/vmime/utility/inputStreamStringAdapter.hpp +index a7d986f..18a9083 100644 +--- a/vmime/utility/inputStreamStringAdapter.hpp ++++ b/vmime/utility/inputStreamStringAdapter.hpp +@@ -25,7 +25,7 @@ + #define VMIME_UTILITY_INPUTSTREAMSTRINGADAPTER_HPP_INCLUDED + + +-#include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/seekableInputStream.hpp" + + + namespace vmime { +@@ -35,7 +35,7 @@ namespace utility { + /** An adapter class for string input. + */ + +-class inputStreamStringAdapter : public inputStream ++class inputStreamStringAdapter : public seekableInputStream + { + public: + +@@ -46,6 +46,8 @@ public: + void reset(); + size_type read(value_type* const data, const size_type count); + size_type skip(const size_type count); ++ size_type getPosition() const; ++ void seek(const size_type pos); + + private: + +diff --git a/vmime/utility/inputStreamStringProxyAdapter.hpp b/vmime/utility/inputStreamStringProxyAdapter.hpp +index 74b3f60..dc52637 100644 +--- a/vmime/utility/inputStreamStringProxyAdapter.hpp ++++ b/vmime/utility/inputStreamStringProxyAdapter.hpp +@@ -25,7 +25,7 @@ + #define VMIME_UTILITY_INPUTSTREAMSTRINGPROXYADAPTER_HPP_INCLUDED + + +-#include "vmime/utility/inputStream.hpp" ++#include "vmime/utility/seekableInputStream.hpp" + + + namespace vmime { +@@ -38,7 +38,7 @@ class stringProxy; + /** An adapter class for stringProxy input. + */ + +-class inputStreamStringProxyAdapter : public inputStream ++class inputStreamStringProxyAdapter : public seekableInputStream + { + public: + +@@ -50,6 +50,8 @@ public: + void reset(); + size_type read(value_type* const data, const size_type count); + size_type skip(const size_type count); ++ size_type getPosition() const; ++ void seek(const size_type pos); + + private: + +diff --git a/vmime/utility/parserInputStreamAdapter.hpp b/vmime/utility/parserInputStreamAdapter.hpp +new file mode 100644 +index 0000000..c24fa44 +--- /dev/null ++++ b/vmime/utility/parserInputStreamAdapter.hpp +@@ -0,0 +1,173 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_PARSERINPUTSTREAMADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_PARSERINPUTSTREAMADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/seekableInputStream.hpp" ++ ++#include ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An adapter class used for parsing from an input stream. ++ */ ++ ++class parserInputStreamAdapter : public seekableInputStream ++{ ++public: ++ ++ /** @param is input stream to wrap ++ */ ++ parserInputStreamAdapter(ref inputStream); ++ ++ ref getUnderlyingStream(); ++ ++ bool eof() const; ++ void reset(); ++ size_type read(value_type* const data, const size_type count); ++ ++ void seek(const size_type pos) ++ { ++ m_stream->seek(pos); ++ } ++ ++ size_type skip(const size_type count) ++ { ++ return m_stream->skip(count); ++ } ++ ++ size_type getPosition() const ++ { ++ return m_stream->getPosition(); ++ } ++ ++ /** Get the byte at the current position without updating the ++ * current position. ++ * ++ * @return byte at the current position ++ */ ++ value_type peekByte() const ++ { ++ const size_type initialPos = m_stream->getPosition(); ++ ++ try ++ { ++ value_type buffer[1]; ++ const size_type readBytes = m_stream->read(buffer, 1); ++ ++ m_stream->seek(initialPos); ++ ++ return (readBytes == 1 ? buffer[0] : 0); ++ } ++ catch (...) ++ { ++ m_stream->seek(initialPos); ++ throw; ++ } ++ } ++ ++ /** Get the byte at the current position and advance current ++ * position by one byte. ++ * ++ * @return byte at the current position ++ */ ++ value_type getByte() ++ { ++ value_type buffer[1]; ++ const size_type readBytes = m_stream->read(buffer, 1); ++ ++ return (readBytes == 1 ? buffer[0] : 0); ++ } ++ ++ /** Check whether the bytes following the current position match ++ * the specified bytes. Position is not updated. ++ * ++ * @param bytes bytes to compare ++ * @param length number of bytes ++ * @return true if the next bytes match the pattern, false otherwise ++ */ ++ bool matchBytes(const value_type* bytes, const size_type length) const ++ { ++ const size_type initialPos = m_stream->getPosition(); ++ ++ try ++ { ++ value_type buffer[32]; ++ const size_type readBytes = m_stream->read(buffer, length); ++ ++ m_stream->seek(initialPos); ++ ++ return readBytes == length && ++ ::memcmp(bytes, buffer, length) == 0; ++ } ++ catch (...) ++ { ++ m_stream->seek(initialPos); ++ throw; ++ } ++ } ++ ++ const string extract(const size_type begin, const size_type end) const; ++ ++ /** Skips bytes matching a predicate from the current position. ++ * The current position is updated to the next following byte ++ * which does not match the predicate. ++ * ++ * @param pred predicate ++ * @param endPosition stop at this position (or at end of the stream, ++ * whichever comes first) ++ * @return number of bytes skipped ++ */ ++ template ++ size_type skipIf(PREDICATE pred, const size_type endPosition) ++ { ++ const size_type initialPos = getPosition(); ++ size_type pos = initialPos; ++ ++ while (!m_stream->eof() && pos < endPosition && pred(getByte())) ++ ++pos; ++ ++ m_stream->seek(pos); ++ ++ return pos - initialPos; ++ } ++ ++ size_type findNext(const std::string& token, const size_type startPosition = 0); ++ ++private: ++ ++ mutable ref m_stream; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_PARSERINPUTSTREAMADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/seekableInputStream.hpp b/vmime/utility/seekableInputStream.hpp +new file mode 100644 +index 0000000..c2ab1bb +--- /dev/null ++++ b/vmime/utility/seekableInputStream.hpp +@@ -0,0 +1,64 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_SEEKABLEINPUTSTREAM_HPP_INCLUDED ++#define VMIME_UTILITY_SEEKABLEINPUTSTREAM_HPP_INCLUDED ++ ++ ++#include "vmime/utility/inputStream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An input stream that allows seeking within the input. ++ */ ++ ++class seekableInputStream : public inputStream ++{ ++public: ++ ++ /** Returns the current position in this stream. ++ * ++ * @return the offset from the beginning of the stream, in bytes, ++ * at which the next read occurs ++ */ ++ virtual size_type getPosition() const = 0; ++ ++ /** Sets the position, measured from the beginning of this stream, ++ * at which the next read occurs. ++ * ++ * @param pos the offset position, measured in bytes from the ++ * beginning of the stream, at which to set the stream pointer. ++ */ ++ virtual void seek(const size_type pos) = 0; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_SEEKABLEINPUTSTREAM_HPP_INCLUDED ++ +diff --git a/vmime/utility/seekableInputStreamRegionAdapter.hpp b/vmime/utility/seekableInputStreamRegionAdapter.hpp +new file mode 100644 +index 0000000..5ebccc6 +--- /dev/null ++++ b/vmime/utility/seekableInputStreamRegionAdapter.hpp +@@ -0,0 +1,71 @@ ++// ++// VMime library (http://www.vmime.org) ++// Copyright (C) 2002-2012 Vincent Richard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License as ++// published by the Free Software Foundation; either version 3 of ++// the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++// General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this program; if not, write to the Free Software Foundation, Inc., ++// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Linking this library statically or dynamically with other modules is making ++// a combined work based on this library. Thus, the terms and conditions of ++// the GNU General Public License cover the whole combination. ++// ++ ++#ifndef VMIME_UTILITY_SEEKABLEINPUTSTREAMREGIONADAPTER_HPP_INCLUDED ++#define VMIME_UTILITY_SEEKABLEINPUTSTREAMREGIONADAPTER_HPP_INCLUDED ++ ++ ++#include "vmime/utility/seekableInputStream.hpp" ++ ++ ++namespace vmime { ++namespace utility { ++ ++ ++/** An adapter for reading a limited region of a seekable input stream. ++ */ ++ ++class seekableInputStreamRegionAdapter : public seekableInputStream ++{ ++public: ++ ++ /** Creates a new adapter for a seekableInputStream. ++ * ++ * @param stream source stream ++ * @param begin start position in source stream ++ * @param length region length in source stream ++ */ ++ seekableInputStreamRegionAdapter(ref stream, ++ const size_type begin, const size_type length); ++ ++ bool eof() const; ++ void reset(); ++ size_type read(value_type* const data, const size_type count); ++ size_type skip(const size_type count); ++ size_type getPosition() const; ++ void seek(const size_type pos); ++ ++private: ++ ++ ref m_stream; ++ size_type m_begin; ++ size_type m_length; ++}; ++ ++ ++} // utility ++} // vmime ++ ++ ++#endif // VMIME_UTILITY_SEEKABLEINPUTSTREAMREGIONADAPTER_HPP_INCLUDED ++ +diff --git a/vmime/utility/stream.hpp b/vmime/utility/stream.hpp +index 566ab9d..78be827 100644 +--- a/vmime/utility/stream.hpp ++++ b/vmime/utility/stream.hpp +@@ -54,6 +54,10 @@ public: + */ + typedef string::size_type size_type; + ++ /** Constant value with the greatest possible value for an element of type size_type. ++ */ ++ static const size_type npos; ++ + /** Return the preferred maximum block size when reading + * from or writing to this stream. + * +diff --git a/vmime/utility/streamUtils.hpp b/vmime/utility/streamUtils.hpp +index cdf70aa..87c8fc5 100644 +--- a/vmime/utility/streamUtils.hpp ++++ b/vmime/utility/streamUtils.hpp +@@ -45,6 +45,19 @@ namespace utility { + stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os); + + /** Copy data from one stream into another stream using a buffered method ++ * and copying only a specified range of data. ++ * ++ * @param is input stream (source data) ++ * @param os output stream (destination for data) ++ * @param start number of bytes to ignore before starting copying ++ * @param length maximum number of bytes to copy ++ * @return number of bytes copied ++ */ ++ ++stream::size_type bufferedStreamCopyRange(inputStream& is, outputStream& os, ++ const stream::size_type start, const stream::size_type length); ++ ++/** Copy data from one stream into another stream using a buffered method + * and notify progress state of the operation. + * + * @param is input stream (source data) +diff --git a/vmime/word.hpp b/vmime/word.hpp +index ad848ec..492aab5 100644 +--- a/vmime/word.hpp ++++ b/vmime/word.hpp +@@ -128,21 +128,52 @@ public: + #endif + + +- using component::parse; +- using component::generate; ++protected: + +- void parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition = NULL); +- void generate(utility::outputStream& os, const string::size_type maxLineLength = lineLengthLimits::infinite, const string::size_type curLinePos = 0, string::size_type* newLinePos = NULL) const; ++ void parseImpl ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition = NULL); + +- void generate(utility::outputStream& os, const string::size_type maxLineLength, const string::size_type curLinePos, string::size_type* newLinePos, const int flags, generatorState* state) const; ++ void generateImpl ++ (utility::outputStream& os, ++ const string::size_type maxLineLength = lineLengthLimits::infinite, ++ const string::size_type curLinePos = 0, ++ string::size_type* newLinePos = NULL) const; + +- const std::vector > getChildComponents() const; ++public: + +-private: ++ using component::generate; + +- static ref parseNext(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition, bool prevIsEncoded, bool* isEncoded, bool isFirst); ++#ifndef VMIME_BUILDING_DOC ++ void generate ++ (utility::outputStream& os, ++ const string::size_type maxLineLength, ++ const string::size_type curLinePos, ++ string::size_type* newLinePos, ++ const int flags, ++ generatorState* state) const; ++#endif ++ ++ const std::vector > getChildComponents(); ++ ++private: + +- static const std::vector > parseMultiple(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition); ++ static ref parseNext ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition, ++ bool prevIsEncoded, ++ bool* isEncoded, ++ bool isFirst); ++ ++ static const std::vector > parseMultiple ++ (const string& buffer, ++ const string::size_type position, ++ const string::size_type end, ++ string::size_type* newPosition); + + + // The "m_buffer" of this word holds the data, and this data is encoded +-- +1.7.10.4 + + +From 2e05e574fde890c7ec6dd9f3930d06b1b492ea80 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Fri, 27 Apr 2012 08:34:26 +0200 +Subject: [PATCH 38/42] Fixed duplicate file reference (thanks to Enes Albay). + + +diff --git a/SConstruct b/SConstruct +index 2690172..1f3c7c9 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -137,7 +137,6 @@ libvmime_sources = [ + 'utility/childProcess.hpp', + 'utility/file.hpp', + 'utility/datetimeUtils.cpp', 'utility/datetimeUtils.hpp', +- 'utility/filteredStream.cpp', 'utility/filteredStream.hpp', + 'utility/path.cpp', 'utility/path.hpp', + 'utility/progressListener.cpp', 'utility/progressListener.hpp', + 'utility/random.cpp', 'utility/random.hpp', +-- +1.7.10.4 + + +From 799629fd8b21a716f3e3abc6e6a5264555470d85 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Fri, 6 Jul 2012 18:45:02 +0200 +Subject: [PATCH 39/42] Fixed issue #10. + + +diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp +index 702d5f2..8006920 100644 +--- a/src/net/imap/IMAPMessage.cpp ++++ b/src/net/imap/IMAPMessage.cpp +@@ -279,8 +279,6 @@ void IMAPMessage::extract(ref p, utility::outputStream& os, + { + if (headerOnly) + command << "HEADER"; +- else +- command << "TEXT"; + } + else + { +-- +1.7.10.4 + + +From 72cf7a025f7764998609683904eea1046a766d97 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Sat, 28 Jul 2012 13:01:48 +0200 +Subject: [PATCH 40/42] Added functions to get messages by UID (IMAP only for + now). + + +diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp +index 81bf386..3d8c17e 100644 +--- a/src/net/imap/IMAPFolder.cpp ++++ b/src/net/imap/IMAPFolder.cpp +@@ -208,7 +208,7 @@ void IMAPFolder::open(const int mode, bool failIfModeIsNotAvailable) + { + case IMAPParser::resp_text_code::UIDVALIDITY: + +- m_uidValidity = code->nz_number()->value(); ++ m_uidValidity = static_cast (code->nz_number()->value()); + break; + + default: +@@ -550,6 +550,109 @@ std::vector > IMAPFolder::getMessages(const std::vector & nu + } + + ++ref IMAPFolder::getMessageByUID(const message::uid& uid) ++{ ++ std::vector uids; ++ uids.push_back(uid); ++ ++ std::vector > msgs = getMessagesByUID(uids); ++ ++ if (msgs.size() == 0) ++ throw exceptions::message_not_found(); ++ ++ return msgs[0]; ++} ++ ++ ++std::vector > IMAPFolder::getMessagesByUID(const std::vector & uids) ++{ ++ if (!isOpen()) ++ throw exceptions::illegal_state("Folder not open"); ++ ++ if (uids.size() == 0) ++ return std::vector >(); ++ ++ // C: . UID FETCH uuuu1,uuuu2,uuuu3 UID ++ // S: * nnnn1 FETCH (UID uuuu1) ++ // S: * nnnn2 FETCH (UID uuuu2) ++ // S: * nnnn3 FETCH (UID uuuu3) ++ // S: . OK UID FETCH completed ++ ++ // Prepare command and arguments ++ std::ostringstream cmd; ++ cmd.imbue(std::locale::classic()); ++ ++ cmd << "UID FETCH " << IMAPUtils::extractUIDFromGlobalUID(uids[0]); ++ ++ for (unsigned int i = 1, n = uids.size() ; i < n ; ++i) ++ cmd << "," << IMAPUtils::extractUIDFromGlobalUID(uids[i]); ++ ++ cmd << " UID"; ++ ++ // Send the request ++ m_connection->send(true, cmd.str(), true); ++ ++ // Get the response ++ utility::auto_ptr resp(m_connection->readResponse()); ++ ++ if (resp->isBad() || resp->response_done()->response_tagged()-> ++ resp_cond_state()->status() != IMAPParser::resp_cond_state::OK) ++ { ++ throw exceptions::command_error("UID FETCH ... UID", m_connection->getParser()->lastLine(), "bad response"); ++ } ++ ++ // Process the response ++ const std::vector & respDataList = ++ resp->continue_req_or_response_data(); ++ ++ std::vector > messages; ++ ++ for (std::vector ::const_iterator ++ it = respDataList.begin() ; it != respDataList.end() ; ++it) ++ { ++ if ((*it)->response_data() == NULL) ++ { ++ throw exceptions::command_error("UID FETCH ... UID", ++ m_connection->getParser()->lastLine(), "invalid response"); ++ } ++ ++ const IMAPParser::message_data* messageData = ++ (*it)->response_data()->message_data(); ++ ++ // We are only interested in responses of type "FETCH" ++ if (messageData == NULL || messageData->type() != IMAPParser::message_data::FETCH) ++ continue; ++ ++ // Get Process fetch response for this message ++ const int msgNum = static_cast (messageData->number()); ++ message::uid msgUID, msgFullUID; ++ ++ // Find UID in message attributes ++ const std::vector atts = messageData->msg_att()->items(); ++ ++ for (std::vector ::const_iterator ++ it = atts.begin() ; it != atts.end() ; ++it) ++ { ++ if ((*it)->type() == IMAPParser::msg_att_item::UID) ++ { ++ msgFullUID = IMAPUtils::makeGlobalUID(m_uidValidity, (*it)->unique_id()->value()); ++ msgUID = (*it)->unique_id()->value(); ++ ++ break; ++ } ++ } ++ ++ if (!msgUID.empty()) ++ { ++ ref thisFolder = thisRef().dynamicCast (); ++ messages.push_back(vmime::create (thisFolder, msgNum, msgFullUID)); ++ } ++ } ++ ++ return messages; ++} ++ ++ + int IMAPFolder::getMessageCount() + { + if (!isOpen()) +@@ -730,7 +833,7 @@ void IMAPFolder::fetchMessages(std::vector >& msg, const int opti + + if (msg != numberToMsg.end()) + { +- (*msg).second->processFetchResponse(options, messageData->msg_att()); ++ (*msg).second->processFetchResponse(options, messageData); + + if (progress) + progress->progress(++current, total); +@@ -1781,7 +1884,7 @@ std::vector IMAPFolder::getMessageNumbersStartingOnUID(const message::uid& + std::ostringstream command; + command.imbue(std::locale::classic()); + +- command << "SEARCH UID " << uid; ++ command << "SEARCH UID " << uid << ":*"; + + // Send the request + m_connection->send(true, command.str(), true); +diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp +index 8006920..7202a7d 100644 +--- a/src/net/imap/IMAPMessage.cpp ++++ b/src/net/imap/IMAPMessage.cpp +@@ -98,6 +98,14 @@ IMAPMessage::IMAPMessage(ref folder, const int num) + } + + ++IMAPMessage::IMAPMessage(ref folder, const int num, const uid& uniqueId) ++ : m_folder(folder), m_num(num), m_size(-1), m_flags(FLAG_UNDEFINED), ++ m_expunged(false), m_uid(uniqueId), m_structure(NULL) ++{ ++ folder->registerMessage(this); ++} ++ ++ + IMAPMessage::~IMAPMessage() + { + ref folder = m_folder.acquire(); +@@ -271,7 +279,11 @@ void IMAPMessage::extract(ref p, utility::outputStream& os, + std::ostringstream command; + command.imbue(std::locale::classic()); + +- command << "FETCH " << m_num << " BODY"; ++ if (m_uid.empty()) ++ command << "FETCH " << m_num << " BODY"; ++ else ++ command << "UID FETCH " << IMAPUtils::extractUIDFromGlobalUID(m_uid) << " BODY"; ++ + if (peek) command << ".PEEK"; + command << "["; + +@@ -361,19 +373,18 @@ void IMAPMessage::fetch(ref msgFolder, const int options) + continue; + + // Process fetch response for this message +- processFetchResponse(options, messageData->msg_att()); ++ processFetchResponse(options, messageData); + } + } + + + void IMAPMessage::processFetchResponse +- (const int options, const IMAPParser::msg_att* msgAtt) ++ (const int options, const IMAPParser::message_data* msgData) + { + ref folder = m_folder.acquire(); + + // Get message attributes +- const std::vector atts = +- msgAtt->items(); ++ const std::vector atts = msgData->msg_att()->items(); + + int flags = 0; + +@@ -389,12 +400,7 @@ void IMAPMessage::processFetchResponse + } + case IMAPParser::msg_att_item::UID: + { +- std::ostringstream oss; +- oss.imbue(std::locale::classic()); +- +- oss << folder->m_uidValidity << ":" << (*it)->unique_id()->value(); +- +- m_uid = oss.str(); ++ m_uid = IMAPUtils::makeGlobalUID(folder->m_uidValidity, (*it)->unique_id()->value()); + break; + } + case IMAPParser::msg_att_item::ENVELOPE: +diff --git a/src/net/imap/IMAPUtils.cpp b/src/net/imap/IMAPUtils.cpp +index 0d6fc47..eceac16 100644 +--- a/src/net/imap/IMAPUtils.cpp ++++ b/src/net/imap/IMAPUtils.cpp +@@ -540,6 +540,24 @@ const string IMAPUtils::listToSet(const std::vector & list, const int max, + + + // static ++const string IMAPUtils::listToSet(const std::vector & list) ++{ ++ if (list.size() == 0) ++ return ""; ++ ++ std::ostringstream res; ++ res.imbue(std::locale::classic()); ++ ++ res << extractUIDFromGlobalUID(list[0]); ++ ++ for (unsigned int i = 1, n = list.size() ; i < n ; ++i) ++ res << "," << extractUIDFromGlobalUID(list[i]); ++ ++ return res.str(); ++} ++ ++ ++// static + const string IMAPUtils::dateTime(const vmime::datetime& date) + { + std::ostringstream res; +@@ -609,7 +627,8 @@ const string IMAPUtils::dateTime(const vmime::datetime& date) + + + // static +-const string IMAPUtils::buildFetchRequest(const std::vector & list, const int options) ++const string IMAPUtils::buildFetchRequestImpl ++ (const std::string& mode, const std::string& set, const int options) + { + // Example: + // C: A654 FETCH 2:4 (FLAGS BODY[HEADER.FIELDS (DATE FROM)]) +@@ -671,7 +690,10 @@ const string IMAPUtils::buildFetchRequest(const std::vector & list, const i + std::ostringstream command; + command.imbue(std::locale::classic()); + +- command << "FETCH " << listToSet(list, -1, false) << " ("; ++ if (mode == "uid") ++ command << "UID FETCH " << set << " ("; ++ else ++ command << "FETCH " << set << " ("; + + for (std::vector ::const_iterator it = items.begin() ; + it != items.end() ; ++it) +@@ -687,6 +709,20 @@ const string IMAPUtils::buildFetchRequest(const std::vector & list, const i + + + // static ++const string IMAPUtils::buildFetchRequest(const std::vector & list, const int options) ++{ ++ return buildFetchRequestImpl("number", listToSet(list, -1, false), options); ++} ++ ++ ++// static ++const string IMAPUtils::buildFetchRequest(const std::vector & list, const int options) ++{ ++ return buildFetchRequestImpl("uid", listToSet(list), options); ++} ++ ++ ++// static + void IMAPUtils::convertAddressList + (const IMAPParser::address_list& src, mailboxList& dest) + { +@@ -706,6 +742,46 @@ void IMAPUtils::convertAddressList + } + + ++// static ++unsigned int IMAPUtils::extractUIDFromGlobalUID(const message::uid& uid) ++{ ++ message::uid::size_type colonPos = uid.find(':'); ++ ++ if (colonPos == message::uid::npos) ++ { ++ std::istringstream iss(uid); ++ iss.imbue(std::locale::classic()); ++ ++ unsigned int n = 0; ++ iss >> n; ++ ++ return n; ++ } ++ else ++ { ++ std::istringstream iss(uid.substr(colonPos + 1)); ++ iss.imbue(std::locale::classic()); ++ ++ unsigned int n = 0; ++ iss >> n; ++ ++ return n; ++ } ++} ++ ++ ++// static ++const message::uid IMAPUtils::makeGlobalUID(const unsigned int UIDValidity, const unsigned int messageUID) ++{ ++ std::ostringstream oss; ++ oss.imbue(std::locale::classic()); ++ ++ oss << UIDValidity << ":" << messageUID; ++ ++ return message::uid(oss.str()); ++} ++ ++ + } // imap + } // net + } // vmime +diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp +index 8c4b275..b606cda 100644 +--- a/src/net/maildir/maildirFolder.cpp ++++ b/src/net/maildir/maildirFolder.cpp +@@ -444,6 +444,18 @@ std::vector > maildirFolder::getMessages(const std::vector & + } + + ++ref maildirFolder::getMessageByUID(const message::uid& /* uid */) ++{ ++ throw exceptions::operation_not_supported(); ++} ++ ++ ++std::vector > maildirFolder::getMessagesByUID(const std::vector & /* uids */) ++{ ++ throw exceptions::operation_not_supported(); ++} ++ ++ + int maildirFolder::getMessageCount() + { + return (m_messageCount); +diff --git a/src/net/pop3/POP3Folder.cpp b/src/net/pop3/POP3Folder.cpp +index e085609..21e7a8b 100644 +--- a/src/net/pop3/POP3Folder.cpp ++++ b/src/net/pop3/POP3Folder.cpp +@@ -249,6 +249,18 @@ std::vector > POP3Folder::getMessages(const int from, const int t + } + + ++ref POP3Folder::getMessageByUID(const message::uid& /* uid */) ++{ ++ throw exceptions::operation_not_supported(); ++} ++ ++ ++std::vector > POP3Folder::getMessagesByUID(const std::vector & /* uids */) ++{ ++ throw exceptions::operation_not_supported(); ++} ++ ++ + std::vector > POP3Folder::getMessages(const std::vector & nums) + { + ref store = m_store.acquire(); +diff --git a/vmime/net/folder.hpp b/vmime/net/folder.hpp +index df9cbaf..a50ee0e 100644 +--- a/vmime/net/folder.hpp ++++ b/vmime/net/folder.hpp +@@ -169,7 +169,7 @@ public: + */ + virtual bool isOpen() const = 0; + +- /** Get a new reference to a message in this folder. ++ /** Get a new reference to a message in this folder, given its number. + * + * @param num message sequence number + * @return a new object referencing the specified message +@@ -177,7 +177,7 @@ public: + */ + virtual ref getMessage(const int num) = 0; + +- /** Get new references to messages in this folder. ++ /** Get new references to messages in this folder, given their numbers. + * + * @param from sequence number of the first message to get + * @param to sequence number of the last message to get +@@ -186,14 +186,30 @@ public: + */ + virtual std::vector > getMessages(const int from = 1, const int to = -1) = 0; + +- /** Get new references to messages in this folder. ++ /** Get new references to messages in this folder, given their numbers. + * +- * @param nums sequence numbers of the messages to delete ++ * @param nums sequence numbers of the messages to retrieve + * @return new objects referencing the specified messages + * @throw net_exception if an error occurs + */ + virtual std::vector > getMessages(const std::vector & nums) = 0; + ++ /** Get message in this folder, given its UID. ++ * ++ * @param uid UID of message to retrieve ++ * @return a new object referencing the specified message ++ * @throw net_exception if an error occurs ++ */ ++ virtual ref getMessageByUID(const message::uid& uid) = 0; ++ ++ /** Get messages in this folder, given their UIDs. ++ * ++ * @param uids UIDs of messages to retrieve ++ * @return new objects referencing the specified messages ++ * @throw net_exception if an error occurs ++ */ ++ virtual std::vector > getMessagesByUID(const std::vector & uids) = 0; ++ + /** Return the number of messages in this folder. + * + * @return number of messages in the folder +diff --git a/vmime/net/imap/IMAPFolder.hpp b/vmime/net/imap/IMAPFolder.hpp +index cc52596..3337858 100644 +--- a/vmime/net/imap/IMAPFolder.hpp ++++ b/vmime/net/imap/IMAPFolder.hpp +@@ -84,6 +84,12 @@ public: + ref getMessage(const int num); + std::vector > getMessages(const int from = 1, const int to = -1); + std::vector > getMessages(const std::vector & nums); ++ ++ ref getMessageByUID(const message::uid& uid); ++ std::vector > getMessagesByUID(const std::vector & uids); ++ ++ std::vector getMessageNumbersStartingOnUID(const message::uid& uid); ++ + int getMessageCount(); + + ref getFolder(const folder::path::component& name); +@@ -120,8 +126,6 @@ public: + + int getFetchCapabilities() const; + +- std::vector getMessageNumbersStartingOnUID(const message::uid& uid); +- + private: + + void registerMessage(IMAPMessage* msg); +@@ -152,7 +156,7 @@ private: + + int m_messageCount; + +- int m_uidValidity; ++ unsigned int m_uidValidity; + + std::vector m_messages; + }; +diff --git a/vmime/net/imap/IMAPMessage.hpp b/vmime/net/imap/IMAPMessage.hpp +index edbf69f..fbba6e7 100644 +--- a/vmime/net/imap/IMAPMessage.hpp ++++ b/vmime/net/imap/IMAPMessage.hpp +@@ -50,6 +50,7 @@ private: + friend class vmime::creator; // vmime::create + + IMAPMessage(ref folder, const int num); ++ IMAPMessage(ref folder, const int num, const uid& uniqueId); + IMAPMessage(const IMAPMessage&) : message() { } + + ~IMAPMessage(); +@@ -83,7 +84,7 @@ private: + + void fetch(ref folder, const int options); + +- void processFetchResponse(const int options, const IMAPParser::msg_att* msgAtt); ++ void processFetchResponse(const int options, const IMAPParser::message_data* msgData); + + /** Recursively fetch part header for all parts in the structure. + * +diff --git a/vmime/net/imap/IMAPUtils.hpp b/vmime/net/imap/IMAPUtils.hpp +index d1ed5c8..9c9c420 100644 +--- a/vmime/net/imap/IMAPUtils.hpp ++++ b/vmime/net/imap/IMAPUtils.hpp +@@ -29,6 +29,7 @@ + #include "vmime/dateTime.hpp" + + #include "vmime/net/folder.hpp" ++#include "vmime/net/message.hpp" + #include "vmime/net/imap/IMAPParser.hpp" + + #include "vmime/mailboxList.hpp" +@@ -65,8 +66,8 @@ public: + + static const string messageFlagList(const int flags); + +- /** Build an "IMAP set" given a list. The function tries to group +- * consecutive message numbers to reduce the list. ++ /** Build an "IMAP set" given a list of message numbers. The function tries ++ * to group consecutive message numbers to reduce the list. + * + * Example: + * IN = "1,2,3,4,5,7,8,13,15,16,17" +@@ -81,6 +82,13 @@ public: + static const string listToSet(const std::vector & list, + const int max = -1, const bool alreadySorted = false); + ++ /** Build an "IMAP set" set given a list of message UIDs. ++ * ++ * @param list list of message UIDs ++ * @return a set corresponding to the list ++ */ ++ static const string listToSet(const std::vector & list); ++ + /** Format a date/time to IMAP date/time format. + * + * @param date date/time to format +@@ -88,7 +96,7 @@ public: + */ + static const string dateTime(const vmime::datetime& date); + +- /** Construct a fetch request for the specified messages. ++ /** Construct a fetch request for the specified messages, designated by their sequence numbers. + * + * @param list list of message numbers + * @param options fetch options +@@ -96,12 +104,40 @@ public: + */ + static const string buildFetchRequest(const std::vector & list, const int options); + ++ /** Construct a fetch request for the specified messages, designated by their UIDs. ++ * ++ * @param list list of message UIDs ++ * @param options fetch options ++ * @return fetch request ++ */ ++ static const string buildFetchRequest(const std::vector & list, const int options); ++ + /** Convert a parser-style address list to a mailbox list. + * + * @param src input address list + * @param dest output mailbox list + */ + static void convertAddressList(const IMAPParser::address_list& src, mailboxList& dest); ++ ++ /** Extract the message UID from a globally unique UID. ++ * ++ * @param uid globally unique UID (as returned by makeGlobalUID(), for example) ++ * @return message UID ++ */ ++ static unsigned int extractUIDFromGlobalUID(const message::uid& uid); ++ ++ /** Construct a globally unique UID from UID Validity and a message UID. ++ * ++ * @param UIDValidity UID Validity of the folder ++ * @param messageUID UID of the message ++ * @return global UID ++ */ ++ static const message::uid makeGlobalUID(const unsigned int UIDValidity, const unsigned int messageUID); ++ ++private: ++ ++ static const string buildFetchRequestImpl ++ (const std::string& mode, const std::string& set, const int options); + }; + + +diff --git a/vmime/net/maildir/maildirFolder.hpp b/vmime/net/maildir/maildirFolder.hpp +index 68b5b89..c9ba899 100644 +--- a/vmime/net/maildir/maildirFolder.hpp ++++ b/vmime/net/maildir/maildirFolder.hpp +@@ -85,6 +85,10 @@ public: + ref getMessage(const int num); + std::vector > getMessages(const int from = 1, const int to = -1); + std::vector > getMessages(const std::vector & nums); ++ ++ ref getMessageByUID(const message::uid& uid); ++ std::vector > getMessagesByUID(const std::vector & uids); ++ + int getMessageCount(); + + ref getFolder(const folder::path::component& name); +diff --git a/vmime/net/pop3/POP3Folder.hpp b/vmime/net/pop3/POP3Folder.hpp +index c482908..090f948 100644 +--- a/vmime/net/pop3/POP3Folder.hpp ++++ b/vmime/net/pop3/POP3Folder.hpp +@@ -83,6 +83,10 @@ public: + ref getMessage(const int num); + std::vector > getMessages(const int from = 1, const int to = -1); + std::vector > getMessages(const std::vector & nums); ++ ++ ref getMessageByUID(const message::uid& uid); ++ std::vector > getMessagesByUID(const std::vector & uids); ++ + int getMessageCount(); + + ref getFolder(const folder::path::component& name); +-- +1.7.10.4 + + +From 7501f61214b06a35c8fce7772fd48dded2cad335 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Mon, 30 Jul 2012 11:23:23 +0200 +Subject: [PATCH 41/42] Fixed compilation warning. + + +diff --git a/vmime/utility/parserInputStreamAdapter.hpp b/vmime/utility/parserInputStreamAdapter.hpp +index c24fa44..861e75b 100644 +--- a/vmime/utility/parserInputStreamAdapter.hpp ++++ b/vmime/utility/parserInputStreamAdapter.hpp +@@ -82,7 +82,7 @@ public: + + m_stream->seek(initialPos); + +- return (readBytes == 1 ? buffer[0] : 0); ++ return (readBytes == 1 ? buffer[0] : static_cast (0)); + } + catch (...) + { +@@ -101,7 +101,7 @@ public: + value_type buffer[1]; + const size_type readBytes = m_stream->read(buffer, 1); + +- return (readBytes == 1 ? buffer[0] : 0); ++ return (readBytes == 1 ? buffer[0] : static_cast (0)); + } + + /** Check whether the bytes following the current position match +-- +1.7.10.4 + + +From f9f9b3bf52c76e1803855d1c44147f68ec9f62f2 Mon Sep 17 00:00:00 2001 +From: Vincent Richard +Date: Mon, 30 Jul 2012 20:45:17 +0200 +Subject: [PATCH 42/42] Fixed body part extraction (only body should be + extracted). + + +diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp +index 7202a7d..808f7d1 100644 +--- a/src/net/imap/IMAPMessage.cpp ++++ b/src/net/imap/IMAPMessage.cpp +@@ -192,7 +192,7 @@ void IMAPMessage::extract(utility::outputStream& os, utility::progressListener* + if (!folder) + throw exceptions::folder_not_found(); + +- extract(NULL, os, progress, start, length, false, peek); ++ extractImpl(NULL, os, progress, start, length, EXTRACT_HEADER | EXTRACT_BODY | (peek ? EXTRACT_PEEK : 0)); + } + + +@@ -205,7 +205,7 @@ void IMAPMessage::extractPart + if (!folder) + throw exceptions::folder_not_found(); + +- extract(p, os, progress, start, length, false, peek); ++ extractImpl(p, os, progress, start, length, EXTRACT_HEADER | EXTRACT_BODY | (peek ? EXTRACT_PEEK : 0)); + } + + +@@ -219,7 +219,7 @@ void IMAPMessage::fetchPartHeader(ref p) + std::ostringstream oss; + utility::outputStreamAdapter ossAdapter(oss); + +- extract(p, ossAdapter, NULL, 0, -1, true, true); ++ extractImpl(p, ossAdapter, NULL, 0, -1, EXTRACT_HEADER | EXTRACT_PEEK); + + p.dynamicCast ()->getOrCreateHeader().parse(oss.str()); + } +@@ -240,9 +240,9 @@ void IMAPMessage::fetchPartHeaderForStructure(ref str) + } + + +-void IMAPMessage::extract(ref p, utility::outputStream& os, ++void IMAPMessage::extractImpl(ref p, utility::outputStream& os, + utility::progressListener* progress, const int start, +- const int length, const bool headerOnly, const bool peek) const ++ const int length, const int extractFlags) const + { + ref folder = m_folder.acquire(); + +@@ -284,18 +284,45 @@ void IMAPMessage::extract(ref p, utility::outputStream& os, + else + command << "UID FETCH " << IMAPUtils::extractUIDFromGlobalUID(m_uid) << " BODY"; + +- if (peek) command << ".PEEK"; ++ /* ++ BODY[] header + body ++ BODY.PEEK[] header + body (peek) ++ BODY[HEADER] header ++ BODY.PEEK[HEADER] header (peek) ++ BODY[TEXT] body ++ BODY.PEEK[TEXT] body (peek) ++ */ ++ ++ if (extractFlags & EXTRACT_PEEK) ++ command << ".PEEK"; ++ + command << "["; + + if (section.str().empty()) + { +- if (headerOnly) ++ // header + body ++ if ((extractFlags & EXTRACT_HEADER) && (extractFlags & EXTRACT_BODY)) ++ command << ""; ++ // body only ++ else if (extractFlags & EXTRACT_BODY) ++ command << "TEXT"; ++ // header only ++ else if (extractFlags & EXTRACT_HEADER) + command << "HEADER"; + } + else + { + command << section.str(); +- if (headerOnly) command << ".MIME"; // "MIME" not "HEADER" for parts ++ ++ // header + body ++ if ((extractFlags & EXTRACT_HEADER) && (extractFlags & EXTRACT_BODY)) ++ *((int *) 0)=42;//throw exceptions::operation_not_supported(); ++ // body only ++ else if (extractFlags & EXTRACT_BODY) ++ command << ".TEXT"; ++ // header only ++ else if (extractFlags & EXTRACT_HEADER) ++ command << ".MIME"; // "MIME" not "HEADER" for parts + } + + command << "]"; +@@ -318,7 +345,7 @@ void IMAPMessage::extract(ref p, utility::outputStream& os, + } + + +- if (!headerOnly) ++ if (extractFlags & EXTRACT_BODY) + { + // TODO: update the flags (eg. flag "\Seen" may have been set) + } +diff --git a/src/net/imap/IMAPMessagePartContentHandler.cpp b/src/net/imap/IMAPMessagePartContentHandler.cpp +index 85c6ec2..c2cd647 100644 +--- a/src/net/imap/IMAPMessagePartContentHandler.cpp ++++ b/src/net/imap/IMAPMessagePartContentHandler.cpp +@@ -121,7 +121,7 @@ void IMAPMessagePartContentHandler::extract + // No decoding to perform + if (!isEncoded()) + { +- msg->extractPart(part, os, progress); ++ msg->extractImpl(part, os, progress, 0, -1, IMAPMessage::EXTRACT_BODY); + } + // Need to decode data + else +@@ -130,7 +130,7 @@ void IMAPMessagePartContentHandler::extract + std::ostringstream oss; + utility::outputStreamAdapter tmp(oss); + +- msg->extractPart(part, tmp, NULL); ++ msg->extractImpl(part, tmp, NULL, 0, -1, IMAPMessage::EXTRACT_BODY); + + // Encode temporary buffer to output stream + utility::inputStreamStringAdapter is(oss.str()); +diff --git a/vmime/net/imap/IMAPMessage.hpp b/vmime/net/imap/IMAPMessage.hpp +index fbba6e7..06f8091 100644 +--- a/vmime/net/imap/IMAPMessage.hpp ++++ b/vmime/net/imap/IMAPMessage.hpp +@@ -47,6 +47,7 @@ class IMAPMessage : public message + private: + + friend class IMAPFolder; ++ friend class IMAPMessagePartContentHandler; + friend class vmime::creator; // vmime::create + + IMAPMessage(ref folder, const int num); +@@ -101,7 +102,16 @@ private: + */ + void constructParsedMessage(ref parentPart, ref str, int level = 0); + +- void extract(ref p, utility::outputStream& os, utility::progressListener* progress, const int start, const int length, const bool headerOnly, const bool peek) const; ++ ++ enum ExtractFlags ++ { ++ EXTRACT_HEADER = 0x1, ++ EXTRACT_BODY = 0x2, ++ EXTRACT_PEEK = 0x10 ++ }; ++ ++ void extractImpl(ref p, utility::outputStream& os, utility::progressListener* progress, ++ const int start, const int length, const int extractFlags) const; + + + ref
    getOrCreateHeader(); +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/vmime.mk --- a/src/vmime.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/vmime.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,20 +10,16 @@ $(PKG)_DEPS := gcc libiconv gnutls libgsasl pthreads zlib define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/vmime/files/vmime/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/vmime/files/vmime/' | \ $(SED) -n 's,.*libvmime-\([0-9][^>]*\)\.tar.*,\1,p' | \ tail -1 endef define $(PKG)_BUILD + $(SED) -i 's/pkg-config/$(TARGET)-pkg-config/g;' '$(1)/SConstruct' + # The configure script will make the real configuration, but # we need scons to generate configure.in, Makefile.am etc. - # ansi and pedantic are too strict for mingw. - # http://sourceforge.net/tracker/index.php?func=detail&aid=2373234&group_id=2435&atid=102435 - $(SED) -i "s/'-ansi', //;" '$(1)/SConstruct' - $(SED) -i "s/'-pedantic', //;" '$(1)/SConstruct' - $(SED) -i 's/pkg-config/$(TARGET)-pkg-config/g;' '$(1)/SConstruct' - cd '$(1)' && scons autotools \ prefix='$(PREFIX)/$(TARGET)' \ target='$(TARGET)' \ @@ -33,6 +29,7 @@ cd '$(1)' && ./configure \ --prefix='$(PREFIX)/$(TARGET)' \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --enable-platform-windows \ --disable-rpath \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/vorbis.mk --- a/src/vorbis.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/vorbis.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := vorbis $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 4b089ace4c8420c479b2fde9c5b01588cf86c959 +$(PKG)_CHECKSUM := 8dae60349292ed76db0e490dc5ee51088a84518b $(PKG)_SUBDIR := libvorbis-$($(PKG)_VERSION) $(PKG)_FILE := libvorbis-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://downloads.xiph.org/releases/vorbis/$($(PKG)_FILE) $(PKG)_DEPS := gcc ogg define $(PKG)_UPDATE - wget -q -O- 'http://www.xiph.org/downloads/' | \ + $(WGET) -q -O- 'http://www.xiph.org/downloads/' | \ $(SED) -n 's,.*libvorbis-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef @@ -18,6 +18,7 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ PKG_CONFIG='$(TARGET)-pkg-config' diff -r 1d1285b1f6a0 -r d733a98b84d6 src/vtk.mk --- a/src/vtk.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/vtk.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := qt expat freetype jpeg libxml2 libpng tiff zlib libodbc++ postgresql define $(PKG)_UPDATE - wget -q -O- 'http://vtk.org/gitweb?p=VTK.git;a=tags' | \ + $(WGET) -q -O- 'http://vtk.org/gitweb?p=VTK.git;a=tags' | \ grep 'refs/tags/v[0-9.]*"' | \ $(SED) 's,.*refs/tags/v\(.*\)".*,\1,g;' | \ head -1 @@ -21,7 +21,6 @@ # first we need a native build to create the compile tools mkdir '$(1)/native_build' cd '$(1)/native_build' && cmake \ - -DCMAKE_BUILD_TYPE='Release' \ -DBUILD_TESTING=FALSE \ -DOPENGL_INCLUDE_DIR='$(1)/Utilities/ParseOGLExt/headers' \ -DVTK_USE_RENDERING=FALSE \ diff -r 1d1285b1f6a0 -r d733a98b84d6 src/w32api.mk --- a/src/w32api.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/w32api.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/' | \ $(SED) -n 's,.*w32api-\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/winpcap.mk --- a/src/winpcap.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/winpcap.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://www.winpcap.org/devel.htm' | \ + $(WGET) -q -O- 'http://www.winpcap.org/devel.htm' | \ $(SED) -n 's,.*WpcapSrc_\([0-9][^>]*\)\.zip.*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/wt-1-fixes.patch --- a/src/wt-1-fixes.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/wt-1-fixes.patch Thu Sep 20 10:43:06 2012 +0200 @@ -1,10 +1,102 @@ -# This file is part of MXE. -# See index.html for further information. +This file is part of MXE. +See index.html for further information. + +From 29e0f572f1c1875089601cb0dcae3bd1c3ea7118 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Mon, 18 Jun 2012 13:02:03 +0200 +Subject: [PATCH 1/2] fix case of winsock2.h which matters when cross-building + +taken from +http://sourceforge.net/mailarchive/message.php?msg_id=29421539 +--- + src/Wt/Auth/HashFunction.C | 2 +- + src/Wt/Utils.C | 2 +- + src/http/Configuration.C | 4 ++-- + src/web/TimeUtil.C | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) -diff -ur a/cmake/WtFindBoost-vintage.txt b/cmake/WtFindBoost-vintage.txt ---- a/cmake/WtFindBoost-vintage.txt 2011-11-15 04:49:29.000000000 -0300 -+++ b/cmake/WtFindBoost-vintage.txt 2012-02-02 19:21:07.108060403 -0300 -@@ -70,6 +70,7 @@ +diff --git a/src/Wt/Auth/HashFunction.C b/src/Wt/Auth/HashFunction.C +index 6d764fa..34615e0 100644 +--- a/src/Wt/Auth/HashFunction.C ++++ b/src/Wt/Auth/HashFunction.C +@@ -15,7 +15,7 @@ + #ifndef WIN32 + #include + #else +-#include ++#include + #endif + #endif + +diff --git a/src/Wt/Utils.C b/src/Wt/Utils.C +index 02cdf7d..75fca49 100644 +--- a/src/Wt/Utils.C ++++ b/src/Wt/Utils.C +@@ -13,7 +13,7 @@ + #ifndef WIN32 + #include + #else +-#include ++#include + #endif + + #include "Wt/WLogger" +diff --git a/src/http/Configuration.C b/src/http/Configuration.C +index 6312ae6..3ebf772 100644 +--- a/src/http/Configuration.C ++++ b/src/http/Configuration.C +@@ -18,13 +18,13 @@ + #endif + #ifdef WIN32 + #include // for getpid() +-#include // for gethostname() ++#include // for gethostname() + #endif + #include + #include + + #ifdef __CYGWIN__ +-#include // for gethostname() ++#include // for gethostname() + #endif + + namespace Wt { +diff --git a/src/web/TimeUtil.C b/src/web/TimeUtil.C +index fbada4a..94c2423 100644 +--- a/src/web/TimeUtil.C ++++ b/src/web/TimeUtil.C +@@ -1,7 +1,7 @@ + #include "TimeUtil.h" + + #ifdef _MSC_VER +-#include "Winsock2.h" ++#include "winsock2.h" + #pragma comment (lib, "winmm.lib") + namespace { + #include +-- +1.7.10.4 + + +From f64c3140b11fe2a6d353950229b4edae6ec306a1 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Mon, 18 Jun 2012 13:23:21 +0200 +Subject: [PATCH 2/2] fixes for mxe + +--- + cmake/WtFindBoost-vintage.txt | 1 + + cmake/WtFindGm.txt | 6 ++++++ + cmake/WtFindHaru.txt | 12 ++++++++++++ + cmake/WtFindPangoFt2.txt | 14 +++++++++----- + cmake/WtFindSsl.txt | 5 +++++ + src/Wt/WRasterImage.C | 9 --------- + 6 files changed, 33 insertions(+), 14 deletions(-) + +diff --git a/cmake/WtFindBoost-vintage.txt b/cmake/WtFindBoost-vintage.txt +index e48b21e..1198139 100644 +--- a/cmake/WtFindBoost-vintage.txt ++++ b/cmake/WtFindBoost-vintage.txt +@@ -70,6 +70,7 @@ ELSE(MSVC) boost_thread-${BOOST_COMPILER}-mt-${BOOST_FLAGS}-${BOOST_VERSION} boost_thread-${BOOST_COMPILER}-mt-${BOOST_VERSION} boost_thread-${BOOST_COMPILER}-mt @@ -12,10 +104,11 @@ boost_thread-mt-${BOOST_VERSION} boost_thread-mt boost_thread-${BOOST_COMPILER}-${BOOST_VERSION} -diff -ur a/cmake/WtFindGm.txt b/cmake/WtFindGm.txt ---- a/cmake/WtFindGm.txt 2011-04-01 07:35:50.000000000 -0300 -+++ b/cmake/WtFindGm.txt 2012-02-02 21:31:04.157439938 -0300 -@@ -59,6 +59,12 @@ +diff --git a/cmake/WtFindGm.txt b/cmake/WtFindGm.txt +index 76697fc..9bc0fa1 100644 +--- a/cmake/WtFindGm.txt ++++ b/cmake/WtFindGm.txt +@@ -59,6 +59,12 @@ IF(WIN32) ELSE(GM_LIB AND GMPP_LIB AND GM_LIB_DEBUG AND GMPP_LIB_DEBUG AND GM_INCLUDE_DIR) SET(GM_FOUND FALSE) ENDIF(GM_LIB AND GMPP_LIB AND GM_LIB_DEBUG AND GMPP_LIB_DEBUG AND GM_INCLUDE_DIR) @@ -28,10 +121,11 @@ ELSE(WIN32) FIND_LIBRARY(GM_LIB NAMES -diff -ur a/cmake/WtFindHaru.txt b/cmake/WtFindHaru.txt ---- a/cmake/WtFindHaru.txt 2011-01-10 05:50:55.000000000 -0300 -+++ b/cmake/WtFindHaru.txt 2012-02-02 21:32:08.165440382 -0300 -@@ -44,6 +44,7 @@ +diff --git a/cmake/WtFindHaru.txt b/cmake/WtFindHaru.txt +index 4dba35f..642bd58 100644 +--- a/cmake/WtFindHaru.txt ++++ b/cmake/WtFindHaru.txt +@@ -44,6 +44,7 @@ IF(WIN32) FIND_LIBRARY(Z_LIB NAMES zlib @@ -39,7 +133,7 @@ PATHS ${HARU_PREFIX}/lib ${USERLIB_PREFIX}/lib -@@ -58,6 +59,17 @@ +@@ -58,6 +59,17 @@ IF(WIN32) SET(HARU_SUPPORT_LIBS ${HARU_SUPPORT_LIBS} ${Z_LIB}) ENDIF(Z_LIB) ENDIF(HARU_LIB_RELEASE AND HARU_LIB_DEBUG) @@ -57,10 +151,11 @@ SET(HARU_SUPPORT_LIBS_FOUND TRUE) ELSE(WIN32) FIND_LIBRARY(HARU_LIB -diff -ur a/cmake/WtFindPangoFt2.txt b/cmake/WtFindPangoFt2.txt ---- a/cmake/WtFindPangoFt2.txt 2011-11-28 06:26:54.000000000 -0300 -+++ b/cmake/WtFindPangoFt2.txt 2012-02-02 21:17:14.341434198 -0300 -@@ -36,11 +36,15 @@ +diff --git a/cmake/WtFindPangoFt2.txt b/cmake/WtFindPangoFt2.txt +index cd1e640..b1bbe3d 100644 +--- a/cmake/WtFindPangoFt2.txt ++++ b/cmake/WtFindPangoFt2.txt +@@ -36,11 +36,15 @@ SET(PANGO_FT2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${GLIB2_CONFIG_INCLUDE_DIR}) @@ -81,10 +176,11 @@ IF (PANGO_INCLUDE_DIR AND FT2_INCLUDE_DIR -diff -ur a/cmake/WtFindSsl.txt b/cmake/WtFindSsl.txt ---- a/cmake/WtFindSsl.txt 2011-09-19 09:34:19.000000000 -0300 -+++ b/cmake/WtFindSsl.txt 2012-02-02 21:17:53.033434468 -0300 -@@ -81,6 +81,11 @@ +diff --git a/cmake/WtFindSsl.txt b/cmake/WtFindSsl.txt +index fdbcb5f..578baf1 100644 +--- a/cmake/WtFindSsl.txt ++++ b/cmake/WtFindSsl.txt +@@ -81,6 +81,11 @@ IF(WIN32) AND SSL_LIB_DEBUG AND SSL_TOO_LIB_RELEASE AND SSL_TOO_LIB_DEBUG) @@ -96,21 +192,10 @@ ELSE (WIN32) FIND_LIBRARY(SSL_LIB NAMES -diff -ur a/src/http/Configuration.C b/src/http/Configuration.C ---- a/src/http/Configuration.C 2011-11-24 13:17:42.000000000 -0300 -+++ b/src/http/Configuration.C 2012-02-02 19:21:07.112060403 -0300 -@@ -18,7 +18,7 @@ - #endif - #ifdef WIN32 - #include // for getpid() --#include // for gethostname() -+#include // for gethostname() - #endif - #include - #include -diff -ur a/src/Wt/WRasterImage.C b/src/Wt/WRasterImage.C ---- a/src/Wt/WRasterImage.C 2011-11-24 13:17:42.000000000 -0300 -+++ b/src/Wt/WRasterImage.C 2012-02-02 19:21:07.112060403 -0300 +diff --git a/src/Wt/WRasterImage.C b/src/Wt/WRasterImage.C +index 4c52f39..e948691 100644 +--- a/src/Wt/WRasterImage.C ++++ b/src/Wt/WRasterImage.C @@ -38,15 +38,6 @@ #define M_PI 3.14159265358979323846 #endif @@ -127,3 +212,6 @@ namespace { static const double EPSILON = 1E-5; +-- +1.7.10.4 + diff -r 1d1285b1f6a0 -r d733a98b84d6 src/wt.mk --- a/src/wt.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/wt.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := wt $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 38cf20980f16b0970c42ace45fd62edb28b6358b +$(PKG)_CHECKSUM := 6102a9a2be36cedf41aa6095de6a2a9505629fd6 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/witty/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc boost openssl libharu graphicsmagick pango postgresql sqlite define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/witty/files/witty/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/witty/files/witty/' | \ $(SED) -n 's,.*wt-\([0-9][^>]*\)\.tar.*,\1,p' | \ tail -1 endef @@ -31,8 +31,8 @@ -DGM_PREFIX='$(PREFIX)/$(TARGET)' \ -DGM_LIBS="`'$(TARGET)-pkg-config' --libs-only-l GraphicsMagick++`" \ -DPANGO_FT2_LIBS="`'$(TARGET)-pkg-config' --libs-only-l pangoft2`" \ + -DWT_CMAKE_FINDER_INSTALL_DIR='/lib/wt' \ -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ - -DCMAKE_BUILD_TYPE:STRING="Release" \ '$(1)' $(MAKE) -C '$(1).build' -j '$(JOBS)' install VERBOSE=1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/wxwidgets.mk --- a/src/wxwidgets.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/wxwidgets.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc libiconv libpng jpeg tiff sdl zlib expat define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/wxwindows/files/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/wxwindows/files/' | \ $(SED) -n 's,.*/\([0-9][^"9]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/xapian-core.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/xapian-core.mk Thu Sep 20 10:43:06 2012 +0200 @@ -0,0 +1,19 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := xapian-core +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 1be1896ab11a3a66c6c0ade962c700d96678116e +$(PKG)_SUBDIR := xapian-core-$($(PKG)_VERSION) +$(PKG)_FILE := xapian-core-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://oligarchy.co.uk/xapian/$($(PKG)_VERSION)/xapian-core-$($(PKG)_VERSION).tar.gz +$(PKG)_DEPS := gcc zlib + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --prefix='$(PREFIX)/$(TARGET)' \ + --enable-static + $(MAKE) -C '$(1)' -j '$(JOBS)' install +endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/xerces.mk --- a/src/xerces.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/xerces.mk Thu Sep 20 10:43:06 2012 +0200 @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc libiconv curl define $(PKG)_UPDATE - wget -q -O- 'http://www.apache.org/dist/xerces/c/3/sources/?C=M;O=D' | \ + $(WGET) -q -O- 'http://www.apache.org/dist/xerces/c/3/sources/?C=M;O=D' | \ $(SED) -n 's,.* Date: Sun, 13 Nov 2011 12:05:22 +0100 -Subject: [PATCH 2/4] fake missing definitions for WIN32 +Subject: [PATCH 1/4] fake missing definitions for WIN32 Taken from: https://bugs.xine-project.org/show_bug.cgi?id=433 +--- + src/audio_out/audio_file_out.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) diff --git a/src/audio_out/audio_file_out.c b/src/audio_out/audio_file_out.c -index 802461e..8b9b704 100644 +index bc40d4e..a613a89 100644 --- a/src/audio_out/audio_file_out.c +++ b/src/audio_out/audio_file_out.c @@ -53,6 +53,18 @@ @@ -79,17 +36,20 @@ struct wavhdr { -- -1.7.8.3 +1.7.10.4 -From 42946ec1f900d22b62cb28996b9f12d11d7be7a8 Mon Sep 17 00:00:00 2001 -From: MXE +From 4a7cd803cbc3daa3f19fdc6b34fb93e1994bc2f5 Mon Sep 17 00:00:00 2001 +From: "mxe@mxe.cc" Date: Sun, 13 Nov 2011 13:45:21 +0100 -Subject: [PATCH 3/4] force graphicsmagick over imagemagick +Subject: [PATCH 2/4] force graphicsmagick over imagemagick +--- + configure.ac | 9 --------- + 1 file changed, 9 deletions(-) diff --git a/configure.ac b/configure.ac -index b175301..d37ba36 100644 +index 9112b58..67f1147 100644 --- a/configure.ac +++ b/configure.ac @@ -1412,14 +1412,6 @@ AC_ARG_WITH([imagemagick], @@ -116,37 +76,68 @@ AC_MSG_ERROR([ImageMagick support requested, but neither Wand, MagickWand, nor GraphicsMagick were found]) elif test "x$have_imagemagick" = "xyes"; then -- -1.7.8.3 +1.7.10.4 -From f0fa8b5b9570cdf88788067b1a76669c6863ac9f Mon Sep 17 00:00:00 2001 -From: MXE -Date: Mon, 30 Jan 2012 09:21:33 +0100 -Subject: [PATCH 4/4] zlib 1.2.6 compatibility +From 5b362f4aed3a814a351cd259efb62b40761ddb3d Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Sun, 27 May 2012 23:28:57 +0200 +Subject: [PATCH 3/4] add missing localtime_r + +Previously provided by pthreads-w32-2-8-0-release, which is also +the source of this version. +--- + src/localtime_r.h | 3 +++ + src/xine-engine/scratch.c | 1 + + 2 files changed, 4 insertions(+) + create mode 100644 src/localtime_r.h + +diff --git a/src/localtime_r.h b/src/localtime_r.h +new file mode 100644 +index 0000000..ec778c5 +--- /dev/null ++++ b/src/localtime_r.h +@@ -0,0 +1,3 @@ ++#define localtime_r( _clock, _result ) \ ++ ( *(_result) = *localtime( (_clock) ), \ ++ (_result) ) +diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c +index 39bb592..41d561b 100644 +--- a/src/xine-engine/scratch.c ++++ b/src/xine-engine/scratch.c +@@ -36,6 +36,7 @@ + + #include "xineutils.h" + #include "scratch.h" ++#include "localtime_r.h" + + static void XINE_FORMAT_PRINTF(2, 0) + scratch_printf (scratch_buffer_t *this, const char *format, va_list argp) +-- +1.7.10.4 -diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c -index 1d22ea3..0fbde93 100644 ---- a/src/xine-engine/osd.c -+++ b/src/xine-engine/osd.c -@@ -650,7 +650,7 @@ static void osd_set_position (osd_object_t *osd, int x, int y) { - osd->display_y = y; +From 0d3546c3c12a8bf311c9751f0d0d2e3a95569657 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Sun, 27 May 2012 23:23:19 +0200 +Subject: [PATCH 4/4] ffmpeg 0.11 removed avcodec_init + +--- + src/combined/ffmpeg/ffmpeg_decoder.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/combined/ffmpeg/ffmpeg_decoder.c b/src/combined/ffmpeg/ffmpeg_decoder.c +index 879df53..84ee1a3 100644 +--- a/src/combined/ffmpeg/ffmpeg_decoder.c ++++ b/src/combined/ffmpeg/ffmpeg_decoder.c +@@ -312,7 +312,6 @@ void avcodec_register_all(void) + + void init_once_routine(void) { + pthread_mutex_init(&ffmpeg_lock, NULL); +- avcodec_init(); + avcodec_register_all(); } --static uint16_t gzread_i16(gzFile *fp) { -+static uint16_t gzread_i16(gzFile fp) { - uint16_t ret; - ret = gzgetc(fp); - ret |= (gzgetc(fp)<<8); -@@ -663,7 +663,7 @@ static uint16_t gzread_i16(gzFile *fp) { - - static int osd_renderer_load_font(osd_renderer_t *this, char *filename) { - -- gzFile *fp; -+ gzFile fp; - osd_font_t *font = NULL; - int i, ret = 0; - -- -1.7.8.3 +1.7.10.4 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/xine-lib.mk --- a/src/xine-lib.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/xine-lib.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := xine-lib $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 68e85049723b491ccb22d5123bf8fa780529868a +$(PKG)_CHECKSUM := 0adf20ef55d24f2a1b4a8974e57ad1be5133b236 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) -$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2 +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/xine/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc faad2 ffmpeg flac fontconfig freetype graphicsmagick libiconv libmng pthreads sdl speex theora vorbis zlib define $(PKG)_UPDATE - wget -q -O- 'http://hg.debian.org/hg/xine-lib/xine-lib/tags' | \ + $(WGET) -q -O- 'http://hg.debian.org/hg/xine-lib/xine-lib/tags' | \ $(SED) -n 's,>,\n,gp' | \ $(SED) -n 's,^\([0-9][^< ]*\)<.*,\1,p' | \ head -1 diff -r 1d1285b1f6a0 -r d733a98b84d6 src/xmlwrapp.mk --- a/src/xmlwrapp.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/xmlwrapp.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := xmlwrapp $(PKG)_IGNORE := -$(PKG)_CHECKSUM := b3ef8bff215bbacd988790615b76379672105928 +$(PKG)_CHECKSUM := 7bd66ecc1204b296580a499fd929d77b79e6e85a $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE) -$(PKG)_DEPS := gcc libxml2 libxslt +$(PKG)_DEPS := gcc boost libxml2 libxslt define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/xmlwrapp/files/xmlwrapp/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/xmlwrapp/files/xmlwrapp/' | \ $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/xvidcore.mk --- a/src/xvidcore.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/xvidcore.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc pthreads define $(PKG)_UPDATE - wget -q -O- 'http://www.xvid.org/' | \ + $(WGET) -q -O- 'http://www.xvid.org/' | \ $(SED) -n 's,.*Xvid \([0-9][^ ]*\) .*,\1,p' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/xz.mk --- a/src/xz.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/xz.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,14 +3,14 @@ PKG := xz $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 50ce842bea6519537457d9ad90d110a127656786 +$(PKG)_CHECKSUM := 3e976d7715fde43422572c70f927bfdae56a94c3 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://tukaani.org/xz/$($(PKG)_FILE) $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://tukaani.org/xz/' | \ + $(WGET) -q -O- 'http://tukaani.org/xz/' | \ $(SED) -n 's,.*xz-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef @@ -18,9 +18,9 @@ define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ + --build="`config.guess`" \ --prefix='$(PREFIX)/$(TARGET)' \ --disable-shared \ - --disable-dynamic \ --disable-threads \ --disable-nls $(MAKE) -C '$(1)'/src/liblzma -j '$(JOBS)' install diff -r 1d1285b1f6a0 -r d733a98b84d6 src/zlib-1-win32-static.patch --- a/src/zlib-1-win32-static.patch Thu Sep 20 10:38:14 2012 +0200 +++ b/src/zlib-1-win32-static.patch Thu Sep 20 10:43:06 2012 +0200 @@ -13,7 +13,7 @@ index ea430bf..f2573e7 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -188,11 +188,11 @@ install-libs: $(LIBS) +@@ -190,11 +190,11 @@ install-libs: $(LIBS) -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi @@ -31,7 +31,7 @@ index 780317c..6e6a033 100755 --- a/configure +++ b/configure -@@ -180,10 +180,7 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) >> configure.log 2>&1; then +@@ -205,10 +205,7 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) >> configure.log 2>&1; then CYGWIN* | Cygwin* | cygwin* | OS/2*) EXE='.exe' ;; MINGW* | mingw*) diff -r 1d1285b1f6a0 -r d733a98b84d6 src/zlib.mk --- a/src/zlib.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/zlib.mk Thu Sep 20 10:43:06 2012 +0200 @@ -3,7 +3,7 @@ PKG := zlib $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 3d445731e4bfea1cd00f36567d77d6e5f5a19be9 +$(PKG)_CHECKSUM := 858818fe6d358ec682d54ac5e106a2dd62628e7f $(PKG)_SUBDIR := zlib-$($(PKG)_VERSION) $(PKG)_FILE := zlib-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := http://zlib.net/$($(PKG)_FILE) @@ -11,7 +11,7 @@ $(PKG)_DEPS := gcc define $(PKG)_UPDATE - wget -q -O- 'http://zlib.net/' | \ + $(WGET) -q -O- 'http://zlib.net/' | \ $(SED) -n 's,.*zlib-\([0-9][^>]*\)\.tar.*,\1,ip' | \ head -1 endef diff -r 1d1285b1f6a0 -r d733a98b84d6 src/zziplib.mk --- a/src/zziplib.mk Thu Sep 20 10:38:14 2012 +0200 +++ b/src/zziplib.mk Thu Sep 20 10:43:06 2012 +0200 @@ -10,7 +10,7 @@ $(PKG)_DEPS := gcc zlib define $(PKG)_UPDATE - wget -q -O- 'http://sourceforge.net/projects/zziplib/files/' | \ + $(WGET) -q -O- 'http://sourceforge.net/projects/zziplib/files/' | \ $(SED) -n 's,.*zziplib-\([0-9][^>]*\)\.tar.*,\1,p' | \ head -1 endef