[PATCH] newlib: merge iconvdata into top-level Makefile

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Avoid a recursive make with this tiny subdir to speed things up a bit.
---
NB: I can't easily test this because it's only built for i686-pc-linux,
and I only have GNU C library toolchains using that tuple.  My half
attempts at building it *look* like it uses the right flags.

 newlib/Makefile.am            |     7 +-
 newlib/Makefile.in            |   186 +-
 newlib/configure              |    22 +-
 newlib/configure.ac           |     6 +-
 newlib/iconvdata/Makefile.am  |    23 -
 newlib/iconvdata/Makefile.in  |   643 --
 newlib/iconvdata/aclocal.m4   |  1178 ---
 newlib/iconvdata/configure    | 14169 --------------------------------
 newlib/iconvdata/configure.ac |    22 -
 newlib/iconvdata/local.mk     |    20 +
 10 files changed, 201 insertions(+), 16075 deletions(-)
 delete mode 100644 newlib/iconvdata/Makefile.am
 delete mode 100644 newlib/iconvdata/Makefile.in
 delete mode 100644 newlib/iconvdata/aclocal.m4
 delete mode 100755 newlib/iconvdata/configure
 delete mode 100644 newlib/iconvdata/configure.ac
 create mode 100644 newlib/iconvdata/local.mk

diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index 6a28215d3620..ee986289a60a 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -6,6 +6,7 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 # Variables that will accumulate in subdirs.
 PHONY =
 noinst_DATA =
+pkglib_LTLIBRARIES =
 
 # Multilib support variables.
 MULTISRCTOP =
@@ -67,8 +68,7 @@ AM_MAKEFLAGS = \
 
 FLAGS_TO_PASS=$(AM_MAKEFLAGS)
 
-SUBDIRS = libc libm \
-	. $(EXTRA_DIRS)
+SUBDIRS = libc libm .
 
 tooldir = $(exec_prefix)/$(host_alias)
 toollibdir = $(tooldir)/lib$(MULTISUBDIR)
@@ -539,5 +539,8 @@ clean-local:
 if HAVE_DOC
 include doc/local.mk
 endif
+if HAVE_ICONVDATA
+include iconvdata/local.mk
+endif
 
 .PHONY: $(PHONY)
diff --git a/newlib/configure.ac b/newlib/configure.ac
index 93dde7feb5f7..13f318922605 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -348,14 +348,14 @@ AM_CONDITIONAL(HAVE_DOC, test x$have_multisubdir = xno)
 # subdirectory withing the build directory.
 AM_CONDITIONAL(HAVE_MULTISUBDIR, test x$have_multisubdir = xyes)
 
-EXTRA_DIRS=
+HAVE_ICONVDATA=false
 case $host in
   i[[34567]]86-pc-linux-*)
   	AC_CONFIG_SUBDIRS(iconvdata)
-	EXTRA_DIRS=iconvdata
+	HAVE_ICONVDATA=true
 	;;
 esac
-AC_SUBST(EXTRA_DIRS)
+AM_CONDITIONAL([HAVE_ICONVDATA], $HAVE_ICONVDATA)
 
 CRT0=
 CRT0_DIR=
diff --git a/newlib/iconvdata/local.mk b/newlib/iconvdata/local.mk
new file mode 100644
index 000000000000..31ccbdf278c5
--- /dev/null
+++ b/newlib/iconvdata/local.mk
@@ -0,0 +1,20 @@
+pkglib_LTLIBRARIES += %D%/EUC-JP.la
+
+%C%_EUC_JP_la_SOURCES = %D%/dummy.c
+if !ELIX_LEVEL_1
+%C%_EUC_JP_la_SOURCES += \
+	%D%/euc-jp.c \
+	%D%/jis0201.c \
+	%D%/jis0208.c \
+	%D%/jis0212.c
+endif
+%C%_EUC_JP_la_DEPENDENCIES = $(%C%_EUC_JP_la_LIBADD)
+%C%_EUC_JP_la_CPPFLAGS = \
+	-DNDEBUG \
+	-I$(srcdir)/iconvdata \
+	-I$(srcdir)/libc/sys/linux \
+	$(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+%C%_EUC_JP_la_LDFLAGS = -module -no-undefined -Xcompiler -Wl,-rpath-link=. -Xcompiler -nostdlib -L. -lc
+
+gconvdir = $(pkglibdir)
+gconv_DATA = %D%/gconv-modules
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.