echo "/**************************************************************/"
echo "/**                    m a k e _ py                          **/"
echo "/**                                                          **/"
echo "/** Creates a DISLIN Python modules for UNIX systems.        **/"
echo "/**                                                          **/"
echo "/** Command: make_py     option                              **/"
echo "/**                                                          **/"
echo "/** option   lnx, osf, sun, irx, fbsd, hpux, cyg             **/"
echo "/**************************************************************/"
if test $# -eq 0 ; then
  exit 0
fi

if test $1 = sun ; then
  CC="gcc -c -fPIC -O" 
  PYTH_INC="/home/michels/Python-2.0/Include"
  PYTH_CONF="/home/michels/Python-2.0"
  RLIB="-R/usr/openwin/lib:/usr/dt/lib"
  LLIB="-L/usr/dt/lib"
elif test $1 = irx ; then
  CC="cc -c -O" 
  PYTH_INC="/usr/local/include/python1.5"
  PYTH_CONF="/usr/local/lib/python1.5/config"
elif test $1 = osf ; then
  CC="cc -c -O" 
  PYTH_INC="/usr/global/include/python2.1"
  PYTH_CONF="/usr/global/lib/python2.1/config"
elif test $1 = lnx ; then
  CC="gcc -fPIC -c -O" 
  PYTH_INC="/usr/local/include/python2.0"
  PYTH_CONF="/usr/local/lib/python2.0/config"
elif test $1 = hpux ; then
  CC="cc -c -Ae +z +DA1.1" 
  PYTH_INC="$HOME/Python-2.1/Include"
  PYTH_CONF="$HOME/Python-2.1"
elif test $1 = fbsd ; then
  CC="gcc -fPIC -c -O" 
  PYTH_INC="/usr/local/include/python2.1"
  PYTH_CONF="/usr/local/lib/python2.1/config"
elif test $1 = cyg ; then
  CC="gcc -c -fPIC -O" 
  PYTH_INC="/usr/include/python2.2"
  DIS_LIB="-L. -ldisgcc -lc -lm -luser32 -lgdi32"
  PYTH_LIB="/lib/python2.2/config/libpython2.2.dll.a"
  PYTH_CONF="/lib/python2.2/config"
fi

$CC  -I$PYTH_INC -I$PYTH_CONF dislinmodule.c
       
if test $1 = lnx ; then
  gcc -shared -Wl,-soname,dislinmodule.so -o dislinmodule.so *.o \
 -L$DISLIN -ldislnc
elif test $1 = hpux ; then
  ld -b  -o dislinmodule.sl *.o  -L$DISLIN -ldislnc -lm -lXm -lXt -lX11
elif test $1 = fbsd ; then
  gcc -shared -Wl,-soname,dislinmodule.so -o dislinmodule.so *.o \
 -L$DISLIN -ldislnc
elif test $1 = osf ; then
  ld -shared -expect_unresolved "*" -soname dislinmodule.so \
     -o dislinmodule.so dislinmodule.o -ldislnc -lc -lm
elif test $1 = sun ; then
  ld -G -h dislinmodule.so -o dislinmodule.so dislinmodule.o -L$DISLIN -ldislnc  $LLIB $RLIB -lm -lXm -lXt -lX11
elif test $1 = irx ; then
  ld -shared -soname dislinmodule.so -o dislinmodule.so dislinmodule.o \
   -ldislnc -lc -lm -lXm -lXt -lX11
elif test $1 = cyg ; then
  gcc -shared  -o dislin.dll dislinmodule.o $PYTH_LIB $DIS_LIB
fi




