dev-libs/ucl: initial import of version 1.03

This commit is contained in:
Julian Ospald 2020-05-08 13:06:41 +02:00
parent 086fadd439
commit e8a511645b
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
3 changed files with 342 additions and 0 deletions

View File

@ -0,0 +1,134 @@
From: Nathan Phillip Brink <binki@gentoo.org>
Subject: Respect CCASFLAGS (which often defaults to CFLAGS). Fixes
compilation for portage-multilib users.
diff -r c090ed619e90 configure.ac
--- a/configure.ac Sun Jun 26 16:00:09 2011 -0400
+++ b/configure.ac Sun Jun 26 20:52:01 2011 -0400
@@ -47,14 +47,12 @@
AC_CANONICAL_TARGET
AM_MAINTAINER_MODE
-if test -z "$ac_abs_top_srcdir"; then
- _AC_SRCPATHS(.)
-fi
if test -r .Conf.settings1; then
. ./.Conf.settings1
fi
AC_PROG_CC
+AM_PROG_AS
AC_PROG_CPP
mfx_PROG_CPPFLAGS
AC_C_CONST
@@ -84,13 +82,13 @@
if test "X$enable_asm" != Xno; then
mfx_compile_S='${CC-cc} -c conftest.S 1>&AS_MESSAGE_LOG_FD'
cat > conftest.S <<EOF
-#include "$ac_abs_top_srcdir/asm/i386/src_gas/crc_asm.S"
+#include "$srcdir/asm/i386/src_gas/crc_asm.S"
EOF
enable_asm=no
if AC_TRY_EVAL(mfx_compile_S); then
if AC_TRY_COMMAND([test -s conftest.$ac_objext]); then
enable_asm=yes
- UCL_ASM_VPATH=":$ac_abs_top_srcdir/asm/i386/src_gas"
+ UCL_ASM_VPATH=":\$(top_srcdir)/asm/i386/src_gas"
fi
fi
if test "X$enable_asm" = Xno; then
@@ -160,11 +158,6 @@
AC_SUBST(UCL_CFLAGS)
AC_SUBST(UCL_EXTRA_CFLAGS)
-configure_CPPFLAGS=$CPPFLAGS
-configure_CFLAGS=$CFLAGS
-AC_SUBST(configure_CPPFLAGS)
-AC_SUBST(configure_CFLAGS)
-
AC_CONFIG_FILES([Makefile examples/Makefile include/Makefile include/ucl/Makefile src/Makefile])
AC_OUTPUT
diff -r c090ed619e90 src/Makefile.am
--- a/src/Makefile.am Sun Jun 26 16:00:09 2011 -0400
+++ b/src/Makefile.am Sun Jun 26 20:52:01 2011 -0400
@@ -4,11 +4,10 @@
#
VPATH = @srcdir@@UCL_ASM_VPATH@
-SUFFIXES = .S
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
-CPPFLAGS = $(UCL_CPPFLAGS) $(configure_CPPFLAGS) $(UCL_EXTRA_CPPFLAGS)
-CFLAGS = $(UCL_CFLAGS) $(configure_CFLAGS) $(UCL_EXTRA_CFLAGS)
+AM_CPPFLAGS = $(UCL_CPPFLAGS) $(UCL_EXTRA_CPPFLAGS)
+AM_CFLAGS = $(UCL_CFLAGS) $(UCL_EXTRA_CFLAGS)
lib_LTLIBRARIES = libucl.la
@@ -16,51 +15,37 @@
libucl_la_SOURCES = \
alloc.c \
+ getbit.h \
n2b_99.c n2b_d.c n2b_ds.c n2b_to.c \
n2d_99.c n2d_d.c n2d_ds.c n2d_to.c \
n2e_99.c n2e_d.c n2e_ds.c n2e_to.c \
+ ucl_conf.h \
ucl_crc.c \
ucl_init.c \
- ucl_ptr.c \
+ ucl_ptr.c ucl_ptr.h \
ucl_str.c \
ucl_util.c
EXTRA_DIST = \
- getbit.h \
n2_99.ch \
- ucl_conf.h \
ucl_dll.ch \
ucl_mchw.ch \
- ucl_ptr.h \
ucl_swd.ch
-libucl_la_LIBADD = $(UCL_ASM_OBJECTS)
-libucl_la_DEPENDENCIES = $(libucl_la_LIBADD)
-
-
# /***********************************************************************
# // assembler support
# ************************************************************************/
if UCL_USE_ASM
-
-UCL_ASM_OBJECTS = \
- cpuid.lo crc_asm.lo crcs_asm.lo rdtsc.lo rdtsca.lo \
- n2b_d_f1.lo n2b_d_f2.lo n2b_d_f3.lo n2b_d_f4.lo n2b_d_f5.lo n2b_d_f6.lo \
- n2b_d_n1.lo n2b_d_n2.lo n2b_d_n3.lo n2b_d_n4.lo n2b_d_n5.lo n2b_d_n6.lo \
- n2b_d_s1.lo n2b_d_s2.lo n2b_d_s3.lo n2b_d_s4.lo n2b_d_s5.lo n2b_d_s6.lo \
- n2d_d_f1.lo n2d_d_f2.lo n2d_d_f3.lo n2d_d_f4.lo n2d_d_f5.lo n2d_d_f6.lo \
- n2d_d_n1.lo n2d_d_n2.lo n2d_d_n3.lo n2d_d_n4.lo n2d_d_n5.lo n2d_d_n6.lo \
- n2d_d_s1.lo n2d_d_s2.lo n2d_d_s3.lo n2d_d_s4.lo n2d_d_s5.lo n2d_d_s6.lo \
- n2e_d_f1.lo n2e_d_f2.lo n2e_d_f3.lo n2e_d_f4.lo n2e_d_f5.lo n2e_d_f6.lo \
- n2e_d_n1.lo n2e_d_n2.lo n2e_d_n3.lo n2e_d_n4.lo n2e_d_n5.lo n2e_d_n6.lo \
- n2e_d_s1.lo n2e_d_s2.lo n2e_d_s3.lo n2e_d_s4.lo n2e_d_s5.lo n2e_d_s6.lo
-
-.S.o:
- $(CC) -c $<
-
-.S.lo:
- $(LIBTOOL) --mode=compile $(CC) -c $<
-
+libucl_la_SOURCES += \
+ cpuid.S crc_asm.S crcs_asm.S rdtsc.S rdtsca.S \
+ n2b_d_f1.S n2b_d_f2.S n2b_d_f3.S n2b_d_f4.S n2b_d_f5.S n2b_d_f6.S \
+ n2b_d_n1.S n2b_d_n2.S n2b_d_n3.S n2b_d_n4.S n2b_d_n5.S n2b_d_n6.S \
+ n2b_d_s1.S n2b_d_s2.S n2b_d_s3.S n2b_d_s4.S n2b_d_s5.S n2b_d_s6.S \
+ n2d_d_f1.S n2d_d_f2.S n2d_d_f3.S n2d_d_f4.S n2d_d_f5.S n2d_d_f6.S \
+ n2d_d_n1.S n2d_d_n2.S n2d_d_n3.S n2d_d_n4.S n2d_d_n5.S n2d_d_n6.S \
+ n2d_d_s1.S n2d_d_s2.S n2d_d_s3.S n2d_d_s4.S n2d_d_s5.S n2d_d_s6.S \
+ n2e_d_f1.S n2e_d_f2.S n2e_d_f3.S n2e_d_f4.S n2e_d_f5.S n2e_d_f6.S \
+ n2e_d_n1.S n2e_d_n2.S n2e_d_n3.S n2e_d_n4.S n2e_d_n5.S n2e_d_n6.S \
+ n2e_d_s1.S n2e_d_s2.S n2e_d_s3.S n2e_d_s4.S n2e_d_s5.S n2e_d_s6.S
endif
-

