summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-10-12 10:06:35 +1030
committerAlan Modra <amodra@gmail.com>2022-10-12 10:08:14 +1030
commitb95bb5267e30b26d0831b6ba01d9bd25835d1046 (patch)
tree37578b08c375cdcdd10d6b146fa055611e1fb048 /config
parent82d23ca811ab365217fdc9bda215e23adb5e4a30 (diff)
downloadbinutils-gdb-b95bb5267e30b26d0831b6ba01d9bd25835d1046.tar.gz
Re: Merge configure.ac from gcc project
Also copy over config.acx.m4, and regenerate.
Diffstat (limited to 'config')
-rw-r--r--config/acx.m431
1 files changed, 30 insertions, 1 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 <<EOF
+pragma Warnings (Off);
+with System.CRTL;
+pragma Warnings (On);
+use type System.CRTL.int64;
procedure conftest is begin null; end conftest;
EOF
acx_cv_cc_gcc_supports_ada=no
@@ -420,6 +424,31 @@ else
fi
])
+# Test for D.
+AC_DEFUN([ACX_PROG_GDC],
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
+AC_REQUIRE([AC_PROG_CC])
+AC_CHECK_TOOL(GDC, gdc, no)
+AC_CACHE_CHECK([whether the D compiler works],
+ acx_cv_d_compiler_works,
+[cat >conftest.d <<EOF
+module conftest; int main() { return 0; }
+EOF
+acx_cv_d_compiler_works=no
+if test "x$GDC" != xno; then
+ errors=`(${GDC} $1[]m4_ifval([$1], [ ])-c conftest.d) 2>&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"