From 832a7b1727c469169373cf6392bdf523f0b98518 Mon Sep 17 00:00:00 2001
From: Sam Lawrance <lawrance@FreeBSD.org>
Date: Sat, 17 Dec 2005 07:00:19 +0000
Subject: [PATCH] Use correct WRKSRC paths for pwlib and openh323 when
 WRKDIRPREFIX is set to a non-default value.

PR:		ports/72973
Submitted by:	Vivek Khera <vivek@khera.org>
Approved by:	sobomax (maintainer, timeout 13 months)
---
 net/asterisk-bristuff/Makefile | 7 +++++--
 net/asterisk-devel/Makefile    | 7 +++++--
 net/asterisk/Makefile          | 7 +++++--
 net/asterisk10/Makefile        | 7 +++++--
 net/asterisk12/Makefile        | 7 +++++--
 net/asterisk14/Makefile        | 7 +++++--
 net/asterisk16/Makefile        | 7 +++++--
 7 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/net/asterisk-bristuff/Makefile b/net/asterisk-bristuff/Makefile
index a3d1f27e6a7e..276aa57eb71c 100644
--- a/net/asterisk-bristuff/Makefile
+++ b/net/asterisk-bristuff/Makefile
@@ -39,8 +39,8 @@ USE_REINPLACE=	yes
 MAKE_ENV=	PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
 		PTHREAD_LIBS="${PTHREAD_LIBS}" \
 		MKDIR="${MKDIR}" \
-		PWLIBDIR=${WRKDIRPREFIX}${PORTSDIR}/devel/pwlib/work/pwlib \
-		OPENH323DIR=${WRKDIRPREFIX}${PORTSDIR}/net/openh323/work/openh323 \
+		PWLIBDIR=${PWLIBDIR} \
+		OPENH323DIR=${OPENH323DIR} \
 		OSVERSION=${OSVERSION} \
 		CXX="${CXX}"
 
@@ -48,6 +48,9 @@ MAN8=		asterisk.8
 
 .include <bsd.port.pre.mk>
 
+PWLIBDIR!=	cd ${PORTSDIR}/devel/pwlib; make -V WRKSRC
+OPENH323DIR!=	cd ${PORTSDIR}/net/openh323; make -V WRKSRC
+
 .if ${ARCH} != "i386"
 WITHOUT_H323=	1
 WITHOUT_ZAPTEL=	1
diff --git a/net/asterisk-devel/Makefile b/net/asterisk-devel/Makefile
index a3d1f27e6a7e..276aa57eb71c 100644
--- a/net/asterisk-devel/Makefile
+++ b/net/asterisk-devel/Makefile
@@ -39,8 +39,8 @@ USE_REINPLACE=	yes
 MAKE_ENV=	PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
 		PTHREAD_LIBS="${PTHREAD_LIBS}" \
 		MKDIR="${MKDIR}" \
-		PWLIBDIR=${WRKDIRPREFIX}${PORTSDIR}/devel/pwlib/work/pwlib \
-		OPENH323DIR=${WRKDIRPREFIX}${PORTSDIR}/net/openh323/work/openh323 \
+		PWLIBDIR=${PWLIBDIR} \
+		OPENH323DIR=${OPENH323DIR} \
 		OSVERSION=${OSVERSION} \
 		CXX="${CXX}"
 
@@ -48,6 +48,9 @@ MAN8=		asterisk.8
 
 .include <bsd.port.pre.mk>
 
+PWLIBDIR!=	cd ${PORTSDIR}/devel/pwlib; make -V WRKSRC
+OPENH323DIR!=	cd ${PORTSDIR}/net/openh323; make -V WRKSRC
+
 .if ${ARCH} != "i386"
 WITHOUT_H323=	1
 WITHOUT_ZAPTEL=	1
diff --git a/net/asterisk/Makefile b/net/asterisk/Makefile
index a3d1f27e6a7e..276aa57eb71c 100644
--- a/net/asterisk/Makefile
+++ b/net/asterisk/Makefile
@@ -39,8 +39,8 @@ USE_REINPLACE=	yes
 MAKE_ENV=	PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
 		PTHREAD_LIBS="${PTHREAD_LIBS}" \
 		MKDIR="${MKDIR}" \
-		PWLIBDIR=${WRKDIRPREFIX}${PORTSDIR}/devel/pwlib/work/pwlib \
-		OPENH323DIR=${WRKDIRPREFIX}${PORTSDIR}/net/openh323/work/openh323 \
+		PWLIBDIR=${PWLIBDIR} \
+		OPENH323DIR=${OPENH323DIR} \
 		OSVERSION=${OSVERSION} \
 		CXX="${CXX}"
 
@@ -48,6 +48,9 @@ MAN8=		asterisk.8
 
 .include <bsd.port.pre.mk>
 
+PWLIBDIR!=	cd ${PORTSDIR}/devel/pwlib; make -V WRKSRC
+OPENH323DIR!=	cd ${PORTSDIR}/net/openh323; make -V WRKSRC
+
 .if ${ARCH} != "i386"
 WITHOUT_H323=	1
 WITHOUT_ZAPTEL=	1
diff --git a/net/asterisk10/Makefile b/net/asterisk10/Makefile
index a3d1f27e6a7e..276aa57eb71c 100644
--- a/net/asterisk10/Makefile
+++ b/net/asterisk10/Makefile
@@ -39,8 +39,8 @@ USE_REINPLACE=	yes
 MAKE_ENV=	PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
 		PTHREAD_LIBS="${PTHREAD_LIBS}" \
 		MKDIR="${MKDIR}" \
-		PWLIBDIR=${WRKDIRPREFIX}${PORTSDIR}/devel/pwlib/work/pwlib \
-		OPENH323DIR=${WRKDIRPREFIX}${PORTSDIR}/net/openh323/work/openh323 \
+		PWLIBDIR=${PWLIBDIR} \
+		OPENH323DIR=${OPENH323DIR} \
 		OSVERSION=${OSVERSION} \
 		CXX="${CXX}"
 
@@ -48,6 +48,9 @@ MAN8=		asterisk.8
 
 .include <bsd.port.pre.mk>
 
+PWLIBDIR!=	cd ${PORTSDIR}/devel/pwlib; make -V WRKSRC
+OPENH323DIR!=	cd ${PORTSDIR}/net/openh323; make -V WRKSRC
+
 .if ${ARCH} != "i386"
 WITHOUT_H323=	1
 WITHOUT_ZAPTEL=	1
diff --git a/net/asterisk12/Makefile b/net/asterisk12/Makefile
index a3d1f27e6a7e..276aa57eb71c 100644
--- a/net/asterisk12/Makefile
+++ b/net/asterisk12/Makefile
@@ -39,8 +39,8 @@ USE_REINPLACE=	yes
 MAKE_ENV=	PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
 		PTHREAD_LIBS="${PTHREAD_LIBS}" \
 		MKDIR="${MKDIR}" \
-		PWLIBDIR=${WRKDIRPREFIX}${PORTSDIR}/devel/pwlib/work/pwlib \
-		OPENH323DIR=${WRKDIRPREFIX}${PORTSDIR}/net/openh323/work/openh323 \
+		PWLIBDIR=${PWLIBDIR} \
+		OPENH323DIR=${OPENH323DIR} \
 		OSVERSION=${OSVERSION} \
 		CXX="${CXX}"
 
@@ -48,6 +48,9 @@ MAN8=		asterisk.8
 
 .include <bsd.port.pre.mk>
 
+PWLIBDIR!=	cd ${PORTSDIR}/devel/pwlib; make -V WRKSRC
+OPENH323DIR!=	cd ${PORTSDIR}/net/openh323; make -V WRKSRC
+
 .if ${ARCH} != "i386"
 WITHOUT_H323=	1
 WITHOUT_ZAPTEL=	1
diff --git a/net/asterisk14/Makefile b/net/asterisk14/Makefile
index a3d1f27e6a7e..276aa57eb71c 100644
--- a/net/asterisk14/Makefile
+++ b/net/asterisk14/Makefile
@@ -39,8 +39,8 @@ USE_REINPLACE=	yes
 MAKE_ENV=	PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
 		PTHREAD_LIBS="${PTHREAD_LIBS}" \
 		MKDIR="${MKDIR}" \
-		PWLIBDIR=${WRKDIRPREFIX}${PORTSDIR}/devel/pwlib/work/pwlib \
-		OPENH323DIR=${WRKDIRPREFIX}${PORTSDIR}/net/openh323/work/openh323 \
+		PWLIBDIR=${PWLIBDIR} \
+		OPENH323DIR=${OPENH323DIR} \
 		OSVERSION=${OSVERSION} \
 		CXX="${CXX}"
 
@@ -48,6 +48,9 @@ MAN8=		asterisk.8
 
 .include <bsd.port.pre.mk>
 
+PWLIBDIR!=	cd ${PORTSDIR}/devel/pwlib; make -V WRKSRC
+OPENH323DIR!=	cd ${PORTSDIR}/net/openh323; make -V WRKSRC
+
 .if ${ARCH} != "i386"
 WITHOUT_H323=	1
 WITHOUT_ZAPTEL=	1
diff --git a/net/asterisk16/Makefile b/net/asterisk16/Makefile
index a3d1f27e6a7e..276aa57eb71c 100644
--- a/net/asterisk16/Makefile
+++ b/net/asterisk16/Makefile
@@ -39,8 +39,8 @@ USE_REINPLACE=	yes
 MAKE_ENV=	PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
 		PTHREAD_LIBS="${PTHREAD_LIBS}" \
 		MKDIR="${MKDIR}" \
-		PWLIBDIR=${WRKDIRPREFIX}${PORTSDIR}/devel/pwlib/work/pwlib \
-		OPENH323DIR=${WRKDIRPREFIX}${PORTSDIR}/net/openh323/work/openh323 \
+		PWLIBDIR=${PWLIBDIR} \
+		OPENH323DIR=${OPENH323DIR} \
 		OSVERSION=${OSVERSION} \
 		CXX="${CXX}"
 
@@ -48,6 +48,9 @@ MAN8=		asterisk.8
 
 .include <bsd.port.pre.mk>
 
+PWLIBDIR!=	cd ${PORTSDIR}/devel/pwlib; make -V WRKSRC
+OPENH323DIR!=	cd ${PORTSDIR}/net/openh323; make -V WRKSRC
+
 .if ${ARCH} != "i386"
 WITHOUT_H323=	1
 WITHOUT_ZAPTEL=	1