From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id 16FDB385803B; Thu, 17 Feb 2022 01:25:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16FDB385803B 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] libgloss: m68k: switch to AC_NO_EXECUTABLES X-Act-Checkin: newlib-cygwin X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: 91019da446b3c3e1be728cb6eaf2794706bfd897 X-Git-Newrev: 7d565fe0133a8c0ae86c21c515b1aa47a03ddd0c Message-Id: <20220217012558.16FDB385803B@sourceware.org> Date: Thu, 17 Feb 2022 01:25:58 +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: Thu, 17 Feb 2022 01:25:58 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D7d565fe0133= a8c0ae86c21c515b1aa47a03ddd0c commit 7d565fe0133a8c0ae86c21c515b1aa47a03ddd0c Author: Mike Frysinger Date: Fri Feb 11 06:58:43 2022 -0500 libgloss: m68k: switch to AC_NO_EXECUTABLES =20 Use this macro rather than hacking up the LDFLAGS settings. This will make it easier to merge the logic into the top-level which is already using AC_NO_EXECUTABLES. Diff: --- libgloss/m68k/configure | 82 ++++++++++++++++++++++++++++++++++++++++++= ++-- libgloss/m68k/configure.ac | 10 ++---- 2 files changed, 81 insertions(+), 11 deletions(-) diff --git a/libgloss/m68k/configure b/libgloss/m68k/configure index f5ecb8280..9420a642b 100755 --- a/libgloss/m68k/configure +++ b/libgloss/m68k/configure @@ -582,6 +582,7 @@ PACKAGE_BUGREPORT=3D PACKAGE_URL=3D =20 ac_unique_file=3D"crt0.S" +ac_no_link=3Dno ac_subst_vars=3D'LTLIBOBJS LIBOBJS multi_basedir @@ -2598,11 +2599,11 @@ test "${CCASFLAGS+set}" =3D set || CCASFLAGS=3D$CFL= AGS =20 =20 =20 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking target cpu family" >&5 $as_echo_n "checking target cpu family... " >&6; } TARGET=3Dm68k -saved_LDFLAGS=3D"$LDFLAGS" -LDFLAGS=3D"-nostdlib -e main" ac_ext=3Dc ac_cpp=3D'$CPP $CPPFLAGS' ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2934,6 +2935,29 @@ done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ =20 +int +main () +{ + + ; + return 0; +} +_ACEOF +if { { ac_try=3D"$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=3D\$ac_try;; + *) ac_try_echo=3D$ac_try;; +esac +eval ac_try_echo=3D"\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=3D$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 + test $ac_status =3D 0; }; then + ac_no_link=3Dno + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + int main () { @@ -3130,6 +3154,59 @@ $as_echo "$cross_compiling" >&6; } =20 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=3D$ac_clean_files_save + +else + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.o conftest.obj conf= test.dSYM + ac_no_link=3Dyes + # Setting cross_compile will disable run tests; it will + # also disable AC_CHECK_FILE but that's generally + # correct if we can't link. + cross_compiling=3Dyes + EXEEXT=3D + # Check that the compiler produces executables we can run. If not, eith= er +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross com= piling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" !=3D yes; then + { { ac_try=3D"$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=3D\$ac_try;; + *) ac_try_echo=3D$ac_try;; +esac +eval ac_try_echo=3D"\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=3D$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 + test $ac_status =3D 0; } + if { ac_try=3D'./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=3D\$ac_try;; + *) ac_try_echo=3D$ac_try;; +esac +eval ac_try_echo=3D"\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=3D$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 + test $ac_status =3D 0; }; }; then + cross_compiling=3Dno + else + if test "$cross_compiling" =3D maybe; then + cross_compiling=3Dyes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object fil= es" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : @@ -3565,7 +3642,6 @@ if ac_fn_c_try_cpp "$LINENO"; then : TARGET=3D"fido" fi rm -f conftest.err conftest.i conftest.$ac_ext -LDFLAGS=3D$saved_LDFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TARGET" >&5 $as_echo "$TARGET" >&6; } =20 diff --git a/libgloss/m68k/configure.ac b/libgloss/m68k/configure.ac index 41b49a530..0230e08d8 100644 --- a/libgloss/m68k/configure.ac +++ b/libgloss/m68k/configure.ac @@ -30,15 +30,10 @@ AC_SUBST(LD) AC_PROG_RANLIB LIB_AM_PROG_AS =20 +AC_NO_EXECUTABLES + AC_MSG_CHECKING([target cpu family]) TARGET=3Dm68k -dnl Temporarily modify LDFLAGS so that link tests will succeed without -dnl a C library. Note that we may not have a C librabry yet and that -dnl autoconf automatically adds script to check whether we can create -dnl an executable or not. -dnl -saved_LDFLAGS=3D"$LDFLAGS" -LDFLAGS=3D"-nostdlib -e main" AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#ifndef __mcoldfire__ #error we are not coldfire #endif])], @@ -47,7 +42,6 @@ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#ifndef __mfido__ #error we are not fido #endif])], TARGET=3D"fido",) -LDFLAGS=3D$saved_LDFLAGS AC_MSG_RESULT($TARGET) AC_SUBST(TARGET)