Subject: buildlink?.mk files checking for /usr/some/file
To: None <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 02/04/2004 16:19:08
Is it okay if buildlink?.mk files that check for /usr/some/file can also
make sure that LOCALBASE is not "/usr" too?

For example, I am building on NetBSD with LOCALBASE as /usr. So some
package needed pthreads. So pth was installed.

Then later openldap needed pthreads, but now the mk/
assumes it is native. And it is not buildlinked:

cc -O2 -I/usr/include/db4
-I/tmp/pkgsrc/databases/openldap/work.bigfour/.buildlink/include -o
apitest apitest.o  ./.libs/libldap_r.a
../../libraries/liblutil/liblutil.a -lssl -lcrypto /usr/lib/libpthread.a
No such file or directory
*** Error code 1

If LOCALBASE is /usr, pkgsrc should assume that anything in /usr is a
package (even if it is not) at least so buildlinking works.

May I commit this?

--- mk/	2004/01/25 16:17:37	1.2
+++ mk/	2004/02/05 00:07:42
@@ -116,7 +116,8 @@
-.if exists(/usr/include/pthread.h) && ${PREFER_NATIVE_PTHREADS} == "YES"
+.if (${LOCALBASE} != "/usr") && exists(/usr/include/pthread.h) && \
 .  if !empty(PTHREAD_OPTS:Mnative)

Then openldap built and installed fine.

For your information, I have been using pkgsrc with LOCALBASE as /usr on
over ten systems for about 17 months now. This is the first time with
NetBSD as the operating system.

I have several other buildlink?.mk files (like for openssl) with similar

   Jeremy C. Reed