diff --git a/src/libjpeg-turbo-1-fixes.patch b/src/libjpeg-turbo-1-fixes.patch new file mode 100644 index 00000000..b2bf4f14 --- /dev/null +++ b/src/libjpeg-turbo-1-fixes.patch @@ -0,0 +1,73 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From 04ccaff0828b986fe9c97334734957b0edb8b007 Mon Sep 17 00:00:00 2001 +From: MXE +Date: Sun, 6 Sep 2015 23:16:12 +1000 +Subject: [PATCH 1/2] fix typedef conflicts + +taken from: +https://aur.archlinux.org/cgit/aur.git/tree/0001-header-compat.mingw.patch?h=mingw-w64-libjpeg-turbo + +diff --git a/jmorecfg.h b/jmorecfg.h +index 108e7de..ea74b4f 100644 +--- a/jmorecfg.h ++++ b/jmorecfg.h +@@ -12,6 +12,12 @@ + * optimizations. Most users will not need to touch this file. + */ + ++/* prevents conflicts */ ++#if defined(__MINGW32__) ++#include /* typedefs INT16 and INT32 */ ++ ++#define HAVE_BOOLEAN ++#endif + + /* + * Maximum number of components (color channels) allowed in JPEG image. +@@ -112,6 +118,7 @@ typedef char JOCTET; + #endif /* HAVE_UNSIGNED_CHAR */ + + ++#ifndef _BASETSD_H_ /* basestd.h from mingw-w64 defines UINT8, UINT16, INT16, INT32 */ + /* These typedefs are used for various table entries and so forth. + * They must be at least as wide as specified; but making them too big + * won't cost a huge amount of memory, so we don't provide special +@@ -150,6 +157,7 @@ typedef short INT16; + #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ + typedef long INT32; + #endif ++#endif + + /* Datatype used for image dimensions. The JPEG standard only supports + * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore +-- +2.3.2 (Apple Git-55) + + +From 530578ee474c1f85732705cdcd95cb0cf529c52e Mon Sep 17 00:00:00 2001 +From: MXE +Date: Sun, 6 Sep 2015 23:17:23 +1000 +Subject: [PATCH 2/2] include stdio.h + +taken from: +https://aur.archlinux.org/cgit/aur.git/tree/libjpeg-turbo-1.3.1-libmng-compatibility.patch?h=mingw-w64-libjpeg-turbo + +diff --git a/jpeglib.h b/jpeglib.h +index 9615c5d..f5fffe5 100644 +--- a/jpeglib.h ++++ b/jpeglib.h +@@ -28,6 +28,7 @@ + #endif + #include "jmorecfg.h" /* seldom changed options */ + ++#include + + #ifdef __cplusplus + #ifndef DONT_USE_EXTERN_C +-- +2.3.2 (Apple Git-55) + diff --git a/src/libjpeg-turbo.mk b/src/libjpeg-turbo.mk index 5eb2285a..e47af58b 100644 --- a/src/libjpeg-turbo.mk +++ b/src/libjpeg-turbo.mk @@ -17,8 +17,26 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD - $(SED) -i 's,yasm,$(TARGET)-yasm,g' '$(1)/configure' cd '$(1)' && ./configure \ - $(MXE_CONFIGURE_OPTS) - $(MAKE) -C '$(1)' -j '$(JOBS)' install + $(MXE_CONFIGURE_OPTS) \ + --libdir='$(PREFIX)/$(TARGET)/lib/$(PKG)' \ + --includedir='$(PREFIX)/$(TARGET)/include/$(PKG)' \ + NASM=$(TARGET)-yasm + $(MAKE) -C '$(1)' -j '$(JOBS)' install $(MXE_DISABLE_CRUFT) + + # create pkg-config file + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig' + (echo 'Name: jpeg-turbo'; \ + echo 'Version: $($(PKG)_VERSION)'; \ + echo 'Description: jpeg-turbo'; \ + echo 'Cflags: -I$(PREFIX)/$(TARGET)/include/$(PKG)'; \ + echo 'Libs: -L$(PREFIX)/$(TARGET)/lib/$(PKG) -ljpeg';) \ + > '$(PREFIX)/$(TARGET)/lib/pkgconfig/jpeg-turbo.pc' + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(TOP_DIR)/src/jpeg-test.c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \ + `'$(TARGET)-pkg-config' jpeg-turbo --cflags --libs` endef + +$(PKG)_BUILD_SHARED =