Re: configure can not determin 'HAVE_LIMITS'

2005-10-27 Thread Steven Woody
Ralf Corsepius [EMAIL PROTECTED] writes:


 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


thanks! it now okay!






Re: configure can not determin 'HAVE_LIMITS'

2005-10-26 Thread Stepan Kasal
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




Re: configure can not determin 'HAVE_LIMITS'

2005-10-26 Thread Steven Woody
Stepan Kasal [EMAIL PROTECTED] 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?

-- 
steven woody (id: narke)

Can two friends sleep together and still love each other in the
morning?

- When Harry Met Sally... (1989)





Re: configure can not determin 'HAVE_LIMITS'

2005-10-26 Thread Ralf Corsepius
On Wed, 2005-10-26 at 21:52 +0800, Steven Woody wrote:
 Stepan Kasal [EMAIL PROTECTED] 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])

If this fails, something else is broken and you will have to
investigate. It could be a bug inside of limits, it could be problem
elsewhere inside of your configure script, or could be a problem with
your include paths.

It's hard to guess what actually goes wrong without having seen your
code.

Ralf








Re: configure can not determin 'HAVE_LIMITS'

2005-10-26 Thread Andreas Schwab
Ralf Corsepius [EMAIL PROTECTED] writes:

 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])

 If this fails, something else is broken and you will have to
 investigate. It could be a bug inside of limits, it could be problem
 elsewhere inside of your configure script, or could be a problem with
 your include paths.

Note that limits is a C++ header.  By default, configure scripts don't
use the C++ compiler when checking for headers.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.




Re: configure can not determin 'HAVE_LIMITS'

2005-10-26 Thread Steven Woody
Andreas Schwab [EMAIL PROTECTED] writes:

 Ralf Corsepius [EMAIL PROTECTED] writes:

 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])

 If this fails, something else is broken and you will have to
 investigate. It could be a bug inside of limits, it could be problem
 elsewhere inside of your configure script, or could be a problem with
 your include paths.

 Note that limits is a C++ header.  By default, configure scripts don't
 use the C++ compiler when checking for headers.


so ... what?





Re: configure can not determin 'HAVE_LIMITS'

2005-10-26 Thread Steven Woody
Ralf Corsepius [EMAIL PROTECTED] writes:

 On Wed, 2005-10-26 at 21:52 +0800, Steven Woody wrote:
 Stepan Kasal [EMAIL PROTECTED] 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?

 If this fails, something else is broken and you will have to
 investigate. It could be a bug inside of limits, it could be problem
 elsewhere inside of your configure script, or could be a problem with
 your include paths.






Re: configure can not determin 'HAVE_LIMITS'

2005-10-26 Thread Ralf Corsepius
On Thu, 2005-10-27 at 08:28 +0800, Steven Woody wrote:
 Andreas Schwab [EMAIL PROTECTED] writes:
 
  Ralf Corsepius [EMAIL PROTECTED] writes:
 
  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])
 
  If this fails, something else is broken and you will have to
  investigate. It could be a bug inside of limits, it could be problem
  elsewhere inside of your configure script, or could be a problem with
  your include paths.
 
  Note that limits is a C++ header.  By default, configure scripts don't
  use the C++ compiler when checking for headers.
I knew - sorry for not having mentioned this ;)

 so ... what?
A look into the config.log your configure script produces when running,
would have told you (and us).

If it's really the standard c++-header limits, you want to test for, I
guess you might be using the c-compiler (which fails to compile
limits), instead of the c++-compiler.

To test for the c++-header limits, something along these lines should
work:

..
AC_PROG_CXX
..
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([limits])
AC_LANG_POP
..

Ralf







Re: configure can not determin 'HAVE_LIMITS'

2005-10-26 Thread Ralf Corsepius
On Thu, 2005-10-27 at 08:29 +0800, Steven Woody wrote:
 Ralf Corsepius [EMAIL PROTECTED] writes:
 
  On Wed, 2005-10-26 at 21:52 +0800, Steven Woody wrote:
  Stepan Kasal [EMAIL PROTECTED] 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






configure can not determin 'HAVE_LIMITS'

2005-10-25 Thread Steven Woody

i am using autoconf/automake in my currenty project. the project also use a
third-party library which comes with a header file which i should include in my
own sources. but in the header file, there is something like below:

#ifdef HAVE_LIMITS
#include limits
#else
#include machine/limits.h
#endif

so, my code including the header will never pass compile becase HAVE_LIMITS was
not set by the ./configure, hence the header will ask the machine/limits.h
which however does not exist on my system.

does anyone know what's the cause and gets a solution?

-- 
steven woody (id: narke)

Can two friends sleep together and still love each other in the
morning?

- When Harry Met Sally... (1989)