[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / cad / mex-wcalc

Annotation of pkgsrc/cad/mex-wcalc/Makefile, Revision 1.8

1.8     ! joerg       1: # $NetBSD: Makefile,v 1.7 2006/10/01 13:52:17 rillig Exp $
1.1       dmcmahil    2: #
                      3:
1.8     ! joerg       4: PKG_DESTDIR_SUPPORT=   user-destdir
        !             5:
1.1       dmcmahil    6: .include "../../cad/wcalc/Makefile.common"
                      7: PKGNAME=       mex-${DISTNAME}
1.5       joerg       8: PKGREVISION=   1
1.1       dmcmahil    9:
                     10: COMMENT=       Matlab Based Transmission Line Analysis/Synthesis Calculator
                     11:
                     12: # Only enable the matlab frontend
                     13: CONFIGURE_ARGS+=       --disable-cgi
1.2       dmcmahil   14: CONFIGURE_ARGS+=       --disable-gtk1
                     15: CONFIGURE_ARGS+=       --disable-gtk2
1.1       dmcmahil   16: CONFIGURE_ARGS+=       --disable-htdocs
                     17: CONFIGURE_ARGS+=       --disable-libwcalc
                     18: CONFIGURE_ARGS+=       --disable-stdio
                     19: CONFIGURE_ARGS+=       --with-matlab
                     20: CONFIGURE_ARGS+=       --without-octave
                     21: CONFIGURE_ARGS+=       --without-scilab
                     22:
1.7       rillig     23: SUBST_CLASSES+=                mwc
                     24: SUBST_STAGE.mwc=       post-patch
                     25: SUBST_FILES.mwc=       mex-wcalc/mexopts.sh.in
                     26: SUBST_SED.mwc=         -e 's;\.\./libwcalc;${BUILDLINK_DIR}/lib;g'
1.2       dmcmahil   27:
1.1       dmcmahil   28: # This depends on an installation of Matlab which pkgsrc does
1.2       dmcmahil   29: # not have.  We should find a sane way to deal with this.  It is
1.1       dmcmahil   30: # not clear if linux/solaris matlab users care to use pkgsrc
                     31: # to manage its installation or if it will always be installed
                     32: # outside of pkgsrc.
                     33:
                     34: # In addition, mex-wcalc will not currently build correctly
                     35: # if you are using a non-native matlab (i.e. linux or solaris
1.2       dmcmahil   36: # matlab on NetBSD).
                     37: #
                     38: # To get mex-wcalc to work under emulation you need to set up
1.1       dmcmahil   39: # a cross-tool chain, build a libwcalc targeted to the same
                     40: # system as the matlab installation, and modify the mexopts.sh
                     41: # file in ${WRKSRC}/mex-wcalc to use this cross tool chain.
                     42: # Basically what it comes down to is you need to compile shared
                     43: # modules for the same os as the matlab binary.
                     44: #
                     45: ONLY_FOR_PLATFORM=     Linux-*-i386 SunOS-*-sparc*
                     46:
1.2       dmcmahil   47: .include "../../mk/bsd.prefs.mk"
                     48:
1.4       dmcmahil   49: DEF_MATLAB_ARCH=       unknown
                     50: DEF_MATLAB_MEX=        mex
                     51: DEF_MEX_SUFX=  unknown
1.2       dmcmahil   52: .if ${OPSYS} == "Linux"
1.7       rillig     53: .  if (${MACHINE_ARCH} == "i386")
1.4       dmcmahil   54: DEF_MATLAB_ARCH=       glnx86
                     55: DEF_MEX_SUFX=  mexglx
1.7       rillig     56: .  endif
1.2       dmcmahil   57: .elif ${OPSYS} == "SunOS"
1.7       rillig     58: .  if (${MACHINE_ARCH} == "sparc")
1.4       dmcmahil   59: DEF_MATLAB_ARCH=       sol2
                     60: DEF_MEX_SUFX=  mexsol
1.7       rillig     61: .  endif
1.2       dmcmahil   62: .endif
1.4       dmcmahil   63: MATLAB_ARCH?=  ${DEF_MATLAB_ARCH}
                     64: MEX_SUFX?=     ${DEF_MEX_SUFX}
1.2       dmcmahil   65:
1.4       dmcmahil   66: MATLAB_MEX?=           ${DEF_MATLAB_MEX}
1.2       dmcmahil   67:
1.3       rillig     68: PLIST_SUBST+=          MEX_SUFX=${MEX_SUFX:Q}
1.2       dmcmahil   69:
1.6       jlam       70: .if !defined(MATLAB_DIR)
                     71: MATLAB_DIR!=                                                           \
                     72:        case ${MATLAB_MEX:Q}"" in                                       \
                     73:        /*)     matlab_mex=${MATLAB_MEX:Q} ;;                           \
                     74:        *)      SAVEIFS="$$IFS"; IFS=:;                                 \
                     75:                for p in $$PATH; do                                     \
                     76:                        ${TEST} ! -x $$p/${MATLAB_MEX} ||               \
                     77:                                matlab_mex=$$p/${MATLAB_MEX};           \
                     78:                done;                                                   \
                     79:                IFS="$$SAVEIFS";                                        \
                     80:                ;;                                                      \
                     81:        esac;                                                           \
                     82:        if ${TEST} -z "$$matlab_mex"; then                              \
                     83:                ${ECHO} "MATLAB_DIR_not_set";                           \
                     84:        else                                                            \
                     85:                $$matlab_mex -v 2>/dev/null |                           \
                     86:                ${AWK} 'BEGIN { s = "MATLAB_DIR_not_set" }              \
                     87:                        /[ \t]MATLAB[ \t]/ { s = $$NF }                 \
                     88:                        END { print s }';                               \
                     89:        fi
                     90: .  if empty(MATLAB_DIR:M*not_set)
                     91: MAKEVARS+=     MATLAB_DIR
                     92: .  endif
                     93: .endif
1.2       dmcmahil   94:
                     95: BUILDLINK_PASSTHRU_DIRS+=      ${MATLAB_DIR}/extern/include
                     96: BUILDLINK_PASSTHRU_DIRS+=      ${MATLAB_DIR}/simulink/include
                     97: BUILDLINK_PASSTHRU_DIRS+=      ${MATLAB_DIR}/bin/${MATLAB_ARCH}
                     98:
                     99: .include "../../cad/libwcalc/buildlink3.mk"
1.1       dmcmahil  100: .include "../../mk/bsd.pkg.mk"

CVSweb <webmaster@jp.NetBSD.org>