[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: configure can not determin 'HAVE_LIMITS'
From: |
Ralf Corsepius |
Subject: |
Re: configure can not determin 'HAVE_LIMITS' |
Date: |
Thu, 27 Oct 2005 04:47:13 +0200 |
On Thu, 2005-10-27 at 08:29 +0800, Steven Woody wrote:
> Ralf Corsepius <address@hidden> writes:
>
> > On Wed, 2005-10-26 at 21:52 +0800, Steven Woody wrote:
> >> Stepan Kasal <address@hidden> writes:
> >>
> >> > Hello,
> >> >
> >> > On Tue, Oct 25, 2005 at 10:23:55PM +0800, Steven Woody wrote:
> >> >> #ifdef HAVE_LIMITS
> >> >
> >> > add line
> >> >
> >> > AC_CHECK_HEADERS([limits])
> >> >
> >> > to configure.ac (or configure.in).
> >> >
> >> > HTH,
> >> > Stepan Kasal
> >>
> >> thanks. but still got problem. if i say, AC_CHECK_HEADERS([limits]) as you
> >> pointed, the the configure script will complain and the HAVE_LIMITS
> >> veriable
> >> would't be set because my system (Linux) only get limits.h instead of
> >> 'limits'.
> >>
> >> so to make 'configure' happy, i changed to AC_CHECK_HEADERS([limits.h]),
> >> this
> >> time, 'configure' feels happy and HAVE_LIMITS_H is set properly. but the
> >> third-party headers used in my project requires a HAVE_LIMITS that is
> >> still not
> >> set.
> >>
> >> my current solution is add the below line into 'config.h.in':
> >>
> >> #define HAVE_LIMITS 1
> >>
> >> but i think this is not a decent way. any thinking?
> >
> > You seem to be confused and are outsmarting yourself ;)
> >
> > limits.h is a POSIX header. On linux it is supplied by GCC.
> >
> > So if you want to check for "limits", you should use
> > AC_CHECK_HEADERS([limits])
> >
>
> but could you explain why AC_CHECK_HEADERS([limits]) failed but
> AC_CHECK_HEADERS([limits.h]) success?
AC_CHECK_HEADER by default uses the c-compiler.
To check for C++-headers you normally have to tell the configure script
to switch languages/compilers.
Example:
# This uses the c-compiler
AC_CHECK_HEADERS([limits.h])
# This uses the c++-compiler
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([limits])
AC_LANG_POP
Ralf