Behaviour differs at configure time

2005-07-19 Thread Andre Caldas

Hello, All!

I have these lines in my configure.ac:

AC_CHECK_LIB( pthread, [pthread_create] )
AC_CHECK_HEADERS( pthread.h, [ AC_DEFINE(THREAD_SAFE, 1,
[We will use posix threads]) ] )
AC_CHECK_FUNCS( pthread_yield pthread_mutexattr_settype )


I am cross-compiling (--host=arm-linux).

When I run the configure script it checks for 
pthread_mutexattr_settype and finds it. But when I do a "make", I get 
an error saying that this function is not defined.


Well, the function is protected by a "#ifdef __USE_UNIX98". I guess 
this is the source of my problem. Why would that be defined during 
configure and not during make?


I don't have any environment vars set that would affect this, I 
belive. I did this:

set | grep FLAG
and got nothing.

I run configure like this:
~/project/configure --prefix=~/usr --disable-static 'CXXFLAGS=-O3 -g0 
-Wall -pedantic-errors -Wno-long-long -Woverloaded-virtual'


Thank you,
Andre Caldas.


___
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf


Re: Behaviour differs at configure time

2005-07-20 Thread Stepan Kasal
Hello,

On Wed, Jul 20, 2005 at 10:02:18AM +0900, Andre Caldas wrote:
> Hello, All!
> 
> I have these lines in my configure.ac:
> 
> AC_CHECK_LIB( pthread, [pthread_create] )
> AC_CHECK_HEADERS( pthread.h, [ AC_DEFINE(THREAD_SAFE, 1,
>   [We will use posix threads]) ] )
> AC_CHECK_FUNCS( pthread_yield pthread_mutexattr_settype )
> 
> 
> I am cross-compiling (--host=arm-linux).
> 
> When I run the configure script it checks for 
> pthread_mutexattr_settype and finds it. But when I do a "make", I get 
> an error saying that this function is not defined.

configure uses some default headers.  Try this:

1) modify your configure.ac so that it looks for
"pthread_mutexattr_settypeNO"
2) run autoconf && ./configure ...
   Of course, pthread_mutexattr_settypeNO is not found.
3) Look into the config.log: it says that pthread_mutexattr_settypeNO was
   not found and then there is an exact copy of the failed program.
   This is the same program which succeeded when configure found
   pthread_mutexattr_settype.  The gcc command line will also be somewhere
   near in config.log.
4) Try to compile that program with that cmdline.  It should succeed.
   Then you can investigate the differences.

HTH,
Stepan Kasal



___
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf