On Mar 13, 2009, at 5:23 AM, Richard W.M. Jones wrote:

> On Thu, Mar 12, 2009 at 03:30:58PM -0400, David Shaw wrote:
>> The issue seems to be that the pthread.h header from that package is:
>>  /usr/i686-pc-mingw32/sys-root/mingw/include/pthread/pthread.h
>> and not:
>>  /usr/i686-pc-mingw32/sys-root/mingw/include/pthread.h
>
> Try using something like autoconf to detect the location of the
> header, eg:
>
> AC_CHECK_HEADERS([pthread.h pthread/pthread.h])
>
> ...
>
> #ifdef HAVE_PTHREAD_H
> #include <pthread.h>
> #else
> #ifdef HAVE_PTHREAD_PTHREAD_H
> #include <pthread/pthread.h>
> #endif
> #endif
>
> I think this works even though <pthread/pthread.h> includes <sched.h>
> which is in the pthread/ subdirectory?

Alas, no.  It fails when pthread/pthread.h includes sched.h.

>  If not you'll have to use some
> more complex autoconf magic to set the include path.

Sure, that's possible.  There are half a dozen or more autoconf-ish  
ways to do this.  What surprises me is that this is necessary.  Isn't  
part of the point here to not need to make such changes for a header  
that is supposed to (as per POSIX) be in the main include directory,  
rather than a subdirectory?  It seems it would make cross-compiling a  
much harder task if we need to modify code or put in special autoconf  
tests to catch the cross-compiling case for something as simple (from  
the outside, anyway) as pthreads.

i686-pc-mingw32-gcc is quite wisely set up to use the headers from / 
usr/i686-pc-mingw32/sys-root/mingw/include.  I'm just surprised that  
mingw32-pthreads is not in the standard place.

Even the README file from mingw32-pthreads indicates the headers  
should be put "in your system include directory".

David
_______________________________________________
fedora-mingw mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/fedora-mingw

Reply via email to