From b95bb5267e30b26d0831b6ba01d9bd25835d1046 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 12 Oct 2022 10:06:35 +1030 Subject: [PATCH] Re: Merge configure.ac from gcc project Also copy over config.acx.m4, and regenerate. --- config/acx.m4 | 31 +++++++++++- configure | 130 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 156 insertions(+), 5 deletions(-) diff --git a/config/acx.m4 b/config/acx.m4 index 87c1b5e2932..7efe98aaf96 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -393,9 +393,13 @@ AC_DEFUN([ACX_PROG_GNAT], AC_REQUIRE([AC_PROG_CC]) AC_CHECK_TOOL(GNATBIND, gnatbind, no) AC_CHECK_TOOL(GNATMAKE, gnatmake, no) -AC_CACHE_CHECK([whether compiler driver understands Ada], +AC_CACHE_CHECK([whether compiler driver understands Ada and is recent enough], acx_cv_cc_gcc_supports_ada, [cat >conftest.adb <conftest.d <&1 || echo failure` + if test x"$errors" = x && test -f conftest.$ac_objext; then + acx_cv_d_compiler_works=yes + fi + rm -f conftest.* +fi]) +if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then + have_gdc=yes +else + have_gdc=no +fi +]) + dnl 'make compare' can be significantly faster, if cmp itself can dnl skip bytes instead of using tail. The test being performed is dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2" diff --git a/configure b/configure index d7d97700563..4d328b735a3 100755 --- a/configure +++ b/configure @@ -622,7 +622,6 @@ CC_FOR_TARGET RANLIB_PLUGIN_OPTION AR_PLUGIN_OPTION GDCFLAGS -GDC READELF OTOOL OBJDUMP @@ -709,6 +708,7 @@ PGO_BUILD_GEN_CFLAGS HAVE_CXX11_FOR_BUILD HAVE_CXX11 do_compare +GDC GNATMAKE GNATBIND ac_ct_CXX @@ -5664,12 +5664,16 @@ else GNATMAKE="$ac_cv_prog_GNATMAKE" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler driver understands Ada" >&5 -$as_echo_n "checking whether compiler driver understands Ada... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler driver understands Ada and is recent enough" >&5 +$as_echo_n "checking whether compiler driver understands Ada and is recent enough... " >&6; } if ${acx_cv_cc_gcc_supports_ada+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.adb <&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GDC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GDC"; then + ac_cv_prog_GDC="$GDC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GDC="${ac_tool_prefix}gdc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GDC=$ac_cv_prog_GDC +if test -n "$GDC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDC" >&5 +$as_echo "$GDC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_GDC"; then + ac_ct_GDC=$GDC + # Extract the first word of "gdc", so it can be a program name with args. +set dummy gdc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_GDC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_GDC"; then + ac_cv_prog_ac_ct_GDC="$ac_ct_GDC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GDC="gdc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_GDC=$ac_cv_prog_ac_ct_GDC +if test -n "$ac_ct_GDC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GDC" >&5 +$as_echo "$ac_ct_GDC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_GDC" = x; then + GDC="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + GDC=$ac_ct_GDC + fi +else + GDC="$ac_cv_prog_GDC" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D compiler works" >&5 +$as_echo_n "checking whether the D compiler works... " >&6; } +if ${acx_cv_d_compiler_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.d <&1 || echo failure` + if test x"$errors" = x && test -f conftest.$ac_objext; then + acx_cv_d_compiler_works=yes + fi + rm -f conftest.* +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_d_compiler_works" >&5 +$as_echo "$acx_cv_d_compiler_works" >&6; } +if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then + have_gdc=yes +else + have_gdc=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to compare bootstrapped objects" >&5 $as_echo_n "checking how to compare bootstrapped objects... " >&6; } if ${gcc_cv_prog_cmp_skip+:} false; then : -- 2.30.2