aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.in
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2001-07-30 22:08:41 +0000
committerDaniel Jacobowitz <drow@false.org>2001-07-30 22:08:41 +0000
commit72473524da621267b753414666ae9fde8d418b7c (patch)
treeaf9fdbad5af111505f7a855554a621f305447440 /gdb/configure.in
parent4b418e06b0deeefd61d79a57666ff971533e79fa (diff)
downloadgdb-72473524da621267b753414666ae9fde8d418b7c.zip
gdb-72473524da621267b753414666ae9fde8d418b7c.tar.gz
gdb-72473524da621267b753414666ae9fde8d418b7c.tar.bz2
* configure.in: Only invoke AC_FUNC_SETPGRP if not cross-compiling.
Check for SETPGRP_VOID separately if cross-compiling and ISO C headers are available.
Diffstat (limited to 'gdb/configure.in')
-rw-r--r--gdb/configure.in19
1 files changed, 18 insertions, 1 deletions
diff --git a/gdb/configure.in b/gdb/configure.in
index da78509..f676877 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -134,7 +134,24 @@ AC_C_CONST
AC_CHECK_FUNCS(setpgid setpgrp sbrk sigaction isascii bzero bcopy btowc poll sigprocmask)
AC_FUNC_VFORK
AC_FUNC_ALLOCA
-AC_FUNC_SETPGRP
+dnl AC_FUNC_SETPGRP does not work when cross compiling
+dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
+if test "$cross_compiling" = no; then
+ AC_FUNC_SETPGRP
+else
+ AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
+ [AC_TRY_COMPILE([
+#include <unistd.h>
+], [
+ if (setpgrp(1,1) == -1)
+ exit (0);
+ else
+ exit (1);
+], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
+if test $ac_cv_func_setpgrp_void = yes; then
+ AC_DEFINE(SETPGRP_VOID, 1)
+fi
+fi
# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
# since sigsetjmp might only be defined as a macro.