public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level
@ 2022-01-26  9:45 Mike Frysinger
  2022-01-26  9:45 ` [PATCH 2/3] libgloss: merge subdirs that have unique makefile_frags " Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mike Frysinger @ 2022-01-26  9:45 UTC (permalink / raw)
  To: newlib

These subdirs have unique configure scripts to do some compiler tests.
The checks should work for all targets, so hoist them up to the top
libgloss dir.  This should allow us to delete these subdir configure
scripts.

It means the top-level gains autoheader support, but that's fine.
It wasn't exporting any defines previously (i.e. -D into CPPFLAGS),
and all of the defines it now exports are only used by code in the
libnosys subdir which was expecting to have a config.h.
---
 libgloss/aclocal.m4                 |   64 +
 libgloss/{libnosys => }/config.h.in |    0
 libgloss/configure                  | 1857 ++++++++++--
 libgloss/configure.ac               |   87 +-
 libgloss/epiphany/aclocal.m4        |  383 ---
 libgloss/epiphany/config.h.in       |   31 -
 libgloss/epiphany/configure         | 4057 --------------------------
 libgloss/epiphany/configure.ac      |  110 -
 libgloss/libnosys/acinclude.m4      |   27 +
 libgloss/libnosys/aclocal.m4        |  383 ---
 libgloss/libnosys/configure         | 4179 ---------------------------
 libgloss/libnosys/configure.ac      |  181 --
 libgloss/or1k/aclocal.m4            |  383 ---
 libgloss/or1k/configure             | 3887 -------------------------
 libgloss/or1k/configure.ac          |   65 -
 15 files changed, 1867 insertions(+), 13827 deletions(-)
 rename libgloss/{libnosys => }/config.h.in (100%)
 delete mode 100644 libgloss/epiphany/aclocal.m4
 delete mode 100644 libgloss/epiphany/config.h.in
 delete mode 100755 libgloss/epiphany/configure
 delete mode 100644 libgloss/epiphany/configure.ac
 create mode 100644 libgloss/libnosys/acinclude.m4
 delete mode 100644 libgloss/libnosys/aclocal.m4
 delete mode 100755 libgloss/libnosys/configure
 delete mode 100644 libgloss/libnosys/configure.ac
 delete mode 100644 libgloss/or1k/aclocal.m4
 delete mode 100755 libgloss/or1k/configure
 delete mode 100644 libgloss/or1k/configure.ac

diff --git a/libgloss/libnosys/config.h.in b/libgloss/config.h.in
similarity index 100%
rename from libgloss/libnosys/config.h.in
rename to libgloss/config.h.in
diff --git a/libgloss/configure b/libgloss/configure
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index f738a6c98ac1..21ba8f10691f 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT([libgloss],[LIBGLOSS_VERSION])
-AC_CONFIG_SRCDIR([libnosys])
+AC_CONFIG_HEADER(config.h)
 
 if test "${enable_shared}" = "yes" ; then
   AC_MSG_WARN([Shared libraries not supported for cross compiling, ignored])
@@ -36,7 +36,8 @@ case "${target}" in
 	AC_CONFIG_SUBDIRS(csky)
 	;;
   epiphany-*-*)
-	AC_CONFIG_SUBDIRS(epiphany)
+	AC_CONFIG_FILES([epiphany/Makefile])
+	subdirs="$subdirs epiphany"
 	config_testsuite=true
 	;;
   i[[3456]]86-*-elf* | i[[3456]]86-*-coff*)
@@ -196,7 +197,8 @@ case "${target}" in
 	subdirs="$subdirs iq2000"
 	;;
   or1k-*-* | or1knd-*-* )
-	AC_CONFIG_SUBDIRS([or1k])
+	AC_CONFIG_FILES([or1k/Makefile])
+	subdirs="$subdirs or1k"
 	;;
   pru-*-*)
 	AC_CONFIG_FILES([pru/Makefile])
@@ -215,7 +217,8 @@ dnl   then AC_CONFIG_SUBDIRS([testsuite])
 dnl fi
 
 if test "${config_libnosys}" = "true"; then
-  AC_CONFIG_SUBDIRS([libnosys])
+  AC_CONFIG_FILES([libnosys/Makefile])
+  subdirs="$subdirs libnosys"
 fi
 
 LIB_AC_PROG_CC
@@ -229,6 +232,82 @@ AC_SUBST(LD)
 AC_PROG_RANLIB
 LIB_AM_PROG_AS
 
+AC_DEFINE(HAVE_GNU_LD, 1, [Using GNU LD])
+
+AC_CACHE_CHECK([if target is ELF], libc_cv_is_elf, [dnl
+  AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
+[[#ifndef __ELF__
+# error "not ELF"
+#endif
+]])], [libc_cv_is_elf=yes], [libc_cv_is_elf=no])
+])
+if test "x${libc_cv_is_elf}" = "xyes"; then
+  AC_DEFINE(HAVE_ELF, 1, [Using ELF format])
+fi
+
+AC_CACHE_CHECK([for .previous assembler directive],
+	       libc_cv_asm_previous_directive, [dnl
+  libc_cv_asm_previous_directive=no
+  cat > conftest.s <<EOF
+.section foo_section
+.previous
+EOF
+  if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
+    libc_cv_asm_previous_directive=yes
+  fi
+  rm -f conftest*])
+if test "x${libc_cv_asm_previous_directive}" = "xyes"; then
+  AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE, 1, [.previous directive allowed])
+fi
+
+AC_CACHE_CHECK([for .popsection assembler directive],
+	       libc_cv_asm_popsection_directive, [dnl
+  libc_cv_asm_popsection_directive=no
+  cat > conftest.s <<EOF
+.pushsection foo_section
+.popsection
+EOF
+  if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
+    libc_cv_asm_popsection_directive=yes
+  fi
+  rm -f conftest*])
+if test "x${libc_cv_asm_popsection_directive}" = "xyes"; then
+  AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE, 1, [.pushsection/.popsection directives allowed])
+fi
+
+AC_CACHE_CHECK([for section attributes],
+	       libc_cv_section_attributes, [dnl
+  libc_cv_section_attributes=no
+  cat > conftest.c <<EOF
+int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10;
+int main() {}
+EOF
+  if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.c 1>&AC_FD_CC); then
+    libc_cv_section_attributes=yes
+  fi
+  rm -f conftest*])
+if test "x${libc_cv_section_attributes}" = "xyes"; then
+  AC_DEFINE(HAVE_SECTION_ATTRIBUTES, 1, [support for section attributes])
+fi
+
+AC_CACHE_CHECK([for symbol prefix], libc_cv_symbol_prefix, [dnl
+  cat > conftest.c <<\EOF
+foo () { }
+EOF
+dnl
+  libc_cv_symbol_prefix=''
+  if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]); then
+    libc_cv_symbol_prefix='$'
+  else
+    if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "_foo" > /dev/null]); then
+      libc_cv_symbol_prefix=_
+    fi
+  fi
+  rm -f conftest* ])
+AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_cv_symbol_prefix", [symbol prefix])
+
+m4_include([libnosys/acinclude.m4])
+
 host_makefile_frag=${srcdir}/config/default.mh
 target_makefile_frag=${srcdir}/config/default.mt
 
diff --git a/libgloss/epiphany/configure.ac b/libgloss/epiphany/configure.ac
deleted file mode 100644
index 4ed915e71d2f..000000000000
--- a/libgloss/epiphany/configure.ac
+++ /dev/null
@@ -1,110 +0,0 @@
-# Makefile for libgloss/epiphany
-
-# Copyright (c) 2011, Adapteva, Inc.
-# All rights reserved.
-
-# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com> for Adapteva Inc
-
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#  * Redistributions of source code must retain the above copyright notice,
-#    this list of conditions and the following disclaimer.
-#  * Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#  * Neither the name of Adapteva nor the names of its contributors may be
-#    used to endorse or promote products derived from this software without
-#    specific prior written permission.
-
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.                                               */
-
-# Process this file with autoconf to produce a configure script
-
-AC_INIT(libepiphany,0.0.1)
-AC_CONFIG_HEADER(config.h)
-
-AC_CONFIG_AUX_DIR(../..)
-
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-
-AC_PROG_INSTALL
-
-AC_DEFINE(HAVE_GNU_LD, 1, [Using GNU ld])
-
-# We always use ELF, define various useful associated things.
-AC_DEFINE(HAVE_ELF, 1, [Using ELF format])
-
-# Assembler directives (the assembler handles them, whether it does anything
-# useful with them is another matter...
-AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE, 1, [.previous directive allowed])
-AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE, 1,
-          [.pushsection/.popsection directives allowed])
-
-# Section attributes in C don't currently work
-#AC_DEFINE(HAVE_SECTION_ATTRIBUTES, 1, [support for section attributes])
-
-# Sort out what the symbol prefix is (we could just fix it as '_', but let the
-# script work it out.
-AC_CACHE_CHECK([for symbol prefix], libc_cv_symbol_prefix, [dnl
-cat > conftest.c <<\EOF
-foo () { }
-EOF
-dnl
-libc_cv_symbol_prefix=none
-if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]);
-then
-  libc_cv_symbol_prefix='$'
-else
-  if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "_foo" > /dev/null]);
-  then
-    libc_cv_symbol_prefix=_
-  fi
-fi
-rm -f conftest* ])
-if test $libc_cv_symbol_prefix != none; then
-  AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_cv_symbol_prefix", [symbol prefix])
-else
-  AC_DEFINE(__SYMBOL_PREFIX, "", [symbol prefix])
-fi
-
-# Standard stuff copied from libnosys. For this we'll need to an aclocal.m4
-LIB_AC_PROG_CC
-AS=${AS-as}
-AC_SUBST(AS)
-AR=${AR-ar}
-AC_SUBST(AR)
-LD=${LD-ld}
-AC_SUBST(LD)
-AC_PROG_RANLIB
-LIB_AM_PROG_AS
-
-host_makefile_frag=${srcdir}/../config/default.mh
-
-dnl We have to assign the same value to other variables because autoconf
-dnl doesn't provide a mechanism to substitute a replacement keyword with
-dnl arbitrary data or pathnames.
-dnl
-host_makefile_frag_path=$host_makefile_frag
-AC_SUBST(host_makefile_frag_path)
-AC_SUBST_FILE(host_makefile_frag)
-
-AC_CONFIG_FILES(Makefile,
-ac_file=Makefile . ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
diff --git a/libgloss/libnosys/acinclude.m4 b/libgloss/libnosys/acinclude.m4
new file mode 100644
index 000000000000..7b0d7b4d67b6
--- /dev/null
+++ b/libgloss/libnosys/acinclude.m4
@@ -0,0 +1,27 @@
+dnl Make sure syscall names match those being used by newlib
+case "${target}" in
+  *-*-cygwin*) ;;
+  a29k-amd-udi) ;;
+  aarch64*-*-*) ;;
+  arc-*-*) ;;
+  arm*-*-*) ;;
+  bfin-*-*) ;;
+  cris-*-* | crisv32-*-*) ;;
+  d10v*) ;;
+  h8300*-*-*) ;;
+  h8500-*-*) ;;
+  i[3456]86-*-sco*) ;;
+  lm32-*-*) ;;
+  m32r-*-*) ;;
+  mn10?00-*-*) ;;
+  riscv*-*-*) ;;
+  powerpcle-*-pe) ;;
+  sh*-*-*) ;;
+  sparc-sun-sunos*) ;;
+  sparc64-*-*) ;;
+  v850*-*-*) ;;
+  w65-*-*) ;;
+  xstormy16-*-*) ;;
+  z8k-*-*) ;;
+  *) AC_DEFINE(MISSING_SYSCALL_NAMES, 1, [Missing syscall names]) ;;
+esac
diff --git a/libgloss/libnosys/configure.ac b/libgloss/libnosys/configure.ac
deleted file mode 100644
index f428616d7524..000000000000
--- a/libgloss/libnosys/configure.ac
+++ /dev/null
@@ -1,181 +0,0 @@
-# Copyright (c) 1995, 1996 Cygnus Support
-#
-# The authors hereby grant permission to use, copy, modify, distribute,
-# and license this software and its documentation for any purpose, provided
-# that existing copyright notices are retained in all copies and that this
-# notice is included verbatim in any distributions. No written agreement,
-# license, or royalty fee is required for any of the authorized uses.
-# Modifications to this software may be copyrighted by their authors
-# and need not follow the licensing terms described here, provided that
-# the new terms are clearly indicated on the first page of each file where
-# they apply.
-#
-# Process this file with autoconf to produce a configure script.
-#
-AC_INIT(close.c)
-AC_CONFIG_HEADER(config.h)
-
-AC_CONFIG_AUX_DIR(../..)
-
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-
-AC_PROG_INSTALL
-
-AC_DEFINE(HAVE_GNU_LD, 1, [Using GNU LD])
-dnl Make sure syscall names match those being used by newlib
-case "${target}" in
-  *-*-cygwin*)
-	;;
-  a29k-amd-udi)
-	;;
-  aarch64*-*-*)
-	;;
-  arc-*-*)
-	;;
-  arm*-*-*)
-	;;
-  bfin-*-*)
-	;;
-  cris-*-* | crisv32-*-*)
-	;;
-  d10v*)
-	;;
-  h8300*-*-*)
-	;;	
-  h8500-*-*)
-	;;	
-  i[3456]86-*-sco*)
-	;;
-  lm32-*-*)
-	;;
-  m32r-*-*)
-	;;
-  mn10?00-*-*)
-	;;
-  riscv*-*-*)
-	;;
-  powerpcle-*-pe)
-	;;
-  sh*-*-*)
-	;;
-  sparc-sun-sunos*)
-	;;
-  sparc64-*-*)
-	;;
-  v850*-*-*)
-	;;
-  w65-*-*)
-	;;	
-  xstormy16-*-*)
-	;;
-  z8k-*-*)
-	;;
-  *)
-	AC_DEFINE(MISSING_SYSCALL_NAMES, 1, [Missing syscall names])
-	;;
-esac
-
-dnl Make sure we know if elf format used
-case "${target}" in
-  *-*-elf)
-        AC_DEFINE(HAVE_ELF, 1, [Using ELF format])
-
-        AC_CACHE_CHECK([for .previous assembler directive],
-                         libc_cv_asm_previous_directive, [dnl
-        libc_cv_asm_previous_directive=no
-        cat > conftest.s <<EOF
-.section foo_section
-.previous
-EOF
-        if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
-          libc_cv_asm_previous_directive=yes
-        fi
-        rm -f conftest*])
-
-	if test "x${libc_cv_asm_previous_directive}" = "xyes"; then
-          AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE, 1, [.previous directive allowed])
-	fi
-
-        AC_CACHE_CHECK([for .popsection assembler directive],
-                         libc_cv_asm_popsection_directive, [dnl
-        libc_cv_asm_popsection_directive=no
-        cat > conftest.s <<EOF
-.pushsection foo_section
-.popsection
-EOF
-        if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
-          libc_cv_asm_popsection_directive=yes
-        fi
-        rm -f conftest*])
-
-	if test "x${libc_cv_asm_popsection_directive}" = "xyes"; then
-          AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE, 1, [.pushsection/.popsection directives allowed])
-	fi
-
-        AC_CACHE_CHECK([for section attributes],
-                         libc_cv_section_attributes, [dnl
-        libc_cv_section_attributes=no
-        cat > conftest.c <<EOF
-int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10;
-int main() {}
-EOF
-        if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.c 1>&AC_FD_CC); then
-          libc_cv_section_attributes=yes
-        fi
-        rm -f conftest*])
-	if test "x${libc_cv_section_attributes}" = "xyes"; then
-          AC_DEFINE(HAVE_SECTION_ATTRIBUTES, 1, [support for section attributes])
-	fi
-        ;;
-esac
-
-AC_CACHE_CHECK([for symbol prefix], libc_cv_symbol_prefix, [dnl
-cat > conftest.c <<\EOF
-foo () { }
-EOF
-dnl
-libc_cv_symbol_prefix=''
-if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]);
-then
-  libc_cv_symbol_prefix='$'
-else
-  if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "_foo" > /dev/null]);
-  then
-    libc_cv_symbol_prefix=_
-  fi
-fi
-rm -f conftest* ])
-AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_cv_symbol_prefix", [symbol prefix])
-
-LIB_AC_PROG_CC
-AS=${AS-as}
-AC_SUBST(AS)
-AR=${AR-ar}
-AC_SUBST(AR)
-LD=${LD-ld}
-AC_SUBST(LD)
-AC_PROG_RANLIB
-LIB_AM_PROG_AS
-
-host_makefile_frag=${srcdir}/../config/default.mh
-
-dnl We have to assign the same value to other variables because autoconf
-dnl doesn't provide a mechanism to substitute a replacement keyword with
-dnl arbitrary data or pathnames.
-dnl
-host_makefile_frag_path=$host_makefile_frag
-AC_SUBST(host_makefile_frag_path)
-AC_SUBST_FILE(host_makefile_frag)
-
-AC_CONFIG_FILES(Makefile,
-ac_file=Makefile . ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
-
-
diff --git a/libgloss/or1k/configure.ac b/libgloss/or1k/configure.ac
deleted file mode 100644
index 839ecf5351e6..000000000000
--- a/libgloss/or1k/configure.ac
+++ /dev/null
@@ -1,65 +0,0 @@
-# Makefile for libgloss/or1k
-
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.                                               */
-
-# Process this file with autoconf to produce a configure script
-
-AC_INIT(libor1k,0.0.1)
-
-# Where are the auxillary tools (confg.sub etc)?
-AC_CONFIG_AUX_DIR(../..)
-
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-
-AC_PROG_INSTALL
-
-AC_DEFINE(HAVE_GNU_LD, 1, [Using GNU ld])
-
-# We always use ELF, define various useful associated things.
-AC_DEFINE(HAVE_ELF, 1, [Using ELF format])
-
-# Standard stuff copied from libnosys. For this we'll need to an aclocal.m4
-LIB_AC_PROG_CC
-AS=${AS-as}
-AC_SUBST(AS)
-AR=${AR-ar}
-AC_SUBST(AR)
-LD=${LD-ld}
-AC_SUBST(LD)
-AC_PROG_RANLIB
-LIB_AM_PROG_AS
-
-host_makefile_frag=${srcdir}/../config/default.mh
-target_makefile_frag=${srcdir}/../config/default.mt
-
-dnl We have to assign the same value to other variables because autoconf
-dnl doesn't provide a mechanism to substitute a replacement keyword with
-dnl arbitrary data or pathnames.
-dnl
-host_makefile_frag_path=$host_makefile_frag
-AC_SUBST(host_makefile_frag_path)
-AC_SUBST_FILE(host_makefile_frag)
-target_makefile_frag_path=$target_makefile_frag
-AC_SUBST(target_makefile_frag_path)
-AC_SUBST_FILE(target_makefile_frag)
-
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] libgloss: merge subdirs that have unique makefile_frags up a level
  2022-01-26  9:45 [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level Mike Frysinger
@ 2022-01-26  9:45 ` Mike Frysinger
  2022-01-26  9:45 ` [PATCH 3/3] libgloss: move to ../config/multi.m4 for multilib logic Mike Frysinger
  2022-01-26 12:30 ` [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level Corinna Vinschen
  2 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2022-01-26  9:45 UTC (permalink / raw)
  To: newlib

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=8bit, Size: 6920 bytes --]

