From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Jacobowitz To: Andrew Cagney Cc: Mark Kettenis , gdb-patches@sources.redhat.com Subject: Re: SETPGRP and autoconf Date: Fri, 27 Jul 2001 10:21:00 -0000 Message-id: <20010727102017.A5627@nevyn.them.org> References: <20010725162420.A13860@nevyn.them.org> <200107261040.f6QAe2T05377@delius.kettenis.local> <20010726084450.A2941@nevyn.them.org> <3B60505D.5080304@cygnus.com> X-SW-Source: 2001-07/msg00676.html On Thu, Jul 26, 2001 at 01:16:13PM -0400, Andrew Cagney wrote: > native - already covered, test works > cross debugger - N/A procfs et.al. do not need the results of the test > canadian cross - try headers; test is against the build systems > build-X-host cross compiler and not the build systems build-X-build > native compiler. > > I can't see anyone trying to canadian-cross GDB to anything but a fairly > modern operating system, consequently, the headers test should work. How does this look? Only gotcha - I regenerated configure (not included) with autoconf 2.13, and the existing one claims to be autoconf 2.13, but they have some noticeable differences - -site-file for instance. Is there a particular autoconf I should be using? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer 2001-07-27 Daniel Jacobowitz * 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. Index: configure.in =================================================================== RCS file: /cvs/src/src/gdb/configure.in,v retrieving revision 1.68 diff -u -r1.68 configure.in --- configure.in 2001/07/27 16:35:27 1.68 +++ configure.in 2001/07/27 17:14:08 @@ -134,7 +134,24 @@ 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 if 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 +], [ + 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.