pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Resolve ${LOCALBASE} to its phyiscal pat...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3fde02c06270
branches:  trunk
changeset: 469058:3fde02c06270
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Feb 19 12:50:47 2004 +0000

description:
Resolve ${LOCALBASE} to its phyiscal path and mangle it back into
${LOCALBASE}.  Some packages' configure scripts resolve all paths to
physical paths, and since buildlink3 suppresses references outside of
${LOCALBASE}, it can break the build of those packages.

This should fix the problem noted by Nathan Williams in the thread
titled "x11/tk build failure" at:

        http://mail-index.netbsd.org/tech-pkg/2004/02/17/0004.html

diffstat:

 mk/buildlink3/bsd.buildlink3.mk |  40 +++++++++++++++++++++++++---------------
 1 files changed, 25 insertions(+), 15 deletions(-)

diffs (62 lines):

diff -r 3ea168d04fb7 -r 3fde02c06270 mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk   Thu Feb 19 11:51:48 2004 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk   Thu Feb 19 12:50:47 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.95 2004/02/19 07:41:44 jlam Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.96 2004/02/19 12:50:47 jlam Exp $
 #
 # An example package buildlink3.mk file:
 #
@@ -759,16 +759,6 @@
 #
 _BLNK_PASSTHRU_RPATHDIRS:=     ${_BLNK_PASSTHRU_RPATHDIRS:N/usr/lib}
 
-# Resolve the path to ${WRKDIR} completely in case it's a symlink.
-.if !defined(_BLNK_WRKDIR)
-_BLNK_WRKDIR!= if [ -d ${WRKDIR} ]; then                               \
-                       cd ${WRKDIR}; ${PWD_CMD};                       \
-               else                                                    \
-                       ${ECHO} ${WRKDIR};                              \
-               fi
-MAKEFLAGS+=    _BLNK_WRKDIR=${_BLNK_WRKDIR:Q}
-.endif
-
 _BLNK_MANGLE_DIRS=     # empty
 _BLNK_MANGLE_DIRS+=    ${BUILDLINK_DIR}
 _BLNK_MANGLE_DIRS+=    ${BUILDLINK_X11_DIR}
@@ -816,11 +806,31 @@
 _BLNK_UNPROTECT_DIRS+= ${BUILDLINK_X11_DIR}
 _BLNK_UNPROTECT_DIRS+= ${BUILDLINK_DIR}
 
-# Transform all references to the physical path to ${WRKDIR} into ${WRKDIR}.
+# Resolve some important directories to their phyiscal paths as symlinks
+# tend to confuse buildlink3.
 #
-.if ${_BLNK_WRKDIR} != ${WRKDIR}
-_BLNK_TRANSFORM+=      mangle:${_BLNK_WRKDIR}:${WRKDIR}
-.endif
+_BLNK_PHYSICAL_PATH_VARS?=     WRKDIR LOCALBASE
+.for _var_ in ${_BLNK_PHYSICAL_PATH_VARS}
+.  if !defined(_BLNK_PHYSICAL_PATH.${_var_})
+_BLNK_PHYSICAL_PATH.${_var_}!=                                         \
+       if [ -d ${${_var_}} ]; then                                     \
+               cd ${${_var_}}; ${PWD_CMD};                             \
+       else                                                            \
+               ${ECHO} ${${_var_}};                                    \
+       fi
+MAKEFLAGS+=    _BLNK_PHYSICAL_PATH.${_var_}=${_BLNK_PHYSICAL_PATH.${_var_}:Q}
+.  endif
+.endfor
+
+# Transform all references to the physical paths to some important
+# directories into their given names.
+#
+.for _var_ in ${_BLNK_PHYSICAL_PATH_VARS}
+.  if (${_BLNK_PHYSICAL_PATH.${_var_}} != ${${_var_}}) && \
+      empty(${_var_}:M${_BLNK_PHYSICAL_PATH.${_var_}}/*)
+_BLNK_TRANSFORM+=      mangle:${_BLNK_PHYSICAL_PATH.${_var_}}:${${_var_}}
+.  endif
+.endfor
 #
 # Protect work directories and the dependency directories from all the
 # transformations we're about to do.



Home | Main Index | Thread Index | Old Index