Merge the subdir configure scripts up that only existed to set unique
values for their target/host makefile_frags.
---
 libgloss/configure           |   26 +-
 libgloss/configure.ac        |   18 +-
 libgloss/rs6000/aclocal.m4   |  383 ----
 libgloss/rs6000/configure    | 3870 ---------------------------------
 libgloss/rs6000/configure.ac |   40 -
 libgloss/spu/aclocal.m4      |  383 ----
 libgloss/spu/configure       | 3870 ---------------------------------
 libgloss/spu/configure.ac    |   40 -
 libgloss/xc16x/aclocal.m4    |  383 ----
 libgloss/xc16x/configure     | 3887 ----------------------------------
 libgloss/xc16x/configure.ac  |   66 -
 11 files changed, 28 insertions(+), 12938 deletions(-)
 delete mode 100644 libgloss/rs6000/aclocal.m4
 delete mode 100755 libgloss/rs6000/configure
 delete mode 100644 libgloss/rs6000/configure.ac
 delete mode 100644 libgloss/spu/aclocal.m4
 delete mode 100755 libgloss/spu/configure
 delete mode 100644 libgloss/spu/configure.ac
 delete mode 100644 libgloss/xc16x/aclocal.m4
 delete mode 100755 libgloss/xc16x/configure
 delete mode 100644 libgloss/xc16x/configure.ac

diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index 21ba8f10691f..d635f6af9df3 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -23,6 +23,9 @@ config_testsuite=true
 dnl indicates whether to run configure within the libnosys subdirectory
 config_libnosys=true
 
+host_makefile_frag=${srcdir}/config/default.mh
+target_makefile_frag=${srcdir}/config/default.mt
+
 case "${target}" in
   aarch64*-*-*)
 	AC_CONFIG_SUBDIRS(aarch64)
@@ -84,7 +87,9 @@ case "${target}" in
 	subdirs="$subdirs riscv"
 	;;
   powerpc-*-*|powerpcle-*-*)
-	AC_CONFIG_SUBDIRS([rs6000])
+	AC_CONFIG_FILES([rs6000/Makefile])
+	subdirs="$subdirs rs6000"
+	host_makefile_frag=${srcdir}/config/ppc.mh
 	;;
   mn10200-*-*)
 	AC_CONFIG_SUBDIRS([mn10200])
@@ -156,7 +161,9 @@ case "${target}" in
 	config_testsuite=false
 	;;
   xc16x-*-*)
-	AC_CONFIG_SUBDIRS([xc16x])
+	AC_CONFIG_FILES([xc16x/Makefile])
+	subdirs="$subdirs xc16x"
+	target_makefile_frag=${srcdir}/config/xc16x.mt
 	;;
   xstormy16-*-*)
 	AC_CONFIG_FILES([xstormy16/Makefile])
