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

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Mon Aug 29 14:02:31 CEST 2005


Hi,

thanks for your report.

At Mon, 8 Aug 2005 19:54:11 +0200,
Michael Nottebrock <lofi at freebsd.org> wrote:
> 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.

Can you give more details about the compile error, just to know what
the actual problem is?  (Reports should always include such
information).

> The attached patch changes gpgme's global configure template and the Makefile 
> template in gpgme/gpgme so that PTH_CFLAGS are only added to the include path 
> where needed. The patch should apply to both the latest gpgme in CVS and gpgme 
> 1.0.x.

Does the patch work?  From your interpretation of the problem, a
compile error should occur in ath-pthread-compat.c, because it will
pick up the pth supplied header file rather than the system header
file.

It seems to me that the pth include directory should only be added to
the ath-pth.c and ath-pth-compat.c compilation.

Also, $(AM_CFLAGS) should be used instead of ${CFLAGS}, but that is a
minor detail.

Thanks,
Marcus


> 
> 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
> [2 gpgme-pth-cflags.diff <text/plain; us-ascii (7bit)>]
> Index: configure.ac
> ===================================================================
> RCS file: /cvs/gnupg/gpgme/configure.ac,v
> retrieving revision 1.98
> diff -u -r1.98 configure.ac
> --- configure.ac	24 Mar 2005 13:09:54 -0000	1.98
> +++ configure.ac	8 Aug 2005 14:37:09 -0000
> @@ -120,7 +120,6 @@
>  	AC_CHECK_PTH(1.2.0,,,no,have_pth=yes)
>  	if test "$have_pth" = yes; then
>  	  AC_DEFINE(HAVE_PTH, ,[Define if we have Pth.])
> -	  CFLAGS="$CFLAGS $PTH_CFLAGS"
>  	fi
>  	AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
>  	if test "$have_pthread" = yes; then
> Index: gpgme/Makefile.am
> ===================================================================
> RCS file: /cvs/gnupg/gpgme/gpgme/Makefile.am,v
> retrieving revision 1.56
> diff -u -r1.56 Makefile.am
> --- gpgme/Makefile.am	24 Mar 2005 13:05:12 -0000	1.56
> +++ gpgme/Makefile.am	8 Aug 2005 14:37:10 -0000
> @@ -99,6 +99,7 @@
>  
>  AM_CPPFLAGS = $(assuan_cppflags) @GPG_ERROR_CFLAGS@
>  
> +libgpgme_la_CFLAGS= ${CFLAGS} @PTH_CFLAGS@
>  libgpgme_la_LDFLAGS = $(libgpgme_version_script_cmd) -version-info \
>  	@LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
>  libgpgme_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
> @@ -113,6 +114,7 @@
>  libgpgme_pthread_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
>  	-lpthread @GPG_ERROR_LIBS@
>  
> +libgpgme_pth_la_CFLAGS = ${CFLAGS} @PTH_CFLAGS@
>  libgpgme_pth_la_CPPFLAGS = $(AM_CPPFLAGS) @PTH_CPPFLAGS@
>  libgpgme_pth_la_LDFLAGS = @PTH_LDFLAGS@ \
>  	$(libgpgme_version_script_cmd) -version-info \
> [3  <text/plain; us-ascii (7bit)>]
> _______________________________________________
> Gpa-dev mailing list
> Gpa-dev at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gpa-dev




More information about the Gpa-dev mailing list