From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id 3D3E83858426; Fri, 21 Jan 2022 22:23:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D3E83858426 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Frysinger To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib: move to ../config/multi.m4 for multilib logic X-Act-Checkin: newlib-cygwin X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: 5cc72ac79d2bb072475de81a00fe302a0082e84b X-Git-Newrev: 17c2b857dc42cfe5e46d110250279f78807a3e5f Message-Id: <20220121222333.3D3E83858426@sourceware.org> Date: Fri, 21 Jan 2022 22:23:33 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2022 22:23:33 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D17c2b857dc4= 2cfe5e46d110250279f78807a3e5f commit 17c2b857dc42cfe5e46d110250279f78807a3e5f Author: Mike Frysinger Date: Thu Jan 20 22:52:02 2022 -0500 newlib: move to ../config/multi.m4 for multilib logic =20 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. Diff: --- 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/Makefile.in b/newlib/Makefile.in index 05abe50e9..a365218a5 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -100,6 +100,7 @@ subdir =3D . ACLOCAL_M4 =3D $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps =3D $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ @@ -392,6 +393,7 @@ lpfx =3D @lpfx@ machine_dir =3D @machine_dir@ mandir =3D @mandir@ mkdir_p =3D @mkdir_p@ +multi_basedir =3D @multi_basedir@ newlib_basedir =3D @newlib_basedir@ oext =3D @oext@ oldincludedir =3D @oldincludedir@ diff --git a/newlib/acinclude.m4 b/newlib/acinclude.m4 index bdefd9635..9e25b8589 100644 --- a/newlib/acinclude.m4 +++ b/newlib/acinclude.m4 @@ -13,6 +13,7 @@ dnl newlib directory. =20 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=3Dno ;; *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; esac], [multilib=3Dyes])dnl +])dnl =20 dnl Support --enable-target-optspace AC_ARG_ENABLE(target-optspace, diff --git a/newlib/aclocal.m4 b/newlib/aclocal.m4 index abf45db51..3d928e199 100644 --- a/newlib/aclocal.m4 +++ b/newlib/aclocal.m4 @@ -1169,6 +1169,7 @@ AC_SUBST([am__untar]) =20 m4_include([../config/depstand.m4]) m4_include([../config/lead-dot.m4]) +m4_include([../config/multi.m4]) m4_include([../config/override.m4]) m4_include([../libtool.m4]) m4_include([../ltoptions.m4]) diff --git a/newlib/configure b/newlib/configure index 2d015dbb6..0cfd83fe0 100755 --- a/newlib/configure +++ b/newlib/configure @@ -771,6 +771,7 @@ build newlib_basedir MAY_SUPPLY_SYSCALLS_FALSE MAY_SUPPLY_SYSCALLS_TRUE +multi_basedir target_alias host_alias build_alias @@ -1512,7 +1513,7 @@ Optional Features: --enable-newlib-retargetable-locking Allow locking routines to be ret= argeted at link time --enable-newlib-long-time_t define time_t to long --enable-newlib-use-gdtoa Use gdtoa rather than legacy ldtoa - --enable-multilib build many library versions (default) + --enable-multilib build many library versions (default) --enable-target-optspace optimize for space --enable-malloc-debugging indicate malloc debugging requested --enable-newlib-multithread enable support for multiple threads @@ -3188,17 +3189,43 @@ fi =20 =20 =20 +# Default to --enable-multilib # Check whether --enable-multilib was given. if test "${enable_multilib+set}" =3D set; then : - enableval=3D$enable_multilib; case "${enableval}" in + enableval=3D$enable_multilib; case "$enableval" in yes) multilib=3Dyes ;; no) multilib=3Dno ;; - *) as_fn_error $? "bad value ${enableval} for multilib option" "$LINEN= O" 5 ;; + *) as_fn_error $? "bad value $enableval for multilib option" "$LINENO"= 5 ;; esac else multilib=3Dyes fi =20 + +# We may get other options which we leave undocumented: +# --with-target-subdir, --with-multisrctop, --with-multisubdir +# See config-ml.in if you want the gory details. + +if test "$srcdir" =3D "."; then + if test "$with_target_subdir" !=3D "."; then + multi_basedir=3D"$srcdir/$with_multisrctop../.." + else + multi_basedir=3D"$srcdir/$with_multisrctop.." + fi +else + multi_basedir=3D"$srcdir/.." +fi + + +# Even if the default multilib is not a cross compilation, +# it may be that some of the other multilibs are. +if test $cross_compiling =3D no && test $multilib =3D yes \ + && test "x${with_multisubdir}" !=3D x ; then + cross_compiling=3Dmaybe +fi + +ac_config_commands=3D"$ac_config_commands default-1" + # Check whether --enable-target-optspace was given. if test "${enable_target_optspace+set}" =3D set; then : enableval=3D$enable_target_optspace; case "${enableval}" in @@ -11980,7 +12007,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11983 "configure" +#line 12010 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -12086,7 +12113,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12089 "configure" +#line 12116 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -12586,12 +12613,6 @@ _ACEOF =20 =20 =20 -if test "${multilib}" =3D "yes"; then - multilib_arg=3D"--enable-multilib" -else - multilib_arg=3D -fi - if test "${newlib_iconv}" =3D "yes"; then =20 $as_echo "#define _ICONV_ENABLED 1" >>confdefs.h @@ -14182,6 +14203,20 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=3D1 # # INIT-COMMANDS # + +srcdir=3D"$srcdir" +host=3D"$host" +target=3D"$target" +with_multisubdir=3D"$with_multisubdir" +with_multisrctop=3D"$with_multisrctop" +with_target_subdir=3D"$with_target_subdir" +ac_configure_args=3D"${multilib_arg} ${ac_configure_args}" +multi_basedir=3D"$multi_basedir" +CONFIG_SHELL=3D${CONFIG_SHELL-/bin/sh} +CC=3D"$CC" +CXX=3D"$CXX" +GFORTRAN=3D"$GFORTRAN" +GCJ=3D"$GCJ" AMDEP_TRUE=3D"$AMDEP_TRUE" ac_aux_dir=3D"$ac_aux_dir" =20 =20 @@ -14447,15 +14482,6 @@ fi =20 =20 =20 -srcdir=3D${srcdir} -host=3D${host} -with_multisubdir=3D${with_multisubdir} -ac_configure_args=3D"${multilib_arg} ${ac_configure_args}" -CONFIG_SHELL=3D${CONFIG_SHELL-/bin/sh} -newlib_basedir=3D${newlib_basedir} -CC=3D"${CC}" -LDFLAGS=3D"${LDFLAGS}" - =20 _ACEOF =20 @@ -14467,6 +14493,7 @@ do case $ac_config_target in "newlib.h") CONFIG_HEADERS=3D"$CONFIG_HEADERS newlib.h:newlib.hin" ;; "_newlib_version.h") CONFIG_HEADERS=3D"$CONFIG_HEADERS _newlib_version= .h:_newlib_version.hin" ;; + "default-1") CONFIG_COMMANDS=3D"$CONFIG_COMMANDS default-1" ;; "depfiles") CONFIG_COMMANDS=3D"$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS=3D"$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES=3D"$CONFIG_FILES Makefile" ;; @@ -15066,6 +15093,14 @@ $as_echo "$as_me: executing $ac_file commands" >&6= ;} =20 case $ac_file$ac_mode in "newlib.h":H) sed -i.tmp -e '/^#define [^_]/d' -e '/^\/\* #undef [^_]/= d' newlib.h && rm -f newlib.h.tmp ;; + "default-1":C) +# Only add multilib support code if we just rebuilt the top-level +# Makefile. +case " $CONFIG_FILES " in + *" Makefile "*) + ac_file=3DMakefile . ${multi_basedir}/config-ml.in + ;; +esac ;; "depfiles":C) test x"$AMDEP_TRUE" !=3D x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval @@ -15804,10 +15839,6 @@ _LT_EOF chmod +x "$ofile" =20 ;; - "Makefile":F) if test -n "$CONFIG_FILES"; then - unset ac_file - . ${newlib_basedir}/../config-ml.in -fi ;; =20 esac done # for ac_tag diff --git a/newlib/configure.ac b/newlib/configure.ac index c54d2047a..b5ee6ff4f 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]) =20 -if test "${multilib}" =3D "yes"; then - multilib_arg=3D"--enable-multilib" -else - multilib_arg=3D -fi - if test "${newlib_iconv}" =3D "yes"; then AC_DEFINE(_ICONV_ENABLED, 1, [ICONV enabled.]) fi @@ -719,18 +713,5 @@ fi =20 AC_SUBST(CFLAGS) =20 -AC_CONFIG_FILES([Makefile], -[if test -n "$CONFIG_FILES"; then - unset ac_file - . ${newlib_basedir}/../config-ml.in -fi], -srcdir=3D${srcdir} -host=3D${host} -with_multisubdir=3D${with_multisubdir} -ac_configure_args=3D"${multilib_arg} ${ac_configure_args}" -CONFIG_SHELL=3D${CONFIG_SHELL-/bin/sh} -newlib_basedir=3D${newlib_basedir} -CC=3D"${CC}" -LDFLAGS=3D"${LDFLAGS}" -) +AC_CONFIG_FILES([Makefile]) AC_OUTPUT