@@ -183,7 +190,9 @@ case "${target}" in
 	AC_CONFIG_SUBDIRS([arm])
 	;;
   spu-*-elf)
-	AC_CONFIG_SUBDIRS([spu])
+	AC_CONFIG_FILES([spu/Makefile])
+	subdirs="$subdirs spu"
+	host_makefile_frag=${srcdir}/config/ppc.mh
 	config_testsuite=false
 	config_libnosys=false
 	;;
@@ -308,9 +317,6 @@ AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_cv_symbol_prefix", [symbol prefix])
 
 m4_include([libnosys/acinclude.m4])
 
-host_makefile_frag=${srcdir}/config/default.mh
-target_makefile_frag=${srcdir}/config/default.mt
-
 dnl We have to assign the same value to other variables because autoconf
 dnl doesn't provide a mechanism to substitute a replacement keyword with
 dnl arbitrary data or pathnames.
diff --git a/libgloss/rs6000/configure.ac b/libgloss/rs6000/configure.ac
deleted file mode 100644
index 0919404d5db9..000000000000
--- a/libgloss/rs6000/configure.ac
+++ /dev/null
@@ -1,40 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(sim-crt0.S)
-
-AC_CONFIG_AUX_DIR(../..)
-
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-
-AC_PROG_INSTALL
-
-LIB_AC_PROG_CC
-
-AS=${AS-as}
-AC_SUBST(AS)
-AR=${AR-ar}
-AC_SUBST(AR)
-LD=${LD-ld}
-AC_SUBST(LD)
-AC_PROG_RANLIB
-LIB_AM_PROG_AS
-
-host_makefile_frag=${srcdir}/../config/ppc.mh
-
-dnl We have to assign the same value to other variables because autoconf
-dnl doesn't provide a mechanism to substitute a replacement keyword with
-dnl arbitrary data or pathnames.
-dnl
-host_makefile_frag_path=$host_makefile_frag
-AC_SUBST(host_makefile_frag_path)
-AC_SUBST_FILE(host_makefile_frag)
-
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
diff --git a/libgloss/spu/configure.ac b/libgloss/spu/configure.ac
deleted file mode 100644
index cf5f00bcc86c..000000000000
--- a/libgloss/spu/configure.ac
+++ /dev/null
@@ -1,40 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(crt0.S)
-
-AC_CONFIG_AUX_DIR(../..)
-
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-
-AC_PROG_INSTALL
-
-LIB_AC_PROG_CC
-
-AS=${AS-as}
-AC_SUBST(AS)
-AR=${AR-ar}
-AC_SUBST(AR)
-LD=${LD-ld}
-AC_SUBST(LD)
-AC_PROG_RANLIB
-LIB_AM_PROG_AS
-
-host_makefile_frag=${srcdir}/../config/ppc.mh
-
-dnl We have to assign the same value to other variables because autoconf
-dnl doesn't provide a mechanism to substitute a replacement keyword with
-dnl arbitrary data or pathnames.
-dnl
-host_makefile_frag_path=$host_makefile_frag
-AC_SUBST(host_makefile_frag_path)
-AC_SUBST_FILE(host_makefile_frag)
-
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
diff --git a/libgloss/xc16x/configure.ac b/libgloss/xc16x/configure.ac
deleted file mode 100644
index 177b7b8282bf..000000000000
--- a/libgloss/xc16x/configure.ac
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Copyright (C) 2006 KPIT Cummins
-# Copyright (C) 2009 Conny Marco Menebröcker
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms is permitted
-# provided that the above copyright notice and following paragraph are
-# duplicated in all such forms.
-#
-# This file is distributed WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#
-#
-# Process this file with autoconf to produce a configure script.
-#
-AC_INIT(crt0.S)
-
-AC_CONFIG_AUX_DIR(../..)
-
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-
-AC_PROG_INSTALL
-
-LIB_AC_PROG_CC
-AS=${AS-as}
-AC_SUBST(AS)
-AR=${AR-ar}
-AC_SUBST(AR)
-LD=${LD-ld}
-AC_SUBST(LD)
-AC_PROG_RANLIB
-LIB_AM_PROG_AS
-
-
-host_makefile_frag=${srcdir}/../config/default.mh
-target_makefile_frag=${srcdir}/../config/xc16x.mt
-
-dnl We have to assign the same value to other variables because autoconf
-dnl doesn't provide a mechanism to substitute a replacement keyword with
-dnl arbitrary data or pathnames.
-dnl
-host_makefile_frag_path=$host_makefile_frag
-AC_SUBST(host_makefile_frag_path)
-AC_SUBST_FILE(host_makefile_frag)
-target_makefile_frag_path=$target_makefile_frag
-AC_SUBST(target_makefile_frag_path)
-AC_SUBST_FILE(target_makefile_frag)
-AC_SUBST(part_specific_obj)
-AC_SUBST(script_list)
-AC_SUBST(bsp_list)
-
-AC_CONFIG_FILES([Makefile],
-[if test -n "$CONFIG_FILES"; then
-  unset ac_file
-  . ${srcdir}/../../config-ml.in
-fi],
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
-
-
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] libgloss: move to ../config/multi.m4 for multilib logic
  2022-01-26  9:45 [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level Mike Frysinger
  2022-01-26  9:45 ` [PATCH 2/3] libgloss: merge subdirs that have unique makefile_frags " Mike Frysinger
@ 2022-01-26  9:45 ` Mike Frysinger
  2022-01-26 12:30 ` [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level Corinna Vinschen
  2 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2022-01-26  9:45 UTC (permalink / raw)
  To: newlib

The current libgloss 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.

The insertions here look larger and that's because none of the scripts
were declaring --enable-multilib explicitly even though they checked the
flag and changed behavior.
---
 libgloss/aarch64/aclocal.m4            |  1 +
 libgloss/aarch64/configure             | 69 +++++++++++++++++++++--
 libgloss/aarch64/configure.ac          | 11 +---
 libgloss/aarch64/cpu-init/aclocal.m4   |  1 +
 libgloss/aarch64/cpu-init/configure    | 69 +++++++++++++++++++++--
 libgloss/aarch64/cpu-init/configure.ac | 11 +---
 libgloss/aclocal.m4                    |  1 +
 libgloss/arm/aclocal.m4                |  1 +
 libgloss/arm/configure                 | 77 ++++++++++++++++++++-----
 libgloss/arm/configure.ac              | 21 ++-----
 libgloss/configure                     | 78 ++++++++++++++++++++------
 libgloss/configure.ac                  | 24 +-------
 libgloss/csky/aclocal.m4               |  1 +
 libgloss/csky/configure                | 70 ++++++++++++++++++++---
 libgloss/csky/configure.ac             | 12 +---
 libgloss/i386/aclocal.m4               |  1 +
 libgloss/i386/configure                | 69 +++++++++++++++++++++--
 libgloss/i386/configure.ac             | 11 +---
 libgloss/m68k/aclocal.m4               |  1 +
 libgloss/m68k/configure                | 70 ++++++++++++++++++++---
 libgloss/m68k/configure.ac             | 12 +---
 libgloss/mcore/aclocal.m4              |  1 +
 libgloss/mcore/configure               | 69 +++++++++++++++++++++--
 libgloss/mcore/configure.ac            | 11 +---
 libgloss/mips/aclocal.m4               |  1 +
 libgloss/mips/configure                | 69 +++++++++++++++++++++--
 libgloss/mips/configure.ac             | 11 +---
 libgloss/mn10200/aclocal.m4            |  1 +
 libgloss/mn10200/configure             | 71 ++++++++++++++++++++---
 libgloss/mn10200/configure.ac          | 13 +----
 libgloss/mn10300/aclocal.m4            |  1 +
 libgloss/mn10300/configure             | 74 ++++++++++++++++++++----
 libgloss/mn10300/configure.ac          | 16 +-----
 libgloss/moxie/aclocal.m4              |  1 +
 libgloss/moxie/configure               | 69 +++++++++++++++++++++--
 libgloss/moxie/configure.ac            | 11 +---
 libgloss/sparc/aclocal.m4              |  1 +
 libgloss/sparc/configure               | 73 ++++++++++++++++++++----
 libgloss/sparc/configure.ac            | 11 +---
 39 files changed, 868 insertions(+), 247 deletions(-)

diff --git a/libgloss/aarch64/configure.ac b/libgloss/aarch64/configure.ac
index 303e51359ca6..b26f55ecaca1 100644
--- a/libgloss/aarch64/configure.ac
+++ b/libgloss/aarch64/configure.ac
@@ -43,12 +43,7 @@ if test -d "${srcdir}/cpu-init"; then
   AC_SUBST(subdirs)
 fi
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
+AM_ENABLE_MULTILIB(, ../..)
+
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/libgloss/aarch64/cpu-init/configure.ac b/libgloss/aarch64/cpu-init/configure.ac
index 91aa2211d8b1..91f9c709a18a 100644
--- a/libgloss/aarch64/cpu-init/configure.ac
+++ b/libgloss/aarch64/cpu-init/configure.ac
@@ -28,12 +28,7 @@ host_makefile_frag_path=$host_makefile_frag
 AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
+AM_ENABLE_MULTILIB(, ../../..)
+
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/libgloss/arm/configure.ac b/libgloss/arm/configure.ac
index 806020b04668..2b98b5453725 100644
--- a/libgloss/arm/configure.ac
+++ b/libgloss/arm/configure.ac
@@ -62,24 +62,11 @@ AC_SUBST_FILE(host_makefile_frag)
 # Configure cpu init plug-ins
 if test -d "${srcdir}/cpu-init"; then
   subdirs="${subdirs} cpu-init"
-  AC_CONFIG_FILES(cpu-init/Makefile,
-  . ${srcdir}/../../config-ml.in,
-  srcdir=${srcdir}
-  target=${target}
-  with_multisubdir=${with_multisubdir}
-  ac_configure_args="${ac_configure_args} --enable-multilib"
-  CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-  )
+  AC_CONFIG_FILES([cpu-init/Makefile])
   AC_SUBST(subdirs)
 fi
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
+AM_ENABLE_MULTILIB(, ../..)
 
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index d635f6af9df3..faacfd93d367 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -328,27 +328,7 @@ target_makefile_frag_path=$target_makefile_frag
 AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
-if test "${multilib}" = "yes"; then
-  multilib_arg="--enable-multilib"
-else
-  multilib_arg=
-fi
+AM_ENABLE_MULTILIB(, ..)
 
-# for now, only add multilibs for specific targets
-AC_CONFIG_FILES([Makefile],
-[if test -n "$CONFIG_FILES"; then
-  unset ac_file
-  . ${srcdir}/../config-ml.in
-fi],
-srcdir=${srcdir}
-target=${target}
-host=${host}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="--enable-multilib ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-CC="${CC}"
-LDFLAGS=${LDFLAGS}
-)
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
-
-
diff --git a/libgloss/csky/configure.ac b/libgloss/csky/configure.ac
index 0387ea46b351..bb9a9195df97 100644
--- a/libgloss/csky/configure.ac
+++ b/libgloss/csky/configure.ac
@@ -65,13 +65,7 @@ target_makefile_frag_path=$target_makefile_frag
 AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
+AM_ENABLE_MULTILIB(, ../..)
 
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/libgloss/i386/configure.ac b/libgloss/i386/configure.ac
index 895e4476edcc..e03620770235 100644
--- a/libgloss/i386/configure.ac
+++ b/libgloss/i386/configure.ac
@@ -53,12 +53,7 @@ host_makefile_frag_path=$host_makefile_frag
 AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
+AM_ENABLE_MULTILIB(, ../..)
+
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/libgloss/m68k/configure.ac b/libgloss/m68k/configure.ac
index 53615ffc66df..de35d7934966 100644
--- a/libgloss/m68k/configure.ac
+++ b/libgloss/m68k/configure.ac
@@ -65,13 +65,7 @@ target_makefile_frag_path=$target_makefile_frag
 AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
+AM_ENABLE_MULTILIB(, ../..)
 
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/libgloss/mcore/configure.ac b/libgloss/mcore/configure.ac
index a314d4ee368d..f6b3f009643e 100644
--- a/libgloss/mcore/configure.ac
+++ b/libgloss/mcore/configure.ac
@@ -39,12 +39,7 @@ host_makefile_frag_path=$host_makefile_frag
 AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
+AM_ENABLE_MULTILIB(, ../..)
+
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/libgloss/mips/configure.ac b/libgloss/mips/configure.ac
index a609233a6105..ca99c7287635 100644
--- a/libgloss/mips/configure.ac
+++ b/libgloss/mips/configure.ac
@@ -97,12 +97,7 @@ AC_SUBST(bsp_list)
 AC_SUBST(crt0)
 AC_SUBST(pcrt0)
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
+AM_ENABLE_MULTILIB(, ../..)
+
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/libgloss/mn10200/configure.ac b/libgloss/mn10200/configure.ac
index 70dbd49d9b16..d5a0cc87aac6 100644
--- a/libgloss/mn10200/configure.ac
+++ b/libgloss/mn10200/configure.ac
@@ -52,14 +52,7 @@ AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 AC_SUBST(part_specific_obj)
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
-
+AM_ENABLE_MULTILIB(, ../..)
 
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/libgloss/mn10300/configure.ac b/libgloss/mn10300/configure.ac
index 9526576b067f..88af0f948748 100644
--- a/libgloss/mn10300/configure.ac
+++ b/libgloss/mn10300/configure.ac
@@ -61,17 +61,7 @@ AC_SUBST(part_specific_obj)
 AC_SUBST(script_list)
 AC_SUBST(bsp_list)
 
-AC_CONFIG_FILES([Makefile],
-[if test -n "$CONFIG_FILES"; then
-  unset ac_file
-  . ${srcdir}/../../config-ml.in
-fi],
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
-AC_OUTPUT
-
+AM_ENABLE_MULTILIB(, ../..)
 
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/libgloss/moxie/configure.ac b/libgloss/moxie/configure.ac
index baf66ef496b9..f09d72b77932 100644
--- a/libgloss/moxie/configure.ac
+++ b/libgloss/moxie/configure.ac
@@ -44,12 +44,7 @@ host_makefile_frag_path=$host_makefile_frag
 AC_SUBST(host_makefile_frag_path)
 AC_SUBST_FILE(host_makefile_frag)
 
-AC_CONFIG_FILES(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
+AM_ENABLE_MULTILIB(, ../..)
+
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/libgloss/sparc/configure.ac b/libgloss/sparc/configure.ac
index 9a9b987da8af..56049d5b9b33 100644
--- a/libgloss/sparc/configure.ac
+++ b/libgloss/sparc/configure.ac
@@ -58,12 +58,7 @@ AC_SUBST(target_makefile_frag_path)
 AC_SUBST_FILE(target_makefile_frag)
 AC_SUBST(CYGMONLDSCRIPTTEMPL)
 
-AC_OUTPUT(Makefile,
-. ${srcdir}/../../config-ml.in,
-srcdir=${srcdir}
-target=${target}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${ac_configure_args} --enable-multilib"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-)
+AM_ENABLE_MULTILIB(, ../..)
 
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level
  2022-01-26  9:45 [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level Mike Frysinger
  2022-01-26  9:45 ` [PATCH 2/3] libgloss: merge subdirs that have unique makefile_frags " Mike Frysinger
  2022-01-26  9:45 ` [PATCH 3/3] libgloss: move to ../config/multi.m4 for multilib logic Mike Frysinger
@ 2022-01-26 12:30 ` Corinna Vinschen
  2022-01-27  2:32   ` Mike Frysinger
  2 siblings, 1 reply; 6+ messages in thread
From: Corinna Vinschen @ 2022-01-26 12:30 UTC (permalink / raw)
  To: newlib

On Jan 26 04:45, Mike Frysinger wrote:
> These subdirs have unique configure scripts to do some compiler tests.
> The checks should work for all targets, so hoist them up to the top
> libgloss dir.  This should allow us to delete these subdir configure
> scripts.

For some reason this patch doesn't apply cleanly to current git master:

  Applying: libgloss: merge epiphany & libnosys & or1k configure scripts up a level
  error: git apply: bad git-diff - inconsistent old filename on line 38
  Patch failed at 0001 libgloss: merge epiphany & libnosys & or1k configure scripts up a level
  [...]

I'm a bit concerned that this patchset removes setting and AC_SUBST'ing
host_makefile_frag_path while the variable is still used by various
Makefile.in files...


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level
  2022-01-26 12:30 ` [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level Corinna Vinschen
@ 2022-01-27  2:32   ` Mike Frysinger
  2022-01-27 14:45     ` Corinna Vinschen
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2022-01-27  2:32 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

On 26 Jan 2022 13:30, Corinna Vinschen wrote:
> On Jan 26 04:45, Mike Frysinger wrote:
> > These subdirs have unique configure scripts to do some compiler tests.
> > The checks should work for all targets, so hoist them up to the top
> > libgloss dir.  This should allow us to delete these subdir configure
> > scripts.
> 
> For some reason this patch doesn't apply cleanly to current git master:
> 
>   Applying: libgloss: merge epiphany & libnosys & or1k configure scripts up a level
>   error: git apply: bad git-diff - inconsistent old filename on line 38
>   Patch failed at 0001 libgloss: merge epiphany & libnosys & or1k configure scripts up a level
>   [...]

probably because the deletions were removed from the patch before posting
to avoid going over the mailing list limit and make it easier to focus on
the actual changes, not generated content.

binutils/gdb allows devs to push to refs/heads/users/$USER/xxx.  glibc
allows refs/heads/$USER/xxx.  should we carve out similar space here ?
then i could push my branches there and it'd be easy for you to git
fetch && git merge with the right state.  no need to sync multiple
e-mails to your local tree.

> I'm a bit concerned that this patchset removes setting and AC_SUBST'ing
> host_makefile_frag_path while the variable is still used by various
> Makefile.in files...

sorry, but what are you looking at ?  it isn't deleting that setting.
the top level configure script has always had (and i'm not removing):
host_makefile_frag=${srcdir}/config/default.mh
host_makefile_frag_path=$host_makefile_frag
AC_SUBST(host_makefile_frag_path)
AC_SUBST_FILE(host_makefile_frag)

so when i delete libgloss/$ARCH/configure, they don't lose that setting,
they simply get it from the top level configure instead of the $ARCH one.
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level
  2022-01-27  2:32   ` Mike Frysinger
@ 2022-01-27 14:45     ` Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2022-01-27 14:45 UTC (permalink / raw)
  To: newlib

On Jan 26 21:32, Mike Frysinger wrote:
> On 26 Jan 2022 13:30, Corinna Vinschen wrote:
> > On Jan 26 04:45, Mike Frysinger wrote:
> > > These subdirs have unique configure scripts to do some compiler tests.
> > > The checks should work for all targets, so hoist them up to the top
> > > libgloss dir.  This should allow us to delete these subdir configure
> > > scripts.
> > 
> > For some reason this patch doesn't apply cleanly to current git master:
> > 
> >   Applying: libgloss: merge epiphany & libnosys & or1k configure scripts up a level
> >   error: git apply: bad git-diff - inconsistent old filename on line 38
> >   Patch failed at 0001 libgloss: merge epiphany & libnosys & or1k configure scripts up a level
> >   [...]
> 
> probably because the deletions were removed from the patch before posting
> to avoid going over the mailing list limit and make it easier to focus on
> the actual changes, not generated content.
> 
> binutils/gdb allows devs to push to refs/heads/users/$USER/xxx.  glibc
> allows refs/heads/$USER/xxx.  should we carve out similar space here ?
> then i could push my branches there and it'd be easy for you to git
> fetch && git merge with the right state.  no need to sync multiple
> e-mails to your local tree.
> 
> > I'm a bit concerned that this patchset removes setting and AC_SUBST'ing
> > host_makefile_frag_path while the variable is still used by various
> > Makefile.in files...
> 
> sorry, but what are you looking at ?  it isn't deleting that setting.
> the top level configure script has always had (and i'm not removing):
> host_makefile_frag=${srcdir}/config/default.mh
> host_makefile_frag_path=$host_makefile_frag
> AC_SUBST(host_makefile_frag_path)
> AC_SUBST_FILE(host_makefile_frag)
> 
> so when i delete libgloss/$ARCH/configure, they don't lose that setting,
> they simply get it from the top level configure instead of the $ARCH one.
> -mike

Ok, please push.


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-27 14:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26  9:45 [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level Mike Frysinger
2022-01-26  9:45 ` [PATCH 2/3] libgloss: merge subdirs that have unique makefile_frags " Mike Frysinger
2022-01-26  9:45 ` [PATCH 3/3] libgloss: move to ../config/multi.m4 for multilib logic Mike Frysinger
2022-01-26 12:30 ` [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level Corinna Vinschen
2022-01-27  2:32   ` Mike Frysinger
2022-01-27 14:45     ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).