[PATCH 1/2] newlib: move to ../config/multi.m4 for multilib logic

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
The current newlib multilib logic is almost exactly the same as the
config/multi.m4, and the differences should be minor, so switch over
to that to delete custom logic on ourside.
---
 newlib/Makefile.in  |  2 ++
 newlib/acinclude.m4 |  2 ++
 newlib/aclocal.m4   |  1 +
 newlib/configure    | 79 +++++++++++++++++++++++++++++++--------------
 newlib/configure.ac | 21 +-----------
 5 files changed, 61 insertions(+), 44 deletions(-)

diff --git a/newlib/acinclude.m4 b/newlib/acinclude.m4
index bdefd963542a..9e25b8589b84 100644
--- a/newlib/acinclude.m4
+++ b/newlib/acinclude.m4
@@ -13,6 +13,7 @@ dnl newlib directory.
 
 AC_DEFUN([NEWLIB_CONFIGURE],
 [AC_REQUIRE([DEF_NEWLIB_VERSION])
+m4_if($1, [.], [AM_ENABLE_MULTILIB(, ..)], [dnl
 dnl Default to --enable-multilib
 AC_ARG_ENABLE(multilib,
 [  --enable-multilib         build many library versions (default)],
@@ -21,6 +22,7 @@ AC_ARG_ENABLE(multilib,
   no)  multilib=no ;;
   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
  esac], [multilib=yes])dnl
+])dnl
 
 dnl Support --enable-target-optspace
 AC_ARG_ENABLE(target-optspace,
diff --git a/newlib/configure.ac b/newlib/configure.ac
index b4d11f5e3b57..f56832247111 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -500,12 +500,6 @@ AC_SUBST([NEWLIB_MAJOR_VERSION])
 AC_SUBST([NEWLIB_MINOR_VERSION])
 AC_SUBST([NEWLIB_PATCHLEVEL_VERSION])
 
-if test "${multilib}" = "yes"; then
-  multilib_arg="--enable-multilib"
-else
-  multilib_arg=
-fi
-
 if test "${newlib_iconv}" = "yes"; then
   AC_DEFINE(_ICONV_ENABLED, 1, [ICONV enabled.])
 fi
@@ -746,18 +740,5 @@ fi
 
 AC_SUBST(CFLAGS)
 
-AC_CONFIG_FILES([Makefile],
-[if test -n "$CONFIG_FILES"; then
-  unset ac_file
-  . ${newlib_basedir}/../config-ml.in
-fi],
-srcdir=${srcdir}
-host=${host}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${multilib_arg} ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-newlib_basedir=${newlib_basedir}
-CC="${CC}"
-LDFLAGS="${LDFLAGS}"
-)
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
-- 
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.