summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/lzo
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-support/lzo
downloadpoky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-support/lzo')
-rw-r--r--meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch70
-rw-r--r--meta/recipes-support/lzo/lzo/acinclude.m4358
-rw-r--r--meta/recipes-support/lzo/lzo_2.08.bb24
3 files changed, 452 insertions, 0 deletions
diff --git a/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch b/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
new file mode 100644
index 0000000000..c26891b46f
--- /dev/null
+++ b/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
@@ -0,0 +1,70 @@
1From: Simon McVittie <smcv@debian.org>
2Date: Sun, 23 Nov 2014 22:50:33 +0000
3Subject: Use memcpy() instead of reinventing it
4
5gcc inlines memcpy() with results as fast as handwritten code (at
6least in my brief testing with lzop), and knows the alignment
7constraints for our architectures.
8
9Change suggested by Julian Taylor.
10
11Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757037
12
13Upstream-Status: Pending
14Signed-off-by: Saul Wold <sgw@linux.intel.com>
15---
16 minilzo/minilzo.c | 14 ++++++++++++++
17 src/lzo_func.h | 14 ++++++++++++++
18 2 files changed, 28 insertions(+)
19
20
21diff --git a/minilzo/minilzo.c b/minilzo/minilzo.c
22index ab2be5f..6913c2f 100644
23--- a/minilzo/minilzo.c
24+++ b/minilzo/minilzo.c
25@@ -3523,6 +3523,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
26 if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
27 LZO_BLOCK_END
28
29+/* Debian-specific change: we know that our compiler inlines memcpy() with
30+ * constant n to be as fast as handwritten code, and knows which architectures
31+ * need things correctly aligned. */
32+#undef LZO_MEMOPS_COPY1
33+#undef LZO_MEMOPS_COPY2
34+#undef LZO_MEMOPS_COPY4
35+#undef LZO_MEMOPS_COPY8
36+#undef LZO_MEMOPS_COPYN
37+#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
38+#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
39+#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
40+#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
41+#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
42+
43 __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
44 {
45 lzo_uint16_t v;
46diff --git a/src/lzo_func.h b/src/lzo_func.h
47index dfaa676..1cc1b53 100644
48--- a/src/lzo_func.h
49+++ b/src/lzo_func.h
50@@ -333,6 +333,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
51 if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
52 LZO_BLOCK_END
53
54+/* Debian-specific change: we know that our compiler inlines memcpy() with
55+ * constant n to be as fast as handwritten code, and knows which architectures
56+ * need things correctly aligned. */
57+#undef LZO_MEMOPS_COPY1
58+#undef LZO_MEMOPS_COPY2
59+#undef LZO_MEMOPS_COPY4
60+#undef LZO_MEMOPS_COPY8
61+#undef LZO_MEMOPS_COPYN
62+#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
63+#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
64+#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
65+#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
66+#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
67+
68 __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
69 {
70 lzo_uint16_t v;
diff --git a/meta/recipes-support/lzo/lzo/acinclude.m4 b/meta/recipes-support/lzo/lzo/acinclude.m4
new file mode 100644
index 0000000000..c4d2ccd5b5
--- /dev/null
+++ b/meta/recipes-support/lzo/lzo/acinclude.m4
@@ -0,0 +1,358 @@
1
2AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
3AC_C_BIGENDIAN([AC_DEFINE(ACC_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
4])#
5
6AC_DEFUN([mfx_ACC_CHECK_HEADERS], [
7AC_HEADER_TIME
8AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/stat.h sys/time.h sys/types.h sys/wait.h])
9])#
10
11AC_DEFUN([mfx_ACC_CHECK_FUNCS], [
12AC_CHECK_FUNCS(access alloca atexit atoi atol chmod chown ctime difftime fstat gettimeofday gmtime localtime longjmp lstat memcmp memcpy memmove memset mktime qsort raise setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf)
13])#
14
15
16AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [
17AC_CHECK_SIZEOF(short)
18AC_CHECK_SIZEOF(int)
19AC_CHECK_SIZEOF(long)
20
21AC_CHECK_SIZEOF(long long)
22AC_CHECK_SIZEOF(__int16)
23AC_CHECK_SIZEOF(__int32)
24AC_CHECK_SIZEOF(__int64)
25
26AC_CHECK_SIZEOF(void *)
27AC_CHECK_SIZEOF(size_t)
28AC_CHECK_SIZEOF(ptrdiff_t)
29])#
30
31
32# /***********************************************************************
33# // Check for ACC_conformance
34# ************************************************************************/
35
36AC_DEFUN([mfx_ACC_ACCCHK], [
37mfx_tmp=$1
38mfx_save_CPPFLAGS=$CPPFLAGS
39dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
40test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
41
42AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
43
44AC_LANG_CONFTEST([AC_LANG_PROGRAM(
45[[#define ACC_CONFIG_NO_HEADER 1
46#include "acc/acc.h"
47#include "acc/acc_incd.h"
48#undef ACCCHK_ASSERT
49#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
50#include "acc/acc_chk.ch"
51#undef ACCCHK_ASSERT
52static void test_acc_compile_time_assert(void) {
53#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
54#include "acc/acc_chk.ch"
55#undef ACCCHK_ASSERT
56}
57#undef NDEBUG
58#include <assert.h>
59static int test_acc_run_time_assert(int r) {
60#define ACCCHK_ASSERT(expr) assert(expr);
61#include "acc/acc_chk.ch"
62#undef ACCCHK_ASSERT
63return r;
64}
65]], [[
66test_acc_compile_time_assert();
67if (test_acc_run_time_assert(1) != 1) return 1;
68]]
69)])
70
71mfx_tmp=FAILED
72_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
73rm -f conftest.$ac_ext conftest.$ac_objext
74
75CPPFLAGS=$mfx_save_CPPFLAGS
76
77AC_MSG_RESULT([$mfx_tmp])
78case x$mfx_tmp in
79 xpassed | xyes) ;;
80 *)
81 AC_MSG_NOTICE([])
82 AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
83 AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
84 AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
85 AC_MSG_NOTICE([Thanks for your support.])
86 AC_MSG_NOTICE([])
87 AC_MSG_ERROR([ACC conformance test failed. Stop.])
88dnl AS_EXIT
89 ;;
90esac
91])# mfx_ACC_ACCCHK
92
93
94# /***********************************************************************
95# // Check for ACC_conformance
96# ************************************************************************/
97
98AC_DEFUN([mfx_MINIACC_ACCCHK], [
99mfx_tmp=$1
100mfx_save_CPPFLAGS=$CPPFLAGS
101dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
102test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
103
104AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
105
106AC_LANG_CONFTEST([AC_LANG_PROGRAM(
107[[#define ACC_CONFIG_NO_HEADER 1
108#define ACC_WANT_ACC_INCD_H 1
109#include $2
110
111#define ACC_WANT_ACC_CHK_CH 1
112#undef ACCCHK_ASSERT
113#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
114#include $2
115
116#define ACC_WANT_ACC_CHK_CH 1
117#undef ACCCHK_ASSERT
118#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
119static void test_acc_compile_time_assert(void) {
120#include $2
121}
122
123#undef NDEBUG
124#include <assert.h>
125#define ACC_WANT_ACC_CHK_CH 1
126#undef ACCCHK_ASSERT
127#define ACCCHK_ASSERT(expr) assert(expr);
128static int test_acc_run_time_assert(int r) {
129#include $2
130return r;
131}
132]], [[
133test_acc_compile_time_assert();
134if (test_acc_run_time_assert(1) != 1) return 1;
135]]
136)])
137
138mfx_tmp=FAILED
139_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
140rm -f conftest.$ac_ext conftest.$ac_objext
141
142CPPFLAGS=$mfx_save_CPPFLAGS
143
144AC_MSG_RESULT([$mfx_tmp])
145case x$mfx_tmp in
146 xpassed | xyes) ;;
147 *)
148 AC_MSG_NOTICE([])
149 AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
150 AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
151 AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
152 AC_MSG_NOTICE([Thanks for your support.])
153 AC_MSG_NOTICE([])
154 AC_MSG_ERROR([ACC conformance test failed. Stop.])
155dnl AS_EXIT
156 ;;
157esac
158])# mfx_MINIACC_ACCCHK
159
160
161
162# serial 1
163
164AC_DEFUN([mfx_PROG_CPPFLAGS], [
165AC_MSG_CHECKING([whether the C preprocessor needs special flags])
166
167AC_LANG_CONFTEST([AC_LANG_PROGRAM(
168[[#include <limits.h>
169#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
170# include "your C preprocessor is broken 1"
171#elif (0xffffu == 0xfffffffful)
172# include "your C preprocessor is broken 2"
173#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX)
174# include "your C preprocessor is broken 3"
175#endif
176]], [[ ]]
177)])
178
179mfx_save_CPPFLAGS=$CPPFLAGS
180mfx_tmp=ERROR
181for mfx_arg in "" -no-cpp-precomp
182do
183 CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS"
184 _AC_COMPILE_IFELSE([],
185[mfx_tmp=$mfx_arg
186break])
187done
188CPPFLAGS=$mfx_save_CPPFLAGS
189rm -f conftest.$ac_ext conftest.$ac_objext
190case x$mfx_tmp in
191 x)
192 AC_MSG_RESULT([none needed]) ;;
193 xERROR)
194 AC_MSG_RESULT([ERROR])
195 AC_MSG_ERROR([your C preprocessor is broken - for details see config.log])
196 ;;
197 *)
198 AC_MSG_RESULT([$mfx_tmp])
199 CPPFLAGS="$mfx_tmp $CPPFLAGS"
200 ;;
201esac
202])# mfx_PROG_CPPFLAGS
203
204
205
206# serial 3
207
208AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [
209AC_CACHE_CHECK([whether limits.h is sane],
210mfx_cv_header_sane_limits_h,
211[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <limits.h>
212#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
213# if defined(__APPLE__) && defined(__GNUC__)
214# error "your preprocessor is broken - use compiler option -no-cpp-precomp"
215# else
216# include "your preprocessor is broken"
217# endif
218#endif
219#define MFX_0xffff 0xffff
220#define MFX_0xffffffffL 4294967295ul
221#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
222# include "error CHAR_BIT"
223#endif
224#if !defined(UCHAR_MAX)
225# include "error UCHAR_MAX 1"
226#endif
227#if !defined(USHRT_MAX)
228# include "error USHRT_MAX 1"
229#endif
230#if !defined(UINT_MAX)
231# include "error UINT_MAX 1"
232#endif
233#if !defined(ULONG_MAX)
234# include "error ULONG_MAX 1"
235#endif
236#if !defined(SHRT_MAX)
237# include "error SHRT_MAX 1"
238#endif
239#if !defined(INT_MAX)
240# include "error INT_MAX 1"
241#endif
242#if !defined(LONG_MAX)
243# include "error LONG_MAX 1"
244#endif
245#if (UCHAR_MAX < 1)
246# include "error UCHAR_MAX 2"
247#endif
248#if (USHRT_MAX < 1)
249# include "error USHRT_MAX 2"
250#endif
251#if (UINT_MAX < 1)
252# include "error UINT_MAX 2"
253#endif
254#if (ULONG_MAX < 1)
255# include "error ULONG_MAX 2"
256#endif
257#if (UCHAR_MAX < 0xff)
258# include "error UCHAR_MAX 3"
259#endif
260#if (USHRT_MAX < MFX_0xffff)
261# include "error USHRT_MAX 3"
262#endif
263#if (UINT_MAX < MFX_0xffff)
264# include "error UINT_MAX 3"
265#endif
266#if (ULONG_MAX < MFX_0xffffffffL)
267# include "error ULONG_MAX 3"
268#endif
269#if (USHRT_MAX > UINT_MAX)
270# include "error USHRT_MAX vs UINT_MAX"
271#endif
272#if (UINT_MAX > ULONG_MAX)
273# include "error UINT_MAX vs ULONG_MAX"
274#endif
275]], [[
276#if (USHRT_MAX == MFX_0xffff)
277{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
278#elif (USHRT_MAX >= MFX_0xffff)
279{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
280#endif
281#if (UINT_MAX == MFX_0xffff)
282{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
283#elif (UINT_MAX >= MFX_0xffff)
284{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
285#endif
286#if (ULONG_MAX == MFX_0xffff)
287{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
288#elif (ULONG_MAX >= MFX_0xffff)
289{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
290#endif
291#if (USHRT_MAX == MFX_0xffffffffL)
292{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
293#elif (USHRT_MAX >= MFX_0xffffffffL)
294{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
295#endif
296#if (UINT_MAX == MFX_0xffffffffL)
297{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
298#elif (UINT_MAX >= MFX_0xffffffffL)
299{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
300#endif
301#if (ULONG_MAX == MFX_0xffffffffL)
302{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
303#elif (ULONG_MAX >= MFX_0xffffffffL)
304{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
305#endif
306]])],
307[mfx_cv_header_sane_limits_h=yes],
308[mfx_cv_header_sane_limits_h=no])])
309])
310
311# /***********************************************************************
312# // standard
313# ************************************************************************/
314
315AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [
316AC_C_BIGENDIAN([AC_DEFINE(LZO_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(LZO_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
317])#
318
319
320# /***********************************************************************
321# //
322# ************************************************************************/
323
324dnl more types which are not yet covered by ACC
325
326AC_DEFUN([mfx_CHECK_SIZEOF], [
327AC_CHECK_SIZEOF(__int32)
328AC_CHECK_SIZEOF(intmax_t)
329AC_CHECK_SIZEOF(uintmax_t)
330AC_CHECK_SIZEOF(intptr_t)
331AC_CHECK_SIZEOF(uintptr_t)
332
333AC_CHECK_SIZEOF(float)
334AC_CHECK_SIZEOF(double)
335AC_CHECK_SIZEOF(long double)
336
337AC_CHECK_SIZEOF(dev_t)
338AC_CHECK_SIZEOF(fpos_t)
339AC_CHECK_SIZEOF(mode_t)
340AC_CHECK_SIZEOF(off_t)
341AC_CHECK_SIZEOF(ssize_t)
342AC_CHECK_SIZEOF(time_t)
343])#
344
345
346
347AC_DEFUN([mfx_CHECK_LIB_WINMM], [
348if test "X$GCC" = Xyes; then
349case $host_os in
350cygwin* | mingw* | pw32*)
351 test "X$LIBS" != "X" && LIBS="$LIBS "
352 LIBS="${LIBS}-lwinmm" ;;
353*)
354 ;;
355esac
356fi
357])#
358
diff --git a/meta/recipes-support/lzo/lzo_2.08.bb b/meta/recipes-support/lzo/lzo_2.08.bb
new file mode 100644
index 0000000000..af06e29a6f
--- /dev/null
+++ b/meta/recipes-support/lzo/lzo_2.08.bb
@@ -0,0 +1,24 @@
1SUMMARY = "Lossless data compression library"
2HOMEPAGE = "http://www.oberhumer.com/opensource/lzo/"
3SECTION = "libs"
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
6 file://src/lzo_init.c;beginline=5;endline=25;md5=a6e25df9a83b24629e847846ccdd8054"
7
8SRC_URI = "http://www.oberhumer.com/opensource/lzo/download/lzo-${PV}.tar.gz \
9 file://0001-Use-memcpy-instead-of-reinventing-it.patch \
10 file://acinclude.m4 \
11 "
12
13SRC_URI[md5sum] = "fcec64c26a0f4f4901468f360029678f"
14SRC_URI[sha256sum] = "ac1b3e4dee46febe9fd28737eb7f5692d3232ef1a01da10444394c3d47536614"
15
16inherit autotools
17
18EXTRA_OECONF = "--enable-shared"
19
20do_configure_prepend () {
21 cp ${WORKDIR}/acinclude.m4 ${S}/
22}
23
24BBCLASSEXTEND = "native nativesdk"