
echo === These are commands that GLK used to create teem.py, in tcsh
echo === Obviously, anyone is welcome to make this into a proper python script
echo === or otherwise make it more robust and portable, especially the stuff
echo === that removes the install path specifics from teem.py
echo ===
echo === You will need a recent gccxml to make this work.

svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9
setenv CTYPES `pwd`/ctypeslib-gccxml-0.9
setenv PYTHONPATH ${CTYPES}:`pwd`

echo === A patch is still needed, hopefully this can be fixed
patch -p0 -i ctypes-codegen.patch

echo === TEEM has to be set to wherever CMake put its make install
setenv TEEM /Users/gk/teem-install

echo === all.h just includes all the other public top-level .h in Teem
rm -rf teemincl
mkdir teemincl
cp -r ${TEEM}/include/teem teemincl
cd teemincl
ls -1 teem/*.h | awk '{print "#include <"$1">"}' > all.h
cd ..

echo === teem.xml represents the Teem API
python ${CTYPES}/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml

echo === DYLD_LIBRARY_PATH is obviously Mac specific, please fix
setenv DYLD_LIBRARY_PATH ${TEEM}/lib
python ${CTYPES}/scripts/xml2py.py teem.xml -llibteem.dylib -o pre-teem.py -m stdio \
        -r "(air|hest|biff|nrrd|ell|unrrdu|alan|moss|tijk|gage|dye|bane|limn|echo|hoover|seek|ten|elf|pull|coil|push|mite|meet).*"
rm -rf teemincl


echo === At this point GLK does emacs stuff to make pre-teem.py into what is
echo === the currently svn committed teem.py
echo === Obviously, this really needs to be automated...

