On Thu, Jan 15, 2009 at 12:59:36PM +0000, John Levon wrote:
On Thu, Jan 15, 2009 at 11:47:13AM +0000, Richard W.M. Jones wrote:
> On Wed, Jan 14, 2009 at 07:21:10AM -0800, john.levon(a)sun.com wrote:
> > +#ifdef __sun
>
> I'm really unhappy about adding #ifdef __sun everywhere in this file.
> Configure should detect the features that are needed / available /
> missing, and the #ifdefs should go on the result of that.
This is Solaris stuff that doesn't and won't exist anywhere else. It
would just be moving the #ifdef __sun into configure.in - I can't
think what advantage you would be expecting from this, [...]
The problem is that someone comes along needing, say, AIX support or
Watcom on Windows or whatever, and before you know it you've got code
like this ...
http://svn.python.org/projects/python/branches/py3k/Modules/posixmodule.c
We really should go by features detected in configure, not assumptions
about the platform which may not even be true.
or indeed how to
even test the need to do the I_PUSHes.
The autoconf manual is voluminous but comprehensive:
http://www.gnu.org/software/autoconf/manual/autoconf.html
For the I_PUSHes I think the best way is to have a tiny test program
and use AC_COMPILE_IFELSE:
http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-the-Com...
(There's an example of how to use it in the preceeding section, 6.3,
in the manual). If that doesn't help, we have Jim Meyering on this
list who is the world's expert at this sort of thing.
Rich.
--
Richard Jones, Emerging Technologies, Red Hat
http://et.redhat.com/~rjones
Read my OCaml programming blog:
http://camltastic.blogspot.com/
Fedora now supports 68 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora