Subject: better pkgsrc support for USE_INET6 and/or MKINET6 in PKG_DEFAULT_OPTIONS
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.org>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 05/23/2006 14:33:21
--pgp-sign-Multipart_Tue_May_23_14:33:19_2006-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

At Mon, 22 May 2006 19:12:27 +0200,
joerg@britannica.bec.de wrote:
>=20
> On Mon, May 22, 2006 at 12:53:30PM -0400, Greg A. Woods wrote:
> > At Fri, 19 May 2006 19:53:24 +0200,
> > joerg@britannica.bec.de wrote:
> > >=20
> > > On Fri, May 19, 2006 at 12:27:30PM -0400, Greg A. Woods wrote:
> > > > I'm building on a NetBSD/i386 3.0_STABLE machine and I'm encounteri=
ng
> > > > the following problem with net/ORBit2-2.12.4.  Has anyone seen the =
likes
> > > > of this and does anyone have any idea what to do about it?  Does 2.=
12.5
> > > > fix this problem by any chance?
> > >=20
> > > vars6.o in libc should provide that symbol. Anything special in your
> > > configuration? E.g. NO_IPV6 build or something like that?
> >=20
> > Well I do have this in /etc/mk.conf:
> >=20
> > 	MKINET6 =3D 'no'
> >=20
> > Shouldn't pkgsrc honour it too?  It is a supported option, IIUC.
>=20
> For those packages which honour it, add
> PKG_DEFAULT_OPTIONS=3D -inet6
> as well.

Hmmm.... that setting should hinge by default on USE_INET6 then, no?

Perhaps something like what's buried in the middle of this diff?

Index: bsd.prefs.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/mk/bsd.prefs.mk,v
retrieving revision 1.215
diff -u -r1.215 bsd.prefs.mk
--- bsd.prefs.mk	5 Dec 2005 22:07:07 -0000	1.215
+++ bsd.prefs.mk	23 May 2006 18:26:57 -0000
@@ -39,7 +39,7 @@
 .elif exists(/bin/uname)
 UNAME=3D/bin/uname
 .else
-UNAME=3Decho Unknown
+UNAME=3Decho UNAME Unknown
 .endif
=20
 .if exists(/usr/bin/cut)
@@ -47,7 +47,7 @@
 .elif exists(/bin/cut)
 CUT=3D/bin/cut
 .else
-CUT=3Decho Unknown
+CUT=3Decho CUT Unknown
 .endif
=20
 .if !defined(OPSYS)
@@ -124,7 +124,9 @@
=20
 .elif ${OPSYS} =3D=3D "FreeBSD"
 LOWER_OPSYS?=3D		freebsd
+.  ifndef LOWER_ARCH
 LOWER_ARCH!=3D		${UNAME} -p
+.  endif
 MACHINE_ARCH=3D		${LOWER_ARCH}
 MAKEFLAGS+=3D		LOWER_ARCH=3D${LOWER_ARCH:Q}
 LOWER_OPSYS_VERSUFFIX!=3D	echo ${LOWER_OS_VERSION} | ${CUT} -c -1
@@ -280,6 +282,24 @@
 .  include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf"
 .endif
=20
+# LDSTATIC is from here on defined, but empty by default, if not set
+# in one of the above includes
+#
+LDSTATIC?=3D		# defined
+
+.if !empty(LDSTATIC)
+LDSTATIC_DEPENDS=3D	BUILD_DEPENDS # XXX old BUILDLINK only?
+CHECK_SHLIBS?=3D		NO	# don't bother with check-shlibs after install
+SHLIB_HANDLING?=3D	NO	# do not do automatic shared lib handling
+MKPIC=3D			no	# don't build or install shared libraries
+NOPIC=3D			1	# disable stuff that requires PIC support
+.else
+LDSTATIC_DEPENDS=3D	DEPENDS	# XXX old BUILDLINK only?
+CHECK_SHLIBS?=3D		YES	# run check-shlibs after install
+SHLIB_HANDLING?=3D	YES	# do automatic shared lib handling
+MKPIC?=3D			yes	# do build and install shared libraries
+.endif
+
 USE_TOOLS?=3D	# empty
=20
 # Provide default values for TOOLs used by the top-level make.
@@ -372,6 +392,7 @@
 .if defined(USE_INET6)
 .  if empty(USE_INET6:M[Yy][Ee][Ss])
 USE_INET6=3D		NO
+PKG_DEFAULT_OPTIONS=3D	-inet6
 .  else
 USE_INET6=3D		YES
 .  endif
@@ -379,6 +400,7 @@
 USE_INET6=3D		YES
 .else
 USE_INET6=3D		NO
+PKG_DEFAULT_OPTIONS=3D	-inet6
 .endif
=20
 LOCALBASE?=3D		${DESTDIR}/usr/pkg
@@ -564,26 +586,11 @@
 # If WRKOBJDIR is set, use that tree to build
 .if defined(WRKOBJDIR)
 BUILD_DIR?=3D		${WRKOBJDIR}/${PKGPATH}
-.else
+.elif !defined(BUILD_DIR)
 BUILD_DIR!=3D		cd ${.CURDIR} && ${PWD_CMD}
 .endif
=20
-# If OBJHOSTNAME is set, use first component of hostname in directory name.
-# If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name.
-#
-.if defined(OBJHOSTNAME)
-.  if !defined(_HOSTNAME)
-_HOSTNAME!=3D		${UNAME} -n
-MAKEFLAGS+=3D		_HOSTNAME=3D${_HOSTNAME:Q}
-.  endif
-WRKDIR_BASENAME?=3D	work.${_HOSTNAME:C|\..*||}
-MAKEFLAGS+=3D		OBJHOSTNAME=3D${OBJHOSTNAME:Q}
-.elif defined(OBJMACHINE)
-WRKDIR_BASENAME?=3D	work.${MACHINE_ARCH}
-MAKEFLAGS+=3D		OBJMACHINE=3D${OBJMACHINE:Q}
-.else
 WRKDIR_BASENAME?=3D	work
-.endif
=20
 WRKDIR?=3D		${BUILD_DIR}/${WRKDIR_BASENAME}
=20


> ORBit2 doesn't belong into this category ATM though.

I'll see if there's something easy I can do for this too.....

--=20
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>

--pgp-sign-Multipart_Tue_May_23_14:33:19_2006-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: KCEsGCSjzz12QjZrzgwgHQ/gv+yeWX74

iQA/AwUBRHNVcGJ7XxTCWceFEQJLkQCgyOJTaXf/IHvM6EMDZWUSkoqh/Y4AoMt4
JHp7gUTD+1v7k3y6NkyzFd4G
=A/Qw
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Tue_May_23_14:33:19_2006-1--