summaryrefslogtreecommitdiff
path: root/cad/mex-wcalc
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-07-10 22:59:26 +0000
committerjlam <jlam@pkgsrc.org>2006-07-10 22:59:26 +0000
commitf3372729ab2e1dd6f8e5969862c77666d8b45bdb (patch)
treecb614cea1d624a5581e700c292825cf7d5a200cb /cad/mex-wcalc
parent9e4ca2161b90f8703d5aea28362f561d5d727b0a (diff)
downloadpkgsrc-f3372729ab2e1dd6f8e5969862c77666d8b45bdb.tar.gz
Completely nuke the concept of PKG_PHASE from pkgsrc except for the
purposes of caching MAKEVARS within bsd.pkg.mk and bsd.makevars.mk.
Diffstat (limited to 'cad/mex-wcalc')
-rw-r--r--cad/mex-wcalc/Makefile29
1 files changed, 25 insertions, 4 deletions
diff --git a/cad/mex-wcalc/Makefile b/cad/mex-wcalc/Makefile
index fc96f37a1d9..816d777f57f 100644
--- a/cad/mex-wcalc/Makefile
+++ b/cad/mex-wcalc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2006/02/05 23:08:22 joerg Exp $
+# $NetBSD: Makefile,v 1.6 2006/07/10 22:59:26 jlam Exp $
#
.include "../../cad/wcalc/Makefile.common"
@@ -67,13 +67,34 @@ MATLAB_MEX?= ${DEF_MATLAB_MEX}
PLIST_SUBST+= MEX_SUFX=${MEX_SUFX:Q}
-.if !empty(PHASES_AFTER_EXTRACT:M${PKG_PHASE})
-MATLAB_DIR!= ${MATLAB_MEX} -v 2>/dev/null | ${AWK} '/[ \t]MATLAB[ \t]/ {print $$NF}'
+.if !defined(MATLAB_DIR)
+MATLAB_DIR!= \
+ case ${MATLAB_MEX:Q}"" in \
+ /*) matlab_mex=${MATLAB_MEX:Q} ;; \
+ *) SAVEIFS="$$IFS"; IFS=:; \
+ for p in $$PATH; do \
+ ${TEST} ! -x $$p/${MATLAB_MEX} || \
+ matlab_mex=$$p/${MATLAB_MEX}; \
+ done; \
+ IFS="$$SAVEIFS"; \
+ ;; \
+ esac; \
+ if ${TEST} -z "$$matlab_mex"; then \
+ ${ECHO} "MATLAB_DIR_not_set"; \
+ else \
+ $$matlab_mex -v 2>/dev/null | \
+ ${AWK} 'BEGIN { s = "MATLAB_DIR_not_set" } \
+ /[ \t]MATLAB[ \t]/ { s = $$NF } \
+ END { print s }'; \
+ fi
+. if empty(MATLAB_DIR:M*not_set)
+MAKEVARS+= MATLAB_DIR
+. endif
+.endif
BUILDLINK_PASSTHRU_DIRS+= ${MATLAB_DIR}/extern/include
BUILDLINK_PASSTHRU_DIRS+= ${MATLAB_DIR}/simulink/include
BUILDLINK_PASSTHRU_DIRS+= ${MATLAB_DIR}/bin/${MATLAB_ARCH}
-.endif
.include "../../cad/libwcalc/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"