Subject: pkg/19273: Support for static-linking of applications using gtk+ is broken.
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 12/04/2002 13:29:17
>Number:         19273
>Category:       pkg
>Synopsis:       Support for static-linking of applications using gtk+ is broken.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 04 10:30:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        pkgsrc-current 2002/12/02
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD 1.5W
Architecture: i386
Machine: i386
>Description:

	Support for static-linking of applications using gtk+ is broken.

>How-To-Repeat:

	try building screentest, aka what's in PR#18006 after upgrading
	gettext-lib, libiconv, gtk+, et al.

>Fix:

Index: devel/gettext-lib/buildlink2.mk
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/devel/gettext-lib/buildlink2.mk,v
retrieving revision 1.13
diff -c -r1.13 buildlink2.mk
*** devel/gettext-lib/buildlink2.mk	2 Dec 2002 22:06:55 -0000	1.13
--- devel/gettext-lib/buildlink2.mk	4 Dec 2002 18:14:43 -0000
***************
*** 8,13 ****
--- 8,16 ----
  BUILDLINK_DEPENDS.gettext?=	gettext-lib>=0.10.35nb1
  BUILDLINK_PKGSRCDIR.gettext?=	../../devel/gettext-lib
  
+ # XXX for now -- until the "pkg_admin pmatch" issue is resolved....
+ USE_GNU_GETTEXT=	# defined
+ 
  .if defined(USE_GNU_GETTEXT)
  _NEED_GNU_GETTEXT=	YES
  _BLNK_LIBINTL_FOUND=	NO
***************
*** 50,56 ****
  BUILDLINK_PACKAGES+=			gettext
  EVAL_PREFIX+=	BUILDLINK_PREFIX.gettext=gettext-lib
  BUILDLINK_PREFIX.gettext_DEFAULT=	${LOCALBASE}
- .include "../../converters/libiconv/buildlink2.mk"
  .else
  BUILDLINK_PREFIX.gettext=	/usr
  .endif
--- 53,58 ----
***************
*** 101,106 ****
--- 103,111 ----
  LIBTOOL_ARCHIVE_UNTRANSFORM_SED+= \
  	-e "s|${BUILDLINK_PREFIX.gettext}/lib/libintl.la|${_BLNK_INTL_LDFLAGS}|g" \
  	-e "s|${LOCALBASE}/lib/libintl.la|${_BLNK_INTL_LDFLAGS}|g"
+ .else
+ # XXX this has to come after we set LIBS above so that -liconv comes after -lintl
+ . include "../../converters/libiconv/buildlink2.mk"
  .endif
  
  gettext-buildlink: _BUILDLINK_USE
Index: converters/libiconv/buildlink2.mk
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/converters/libiconv/buildlink2.mk,v
retrieving revision 1.3
diff -c -r1.3 buildlink2.mk
*** converters/libiconv/buildlink2.mk	10 Sep 2002 16:06:37 -0000	1.3
--- converters/libiconv/buildlink2.mk	4 Dec 2002 18:09:27 -0000
***************
*** 8,13 ****
--- 8,17 ----
  BUILDLINK_DEPENDS.iconv?=	libiconv>=1.8
  BUILDLINK_PKGSRCDIR.iconv?=	../../converters/libiconv
  
+ # XXX for now -- until the "pkg_admin pmatch" issue is resolved....
+ # (see ../../devel/gettext-lib/buildlink.mk)
+ USE_GNU_ICONV=		YES
+ 
  .if defined(USE_GNU_ICONV)
  _NEED_ICONV=		YES
  .else
***************
*** 39,44 ****
--- 43,76 ----
  BUILDLINK_FILES.iconv+=		lib/libiconv.*
  
  BUILDLINK_TARGETS+=		iconv-buildlink
+ 
+ # Add -liconv to LIBS in CONFIGURE_ENV to work around broken gettext.m4:
+ # older gettext.m4 does not add -liconv where it should, and the resulting
+ # configure script fails to detect if libiconv.a is neede or not.
+ #
+ _BLNK_INCICONV=		# empty
+ _BLNK_LIBICONV=		# empty
+ .if ${_NEED_ICONV} == "YES"
+ _BLNK_INCICONV+=	-I${BUILDLINK_PREFIX.iconv}/include
+ _BLNK_LIBICONV+=	-L${BUILDLINK_PREFIX.iconv}/lib
+ _BLNK_LIBICONV+=	-Wl,-R${BUILDLINK_PREFIX.iconv}/lib
+ _BLNK_LIBICONV+=	-liconv
+ .else
+ .  if ${_BLNK_LIBICONV_FOUND} == "YES"
+ _BLNK_LIBICONV+=	-liconv
+ .  endif
+ .endif
+ 
+ .if defined(GNU_CONFIGURE)
+ LIBS+=			${_BLNK_LIBICONV}
+ CONFIGURE_ENV+=		ICONVLIBS="${_BLNK_LIBICONV}"
+ CONFIGURE_ARGS+=	--with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
+ .  if ${_NEED_ICONV} == "NO"
+ .    if ${_BLNK_LIBICONV_FOUND} == "YES"
+ CONFIGURE_ENV+=		gt_cv_func_gnugettext1_libiconv="yes"
+ .    endif
+ .  endif
+ .endif
  
  iconv-buildlink: _BUILDLINK_USE
  
>Release-Note:
>Audit-Trail:
>Unformatted: