[patch] Don't add PTH include path to gpgme's CFLAGS globally

Michael Nottebrock lofi at freebsd.org
Sat Feb 10 01:11:02 CET 2007


In FreeBSD 6 and later, sys/types.h now also defines the basic pthread types 
in order to comply with IEEE Std 1003.1-2004.

This causes a compile error in gpgme due to conflicting types for pthread_* if 
pth-support is enabled, since the pth include directory is globally added to 
CFLAGS and ath-pthread.c picks up the pth-supplied pthread.h header instead 
of the system include:

cc -DHAVE_CONFIG_H -I. -I. -I.. -I../assuan -I/usr/local/include 
-I/usr/local/include/pth -I/usr/local/include/pth 
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -O2 
-pipe -O2 -fno-strict-aliasing -Wall -Wcast-align 
-Wshadow -Wstrict-prototypes -MT ath-pthread.lo -MD -MP -MF 
.deps/ath-pthread.Tpo -c ath-pthread.c  -fPIC -DPIC -o .libs/ath-pthread.o
In file included from ath-pthread.c:36:
/usr/local/include/pth/pthread.h:285: error: conflicting types for 
'pthread_t'
/usr/include/sys/_pthreadtypes.h:64: error: previous declaration of 
'pthread_t' was here
/usr/local/include/pth/pthread.h:286: error: conflicting types for 
'pthread_attr_t'
/usr/include/sys/_pthreadtypes.h:65: error: previous declaration of 
'pthread_attr_t' was here
/usr/local/include/pth/pthread.h:288: error: conflicting types for 
'pthread_once_t'
/usr/include/sys/_pthreadtypes.h:71: error: previous declaration of 
'pthread_once_t' was here
/usr/local/include/pth/pthread.h:289: error: conflicting types for 
'pthread_mutexattr_t'
/usr/include/sys/_pthreadtypes.h:67: error: previous declaration of 
'pthread_mutexattr_t' was here
/usr/local/include/pth/pthread.h:290: error: conflicting types for 
'pthread_mutex_t'
/usr/include/sys/_pthreadtypes.h:66: error: previous declaration of 
'pthread_mutex_t' was here
/usr/local/include/pth/pthread.h:291: error: conflicting types for 
'pthread_condattr_t'
/usr/include/sys/_pthreadtypes.h:69: error: previous declaration of 
'pthread_condattr_t' was here
/usr/local/include/pth/pthread.h:292: error: conflicting types for 
'pthread_cond_t'
/usr/include/sys/_pthreadtypes.h:68: error: previous declaration of 
'pthread_cond_t' was here
/usr/local/include/pth/pthread.h:293: error: conflicting types for 
'pthread_rwlockattr_t'
/usr/include/sys/_pthreadtypes.h:73: error: previous declaration of 
'pthread_rwlockattr_t' was here
/usr/local/include/pth/pthread.h:294: error: conflicting types for 
'pthread_rwlock_t'
/usr/include/sys/_pthreadtypes.h:72: error: previous declaration of 
'pthread_rwlock_t' was here

The attached patch changes the Makefile template in the gpgme subdir so that 
PTH_CFLAGS are only added to the include path where needed.


Cheers,
-- 
   ,_,   | Michael Nottebrock               | lofi at freebsd.org
 (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpgme.diff
Type: text/x-diff
Size: 737 bytes
Desc: not available
Url : /pipermail/attachments/20070210/06a7f60b/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : /pipermail/attachments/20070210/06a7f60b/attachment.pgp 


More information about the Gpa-dev mailing list