Subject: ${BUILDLINK_PKGNAME.${_pkg_}} is empty when _pkg_ is "pthread"
To: None <>
From: Jeremy C. Reed <>
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
                pkg-name [pkg-name ...]
       pkg_info -a [flags]
       pkg_info -Q variable pkg-name [pkg-name ...]
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/ 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/

I have:

$ bmake show-var VARNAME=IS_BUILTIN.pthread

$ bmake show-var VARNAME=USE_BUILTIN.pthread

I had:

PREFER_NATIVE+= xpm iconv getopt

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

Then I saw that 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:


And MAKEVARS includes:


$ bmake show-var VARNAME=BUILTIN_LIB_FOUND.pthread

I patched my 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 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/ 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