From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id B63843851C1A for ; Wed, 26 Jan 2022 09:45:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B63843851C1A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 66ACA33C1C2; Wed, 26 Jan 2022 09:45:06 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH 1/3] libgloss: merge epiphany & libnosys & or1k configure scripts up a level Date: Wed, 26 Jan 2022 04:45:06 -0500 Message-Id: <20220126094508.24259-1-vapier@gentoo.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_STOCKGEN, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2022 09:45:16 -0000 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 <&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 <&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 <&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 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 <&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 <&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 <&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