#!/bin/sh

CONFIG_DIR='./conf'

clear
echo 'Login.app'
echo '------------------------------------------------------------'
echo '1) GNU/Linux [DEFAULT]'
echo '2) GNUSTEP'
echo
echo -n "Select panel graphics: "
read foo
case $foo in 
	2) ANS=GNUSTEP;;
	*) ANS=GNULinux;;
esac
rm -f Panel.xpm *.o Login.app
ln -s $CONFIG_DIR/$ANS.xpm ./Panel.xpm
echo '------------------------------------------------------------'
echo -n "Does your system use Glibc2 (libc6)? <y/n> [n] "
read foo
rm -f Imakefile
if [ "$foo" = "Y" -o "$foo" = "y" ]; then
	ln -s $CONFIG_DIR/Imakefile.glibc2 ./Imakefile
else
	ln -s $CONFIG_DIR/Imakefile.libc5 ./Imakefile
fi
echo '------------------------------------------------------------'
echo -n "Does your system use shadow passwords? <y/n> [n] "
read foo
rm -f Passwords.h
if [ "$foo" = "Y" -o "$foo" = "y" ]; then
	ln -s $CONFIG_DIR/ShadowPasswords.h ./Passwords.h
else
	ln -s $CONFIG_DIR/StandardPasswords.h ./Passwords.h
fi
echo '------------------------------------------------------------'
echo 'Creating makefile...'
xmkmf
echo '------------------------------------------------------------'
echo 'Compiling...'
make
echo 'Done.'
echo '------------------------------------------------------------' 
echo
echo 'Please read the INSTALL file for further instructions how to'
echo 'install Login.app.'
echo

