aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/ptrace.m4
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-10-31 08:30:59 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-10-31 08:30:59 -0400
commit5164c11714c92ba7690d4f93de6be6a90f460220 (patch)
tree2f616d6805b100c55f6090ddb2e834a763299c4c /gdbsupport/ptrace.m4
parentb6fb30eda72b7fc3a6214ed2787f80971f66810d (diff)
downloadgdb-5164c11714c92ba7690d4f93de6be6a90f460220.zip
gdb-5164c11714c92ba7690d4f93de6be6a90f460220.tar.gz
gdb-5164c11714c92ba7690d4f93de6be6a90f460220.tar.bz2
gdbsupport: replace AC_TRY_COMPILE in ptrace.m4
Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE + AC_LANG_PROGRAM. All the changes in the generated configure files are insignificant whitespace changes. gdb/ChangeLog: * configure: Re-generate. gdbserver/ChangeLog: * configure: Re-generate. gdbsupport/ChangeLog: * configure: Re-generate. * ptrace.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE + AC_LANG_PROGRAM. Change-Id: Ia782b5477fe49dad04e68c0f41c6d8ab3fde5bf0
Diffstat (limited to 'gdbsupport/ptrace.m4')
-rw-r--r--gdbsupport/ptrace.m440
1 files changed, 25 insertions, 15 deletions
diff --git a/gdbsupport/ptrace.m4 b/gdbsupport/ptrace.m4
index 57ed802..9f49cf6 100644
--- a/gdbsupport/ptrace.m4
+++ b/gdbsupport/ptrace.m4
@@ -37,13 +37,17 @@ gdb_ptrace_headers='
AC_CACHE_CHECK(
[return type of ptrace],
[gdb_cv_func_ptrace_ret],
- [AC_TRY_COMPILE(
- [$gdb_ptrace_headers],
- [extern long ptrace (enum __ptrace_request, ...);],
- [gdb_cv_func_ptrace_ret='long'],
- [AC_TRY_COMPILE(
+ [AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM(
[$gdb_ptrace_headers],
- [extern int ptrace ();],
+ [extern long ptrace (enum __ptrace_request, ...);]
+ )],
+ [gdb_cv_func_ptrace_ret='long'],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [$gdb_ptrace_headers],
+ [extern int ptrace ();]
+ )],
[gdb_cv_func_ptrace_ret='int'],
[gdb_cv_func_ptrace_ret='long']
)]
@@ -60,25 +64,31 @@ AC_DEFINE_UNQUOTED(
AC_CACHE_CHECK(
[types of arguments for ptrace],
[gdb_cv_func_ptrace_args],
- [AC_TRY_COMPILE(
- [$gdb_ptrace_headers],
- [extern long ptrace (enum __ptrace_request, ...);],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [$gdb_ptrace_headers],
+ [extern long ptrace (enum __ptrace_request, ...);]
+ )],
[gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'],
[for gdb_arg1 in 'int' 'long'; do
for gdb_arg2 in 'pid_t' 'int' 'long'; do
for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
for gdb_arg4 in 'int' 'long' 'void *'; do
- AC_TRY_COMPILE(
- [$gdb_ptrace_headers],
- [extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);],
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [$gdb_ptrace_headers],
+ [extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);]
+ )],
[gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
break 4;]
)
for gdb_arg5 in 'int *' 'int' 'long'; do
- AC_TRY_COMPILE(
- [$gdb_ptrace_headers],
- [extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);],
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [$gdb_ptrace_headers],
+ [extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);]
+ )],
[gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
break 5;]
)