Subject: pkg/30029: [PATCH] devel/glib2 patches in defines never seen by the compiler
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 04/22/2005 07:59:00
>Number:         30029
>Category:       pkg
>Synopsis:       [PATCH] devel/glib2 patches in defines never seen by the compiler
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 22 07:59:00 +0000 2005
>Originator:     Idar Tollefsen
>Release:        N/A
Performance Design
Darwin fulcrum.local 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC  Power Macintosh powerpc
devel/glib2/patch/patch-ah replaces certain directory variables in glib/gutils.c with defines to pkgsrc directories. devel/glib2/Makefile then tries to define these by settings some of them in CONFIGURE_ENV and all of them as -D flags in CPPFLAGS.

Unfortunately, the definitions set up the Makefile are never propagated to the command line and the build fails.

Just try to build devel/glib2.
It is possible that the problem is platform specific.
If so, try to build devel/glib2 on OS X.
Altough the problem _might_ be OS X specific, the solution isn't.
Instead of trying to get the necessary defines passed to the compiler from the command line, include the definitions in config.h.

The patch also changes F77=${FALSE} to only apply to SunOS where the comment says it's needed. It otherwise generates annoying warnings during configuration.

Here's the patch against devel/glib2/Makefile:

--- Makefile.orig	Fri Apr 22 08:47:33 2005
+++ Makefile	Fri Apr 22 09:24:04 2005
@@ -34,7 +34,6 @@
 GNU_CONFIGURE=		# defined
 CONFIGURE_ARGS+=	--enable-gtk-doc=no
 CONFIGURE_ARGS+=	--includedir=${PREFIX}/include/glib
 CONFIGURE_ARGS+=	--with-html-dir=${PREFIX}/share/doc
@@ -42,18 +41,16 @@
 CONFIGURE_ARGS.gnu-iconv=	--with-libiconv=gnu
-# Avoid an ICE in gcc2 on sparc64
 .include "../../mk/"
+# Avoid an ICE in gcc2 on sparc64
+.if ${OPSYS} == "SunOS"
 # FreeBSD fix for libgthread:
 # Be sure libgthread is linked to the threaded library (libc_r), otherwise
 # -pthread is added and this won't work with libraries, only executable
@@ -73,6 +70,13 @@
 PRINT_PLIST_AWK+=	/^@dirrm include\/glib$$/ \
 				{ print "@unexec $${RMDIR} %D/" $$2 \
 				  " 2>/dev/null || $${TRUE}"; next; }
+	@${ECHO} "" >> ${WRKSRC}/config.h
+	@${ECHO} "/* pkgsrc definitions. */" >> ${WRKSRC}/config.h
+	@${ECHO} "#define PREFIX \"${PREFIX}\"" >> ${WRKSRC}/config.h
+	@${ECHO} "#define PKGLOCALEDIR \"${PKGLOCALEDIR}\"" >> ${WRKSRC}/config.h
+	@${ECHO} "#define PKG_SYSCONFDIR \"${PKG_SYSCONFDIR}\"" >> ${WRKSRC}/config.h
 .include "../../converters/libiconv/"
 .include "../../devel/gettext-lib/"