From 6df733320ea501fdbb0d2de80a41122f9ac1e0f1 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 21 Mar 2010 07:56:41 +0000 Subject: [PATCH] - updated to 8a (merged from libjpeg.spec) Changed files: crossmingw32-libjpeg-shared.patch -> 1.3 crossmingw32-libjpeg.spec -> 1.17 libjpeg-DESTDIR.patch -> 1.2 libjpeg-c++.patch -> 1.3 libjpeg-include.patch -> 1.2 libjpeg-maxmem-sysconf.patch -> 1.1 --- crossmingw32-libjpeg-shared.patch | 17 ---------- crossmingw32-libjpeg.spec | 55 +++++++++---------------------- libjpeg-DESTDIR.patch | 53 ----------------------------- libjpeg-c++.patch | 24 -------------- libjpeg-include.patch | 13 -------- libjpeg-maxmem-sysconf.patch | 49 +++++++++++++++++++++++++++ 6 files changed, 65 insertions(+), 146 deletions(-) delete mode 100644 crossmingw32-libjpeg-shared.patch delete mode 100644 libjpeg-DESTDIR.patch delete mode 100644 libjpeg-c++.patch delete mode 100644 libjpeg-include.patch create mode 100644 libjpeg-maxmem-sysconf.patch diff --git a/crossmingw32-libjpeg-shared.patch b/crossmingw32-libjpeg-shared.patch deleted file mode 100644 index 82f8047..0000000 --- a/crossmingw32-libjpeg-shared.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -ruN jpeg-6b./makefile.cfg jpeg-6b/makefile.cfg ---- jpeg-6b./makefile.cfg 2003-12-25 03:23:00.000000000 +0100 -+++ jpeg-6b/makefile.cfg 2003-12-25 03:26:30.147554616 +0100 -@@ -166,9 +166,12 @@ - $(AR) libjpeg.a $(LIBOBJECTS) - $(AR2) libjpeg.a - -+jpeg.dll: $(LIBOBJECTS) -+ $(CC) $(LIBOBJECTS) -shared -Wl,--enable-auto-image-base -o jpeg.dll -Wl,--out-implib,libjpeg.dll.a -+ - # with libtool: - libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS) -- $(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \ -+ $(LIBTOOL) --mode=link $(CC) -no-undefined -o libjpeg.la $(LIBOBJECTS) \ - -rpath $(libdir) -version-info $(JPEG_LIB_VERSION) - - # sample programs: diff --git a/crossmingw32-libjpeg.spec b/crossmingw32-libjpeg.spec index 3d9cb22..a781091 100644 --- a/crossmingw32-libjpeg.spec +++ b/crossmingw32-libjpeg.spec @@ -2,16 +2,13 @@ Summary: Library for handling different jpeg files - Mingw32 cross version Summary(pl.UTF-8): Biblioteka do manipulacji plikami w formacie jpeg - wersja skrośna dla Mingw32 Name: crossmingw32-%{realname} -Version: 6b -Release: 6 +Version: 8a +Release: 1 License: distributable Group: Development/Libraries -Source0: ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{version}.tar.gz -# Source0-md5: dbd5f3b47ed13132f04c685d608a7547 -Patch0: %{realname}-DESTDIR.patch -Patch1: %{realname}-include.patch -Patch2: %{realname}-c++.patch -Patch3: %{name}-shared.patch +Source0: http://www.ijg.org/files/jpegsrc.v%{version}.tar.gz +# Source0-md5: 5146e68be3633c597b0d14d3ed8fa2ea +Patch0: %{realname}-maxmem-sysconf.patch URL: http://www.ijg.org/ BuildRequires: autoconf >= 2.50 BuildRequires: automake @@ -36,6 +33,8 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc %define optflags -O2 %endif +# -z options are invalid for mingw linker +%define filterout_ld -Wl,-z,.* %description The libjpeg package contains a library of functions for manipulating @@ -75,50 +74,27 @@ libjpeg - biblioteka DLL dla Windows. %prep %setup -q -n jpeg-%{version} %patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 - -cp /usr/share/automake/config.* . - -# hack: use recent libtool by configuring for mingw32 in separate dir -# (cannot regenerate main ac/lt because of missing configure.in) -mkdir lthack -cd lthack -cat >configure.ac < /* fetch private declarations */ - #include /* fetch error codes too */ -+#endif -+ -+#ifdef __cplusplus -+} - #endif - - #endif /* JPEGLIB_H */ diff --git a/libjpeg-include.patch b/libjpeg-include.patch deleted file mode 100644 index edd7286..0000000 --- a/libjpeg-include.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- jpeg-6b/jpeglib.h -+++ jpeg-6b.new/jpeglib.h -@@ -24 +24 @@ --#include "jconfig.h" /* widely used configuration options */ -+#include /* widely used configuration options */ -@@ -26 +26 @@ --#include "jmorecfg.h" /* seldom changed options */ -+#include /* seldom changed options */ -@@ -1092,2 +1092,2 @@ --#include "jpegint.h" /* fetch private declarations */ --#include "jerror.h" /* fetch error codes too */ -+#include /* fetch private declarations */ -+#include /* fetch error codes too */ diff --git a/libjpeg-maxmem-sysconf.patch b/libjpeg-maxmem-sysconf.patch new file mode 100644 index 0000000..b1c8d72 --- /dev/null +++ b/libjpeg-maxmem-sysconf.patch @@ -0,0 +1,49 @@ +# Make a reasonable guess about memory limits using sysconf(). +# includes 5% slop factor as suggested in documentation. + +--- jpeg-6b/jmemansi.c ++++ jpeg-6b/jmemansi.c +@@ -12,6 +12,15 @@ + * is shoved onto the user. + */ + ++#include ++ ++#ifdef __FreeBSD__ ++# include ++# include ++# include ++# include ++#endif ++ + #define JPEG_INTERNALS + #include "jinclude.h" + #include "jpeglib.h" +@@ -157,7 +166,26 @@ + GLOBAL(long) + jpeg_mem_init (j_common_ptr cinfo) + { +- return DEFAULT_MAX_MEM; /* default for max_memory_to_use */ ++#ifdef _SC_AVPHYS_PAGES ++ long phys_size; ++ ++ if ((phys_size = sysconf(_SC_AVPHYS_PAGES)) == -1) ++ return DEFAULT_MAX_MEM; /* default for max_memory_to_use */ ++ if ((phys_size *= sysconf(_SC_PAGESIZE)) < 0) ++ return DEFAULT_MAX_MEM; ++ return (long) (phys_size * 0.95); ++#elif defined(HAVE_SYSCTL) && defined(HW_PHYSMEM) ++ /* This works on *bsd and darwin. */ ++ unsigned int physmem; ++ size_t len = sizeof physmem; ++ static int mib[2] = { CTL_HW, HW_PHYSMEM }; ++ ++ if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0 ++ && len == sizeof (physmem)) ++ return (long) (physmem * 0.95); ++#endif ++ ++ return DEFAULT_MAX_MEM; + } + + GLOBAL(void) -- 2.43.0