View File

@ -0,0 +1,173 @@
port ucl to the x32 ABI
https://bugs.gentoo.org/426334
--- a/acc/acc_arch.h
+++ b/acc/acc_arch.h
@@ -19,6 +19,7 @@
* ACC_ARCH_UNKNOWN [default]
* ACC_ARCH_ALPHA
* ACC_ARCH_AMD64 aka x86-64 or ia32e
+ * ACC_ARCH_X32 aka x86-32
* ACC_ARCH_C166
* ACC_ARCH_IA16 Intel Architecture (8088, 8086, 80186, 80286)
* ACC_ARCH_IA32 Intel Architecture (80386+)
@@ -42,8 +43,13 @@
# define ACC_ARCH_IA16 1
# define ACC_INFO_ARCH "ia16"
#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
+# ifdef __ILP32__
+# define ACC_ARCH_X32 1
+# define ACC_INFO_ARCH "x32"
+# else
# define ACC_ARCH_AMD64 1
# define ACC_INFO_ARCH "amd64"
+# endif
#elif (UINT_MAX <= ACC_0xffffL) && defined(__AVR__)
# define ACC_ARCH_AVR 1
# define ACC_INFO_ARCH "avr"
@@ -92,7 +98,7 @@
#endif
-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA16 || ACC_ARCH_IA32)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_IA16 || ACC_ARCH_IA32 || ACC_ARCH_X32)
# define ACC_ENDIAN_LITTLE_ENDIAN 1
# define ACC_INFO_ENDIAN "little-endian"
#elif (ACC_ARCH_M68K)
--- a/acc/acc_chk.ch
+++ b/acc/acc_chk.ch
@@ -407,7 +407,7 @@
#if (ACC_ARCH_IA16)
ACCCHK_ASSERT(sizeof(size_t) == 2)
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
-#elif (ACC_ARCH_IA32 || ACC_ARCH_M68K)
+#elif (ACC_ARCH_IA32 || ACC_ARCH_M68K || ACC_ARCH_X32)
ACCCHK_ASSERT(sizeof(size_t) == 4)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4)
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
--- a/acc/acc_lib.h
+++ b/acc/acc_lib.h
@@ -423,13 +423,13 @@ ACCLIB_EXTERN(void, acc_set_le64) (acc_hvoid_p, acc_uint64l_t);
#endif
/* inline versions */
-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32)
# define ACC_GET_LE16(p) (* (const unsigned short *) (p))
# define ACC_GET_LE32(p) (* (const acc_uint32e_t *) (p))
# define ACC_SET_LE16(p,v) (* (unsigned short *) (p) = (unsigned short) (v))
# define ACC_SET_LE32(p,v) (* (acc_uint32e_t *) (p) = (acc_uint32e_t) (v))
#endif
-#if (ACC_ARCH_AMD64)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_X32)
# define ACC_GET_LE64(p) (* (const acc_uint64l_t *) (p))
# define ACC_SET_LE64(p,v) (* (acc_uint64l_t *) (p) = (acc_uint64l_t) (v))
#endif
--- a/acc/acclib/bele.ch
+++ b/acc/acclib/bele.ch
@@ -71,7 +71,7 @@ ACCLIB_PUBLIC(void, acc_set_be32) (acc_hvoid_p p, acc_uint32l_t v)
ACCLIB_PUBLIC(unsigned, acc_get_le16) (const acc_hvoid_p p)
{
-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32)
return (* (const unsigned short *) (p));
#else
const acc_hbyte_p b = (const acc_hbyte_p) p;
@@ -87,7 +87,7 @@ ACCLIB_PUBLIC(acc_uint32l_t, acc_get_le24) (const acc_hvoid_p p)
ACCLIB_PUBLIC(acc_uint32l_t, acc_get_le32) (const acc_hvoid_p p)
{
-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32)
return (* (const acc_uint32e_t *) (p));
#else
const acc_hbyte_p b = (const acc_hbyte_p) p;
@@ -102,7 +102,7 @@ ACCLIB_PUBLIC(acc_uint32l_t, acc_get_le32) (const acc_hvoid_p p)
ACCLIB_PUBLIC(void, acc_set_le16) (acc_hvoid_p p, unsigned v)
{
-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32)
(* (unsigned short *) (p) = (unsigned short) (v));
#else
acc_hbyte_p b = (acc_hbyte_p) p;
@@ -121,7 +121,7 @@ ACCLIB_PUBLIC(void, acc_set_le24) (acc_hvoid_p p, acc_uint32l_t v)
ACCLIB_PUBLIC(void, acc_set_le32) (acc_hvoid_p p, acc_uint32l_t v)
{
-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32)
(* (acc_uint32e_t *) (p) = (acc_uint32e_t) (v));
#else
acc_hbyte_p b = (acc_hbyte_p) p;
@@ -191,7 +191,7 @@ ACCLIB_PUBLIC(void, acc_set_be64) (acc_hvoid_p p, acc_uint64l_t v)
ACCLIB_PUBLIC(acc_uint64l_t, acc_get_le64) (const acc_hvoid_p p)
{
-#if (ACC_ARCH_AMD64)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_X32)
return (* (const acc_uint64l_t *) (p));
#elif (ACC_ARCH_IA32)
const acc_uint32e_t* b = (const acc_uint32e_t*) p;
@@ -211,7 +211,7 @@ ACCLIB_PUBLIC(acc_uint64l_t, acc_get_le64) (const acc_hvoid_p p)
ACCLIB_PUBLIC(void, acc_set_le64) (acc_hvoid_p p, acc_uint64l_t v)
{
-#if (ACC_ARCH_AMD64)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_X32)
(* (acc_uint64l_t *) (p)) = v;
#elif (ACC_ARCH_IA32)
(((acc_uint32e_t *)(p))[0] = (acc_uint32e_t) (v >> 0));
--- a/acc/acclib/perfctr.ch
+++ b/acc/acclib/perfctr.ch
@@ -63,7 +63,7 @@ ACCLIB_PUBLIC(int, acc_perfctr_open) (acc_perfctr_handle_p h)
break; /* no working TSC available */
case PERFCTR_X86_AMD_K7:
#endif
-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32)
case PERFCTR_X86_AMD_K8:
case PERFCTR_X86_AMD_K8C:
cc->tsc_on = 1; cc->nractrs = 2;
--- a/acc/acclib/rdtsc.ch
+++ b/acc/acclib/rdtsc.ch
@@ -21,7 +21,7 @@
#if defined(acc_int32e_t)
-#if ((ACC_ARCH_AMD64 || ACC_ARCH_IA32) && ACC_CC_GNUC)
+#if ((ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32) && ACC_CC_GNUC)
# if (ACC_CC_GNUC >= 0x020000ul)
# define __ACCLIB_RDTSC_REGS : : "r" (t) : "cc", "memory", "eax", "edx"
# else
@@ -38,7 +38,7 @@
ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t)
{
-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && defined(__ACCLIB_RDTSC_REGS)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32) && defined(__ACCLIB_RDTSC_REGS)
__asm__ __volatile__(
"clc \n" ".byte 0x0f, 0x31\n"
"movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
@@ -73,7 +73,7 @@ ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t)
ACCLIB_PUBLIC(int, acc_tsc_read_add) (acc_uint32e_t* t)
{
-#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && defined(__ACCLIB_RDTSC_REGS)
+#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32) && defined(__ACCLIB_RDTSC_REGS)
__asm__ __volatile__(
"clc \n" ".byte 0x0f, 0x31\n"
"addl %%eax,(%0)\n" "adcl $0,%%edx\n" "addl %%edx,4(%0)\n"
--- a/src/ucl_conf.h
+++ b/src/ucl_conf.h
@@ -172,7 +172,7 @@
#undef UA_SET2
#undef UA_GET4
#undef UA_SET4
-#if 1 && (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
+#if 1 && (ACC_ARCH_AMD64 || ACC_ARCH_IA32 || ACC_ARCH_X32)
# define UA_GET2(p) (* (const ucl_ushortp) (p))
# define UA_SET2(p) (* (ucl_ushortp) (p))
# define UA_GET4(p) (* (const acc_uint32e_t *) (p))

View File

@ -0,0 +1,35 @@
# Copyright 2020 Julian Ospald <hasufell@posteo.de>
# Distributed under the terms of the GNU General Public License v2
require autotools [ supported_autoconf=[ 2.5 ] supported_automake=[ 1.16 ] ]
SUMMARY="The UCL Compression Library"
HOMEPAGE="http://www.oberhumer.com/opensource/ucl/"
DOWNLOADS="http://www.oberhumer.com/opensource/ucl/download/${PNV}.tar.gz"
LICENCES="GPL-2"
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS=""
DEPENDENCIES="
"
BUGS_TO="hasufell@posteo.de"
DEFAULT_SRC_PREPARE_PATCHES=(
"${FILES}"/${PNV}-CFLAGS.patch
"${FILES}"/${PNV}-x32.patch
)
src_prepare() {
edo sed -n -e '/^AC_DEFUN.*mfx_/,/^])#$/p' aclocal.m4 > acinclude.m4
edo sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac
autotools_src_prepare
}
src_configure() {
econf --enable-shared CFLAGS="${CFLAGS} -std=c90"
}