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                        **/"
echo "/**************************************************************/"
if test $# -eq 0 ; then
  exit 0
fi

if test $1 = sun ; then
  CC="gcc -c -fPIC -O" 
  PYTH_INC="/scisoft/python/Python-2.0/Include"
  PYTH_CONF="/scisoft/python/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/python1.5"
  PYTH_CONF="/usr/global/lib/python1.5/config"
elif test $1 = lnx ; then
  CC="gcc -fPIC -c -O" 
  PYTH_INC="/scisoft/python/include/python2.0/"
  PYTH_CONF="/scisoft/python/lib/python2.0/config/"
elif test $1 = fbsd ; then
  CC="gcc -fPIC -c -O" 
  PYTH_INC="/usr/local/include/python1.5"
  PYTH_CONF="/usr/local/lib/python1.5/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 = 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
fi




