#!/bin/csh -f

set ABACUSSYSTEM =  "-DABACUS_SYS_SUNOS5 -DABACUS_TEMPLATES_EXPLICIT"
set ABACUSLPSOLVER = "-DABACUS_LP_CPLEX40 -DABACUS_LP_SOPLEX"
set ABACUSCOMPILER = -DABACUS_COMPILER_GCC


echo " "
echo "Do you want enter paths for LEDA include files and libraries?"
echo "This is only necessary, if your compiler or linker does not"
echo "find the LEDA files in its default directories."
echo " "
echo "Enter paths [y/n] "

set a = $<

if ( "$a" == "y"|| $a == "yes" || "$a" == "YES" || "$a" == "Yes" ) then
  echo " "
  echo "Please, enter the path to the directory containing the LEDA"
  echo "header files without the final ..../LEDA"
  set i = $<
  echo "IPATH = -I$i" >> src/Make.src
  echo "IPATH = -I$i" >> src/MakeOpt.src
  echo "IPATH = -I$i" >> demo/Make.demo
  echo "IPATH = -I$i" >> test/Make.pro
  echo " "
  echo "Please, enter the path to the directory containing the LEDA"
  echo "libraries"
  set l = $<
  echo "LPATH = -L$l -R$l" >> src/Make.src
  echo "LPATH = -L$l -R$l" >> src/MakeOpt.src
  echo "LPATH = -L$l -R$l" >> demo/Make.demo
  echo "LPATH = -L$l -R$l" >> test/Make.pro
else
  echo "IPATH =" >> src/Make.src
  echo "IPATH =" >> src/MakeOpt.src
  echo "IPATH =" >> demo/Make.demo
  echo "IPATH =" >> test/Make.pro
  echo "LPATH =" >> src/Make.src
  echo "LPATH =" >> src/MakeOpt.src
  echo "LPATH =" >> demo/Make.demo
  echo "LPATH =" >> test/Make.pro
endif

echo " "
echo "Do you want enter paths for ABACUS and CPLEX include files and libraries?"
echo "This is only necessary, if youu want to use optimal algorithms, and your"
echo "compiler or linker does not find the include and library files in its"
echo "default directories."
echo " "
echo "Enter paths [y/n] "

set a = $<

if ( "$a" == "y"|| $a == "yes" || "$a" == "YES" || "$a" == "Yes" ) then
  echo " "
  echo "Please, enter the path to the directory containing the ABACUS"
  echo "header files"
  set i = $<
  echo "IABACUS = -I$i" >> src/Make.src
  echo "IABACUS = -I$i" >> src/MakeOpt.src
  echo "IABACUS = -I$i" >> demo/Make.demo
  echo "IABACUS = -I$i" >> test/Make.pro
  echo " "
  echo "Please, enter the path to the directory containing the ABACUS"
  echo "library"
  set l = $<
  echo "LABACUS = -L$l" >> src/MakeOpt.src
  echo "LABACUS = -L$l" >> src/Make.src
  echo "LABACUS = -L$l" >> demo/Make.demo
  echo "LABACUS = -L$l" >> test/Make.pro

  echo " "
  echo "Please, enter the path to the directory containing the CPLEX"
  echo "header files"
  set i = $<
  echo "ICPLEX = -I$i" >> src/Make.src
  echo "ICPLEX = -I$i" >> src/MakeOpt.src
  echo "ICPLEX = -I$i" >> demo/Make.demo
  echo "ICPLEX = -I$i" >> test/Make.pro
  echo " "
  echo "Please, enter the path to the directory containing the CPLEX"
  echo "library"
  set l = $<
  echo "LCPLEX = -L$l" >> src/Make.src
  echo "LCPLEX = -L$l" >> src/MakeOpt.src
  echo "LCPLEX = -L$l" >> demo/Make.demo
  echo "LCPLEX = -L$l" >> test/Make.pro

  echo " "
  echo "Please, enter the path to the directory containing the SOPLEX"
  echo "header files"
  set i = $<
  echo "ISOPLEX = -I$i" >> src/Make.src
  echo "ISOPLEX = -I$i" >> src/MakeOpt.src
  echo "ISOPLEX = -I$i" >> demo/Make.demo
  echo "ISOPLEX = -I$i" >> test/Make.pro
  echo " "
  echo "Please, enter the path to the directory containing the CPLEX"
  echo "library"
  set l = $<
  echo "LSOPLEX = -L$l" >> src/Make.src
  echo "LSOPLEX = -L$l" >> src/MakeOpt.src
  echo "LSOPLEX = -L$l" >> demo/Make.demo
  echo "LSOPLEX = -L$l" >> test/Make.pro
else
  echo "IABACUS =" >> src/Make.src
  echo "IABACUS =" >> src/MakeOpt.src
  echo "IABACUS =" >> demo/Make.demo
  echo "IABACUS =" >> test/Make.pro
  echo "LABACUS =" >> src/Make.src
  echo "LABACUS =" >> src/MakeOpt.src
  echo "LABACUS =" >> demo/Make.demo
  echo "LABACUS =" >> test/Make.pro
  echo "ICPLEX =" >> src/Make.src
  echo "ICPLEX =" >> src/MakeOpt.src
  echo "ICPLEX =" >> demo/Make.demo
  echo "ICPLEX =" >> test/Make.pro
  echo "LCPLEX =" >> src/Make.src
  echo "LCPLEX =" >> src/MakeOpt.src
  echo "LCPLEX =" >> demo/Make.demo
  echo "LCPLEX =" >> test/Make.pro
  echo "ISOPLEX =" >> src/Make.src
  echo "ISOPLEX =" >> src/MakeOpt.src
  echo "ISOPLEX =" >> demo/Make.demo
  echo "ISOPLEX =" >> test/Make.pro
  echo "LSOPLEX =" >> src/Make.src
  echo "LSOPLEX =" >> src/MakeOpt.src
  echo "LSOPLEX =" >> demo/Make.demo
  echo "LSOPLEX =" >> test/Make.pro
endif

  echo "ABACUSSYSTEM = $ABACUSSYSTEM" >> src/MakeOpt.src
  echo "ABACUSSYSTEM = $ABACUSSYSTEM" >> demo/Make.demo
  echo "ABACUSLPSOLVER = $ABACUSLPSOLVER" >> src/MakeOpt.src
  echo "ABACUSLPSOLVER = $ABACUSLPSOLVER" >> demo/Make.demo
  echo "ABACUSCOMPILER = $ABACUSCOMPILER" >> src/MakeOpt.src
  echo "ABACUSCOMPILER = $ABACUSCOMPILER" >> demo/Make.demo
