Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 2006 14:00:34 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 101273 for review
Message-ID:  <200607111400.k6BE0Yur039467@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101273

Change 101273 by gabor@gabor_spitfire on 2006/07/11 14:00:04

	Fix LIB_DEPENDS with DESTDIR, the key is chroot again.

Affected files ...

.. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#18 edit

Differences ...

==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#18 (text+ko) ====

@@ -4736,6 +4736,7 @@
 
 lib-depends:
 .if defined(LIB_DEPENDS) && !defined(NO_DEPENDS)
+.if !defined(DESTDIR)
 	@for i in ${LIB_DEPENDS}; do \
 		lib=$${i%%:*}; \
 		case $$lib in \
@@ -4777,6 +4778,49 @@
 			fi; \
 		fi; \
 	done
+.else
+	@for i in ${LIB_DEPENDS}; do \
+		lib=$${i%%:*}; \
+		case $$lib in \
+			*.*.*)  pattern="`${ECHO_CMD} $$lib | ${SED} -e 's/\./\\\\./g'`" ;;\
+			*.*)    pattern="$${lib%%.*}\.$${lib#*.}" ;;\
+			*)      pattern="$$lib" ;;\
+		esac; \
+		dir=$${i#*:}; \
+		target=$${i##*:}; \
+		if ${TEST} $$dir = $$target; then \
+			target="${DEPENDS_TARGET}"; \
+			depends_args="${DEPENDS_ARGS}"; \
+		else \
+			dir=$${dir%%:*}; \
+		fi; \
+		${ECHO_MSG} -n "===>   ${PKGNAME} depends on shared library: $$lib in ${DESTDIR}"; \
+		if ${CHROOT} ${DESTDIR} ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \
+			${ECHO_MSG} " - found"; \
+			if [ ${_DEPEND_ALWAYS} = 1 ]; then \
+				${ECHO_MSG} "       (but building it anyway)"; \
+				notfound=1; \
+			else \
+				notfound=0; \
+			fi; \
+		else \
+			${ECHO_MSG} " - not found"; \
+			notfound=1; \
+		fi; \
+		if [ $$notfound != 0 ]; then \
+			${ECHO_MSG} "===>    Verifying $$target for $$lib in $$dir"; \
+			if [ ! -d "$$dir" ]; then \
+				${ECHO_MSG} "     => No directory for $$lib.  Skipping.."; \
+			else \
+				${_INSTALL_DEPENDS} \
+					if ! ${CHROOT} ${DESTDIR} ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \
+					${ECHO_MSG} "Error: shared library \"$$lib\" does not exist"; \
+					${FALSE}; \
+				fi; \
+			fi; \
+		fi; \
+	done
+.endif
 .endif
 
 misc-depends:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607111400.k6BE0Yur039467>