#! /bin/sh

srcdir='.'
prefix='/usr'
CC='gcc'
CXX='c++'
CFLAGS='-O'
X_LIBS=' -L/usr/X11R6/lib'

echo
echo "-------------------------------------------------"
echo "Additional Manual configuration for X Northern Captain:"
echo "Comment: You can disable options marked (***) for smaller size"
echo
echo -n "Do You want to use russian mapping in IVES Editor? (Y/n) "
read a
if test "$a" = "n" ;
then
 echo "NO_ALT=-DNO_ALT" >make.conf
 rus="disabled"
else
 echo "NO_ALT=" >make.conf
 rus="enabled"
fi
echo
echo -n "Do You plan to use XNC in PseudoColor (16-256 colors) ? (Y/n) "
read a
if test "$a" = "n" ;
then
 echo "PSEUDO=" >>make.conf
 echo "OPSEUDO=" >>make.conf
 pse="TrueColor;"
else
 echo "PSEUDO=-DPSEUDOCOLOR" >>make.conf
 echo "OPSEUDO=24to8.o" >>make.conf
 pse="PseudoColor; TrueColor;"
fi
echo
echo "JLOC="`pwd`"/jpeg/libjpeg.a" >> make.conf
echo -n "(***) Do You want to use an installed version of libjpeg 6 ? (y/N) "
read a
if test "$a" = "y"
then
  echo "JLIB=-L/usr/local/lib -ljpeg" >> make.conf
  echo "JINC=-I/usr/local/include" >> make.conf
  echo "JDEP=" >> make.conf
else
  echo "JLIB="`pwd`"/jpeg/libjpeg.a" >> make.conf
  echo "JINC=-I"`pwd`"/jpeg" >> make.conf
  echo "JDEP=\$(JLOC)" >> make.conf
fi
echo -n "(***) Do You need XBM image format ? (Y/n) "
read a
if test "$a" = "n" ;
then
 echo "XBM=" >>make.conf
 echo "OXBM=" >>make.conf
 xbm=""
else
 echo "XBM=-DXBMSUPPORT" >>make.conf
 echo "OXBM=xbm.o" >>make.conf
 xbm="XBM"
fi
echo -n "(***) Do You need BMP image format ? (Y/n) "
read a
if test "$a" = "n" ;
then
 echo "BMP=" >>make.conf
 echo "OBMP=" >>make.conf
 bmp=""
else
 echo "BMP=-DBMPSUPPORT" >>make.conf
 echo "OBMP=bmp.o" >>make.conf
 bmp="BMP"
fi
echo -n "(***) Do You need XPM image format ? (Y/n) "
read a
if test "$a" = "n" ;
then
 echo "XPM=" >>make.conf
 echo "OXPM=" >>make.conf
 xpm=""
else
 echo "XPM=-DXPMSUPPORT" >>make.conf
 echo "OXPM=xpm.o" >>make.conf
 xpm="XPM"
fi
echo -n "(***) Do You need PCX image format ? (Y/n) "
read a
if test "$a" = "n" ;
then
 echo "PCX=" >>make.conf
 echo "OPCX=" >>make.conf
 pcx=""
else
 echo "PCX=-DPCXSUPPORT" >>make.conf
 echo "OPCX=pcxr.o" >>make.conf
 pcx="PCX"
fi
echo -n "(***) Do You need TARGA image format ? (Y/n) "
read a
if test "$a" = "n" ;
then
 echo "TGA=" >>make.conf
 echo "OTGA=" >>make.conf
 targa=""
else
 echo "TGA=-DTGASUPPORT" >>make.conf
 echo "OTGA=targa.o" >>make.conf
 targa="TGA"
fi
echo
echo "Warning!!! TIFF support require libtiff installed on Your system."
echo -n "(***) Do You need TIFF 3.3 image format ? (y/N) "
read a
if test "$a" = "y" ;
then
 echo "TIFF=-DTIFFSUPPORT" >>make.conf
 echo "OTIFF=tiffr.o" >>make.conf
 echo "TLIB=-L/usr/local/lib -ltiff" >>make.conf
 tiff="TIFF"
else
 echo "TIFF=" >>make.conf
 echo "OTIFF=" >>make.conf
 echo "TLIB=" >>make.conf
 tiff=""
fi
echo -n "(***) Do You need PhotoCD image format ? (Y/n) "
read a
if test "$a" = "n" ;
then
 echo "PCD=" >>make.conf
 echo "OPCDS=" >>make.conf
 pcd=""
else
 echo "PCD=-DPCD_SUPPORT" >>make.conf
 echo "OPCDS=file.o huff.o yuv2rgb.o inter.o pcdr.o" >>make.conf
 pcd="PhotoCD"
fi
echo -n "(***) Do You need PNG image format? (Y/n) "
read a
if test "$a" = "n" ;
then
 echo "PNG=" >>make.conf
 echo "OPNGS=" >>make.conf
 echo "PNGLIB=" >>make.conf
 echo "PNGDEP=" >>make.conf
 png=""
else
 echo "PNG=-DPNG_SUPPORT" >>make.conf
 echo "OPNGS=png.o" >>make.conf
 echo "PNGLIB=`pwd`/libpng/libpng.a `pwd`/zlib/libz.a" >>make.conf
 echo "PNGDEP=../zlib/libz.a ../libpng/libpng.a" >>make.conf
 png="PNG"
fi
echo "---------------------------------------------------------------"

echo "
Configuration:

  Source code location:     ${srcdir}
  C Compiler:               ${CC}
  C Compiler flags:         ${CFLAGS}
  C++ Compiler:             ${CXX}
  Install path:             ${prefix}/bin
  Man pages path:           ${prefix}/man
  X11 versions:             ${X_LIBS}
  X Visuals:                ${pse}
  Image formats:            JPEG GIF ${pcd} ${tiff} ${xbm} ${xpm} ${pcx} ${bmp} ${targa} ${png}
  IVES Russian:             ${rus}
"
echo "---------------------------------------------------------------"
echo ""
echo "Now remove all '*.o' files and run 'make' for building XNC"
echo "Then run 'make install' for installation as 'root'"
echo ""

