# # gccopts.sh Shell script for configuring MEX-file creation script, # mex. These options were tested with gcc 3.2.3. # # usage: Do not call this file directly; it is sourced by the # mex shell script. Modify only if you don't like the # defaults after running mex. No spaces are allowed # around the '=' in the variable assignment. # # Note: only the gcc side of this script was tested. # The FORTRAN variables are lifted directly from # mexopts.sh; use that file for compiling FORTRAN # MEX-files. # # SELECTION_TAGs occur in template option files and are used by MATLAB # tools, such as mex and mbuild, to determine the purpose of the contents # of an option file. These tags are only interpreted when preceded by '#' # and followed by ':'. # #SELECTION_TAG_MEX_OPT: Template Options file for building gcc MEX-files # # Copyright 1984-2004 The MathWorks, Inc. # $Revision: 1.43.4.6 $ $Date: 2004/04/25 21:30:52 $ #---------------------------------------------------------------------------- # TMW_ROOT="$MATLAB" MFLAGS='' if [ "$ENTRYPOINT" = "mexLibrary" ]; then MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut -lm" else MLIBS="-L/opt/sfw/gcc-3/lib -L/opt/sfw/gcc-3/lib/gcc-lib -L$TMW_ROOT/bin/$Arch -lg2c -lmx -lmex -lmat -lm" fi #---------------------------------------------------------------------------- CC='gcc' GCC_LIBDIR=`$CC -v 2>&1 | sed -n '1s/[^\/]*\(.*\/lib\).*/\1/p'` EXTRA_LIBDIR="/opt/sfw/gcc-3/lib" CFLAGS='-fPIC -fexceptions' CLIBS="$MLIBS -lm" COPTIMFLAGS='-O3 -funroll-loops -mcpu=v9 -DNDEBUG -DBIGENDIAN' CDEBUGFLAGS='-g' CXXDEBUGFLAGS='-g' # CXX='g++' CXXFLAGS='-fPIC' CXXLIBS="$MLIBS -lm" CXXOPTIMFLAGS='-O -DNDEBUG' # LD="$COMPILER" LDEXTENSION='.mexsol' LDFLAGS="-shared -Wl,-M,$TMW_ROOT/extern/lib/$Arch/$MAPFILE,-R,$GCC_LIBDIR,-R,$EXTRA_LIBDIR" LDOPTIMFLAGS='-O' LDDEBUGFLAGS='-g' # POSTLINK_CMDS=':' #----------------------------------------------------------------------------