This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: SETPGRP and autoconf
- To: dmj+ at andrew dot cmu dot edu
- Subject: Re: SETPGRP and autoconf
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Thu, 26 Jul 2001 12:40:02 +0200
- CC: gdb at sources dot redhat dot com
- References: <20010725162420.A13860@nevyn.them.org>
Date: Wed, 25 Jul 2001 16:24:20 -0700
From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
I should have objected :) But it'd been so long since I last saw this issue
that I forgot about it.
AC_FUNC_SETPGRP has some regrettable problems. Witness:
checking whether setpgrp takes no argument... configure: error: cannot check
setpgrp if cross compiling
Thus breaking all host-x-host cross builds.
Bugger!
This is what I really hate about autoconf. There's no good reason for
AC_FUNC_SETPGRP to be an executed test. If you have a prototype for
setpgrp(void), setpgrp(1,1) won't compile, and you don't need to execute
anything at all.
Who says you've got a prototype? Even though GDB requires an ISO C
compiler now, this doesn't mean the host's headers have to be ISO
C-compliant.
What can we do about this? Besides my usual hack: I have a huge list of
autoconf cache variables in my build environment, preset.
Dunno. I don't think there are too many people cross-compiling GDB.
If we want to fix this, we could use an alternative check for
AC_FUNC_SETPGRP when cross-compiling based on the setpgrp prototype.
I don't think it would hurts not defining SETPGRP_VOID if no
prototypes are available, since passing the extra arguments should be
harmless.
Mark