
if test "$1" = "on"
then
   echo ""
   echo "*"
   echo "*"
   echo "* The wizard is going to run."
   echo "* It will perform some timing experiments, and then automatically"
   echo "* update your config.h file."
   echo "* Please be patient, and don't be spooked by any error messages."
   echo "*"
   echo "*"
else
   echo ""
   echo "*"
   echo "*"
   echo "* You have chosen not to run the wizard."
   echo "*"
   echo "*"
   exit 0
fi

rm -rf small

mkdir small
mkdir small/src
mkdir small/include
mkdir small/include/NTL

cp MulTimeTest.c small/src
cp Poly1TimeTest.c small/src
cp Poly2TimeTest.c small/src
cp Poly3TimeTest.c small/src
cp GF2XTimeTest.c small/src
cp InitSettings.c small/src
cp DispSettings.c small/src

cp FFT.c small/src
cp GetTime.c small/src
cp GetPID.c small/src
cp ctools.c small/src
cp ZZ.c small/src
cp ZZVec.c small/src
cp ZZ_p.c small/src
cp ZZ_pX.c small/src
cp ZZ_pX1.c small/src
cp lip.c small/src
cp g_lip_impl.h small/src
cp c_lip_impl.h small/src
cp tools.c small/src
cp vec_ZZ.c small/src
cp vec_ZZ_p.c small/src
cp GF2.c small/src
cp WordVector.c small/src
cp vec_GF2.c small/src
cp GF2X.c small/src
cp GF2X1.c small/src
cp thread.c small/src
cp BasicThreadPool.c small/src
cp fileio.c small/src



sh CopyFeatures '..' small
cp ../include/NTL/FFT.h small/include/NTL
cp ../include/NTL/SPMM_ASM.h small/include/NTL
cp ../include/NTL/ctools.h small/include/NTL
cp ../include/NTL/ZZ.h small/include/NTL
cp ../include/NTL/sp_arith.h small/include/NTL
cp ../include/NTL/ZZVec.h small/include/NTL
cp ../include/NTL/ZZ_p.h small/include/NTL
cp ../include/NTL/ZZ_pX.h small/include/NTL
cp ../include/NTL/config.h small/include/NTL
cp ../include/NTL/lip.h small/include/NTL
cp ../include/NTL/g_lip.h small/include/NTL
cp ../include/NTL/c_lip.h small/include/NTL
cp ../include/NTL/gmp_aux.h small/include/NTL
cp ../include/NTL/mach_desc.h small/include/NTL
cp ../include/NTL/new.h small/include/NTL
cp ../include/NTL/SmartPtr.h small/include/NTL
cp ../include/NTL/Lazy.h small/include/NTL
cp ../include/NTL/LazyTable.h small/include/NTL
cp ../include/NTL/thread.h small/include/NTL
cp ../include/NTL/BasicThreadPool.h small/include/NTL
cp ../include/NTL/fileio.h small/include/NTL
cp ../include/NTL/tools.h small/include/NTL
cp ../include/NTL/vec_ZZ.h small/include/NTL
cp ../include/NTL/vec_ZZ_p.h small/include/NTL
cp ../include/NTL/vec_long.h small/include/NTL
cp ../include/NTL/vector.h small/include/NTL
cp ../include/NTL/GF2.h small/include/NTL
cp ../include/NTL/WordVector.h small/include/NTL
cp ../include/NTL/vec_GF2.h small/include/NTL
cp ../include/NTL/GF2X.h small/include/NTL

cp cfile small/src
cp WizardAux small/src

cp makefile small/src


cd small/src
perl WizardAux

cd ../..

echo "*"
echo "*"
echo "* Updating config.h and wizard_log.h"
echo "*"
echo "*"

cp small/include/NTL/config.h ../include/NTL/config.h
cp small/src/wizard_log.h ../include/NTL/wizard_log.h

rm -r small

exit 0

