recode: fix librecode.so build, xlint.

librecode.so required an external `error` symbol, even on musl systems,
which don't provide one. This was worked around when building
fortune-mod by adding an error.o file into the build, but that wasn't
the correct fix.

This patch makes it so librecode also uses the librecode.a compat
library.
This commit is contained in:
Érico Rolim 2020-12-16 18:43:06 -03:00 committed by Érico Nogueira Rolim
parent 8174859d84
commit a7fba4f268
2 changed files with 54 additions and 8 deletions

View file

@ -0,0 +1,46 @@
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 237fe72..684ee68 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -22,6 +22,7 @@ AUTOMAKE_OPTIONS = gnits
noinst_LIBRARIES = libreco.a
noinst_HEADERS = error.h getopt.h gettext.h pathmax.h xstring.h
libreco_a_SOURCES = error.c getopt.c getopt1.c xstrdup.c
+libreco_a_CFLAGS = -fPIC
EXTRA_DIST = alloca.c gettext.c malloc.c realloc.c strtol.c strtoul.c
diff --git a/lib/error.c b/lib/error.c
index 53b650c..7f879aa 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -65,7 +65,7 @@ void (*error_print_progname) (
/* This variable is incremented each time `error' is called. */
unsigned int error_message_count;
-#ifdef _LIBC
+#if 1
/* In the GNU C library, there is a predefined variable for this. */
# define program_name program_invocation_name
@@ -73,8 +73,6 @@ unsigned int error_message_count;
/* In GNU libc we want do not want to use the common name `error' directly.
Instead make it a weak alias. */
-# define error __error
-# define error_at_line __error_at_line
#else /* not _LIBC */
diff --git a/src/Makefile.am b/src/Makefile.am
index c918aa7..dff6c71 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,6 +48,7 @@ recode_LDADD = librecode.la ../lib/libreco.a
librecode_la_SOURCES = argmatch.c charname.c combine.c fr-charname.c \
hash.c iconv.c libiconv.c localcharset.c merged.c names.c outer.c quotearg.c \
recode.c request.c strip-pool.c task.c xmalloc.c $(C_STEPS)
+librecode_la_LIBADD = ../lib/libreco.a
librecode_la_LDFLAGS = -version-info 0:0:0
INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/libiconv

View file

@ -1,24 +1,24 @@
# Template file for 'recode'
pkgname=recode
version=3.6
revision=9
patch_args="-Np1"
revision=10
build_style=gnu-configure
configure_args="--without-included-gettext jm_cv_func_working_malloc=yes
jm_cv_func_working_realloc=yes"
hostmakedepends="automake gettext libtool texinfo"
short_desc="Character set conversion utility"
homepage="http://recode.progiciels-bpi.ca/"
license="GPL-2"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="http://recode.progiciels-bpi.ca/"
distfiles="${DEBIAN_SITE}/main/r/${pkgname}/${pkgname}_${version}.orig.tar.gz"
checksum=e3e6a4f3f8e5c6052ab70155990c074d87aa0b614fc1be31d194750d1d962fcf
patch_args="-Np1"
pre_configure() {
sed -e 's,AM_CONFIG_HEADER,AC_CONFIG_HEADERS,g' -i configure.in
sed -i -e "/^AM_C_PROTOTYPES.*/d" configure.in
sed -i -e "s/ansi2knr//" src/Makefile.am
rm -f acinclude.m4
vsed -e 's,AM_CONFIG_HEADER,AC_CONFIG_HEADERS,g' -i configure.in
vsed -i -e "/^AM_C_PROTOTYPES.*/d" configure.in
vsed -i -e "s/ansi2knr//" src/Makefile.am
rm acinclude.m4
autoreconf -fi
libtoolize
}