diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-03-15 14:17:04 -0700 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2025-09-24 09:56:49 +0800 |
commit | 9c3d2c86b2999fbe80b804a9a6b2e7c8f6d5be76 (patch) | |
tree | 08d4a2c9ac4d675c79e8ba1d6c977c1024f10796 | |
parent | adcb6e98419f07da5be085b8997da7f69146b743 (diff) | |
download | meta-openembedded-9c3d2c86b2999fbe80b804a9a6b2e7c8f6d5be76.tar.gz |
enca: Fix cross builds
Some portions are built using host CC, which
is important when doing cross compile to pass correct flags
otherwise it fails when using newer host compiler e.g. gcc-14
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 32eb26264323888e77154c2aeadc9994a4a54d5d)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r-- | meta-oe/recipes-support/enca/enca/cross.patch | 68 | ||||
-rw-r--r-- | meta-oe/recipes-support/enca/enca/makefile-remove-tools.patch | 14 | ||||
-rw-r--r-- | meta-oe/recipes-support/enca/enca_1.19.bb | 24 |
3 files changed, 73 insertions, 33 deletions
diff --git a/meta-oe/recipes-support/enca/enca/cross.patch b/meta-oe/recipes-support/enca/enca/cross.patch new file mode 100644 index 0000000000..7749dee088 --- /dev/null +++ b/meta-oe/recipes-support/enca/enca/cross.patch | |||
@@ -0,0 +1,68 @@ | |||
1 | From: Helmut Grohne <helmut@subdivi.de> | ||
2 | Subject: build make_hash with the build arch compiler | ||
3 | |||
4 | Also note that we cannot include config.h in make_hash.c, because it is | ||
5 | specific to the host architecture. | ||
6 | |||
7 | Sourced from debian - https://salsa.debian.org/debian/enca/-/blob/master/debian/patches/cross.patch?ref_type=heads | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | |||
12 | Index: enca-1.19/configure.ac | ||
13 | =================================================================== | ||
14 | --- enca-1.19.orig/configure.ac | ||
15 | +++ enca-1.19/configure.ac | ||
16 | @@ -35,6 +35,7 @@ | ||
17 | dnl Checks for programs. | ||
18 | AC_PROG_AWK | ||
19 | AC_PROG_CC | ||
20 | +AX_PROG_CC_FOR_BUILD | ||
21 | AC_GNU_SOURCE | ||
22 | AC_AIX | ||
23 | AC_ISC_POSIX | ||
24 | Index: enca-1.19/tools/Makefile.am | ||
25 | =================================================================== | ||
26 | --- enca-1.19.orig/tools/Makefile.am | ||
27 | +++ enca-1.19/tools/Makefile.am | ||
28 | @@ -2,7 +2,8 @@ | ||
29 | noinst_HEADERS = encodings.h | ||
30 | noinst_SCRIPTS = expand_table.pl | ||
31 | |||
32 | -make_hash_SOURCES = make_hash.c | ||
33 | +make_hash$(EXEEXT): make_hash.c | ||
34 | + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ $< | ||
35 | |||
36 | BUILT_SOURCES = $(noinst_HEADERS) | ||
37 | |||
38 | Index: enca-1.19/tools/make_hash.c | ||
39 | =================================================================== | ||
40 | --- enca-1.19.orig/tools/make_hash.c | ||
41 | +++ enca-1.19/tools/make_hash.c | ||
42 | @@ -17,25 +17,9 @@ | ||
43 | with this program; if not, write to the Free Software Foundation, Inc., | ||
44 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
45 | */ | ||
46 | -#ifdef HAVE_CONFIG_H | ||
47 | -# include "config.h" | ||
48 | -#endif /* HAVE_CONFIG_H */ | ||
49 | - | ||
50 | #include <stdlib.h> | ||
51 | #include <stdio.h> | ||
52 | - | ||
53 | -#ifdef HAVE_STRING_H | ||
54 | -# include <string.h> | ||
55 | -#else /* HAVE_STRING_H */ | ||
56 | -# ifdef HAVE_STRINGS_H | ||
57 | -# include <strings.h> | ||
58 | -# endif /* HAVE_STRINGS_H */ | ||
59 | -#endif /* HAVE_STRING_H */ | ||
60 | - | ||
61 | -#ifdef HAVE_MEMORY_H | ||
62 | -# include <memory.h> | ||
63 | -#endif /* HAVE_MEMORY_H */ | ||
64 | - | ||
65 | +#include <string.h> | ||
66 | #include <unistd.h> | ||
67 | #include <ctype.h> | ||
68 | |||
diff --git a/meta-oe/recipes-support/enca/enca/makefile-remove-tools.patch b/meta-oe/recipes-support/enca/enca/makefile-remove-tools.patch deleted file mode 100644 index 756745d839..0000000000 --- a/meta-oe/recipes-support/enca/enca/makefile-remove-tools.patch +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | --- enca-1.19/Makefile.am.orig 2006-06-29 15:34:55.000000000 +0100 | ||
4 | +++ enca-1.19/Makefile.am 2006-06-29 15:35:20.000000000 +0100 | ||
5 | @@ -1,7 +1,7 @@ | ||
6 | if MAINTAINER_MODE | ||
7 | -SUBDIRS = tools data script lib src devel-docs test | ||
8 | +SUBDIRS = data script lib src devel-docs test | ||
9 | else | ||
10 | -SUBDIRS = tools script lib src devel-docs | ||
11 | +SUBDIRS = script lib src devel-docs | ||
12 | endif | ||
13 | man_MANS = man/enca.1 | ||
14 | |||
diff --git a/meta-oe/recipes-support/enca/enca_1.19.bb b/meta-oe/recipes-support/enca/enca_1.19.bb index 774f05f7c4..61da50ba52 100644 --- a/meta-oe/recipes-support/enca/enca_1.19.bb +++ b/meta-oe/recipes-support/enca/enca_1.19.bb | |||
@@ -2,33 +2,19 @@ SUMMARY = "Enca is an Extremely Naive Charset Analyser" | |||
2 | SECTION = "libs" | 2 | SECTION = "libs" |
3 | HOMEPAGE = "https://cihar.com/software/enca/" | 3 | HOMEPAGE = "https://cihar.com/software/enca/" |
4 | 4 | ||
5 | DEPENDS += "gettext-native" | 5 | DEPENDS += "gettext-native autoconf-archive-native" |
6 | 6 | ||
7 | LICENSE = "GPL-2.0-only" | 7 | LICENSE = "GPL-2.0-only" |
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=24b9569831c46d4818450b55282476b4" | 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=24b9569831c46d4818450b55282476b4" |
9 | 9 | ||
10 | SRC_URI = "https://dl.cihar.com/enca/enca-${PV}.tar.gz \ | 10 | SRC_URI = "https://dl.cihar.com/enca/enca-${PV}.tar.gz \ |
11 | file://cross.patch \ | ||
11 | file://dont-run-tests.patch \ | 12 | file://dont-run-tests.patch \ |
12 | file://makefile-remove-tools.patch \ | ||
13 | file://libenca-003-iconv.patch \ | 13 | file://libenca-003-iconv.patch \ |
14 | file://0001-Do-not-use-MKTEMP_PROG-in-cross-build.patch" | 14 | file://0001-Do-not-use-MKTEMP_PROG-in-cross-build.patch \ |
15 | " | ||
15 | SRC_URI[sha256sum] = "4c305cc59f3e57f2cfc150a6ac511690f43633595760e1cb266bf23362d72f8a" | 16 | SRC_URI[sha256sum] = "4c305cc59f3e57f2cfc150a6ac511690f43633595760e1cb266bf23362d72f8a" |
16 | 17 | ||
17 | inherit autotools | 18 | inherit autotools |
18 | 19 | ||
19 | do_configure:prepend() { | 20 | EXTRA_OECONF += "MKTEMP_PROG=mktemp" |
20 | # remove failing test which checks for something that isn't even used | ||
21 | sed -i -e '/ye_FUNC_SCANF_MODIF_SIZE_T/d' ${S}/configure.ac | ||
22 | } | ||
23 | |||
24 | do_configure:append() { | ||
25 | sed -i s:-I/usr/include::g ${B}/Makefile | ||
26 | sed -i s:-I/usr/include::g ${B}/*/Makefile | ||
27 | } | ||
28 | |||
29 | do_compile() { | ||
30 | cd ${S}/tools && ${BUILD_CC} -o make_hash make_hash.c | ||
31 | cd ${B} | ||
32 | oe_runmake | ||
33 | } | ||
34 | |||