From 7d565fe0133a8c0ae86c21c515b1aa47a03ddd0c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 11 Feb 2022 06:58:43 -0500 Subject: libgloss: m68k: switch to AC_NO_EXECUTABLES 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. --- libgloss/m68k/configure | 82 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 3 deletions(-) (limited to 'libgloss/m68k/configure') diff --git a/libgloss/m68k/configure b/libgloss/m68k/configure index f5ecb82..9420a64 100755 --- a/libgloss/m68k/configure +++ b/libgloss/m68k/configure @@ -582,6 +582,7 @@ PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="crt0.S" +ac_no_link=no ac_subst_vars='LTLIBOBJS LIBOBJS multi_basedir @@ -2598,11 +2599,11 @@ test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking target cpu family" >&5 $as_echo_n "checking target cpu family... " >&6; } TARGET=m68k -saved_LDFLAGS="$LDFLAGS" -LDFLAGS="-nostdlib -e main" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2942,6 +2943,29 @@ main () return 0; } _ACEOF +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + ac_no_link=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. @@ -3130,6 +3154,59 @@ $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save + +else + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.o conftest.obj conftest.dSYM + ac_no_link=yes + # 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=yes + EXEEXT= + # Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + 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 files" >&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="fido" fi rm -f conftest.err conftest.i conftest.$ac_ext -LDFLAGS=$saved_LDFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TARGET" >&5 $as_echo "$TARGET" >&6; } -- cgit v1.1