|
<?xml version="1.0" encoding="UTF-8" ?> |
|
<config |
|
Name="Xcode with Clang" |
|
ShortName="Clang" |
|
Manufacturer="Apple" |
|
Version="" |
|
Language="C" |
|
Priority="A" |
|
Location="$XCODE_DIR" > |
|
<Details |
|
CompilerExecutable="$CC" |
|
CompilerDefines="$DEFINES" |
|
CompilerFlags="$CFLAGS" |
|
OptimizationFlags="$COPTIMFLAGS" |
|
DebugFlags="$CDEBUGFLAGS" |
|
IncludeFlags="$INCLUDE" |
|
LinkerLibraries="$LINKLIBS" |
|
LinkerOptimizationFlags="$LDOPTIMFLAGS" |
|
LinkerDebugFlags="$LDDEBUGFLAGS" |
|
|
|
CompilerDefineFormatter="-D%s" |
|
LinkerLibrarySwitchFormatter="-l%s" |
|
LinkerPathFormatter="-L%s" |
|
/> |
|
<vars |
|
CMDLINE100="$CC -c $DEFINES $INCLUDE $CFLAGS $OPTIM $SRC -o $OBJ" |
|
CMDLINE200="$LD $LDFLAGS $OBJS $LINKOPTIM $LINKEXPORT $CLIBS $LINKLIBS -o $EXE" |
|
CMDLINE300="rm -f $OBJ" |
|
|
|
CC="$XCRUN_DIR/xcrun -sdk macosx$SDKVER clang" |
|
DEFINES="$MATLABMEX" |
|
MATLABMEX="-DMATLAB_MEX_FILE" |
|
CFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=$SDKVER -fexceptions -isysroot $ISYSROOT" |
|
INCLUDE="-I"$MATLABROOT/extern/include" -I"$MATLABROOT/simulink/include"" |
|
COPTIMFLAGS="-O2 -DNDEBUG" |
|
CDEBUGFLAGS="-g" |
|
|
|
LD="$CC" |
|
LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=$SDKVER -Wl,-syslibroot,$ISYSROOT $LDBUNDLE $LINKEXPORT" |
|
LDBUNDLE="-bundle " |
|
LINKEXPORT="-Wl,-exported_symbols_list,"$MATLABROOT/extern/lib/maci64/mexFunction.map"" |
|
LINKLIBS="-L"$MATLABROOT/bin/maci64" -lmx -lmex -lmat -lc++" |
|
LDOPTIMFLAGS="-O" |
|
LDDEBUGFLAGS="-g" |
|
|
|
OBJEXT=".o" |
|
LDEXT=".mexmaci64" |
|
SETENV="CC="$CC" |
|
CXX="$CC" |
|
CFLAGS="$CFLAGS $DEFINES" |
|
CXXFLAGS="$CFLAGS $DEFINES" |
|
COPTIMFLAGS="$COPTIMFLAGS" |
|
CXXOPTIMFLAGS="$COPTIMFLAGS" |
|
CDEBUGFLAGS="$CDEBUGFLAGS" |
|
CXXDEBUGFLAGS="$CDEBUGFLAGS" |
|
LD="$LD" |
|
LDXX="$LD" |
|
LDFLAGS="$LDFLAGS $LINKLIBS $LINKEXPORT" |
|
LDDEBUGFLAGS="$LDDEBUGFLAGS"" |
|
/> |
|
<client> |
|
<engine |
|
LINKLIBS="$LINKLIBS -leng" |
|
LDBUNDLE="" |
|
LINKEXPORT="" |
|
LDEXT="" |
|
/> |
|
<mbuild |
|
CMDLINE150="$MATLABROOT/bin/maci64/macbundle $EXENAME "$EXEDIR"" |
|
CMDLINE200="$LD $LDFLAGS $OBJS $LINKOPTIM $LINKEXPORT $CLIBS $LINKLIBS -o "$EXEDIR$EXENAME.app/Contents/MacOS/$EXENAME"" |
|
|
|
CFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=$SDKVER -isysroot $ISYSROOT" |
|
DEFINES="-DUNIX -DX11" |
|
LDFLAGS="-arch x86_64 -mmacosx-version-min=$SDKVER -Wl,-syslibroot,$ISYSROOT $LDTYPE $LINKEXPORT -framework CoreFoundation -bind_at_load" |
|
LINKEXPORT="" |
|
LINKLIBS="-L"$MATLABROOT/runtime/maci64" -lmwmclmcrrt" |
|
MATLABMEX="" |
|
LDEXT=".app" |
|
LDTYPE="" |
|
/> |
|
</client> |
|
<locationFinder> |
|
<!--Check for faulty DEVELOPER_DIR environment variable --> |
|
<DEVELOPER_DIR_CHECK> |
|
<or> |
|
<not> |
|
<envVarExists name="DEVELOPER_DIR" /> |
|
</not> |
|
<dirExists name="$$" diagnostic="The environment variable DEVELOPER_DIR indicates a folder that does not exist. Please correct or delete this variable before using MEX." /> |
|
</or> |
|
</DEVELOPER_DIR_CHECK> |
|
<!-- User needs to run "!sudo xcode-select -switch /Applications/Xcode.app/" |
|
to configure xcrun. This creates the file /usr/share/xcode-select/xcode_dir_path --> |
|
<XCODE_DIR> |
|
<and diagnostic="Xcode appears to be installed, but it has not been configured. Run "<a href="matlab:system(['osascript -e ''do shell script ' char(34) 'xcode-select -switch /Applications/Xcode.app' char(34) ' with administrator privileges'''])">osascript -e 'do shell script "xcode-select -switch /Applications/Xcode.app" with administrator privileges'</a>" to configure Xcode. You must be an administrator of this computer to complete this action." > |
|
<cmdReturns name="xcode-select -print-path" /> |
|
<dirExists name="$$" /> |
|
</and> |
|
</XCODE_DIR> |
|
<XCRUN_DIR> |
|
<and> |
|
<cmdReturns name="which xcrun" /> |
|
<dirExists name="$$" /> |
|
</and> |
|
</XCRUN_DIR> |
|
<!-- User needs to agree to license of the version (or higher) that we support --> |
|
<XCODE_AGREED_VERSION> |
|
<and diagnostic="Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement." > |
|
<or> |
|
<cmdReturns name="defaults read com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense"/> |
|
<cmdReturns name="defaults read /Library/Preferences/com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense"/> |
|
</or> |
|
<cmdReturns name=" agreed=$$ if echo $agreed | grep -E '[\.\"]' >/dev/null; then lhs=`expr "$agreed" : '\([0-9]*\)[\.].*'` rhs=`expr "$agreed" : '[0-9]*[\.]\(.*\)$'` if echo $rhs | grep -E '[\."]' >/dev/null; then rhs=`expr "$rhs" : '\([0-9]*\)[\.].*'` fi if [ $lhs -gt 4 ] || ( [ $lhs -eq 4 ] && [ $rhs -ge 3 ] ); then echo $agreed else exit 1 fi fi" /> |
|
</and> |
|
</XCODE_AGREED_VERSION> |
|
<ISYSROOT> |
|
<and> |
|
<cmdReturns name="xcode-select -print-path"/> |
|
<or> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" /> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk" /> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk" /> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk" /> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.9.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.10.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.11.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.12.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.13.sdk" /> |
|
</or> |
|
</and> |
|
</ISYSROOT> |
|
<SDKVER> |
|
<and> |
|
<and> |
|
<cmdReturns name="xcode-select -print-path"/> |
|
<or> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" /> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk" /> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk" /> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk" /> |
|
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.9.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.10.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.11.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.12.sdk" /> |
|
<cmdReturns name="find $$ -name MacOSX10.13.sdk" /> |
|
</or> |
|
</and> |
|
<cmdReturns name="echo $$ | rev | cut -c1-10 | rev | egrep -oh '[0-9]+\.[0-9]+'" /> |
|
</and> |
|
</SDKVER> |
|
</locationFinder> |
|
</config> |