autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autoconf 2.5, 2.13, and Vim


From: Paul Eggert
Subject: Re: autoconf 2.5, 2.13, and Vim
Date: Tue, 12 Jun 2001 05:57:01 -0700 (PDT)

> From: Akim Demaille <address@hidden>
> Date: 12 Jun 2001 09:56:38 +0200
> 
> So, are you actually saying that *any* #include <foo.h> should be
> checked?

No, just if there's a good reason for it.  For example, AC_HEADER_STAT
need not bother to wrap the '#include <sys/types.h>' inside '#if
HAVE_SYS_TYPES_H', since POSIX specifies 'stat' and only POSIX and
POSIX-like systems have 'stat'.  It's theoretically possible for a
system to have 'stat' but not <sys/types.h>, but I think it's not
worth bothering about unless that turns into a problem.

In contrast, many hosts that conform to the C standard but not to
POSIX -- e.g. AmigaOS.  These hosts are of secondary importance to the
GNU project, so if it's a lot of work to cater to them, we shouldn't
bother; but if it's not too much work then it's OK.  Here, only six
macros are affected, and they only need a couple of lines inserted, so
this case is not a lot of work.

> Instead of having acheaders list plenty of headers,
> shouldn't it just list all the headers that have specific macros, and
> then, autoscan would ask for checking all the others?

If that simplifies maintenance, it might be a good thing to do.  I
don't offhand see why it would simplify things, but you're the expert
in that area.

> Hm, there remains the case of headers coming with a lib, and we only
> want to check for a single one of them (e.g., I guess there are
> zillions of X11 headers, but we don't check for them all).

Yes, that sounds counterproductive.  Perhaps we should leave acheaders
alone....


> Paul, what of sys/stat.h too.  Lemme guess: likewise :)

Yes, in _AC_INCLUDES_DEFAULT_REQUIREMENTS and in AC_PROG_CC_STDC.  But
the other occurrences of sys/stat.h assume POSIX, and thus need not be
wrapped.

Actually, come to think of it, it's not correct to simply wrap
sys/types.h and sys/stat.h in AC_PROG_CC_STDC.  AC_PROG_CC_STDC tests
for compiler errors that used to be common, some of which were
triggered by POSIX headers.  If the POSIX headers are absent, then it
should be safe to assume that the compiler errors are absent.
However, if we merely wrap the includes of sys/types.h and sys/stat.h
in AC_PROG_CC_STDC, it will falsely reject compilers on non-POSIX
hosts.  The proper fix for AC_PROG_CC_STDC would look something like
this:

#if HAVE_SYS_TYPES_H && HAVE_SYS_STAT_H
# include <sys/types.h>
# include <sys/stat.h>
#else
struct stat;
#endif

which should be good enough for that particular test.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]