Merge branch 'master' into merge-job
[deliverable/binutils-gdb.git] / gdb / configure.ac
index 6ffd460b21233c983a05c8d82a3522284d8edb6a..1d342f17526b2413e1da06efac3ab424221818dc 100644 (file)
@@ -1,5 +1,6 @@
 dnl Autoconf configure script for GDB, the GNU debugger.
-dnl Copyright (C) 1995-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 1995-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
 dnl
 dnl This file is part of GDB.
 dnl
@@ -248,6 +249,42 @@ if test x${all_targets} = xtrue; then
   fi
 fi
 
+# ROCm dbgapi support.
+
+AC_ARG_WITH(rocm-dbgapi,
+AS_HELP_STRING([--with-rocm-dbgapi=PATH],
+               [specify prefix directory for installed ROCm-dbgapi package]),,
+  [with_rocm_dbgapi=/opt/rocm])
+
+save_CPPFLAGS=${CPPFLAGS}
+CPPFLAGS="${CPPFLAGS} -I$with_rocm_dbgapi/include"
+AC_CHECK_HEADERS(amd-dbgapi.h)
+CPPFLAGS=${save_CPPFLAGS}
+
+save_LIBS=${LIBS}
+save_LDFLAGS=${LDFLAGS}
+LDFLAGS="${LDFLAGS} -L$with_rocm_dbgapi/lib"
+AC_CHECK_LIB(rocm-dbgapi,amd_dbgapi_initialize)
+LDFLAGS=${save_LDFLAGS}
+LIBS=${save_LIBS}
+
+if test x"$ac_cv_header_amd_dbgapi_h" = xyes \
+    -a x"$ac_cv_lib_rocm_dbgapi_amd_dbgapi_initialize" = xyes; then
+
+  if test x"$require_rocm_dbgapi" = xyes -o x"$all_targets" = xtrue; then
+    TARGET_OBS="$TARGET_OBS amdgcn-rocm-tdep.o rocm-tdep.o solib-rocm.o"
+  fi
+
+  CPPFLAGS="${CPPFLAGS} -I$with_rocm_dbgapi/include"
+  ROCM_DBGAPI_LIBS="-L$with_rocm_dbgapi/lib -lrocm-dbgapi"
+  AC_SUBST(ROCM_DBGAPI_LIBS)
+else
+  if test x"$require_rocm_dbgapi" = xyes; then
+    AC_MSG_ERROR([amdgcn*-*-* requires rocm-dbgapi to be installed, or use \
+--with-rocm-dbgapi=PATH])
+  fi
+fi
+
 AC_SUBST(TARGET_OBS)
 AC_SUBST(HAVE_NATIVE_GCORE_TARGET)
 
This page took 0.024565 seconds and 4 git commands to generate.