Subject: ${BUILDLINK_PKGNAME.${_pkg_}} is empty when _pkg_ is "pthread"
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 06/03/2005 00:35:09
The error follows:

===> Patching for ggv-2.8.4
===> Overriding tools for ggv-2.8.4
pkg_info: missing package name(s)
usage: pkg_info [-BbcDdFfhIikLmNnpqRrSsVv] [-e package] [-K pkg_dbdir] [-l
prefix]
                pkg-name [pkg-name ...]
       pkg_info -a [flags]
       pkg_info -Q variable pkg-name [pkg-name ...]
bmake:
"../../mk/wrapper/../../mk/buildlink3/../../mk/wrapper/../../mk/buildlink3/bsd.buildlink3.mk"
line 48: warning: Couldn't read shell's output for "/usr/sbin/pkg_info -K
. -qp  | /bin/sed  -e "s,^[^/]*,,;q""
===> Creating toolchain wrappers for ggv-2.8.4


Running "pkg_info -K . -qp" does give error as shown above.

It is from mk/buildlink3/bsd.buildlink3.mk which has

.      if empty(BUILDLINK_PKGNAME.${_pkg_}:M*not_found)
BUILDLINK_PREFIX.${_pkg_}!=     \
        ${_BLNK_PKG_INFO.${_pkg_}} -qp ${BUILDLINK_PKGNAME.${_pkg_}} | ${SED}  -e "s,^[^/]*,,;q"
.      else
BUILDLINK_PREFIX.${_pkg_}=      BUILDLINK_PREFIX.${_pkg_}_not_found
.      endif


I noticed this in print/ggv2 using LOCALBASE as /usr.

I added some debugging (bogus -e for sed above) and see this happens when
the ${_pkg_} is "pthread".

I am guessing the problem is from somewhere in new mk/pthread.builtin.mk
changes.

I have:

$ bmake show-var VARNAME=IS_BUILTIN.pthread
no

$ bmake show-var VARNAME=USE_BUILTIN.pthread
no

I had:

PREFER_NATIVE+= xpm iconv getopt
PREFER_PKGSRC=  YES

And then I added "pthread" to the PREFER_NATIVE+= but that didn't fix it.

Then I saw that mk/pthread.builtin.mk has

# We ignore the value of PREFER_PKGSRC and PREFER_NATIVE.  Whether we
# prefer one or the other is dependent on the value of
# PREFER_NATIVE_PTHREADS, which is yes/no.

I have the default:

$ bmake show-var VARNAME=PREFER_NATIVE_PTHREADS
yes

And MAKEVARS includes:

 IS_BUILTIN.pthread
 BUILTIN_LIB_FOUND.pthread

$ bmake show-var VARNAME=BUILTIN_LIB_FOUND.pthread
yes

I patched my mk/pthread.builtin.mk to force:

USE_BUILTIN.pthread=    yes

This work-around worked for me.

My include/pthread.h is from my glibc-2.3.4 package which does not have a
buildlink3.mk file. (I have used my glibc from pkgsrc and LOCALBASE as
/usr for a couple years. On a side note, I can't get my pkgsrc glibc and
linux-kernel to build using buildlinking/wrappers anymore.)

Any ideas on how I can get this mk/pthread.builtin.mk to work for me?
Hopefully without buildlinking my glibc. Or should I do that now also?
(I'd prefer not to since it will be slow.)


 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/