echo "This file will install all changes, needed to compile the amiga version"
echo "of the origami editor. (C)1991 by Thomas Hadig"

ask "*nDo you want to install the compile changes ? (Y/N) " "Y" "N"
if NOT WARN
  quit
endif

cd origami:

if exists /bindings
  if not exists /bindings/amiga.keys
    copy amiga/amiga.keys /bindings
  endif
endif

cd origami
if not exists ..
  makedir ..
  cd ..
  makedir h
  copy origami:h/#? h quiet
endif

cd origami:
cd keybind
if not exists ..
  makedir ..
  cd ..
  makedir h
  copy origami:h/#? h quiet
endif

cd origami:
cd viewrc
if not exists ..
  makedir ..
  cd ..
  makedir h
  copy origami:h/#? h quiet
endif

cd origami:
cd dirfold
if not exists ..
  makedir ..
  cd ..
  makedir h
  copy origami:h/#? h quiet
endif

cd origami:
cd pager
if not exists ..
  makedir ..
  cd ..
  makedir h
  copy origami:h/#? h quiet
endif

cd origami:
cd amiga
if not exists getopt
  lha x getopt
endif

ask "Do you want to compile with DICE or SAS ? (DICE/SAS) " "DICE" "SAS"
if WARN
  cd origami:
  protect amiga/dmf-files/#?_dmf +s quiet
  copy amiga/dmf-files/origami_dmf origami/mf
  copy amiga/dmf-files/keybind_dmf keybind/mf
  copy amiga/dmf-files/viewrc_dmf  viewrc/mf
  copy amiga/dmf-files/folder_dmf  dirfold/mf
  copy amiga/dmf-files/pager_dmf   pager/mf
  copy amiga/dmf-files/amiga_dmf   amiga/mf

  copy dinclude:sys/dir.h dirent.h
else
  cd origami:
  protect amiga/lmf-files#?_lmf +s quiet
  copy amiga/lmf-files/origami_lmf origami/mf
  copy amiga/lmf-files/keybind_lmf keybind/mf
  copy amiga/lmf-files/viewrc_lmf  viewrc/mf
  copy amiga/lmf-files/folder_lmf  dirfold/mf
  copy amiga/lmf-files/pager_lmf   pager/mf
  copy amiga/lmf-files/amiga_lmf   amiga/mf

  copy include:sys/dir.h dirent.h

endif

cd origami:
echo >unistd.h ""
echo >pwd.h ""
echo >termcap.h ""

cd origami:
cd amiga
if not exists ..
  makedir ..
  cd ..
  makedir h
  copy origami:h/#? h quiet
  cd /
endif

protect scripts/clean_up +s
protect scripts/install_origami +s
echo "*N... Ready ! Use clean_up to clean_up !"
