#!/bin/sh
# N.B. make sure this really is a true Bourne-compatible shell.

###############################################################
# wxinstal -- wxWindows installation script.                  #
# Julian Smart, July 1997                                     #
# Usage: wxinstal [optional wxWindows target directory]       #
###############################################################

########### Edit these variables for your system. #############
########### ALSO edit wx/src/make.env once unarchived #########

# Editor
MYEDITOR=$EDITOR
if [ "$MYEDITOR" = "" ]
then
  MYEDITOR=emacs
fi

# Pager
MYPAGER=$PAGER
if [ "$MYPAGER" = "" ]
then
  MYPAGER=more
fi

# wxWindows directory to install to
WXDIR=`pwd`
if [ ! "$1" = "" ]
then
  WXDIR=$1
fi

# Target (motif, xview)
GUITARGET=motif

# Archive prefix, dependent on version number
ARCHIVE=wx167

# Platform. 1 = generic platform
PLATFORM=1

# Current directory
CURRENTDIR=`pwd`

# PostScript viewer, if any
POSTSCRIPTVIEWER=ghostview

# PostScript viewer, if any
HTMLVIEWER=netscape

# Don't change this
GUISUFFIX=_motif

if [ "$GUITARGET" = "motif" ]
then
  GUISUFFIX=_motif
fi

if [ "$GUITARGET" = "xview" ]
then
  GUISUFFIX=_ol
fi

if [ "$GUITARGET" = "hp" ]
then
  GUISUFFIX=_hp
fi

# If you add platforms, you just need
# to adjust this number, and
# add environment variables
# for a description and the filename.

PLATFORMCOUNT=12

PLATFORM1="Generic/Linux with gcc"
PLATFORMFILE1="generic.env"

PLATFORM2="Solaris with gcc"
PLATFORMFILE2="sol_gcc.env"

PLATFORM3="Solaris with Sun C++"
PLATFORMFILE3="sol_sun.env"

PLATFORM4="SunOS 4.x.x with gcc"
PLATFORMFILE4="sunosgcc.env"

PLATFORM5="FreeBSD with gcc"
PLATFORMFILE5="freebsd.env"

PLATFORM6="AIX with gcc"
PLATFORMFILE6="aixgcc.env"

PLATFORM7="AIX with CSet++"
PLATFORMFILE7="aixcset.env"

PLATFORM8="Data General"
PLATFORMFILE8="datagen.env"

PLATFORM9="HPUX"
PLATFORMFILE9="hp.env"

PLATFORM10="IRIX"
PLATFORMFILE10="irix.env"

PLATFORM11="DEC OSF"
PLATFORMFILE11="decosf.env"

PLATFORM12="VAX VMS"
PLATFORMFILE12="vms.env"

install_from_tar()
{
  if [ -f $CURRENTDIR/$ARCHIVE"_1.tar" ]
  then
    if [ ! -d $WXDIR ]
    then
      echo Making directory $WXDIR
      mkdir $WXDIR
    fi
    if [ ! -d $WXDIR ]
    then
      echo $WXDIR" cannot be created!"
    else
      echo Untarring $CURRENTDIR/$ARCHIVE"_*.tar."
      echo Please be patient...
      cd $WXDIR
      tar xf $CURRENTDIR/$ARCHIVE"_1.tar"
      tar xf $CURRENTDIR/$ARCHIVE"_2.tar"
      echo If you saw no errors, untarring was successful.
    fi
  else
    echo $CURRENTDIR/$ARCHIVE"_1.tar" not found.
  fi

  # Unarchive PostScript documentation if found
  if [ -f $CURRENTDIR/$ARCHIVE"ps.tar" ]
  then
    echo Untarring PostScript documentation $CURRENTDIR/$ARCHIVE"ps.tar."
    echo Please be patient...
    cd $WXDIR
    tar xf $CURRENTDIR/$ARCHIVE"ps.tar"
  fi

  # Unarchive HTML documentation if found
  if [ -f $CURRENTDIR/$ARCHIVE"htm.tar" ]
  then
    echo Untarring wxHelp documentation $CURRENTDIR/$ARCHIVE"htm.tar."
    echo Please be patient...
    cd $WXDIR
    tar xf $CURRENTDIR/$ARCHIVE"htm.tar"
  fi

  cd $CURRENTDIR
}

install_from_gzip()
{
  if [ -f $CURRENTDIR/$ARCHIVE"_1.tgz" ]
  then
    echo Unarchiving $CURRENTDIR/$ARCHIVE"_1.tgz"
    gzip -c -d $CURRENTDIR/$ARCHIVE"_1.tgz" | tar xf -
    echo Unarchiving $CURRENTDIR/$ARCHIVE"_2.tgz"
    gzip -c -d $CURRENTDIR/$ARCHIVE"_2.tgz" | tar xf -

    # Optional: PostScript documentation
    if [ -f $CURRENTDIR/$ARCHIVE"ps.tgz" ]
    then
      echo Unarchiving $CURRENTDIR/$ARCHIVE"ps.tgz"
      gzip -c -d $CURRENTDIR/$ARCHIVE"ps.tgz" | tar xf -
    fi

    # Optional: HTML documentation
    if [ -f $CURRENTDIR/$ARCHIVE"htm.tgz" ]
    then
      echo Unarchiving $CURRENTDIR/$ARCHIVE"htm.tgz"
      gzip -c -d $CURRENTDIR/$ARCHIVE"htm.tgz" | tar xf -
    fi

  else
    echo $CURRENTDIR/$ARCHIVE"_1.tgz" not found. Please place in the current directory.
  fi
  cd $CURRENTDIR
}

edit_make_env()
{
  cd $CURRENTDIR

  if [ -f $WXDIR/src/make.env ]
  then
    echo ""
    echo "If the files are unarchived ok, you should edit the file"
    echo $WXDIR"/src/make.env"
    echo "since this sets many options for your wxWindows"
    echo "compilation environment."
    echo ""
    echo "Would you like to edit the file now? (y/n)"
    echo
    read ans
    if [ "$ans" = "y" ]
    then
      $MYEDITOR $WXDIR/src/make.env
      echo ""
      echo Ok, if you get compilation or link errors in the installation,
      echo $WXDIR"/src/make.env is the first place to look."
      echo ""
      echo "Press return to continue."
      read ans
    fi
  else
    echo ""
    echo "Uh-oh, cannot find "$WXDIR"/src/make.env; probably you have not unarchived"
    echo "properly yet."
    echo ""
    echo "Press return to continue."
    read ans
  fi
}

install_from_archive()
{
  echo
  echo "Install from Archive"
  echo "--------------------"

  echo "1) Install from "$ARCHIVE"_1.tgz, "$ARCHIVE"_2.tgz"
  echo "   and "$ARCHIVE"htm.tgz, "$ARCHIVE"ps.tgz if present."
  echo "0) Quit."
  echo
  read archans

  if [ "$archans" = "1" ]
  then
    install_from_gzip
    edit_make_env
  fi
}

make_main_library()
{
  if [ ! -d $WXDIR/src ]
  then
    echo "Source directory not found: please unarchive first."
    echo Press return to continue.
    read ans
  else
    echo
    echo Making the wxWindows main library. It will go in
    echo $WXDIR/lib.
    echo
    echo Please press RETURN to continue, and then make yourself a coffee.
    echo 
    read ans
    if [ ! -d $WXDIR/lib ]
    then
      mkdir $WXDIR/lib
    fi

    cd $WXDIR/src/x
    make -f makefile.unx $GUITARGET 2>&1 | tee -a $CURRENTDIR/make.log
    cd $CURRENTDIR

    if [ -f $WXDIR/lib/libwx$GUISUFFIX".a" ]
    then  
      echo
      echo "If you saw no errors, wxWindows was compiled. See the file make.log"
      echo "for errors and warnings."
    else
      echo
      echo $WXDIR/lib/libwx$GUISUFFIX".a was not built."
      echo "Please check make.env, and read install.txt and faq.txt/ps."
      echo
      echo "Press return to continue."
      echo
      read ans
    fi
  fi
}

###############################################################
# Make peripheral components                                  #
###############################################################

make_prologio()
{
  if [ ! -d $WXDIR/utils/prologio ]
  then
    echo PROLOGIO directory does not exist.
    echo Press return to continue.
    read ans
  else
    echo
    echo "Warning: if FLEX fails, it may be because lexer.l is"
    echo "in DOS file format. In which case, use EMACS to remove"
    echo "^M characters in lexer.l with:"
    echo "  (Meta-X replace-string RETURN Ctl-Q RETURN RETURN RETURN),"
    echo "or use tounix or other DOS->UNIX file conversion program."
    echo
    echo "Press return to continue."
    read ans
    echo
    echo Making the PROLOGIO library. It will go in
    echo $WXDIR/utils/prologio/lib.
    echo
    cd $WXDIR/utils/prologio/src
    make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
    cd $CURRENTDIR
    echo
    echo "If you saw no errors, the PROLOGIO library was compiled. See the file make.log"
    echo "for errors and warnings."
    echo ""
    echo "Would you like to make and run the sample for this library? (y/n)"
    echo
    read ans
    if [ "$ans" = "y" ]
    then
      cd $WXDIR/utils/prologio/src
      make -f makefile.unx sample$GUISUFFIX 2>&1 | tee $CURRENTDIR/make.log
      echo ""
      if [ -f $WXDIR/utils/prologio/src/test$GUISUFFIX ]
      then
        echo "Run the PROLOGIO sample? (y/n)"
        echo ""
        read ans1
        if [ "$ans1" = "y" ]
        then
          echo "Try opening the file "$WXDIR/utils/prologio/docs/badcase.txt"."
          echo "This is a fairly big PROLOGIO file; if an error occurs during"
          echo "reading, there is a problem (or the file is not a PROLOGIO file,"
          echo "or is in DOS format)."
          echo ""
          echo "If the test program exits with the message:"
          echo ""
          echo "  Input string too long, limit 200"
          echo ""
          echo "then you'll need to change YYLMAX in lex_yy.c to a large number,"
          echo "such as 5000".
          echo "" 
          echo "You can double-check PROLOGIO by saving as a different file, and checking"
          echo "that the contents are the same as the original."
          echo ""
          echo "Press return to continue."
          read ans1
          $WXDIR/utils/prologio/src/test$GUISUFFIX
        fi
      fi
      cd $CURRENTDIR
    fi
  fi
}

make_hytext()
{
  if [ ! -d $WXDIR/utils/hytext ]
  then
    echo hyText directory does not exist.
    echo Press return to continue.
    read ans
  else
    echo
    echo Making the hyText library. It will go in
    echo $WXDIR/utils/hytext/lib.
    echo
    cd $WXDIR/utils/hytext/src
    make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
    cd $CURRENTDIR
    echo
    echo "If you saw no errors, the hyText library was compiled. See the file make.log"
    echo "for errors and warnings."
  fi
}

make_wxtree()
{
  if [ ! -d $WXDIR/utils/wxtree ]
  then
    echo wxTree directory does not exist.
    echo Press return to continue.
    read ans
  else
    echo
    echo Making the wxTree library. It will go in
    echo $WXDIR/utils/wxtree/lib.
    echo
    cd $WXDIR/utils/wxtree/src
    make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
    cd $CURRENTDIR
    echo
    echo "If you saw no errors, the wxTree library was compiled. See the file make.log"
    echo "for errors and warnings."
  fi
}

make_wxgraph()
{
  if [ ! -d $WXDIR/utils/wxgraph ]
  then
    echo wxGraph directory does not exist.
    echo Press return to continue.
    read ans
  else
    echo
    echo Making the wxGraph library. It will go in
    echo $WXDIR/utils/wxgraph/lib.
    echo
    cd $WXDIR/utils/wxgraph/src
    make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
    cd $CURRENTDIR
    echo
    echo "If you saw no errors, the wxGraph library was compiled. See the file make.log"
    echo "for errors and warnings."
  fi
}

make_wximage()
{
  if [ ! -d $WXDIR/utils/image ]
  then
    echo #WXDIR/utils/image directory does not exist.
    echo Press return to continue.
    read ans
  else
    echo
    echo Making the wxImage library. It will go in
    echo $WXDIR/utils/image/lib.
    echo
    cd $WXDIR/utils/image/src
    make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
    cd $CURRENTDIR
    echo
    echo "If you saw no errors, the wxImage library was compiled. See the file make.log"
    echo "for errors and warnings."
    echo ""
    echo "Would you like to make and run the sample for this library? (y/n)"
    echo
    read ans
    if [ "$ans" = "y" ]
    then
      cd $WXDIR/utils/image/src
      make -f makefile.unx sample$GUISUFFIX 2>&1 | tee $CURRENTDIR/make.log
      echo ""
      if [ -f $WXDIR/utils/image/src/test$GUISUFFIX ]
      then
        echo "Run the wxImage sample? (y/n)"
        echo ""
        read ans1
        if [ "$ans1" = "y" ]
        then
          $WXDIR/utils/image/src/test$GUISUFFIX
        fi
      fi
      cd $CURRENTDIR
    fi
  fi
}

make_colour()
{
  if [ ! -d $WXDIR/utils/colours ]
  then
    echo $WXDIR/utils/colours directory does not exist.
    echo Press return to continue.
    read ans
  else
    echo
    echo Making the Colour sampler. It will go in
    echo $WXDIR/utils/colours
    echo
    cd $WXDIR/utils/colours
    make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
    cd $CURRENTDIR
    echo
    echo "If you saw no errors, the Colour sampler was compiled. See the file make.log"
    echo "for errors and warnings."
    echo ""
    if [ -f $WXDIR/utils/colours/colours$GUISUFFIX ]
    then
      echo "Run the Colour sampler? (y/n)"
      echo ""
      read ans1
      if [ "$ans1" = "y" ]
      then
        $WXDIR/utils/colours/colours$GUISUFFIX
      fi
    fi
  fi
}

make_wxhelp()
{
  if [ ! -d $WXDIR/utils/wxhelp ]
  then
    echo wxHelp directory does not exist.
    echo Press return to continue.
    read ans
  else
    echo
    echo Making the wxHelp program. It will go in
    echo $WXDIR/utils/wxhelp/src.
    echo
    cd $WXDIR/utils/wxhelp/src
    make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
    cd $CURRENTDIR
    echo
    echo "If you saw no errors, the wxHelp program was compiled. See the file make.log"
    echo "for errors and warnings."
  fi
}

make_wxbuild1()
{
  echo
  echo Making the wxBuilder program. It will go in
  echo $WXDIR/utils/wxbuild/src.
  echo
  cd $WXDIR/utils/wxbuild/src
  make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
  cd $CURRENTDIR
  echo
  echo "If you saw no errors, the wxBuilder program was compiled. See the file make.log"
  echo "for errors and warnings."
}

make_wxbuild()
{
  if [ ! -d $WXDIR/utils/wxbuild ]
  then
    echo wxBuilder directory does not exist.
    echo Press return to continue.
    read ans
  else
    if [ "$GUITARGET" = "xview" ]
    then
      echo "The XView version of wxBuilder isn't fully functional"
      echo "at the moment: it's waiting for some modal dialogs to be removed"
      echo "since more than one level of modal dialog gives XView the"
      echo "heebee-jeebees. Make wxBuilder? (y/n)"
      echo
      read ans
      if [ "$ans" = "y" ]
      then
        make_wxbuild1
      fi
    else
      make_wxbuild1
    fi
  fi
}

make_tex2rtf()
{
  if [ ! -d $WXDIR/utils/tex2rtf ]
  then
    echo Tex2RTF directory does not exist.
    echo Press return to continue.
    read ans
  else
    echo
    echo Making the Tex2RTF utility. It will go in
    echo $WXDIR/utils/tex2rtf/src.
    echo
    cd $WXDIR/utils/tex2rtf/src
    make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
    cd $CURRENTDIR
    echo
    echo "If you saw no errors, the Tex2RTF program was compiled. See the file make.log"
    echo "for errors and warnings."
  fi
}

###############################################################
# Make samples                                                  #
###############################################################

make_hello()
{
  echo
  echo Making the Hello sample. It will be made as
  echo $WXDIR/samples/hello/hello$GUISUFFIX
  echo
  cd $WXDIR/samples/hello
  make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
  cd $CURRENTDIR
  echo
  echo "If you saw no errors, the Hello sample was compiled. See the file make.log"
  echo "for errors and warnings."
}

make_minimal()
{
  echo
  echo Making the Minimal sample. It will be made as
  echo $WXDIR/samples/minimal/minimal$GUISUFFIX
  echo
  cd $WXDIR/samples/minimal
  make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
  cd $CURRENTDIR
  echo
  echo "If you saw no errors, the Minimal sample was compiled. See the file make.log"
  echo "for errors and warnings."
}

make_mdi()
{
  echo
  echo Making the Mdi sample. It will be made as
  echo $WXDIR/samples/mdi/mdi$GUISUFFIX
  echo
  cd $WXDIR/samples/mdi
  make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
  cd $CURRENTDIR
  echo
  echo "If you saw no errors, the MDI sample was compiled. See the file make.log"
  echo "for errors and warnings."
}

make_animate()
{
  echo
  echo Making the Animate sample. It will be made as
  echo $WXDIR/samples/animate/anim$GUISUFFIX
  echo
  cd $WXDIR/samples/animate
  make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
  cd $CURRENTDIR
  echo
  echo "If you saw no errors, the Animate sample was compiled. See the file make.log"
  echo "for errors and warnings."
}

make_fractal()
{
  echo
  echo Making the Fractal sample. It will be made as
  echo $WXDIR/samples/fractal/fractal$GUISUFFIX
  echo
  cd $WXDIR/samples/fractal
  make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
  cd $CURRENTDIR
  echo
  echo "If you saw no errors, the Fractal sample was compiled. See the file make.log"
  echo "for errors and warnings."
}

make_form()
{
  echo
  echo Making the Form sample. It will be made as
  echo $WXDIR/samples/form/form$GUISUFFIX
  echo
  cd $WXDIR/samples/form
  make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
  cd $CURRENTDIR
  echo
  echo "If you saw no errors, the Form sample was compiled. See the file make.log"
  echo "for errors and warnings."
}

make_ipc()
{
  echo
  echo Making the IPC sample. It will be made as
  echo $WXDIR/samples/ipc/server$GUISUFFIX
  echo $WXDIR/samples/ipc/client$GUISUFFIX
  echo
  cd $WXDIR/samples/ipc
  make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
  cd $CURRENTDIR
  echo
  echo "If you saw no errors, the IPC sample was compiled. See the file make.log"
  echo "for errors and warnings."
}

make_all_periph_components()
{
  make_prologio
  make_wxtree
  make_wxgraph
  make_hytext
  make_wxhelp
  make_tex2rtf
  make_colour
  make_wximage
  make_wxbuild
}

about_periph_components()
{
  clear
  echo "About the Peripheral Components"
  echo "-------------------------------"
  echo
  echo "These are libraries and programs that are considered useful"
  echo "enough to put in the main wxWindows distribution."
  echo
  echo PROLOGIO
  echo --------
  echo    A library of routines for making it easy to read and write
  echo    files of objects with attributes and values, such as:
  echo
  echo "     thing(id = 1, name = fred)."
  echo
  echo    These files can be very robust to changes in your application,
  echo    they can be edited by hand, and they are very easy to manipulate.
  echo
  echo wxTree A tree-drawing library, with sample
  echo ------
  echo    
  echo wxGraph A node and arc graph-drawing library, with sample
  echo -------
  echo    
  echo "Press return to continue"
  read ans
  clear
  echo hyText A simple hypertext library
  echo ------
  echo    
  echo wxHelp The wxWindows on-line help program
  echo ------
  echo
  echo wxImage A library for reading/displaying bitmaps under X,
  echo ------- with sample
  echo
  echo Colours A colour sampler displaying colours and their names
  echo -------
  echo
  echo "Tex2RTF LaTeX->RTF, HTML, XLP converter"
  echo -------
  echo
  echo wxBuilder A simple screen painter/C++ code generator
  echo ---------
  echo
  echo "Press return to continue"
  read ans
  clear
  echo   Also available separately from skye.aiai.ed.ac.uk:
  echo
  echo   wxCLIPS, an Open Look/Motif/Windows version of the
  echo   rule-based shell CLIPS, with binaries.
  echo   "May be ftp'ed from /pub/wxclips."
  echo
  echo   Tex2RTF sources and binaries for Open Look/Motif/Windows.
  echo   "May be ftp'ed from /pub/tex2rtf."
  echo
  echo   ClockWorks, an Open Look/Motif/Windows configurable analog
  echo   clock, with source.
  echo   "May be ftp'ed from /pub/wxwin/clockworks."
  echo   
  echo "Press return to continue"
  read ans
}

make_peripheral_components()
{
  compoption='none'
  while [ "$compoption" != "0" ]
  do
    echo
    echo "Peripheral Component Options"
    echo "----------------------------"
    echo " 1) Make PROLOGIO library"
    echo " 2) Make wxTree layout library"
    echo " 3) Make wxGraph layout library"
    echo " 4) Make hyText library"
    echo " 5) Make wxImage GIF/BMP loading library"
    echo " 6) Make wxHelp system"
    echo " 7) Make Colour sampler"
    echo " 8) Make Tex2RTF RTF/HTML/wxHelp/WinHelp converter"
    echo " 9) Make wxBuilder (Motif only)"
    echo "10) Make all the above"
    echo "----------------------------"
    echo " ?) About these components"
    echo "----------------------------"
    echo " 0) Quit."
    echo
    read compoption

    if [ "$compoption" = "1" ]
    then
      make_prologio
    fi
    if [ "$compoption" = "2" ]
    then
      make_wxtree
    fi
    if [ "$compoption" = "3" ]
    then
      make_wxgraph
    fi
    if [ "$compoption" = "4" ]
    then
      make_hytext
    fi
    if [ "$compoption" = "5" ]
    then
      make_wximage
    fi
    if [ "$compoption" = "6" ]
    then
      make_wxhelp
    fi
    if [ "$compoption" = "7" ]
    then
      make_colour
    fi
    if [ "$compoption" = "8" ]
    then
      make_tex2rtf
    fi
    if [ "$compoption" = "9" ]
    then
      make_wxbuild
    fi
    if [ "$compoption" = "10" ]
    then
      make_all_periph_components
    fi
    if [ "$compoption" = "?" ]
    then
      about_periph_components
    fi
  done
}

make_all_samples()
{
  echo
  echo "Note: compiling all samples is going to use up bags of disk space."
  echo "Continue? (y/n)"
  echo
  read ans

  if [ "$ans" = "y" ]
  then
    cd $WXDIR/samples
    make -f makefile.unx all$GUISUFFIX
  fi
}

make_samples()
{
  compoption='none'
  while [ "$compoption" != "0" ]
  do
    echo
    echo "Sample compilation options"
    echo "------------------------"
    echo "1) Make Hello sample (the main wxWindows sample)"
    echo "2) Make Minimal sample"
    echo "3) Make all samples"
    echo "4) Run a sample"
    echo "------------------------"
    echo "0) Quit."
    echo
    read compoption

    if [ "$compoption" = "1" ]
    then
      make_hello
    fi
    if [ "$compoption" = "2" ]
    then
      make_minimal
    fi
    if [ "$compoption" = "3" ]
    then
      make_all_samples
    fi
    if [ "$compoption" = "4" ]
    then
      run_samples
    fi
  done
}

# Find a platform filename, using 'arg' as input and output
platform_filename()
{
  case "$arg" in
    1) arg=$PLATFORMFILE1;;
    2) arg=$PLATFORMFILE2;;
    3) arg=$PLATFORMFILE3;;
    4) arg=$PLATFORMFILE4;;
    5) arg=$PLATFORMFILE5;;
    6) arg=$PLATFORMFILE6;;
    7) arg=$PLATFORMFILE7;;
    8) arg=$PLATFORMFILE8;;
    9) arg=$PLATFORMFILE9;;
    10) arg=$PLATFORMFILE10;;
    11) arg=$PLATFORMFILE11;;
    12) arg=$PLATFORMFILE12;;
    13) arg=$PLATFORMFILE13;;
    14) arg=$PLATFORMFILE14;;
    15) arg=$PLATFORMFILE15;;
    16) arg=$PLATFORMFILE16;;
    17) arg=$PLATFORMFILE17;;
    18) arg=$PLATFORMFILE18;;
    19) arg=$PLATFORMFILE19;;
    20) arg=$PLATFORMFILE20;;
    *) arg=''
  esac
}

platform_description()
{
  case "$arg" in
    1) arg=$PLATFORM1;;
    2) arg=$PLATFORM2;;
    3) arg=$PLATFORM3;;
    4) arg=$PLATFORM4;;
    5) arg=$PLATFORM5;;
    6) arg=$PLATFORM6;;
    7) arg=$PLATFORM7;;
    8) arg=$PLATFORM8;;
    9) arg=$PLATFORM9;;
    10) arg=$PLATFORM10;;
    11) arg=$PLATFORM11;;
    12) arg=$PLATFORM12;;
    13) arg=$PLATFORM13;;
    14) arg=$PLATFORM14;;
    15) arg=$PLATFORM15;;
    16) arg=$PLATFORM16;;
    17) arg=$PLATFORM17;;
    18) arg=$PLATFORM18;;
    19) arg=$PLATFORM19;;
    20) arg=$PLATFORM20;;
    *) arg=''
  esac
}

###############################################################
# Select a platform
###############################################################

select_platform()
{
  echo
  echo "Select a platform"
  echo "----------------------------"
  echo "Note: this copies a file from $WXDIR/src/makeenvs"
  echo "to $WXDIR/src/make.env. If you have"
  echo "restarted the installation, the current option listed"
  echo "may not reflect the current make.env."
  echo
  echo "You may wish to edit a .env file in $WXDIR/src/makeenvs"
  echo "instead of src/make.env, which might be overwritten in future"
  echo "installations."
  echo
  echo "In any event, a backup of make.env is made (make.bak) before it is"
  echo "overwritten."
  echo
  echo "Please press return to continue."
  read dummy

  compoption='none'
  selectdone=0
  while [ "$selectdone" = "0" ]
  do
    echo
    echo "Select a platform"
    echo "----------------------------"
    echo

    i=1
    while [ $i -le $PLATFORMCOUNT ]
    do
      arg=$i
      platform_description
      plat=$arg
      markit=" "
      if [ "$PLATFORM" = "$i" ]
      then
        markit="*"
      fi
      echo " "$markit" "$i") "$plat
      i=`expr $i + 1`
    done
    echo
    echo "   e) Edit the current src/make.env"
    echo
    echo "Enter a choice, return for default: "
    read compoption

    if [ "$compoption" = "e" ]
    then
      $MYEDITOR $WXDIR/src/make.env
    else
      if [ "$compoption" != "" ]
      then
        arg=$compoption
        platform_description
        plat=$arg

        arg=$compoption
        platform_filename
        platfile=$arg

        if [ "$platfile" != "" ]
        then
          if [ ! -f $WXDIR"/src/makeenvs/"$platfile ]
          then
            echo "Sorry, this platform is not catered for yet."
            echo "Try using the generic settings instead."
            echo ""
            echo "Press return to continue."
            read dummy
          else
            selectdone=1
            PLATFORM=$compoption
            cp -f $WXDIR/src/make.env $WXDIR/src/make.bak
            cp -f $WXDIR/src/makeenvs/$platfile $WXDIR/src/make.env
          fi
        fi
      else
        selectdone=1
      fi
    fi
  done
}

###############################################################
# Run samples                                                   #
###############################################################

run_hello()
{
  if [ ! -f $WXDIR"/samples/hello/hello"$GUISUFFIX ]
  then
    echo The Hello sample has not been compiled yet.
  else
    echo
    echo "Running "$WXDIR"/samples/hello/hello"$GUISUFFIX
    echo
    cd $WXDIR"/samples/hello"
    "hello"$GUISUFFIX
    cd $CURRENTDIR
  fi
}

run_minimal()
{
  if [ ! -f $WXDIR"/samples/minimal/minimal"$GUISUFFIX ]
  then
    echo The Minimal sample has not been compiled yet.
  else
    echo
    echo "Running "$WXDIR"/samples/minimal/minimal"$GUISUFFIX
    echo
    cd $WXDIR"/samples/minimal"
    "minimal"$GUISUFFIX
    cd $CURRENTDIR
  fi
}

run_form()
{
  if [ ! -f $WXDIR"/samples/form/form"$GUISUFFIX ]
  then
    echo The Form sample has not been compiled yet.
  else
    echo
    echo "Running "$WXDIR"/samples/form/form"$GUISUFFIX
    echo
    cd $WXDIR"/samples/form"
    "form"$GUISUFFIX
    cd $CURRENTDIR
  fi
}

run_animate()
{
  if [ ! -f $WXDIR"/samples/animate/anim"$GUISUFFIX ]
  then
    echo The Animate sample has not been compiled yet.
  else
    echo
    echo "Running "$WXDIR"/samples/animate/anim"$GUISUFFIX
    echo
    cd $WXDIR"/samples/animate"
    "anim"$GUISUFFIX
    cd $CURRENTDIR
  fi
}

run_fractal()
{
  if [ ! -f $WXDIR"/samples/fractal/fractal"$GUISUFFIX ]
  then
    echo The Fractal sample has not been compiled yet.
  else
    echo
    echo "Running "$WXDIR"/samples/fractal/fractal"$GUISUFFIX
    echo
    cd $WXDIR"/samples/fractal"
    "fractal"$GUISUFFIX
    cd $CURRENTDIR
  fi
}

run_ipc()
{
  if [ ! -f $WXDIR"/samples/ipc/client"$GUISUFFIX ]
  then
    echo The IPC samples have not been compiled yet.
  else
    echo
    echo "Running "$WXDIR"/samples/ipc/client"$GUISUFFIX,
    echo "        "$WXDIR"/samples/ipc/server"$GUISUFFIX
    echo
    cd $WXDIR"/samples/ipc"
    echo "Starting server..."
    "server"$GUISUFFIX &
    echo "Waiting 10 seconds..."
    sleep 10
    echo "Starting client..."
    "client"$GUISUFFIX
    cd $CURRENTDIR
  fi
}

run_samples()
{
  runoption='none'
  while [ "$runoption" != "0" ]
  do
    echo
    echo "Run a wxWindows sample"
    echo "--------------------"
    echo "Note: this is a small selection. For more, please"
    echo "browse the samples subdirectory."
    echo
    echo "1) Run Hello sample (the main wxWindows sample)"
    echo "2) Run Minimal sample"
    echo "3) Run IPC sample"
    echo "4) Run wxForm sample"
    echo "5) Run 3D Animate sample"
    echo "6) Run Fractal sample"
    echo "--------------------"
    echo "0) Quit."
    echo
    read runoption

    if [ "$runoption" = "1" ]
    then
      run_hello
    fi
    if [ "$runoption" = "2" ]
    then
      run_minimal
    fi
    if [ "$runoption" = "3" ]
    then
      run_ipc
    fi
    if [ "$runoption" = "4" ]
    then
      run_form
    fi
    if [ "$runoption" = "5" ]
    then
      run_animate
    fi
    if [ "$runoption" = "6" ]
    then
      run_fractal
    fi
  done
}

make_all()
{
  make_main_library
  make_all_periph_components
  make_all_samples
}

remove_component()
{
  if [ -d $COMPONENT ]
  then
    echo "Remove "$COMPONENT": are you sure? (y/n) "
    echo
    read ans
    if [ "$ans" = "y" ]
    then
      rm -f -r $COMPONENT
    fi
  fi
}

remove_components()
{
  compoption='none'
  while [ "$compoption" != "0" ]
  do
    if [ -f $WXDIR/docs/ps/wx.ps ]
    then
      PSMANUALSOK="*"
    else
      PSMANUALSOK=" "
    fi
  
    if [ -f $WXDIR/docs/html/wx/wx.htm ]
    then
      HTMLMANUALSOK="*"
    else
      HTMLMANUALSOK=" "
    fi
  
    if [ -d $WXDIR/utils/prologio ]
    then
      PROLOGIOOK="*"
    else
      PROLOGIOOK=" "
    fi
  
    if [ -d $WXDIR/utils/wxtree ]
    then
      WXTREEOK="*"
    else
      WXTREEOK=" "
    fi
  
    if [ -d $WXDIR/utils/wxgraph ]
    then
      WXGRAPHOK="*"
    else
      WXGRAPHOK=" "
    fi

    if [ -d $WXDIR/utils/wxhelp ]
    then
      WXHELPOK="*"
    else
      WXHELPOK=" "
    fi

    if [ -d $WXDIR/utils/tex2rtf ]
    then
      TEX2RTFOK="*"
    else
      TEX2RTFOK=" "
    fi

    if [ -d $WXDIR/utils/hytext ]
    then
      HYTEXTOK="*"
    else
      HYTEXTOK=" "
    fi

    if [ -d $WXDIR/utils/colours ]
    then
      COLOURSOK="*"
    else
      COLOURSOK=" "
    fi

    if [ -d $WXDIR/utils/image ]
    then
      IMAGEOK="*"
    else
      IMAGEOK=" "
    fi

    if [ -d $WXDIR/utils/wxbuild ]
    then
      WXBUILDOK="*"
    else
      WXBUILDOK=" "
    fi

    echo
    echo "Remove a wxWindows component (* means it's installed)"
    echo "-----------------------------------------------------"
    echo "wxWindows currently takes up this many KB:"
    du -s $WXDIR
    echo "-----------------------------------------------------"
    echo " 1) "$PSMANUALSOK"Remove PostScript manuals"
    echo " 2) "$HTMLMANUALSOK"Remove HTML manuals"
    echo " 3) "$PROLOGIOOK"Remove PROLOGIO library"
    echo " 4) "$HYTEXTOK"Remove hyText library"
    echo " 5) "$WXTREEOK"Remove wxTree library"
    echo " 6) "$WXGRAPHOK"Remove wxGraph library"
    echo " 7) "$WXHELPOK"Remove wxHelp system"
    echo " 8) "$TEX2RTFOK"Remove Tex2RTF/HTML/WinHelp/wxHelp converter"
    echo " 9) "$COLOURSOK"Remove Colour sampler"
    echo "10) "$IMAGEOK"Remove wxImage GIF/BMP loader library"
    echo "11) "$WXBUILDOK"Remove wxBuilder"
    echo "------------------------------------------------------"
    echo " 0) Quit."
    echo
    read compoption

    if [ "$compoption" = "1" ]
    then
      rm -f $WXDIR/docs/*.ps
      rm -f $WXDIR/utils/*/docs/*.ps
    fi
    if [ "$compoption" = "2" ]
    then
      rm -f -r $WXDIR/html
    fi
    if [ "$compoption" = "3" ]
    then
      COMPONENT=$WXDIR/utils/prologio
      remove_component
    fi
    if [ "$compoption" = "4" ]
    then
      COMPONENT=$WXDIR/utils/hytext
      remove_component
    fi
    if [ "$compoption" = "5" ]
    then
      COMPONENT=$WXDIR/utils/wxtree
      remove_component
    fi
    if [ "$compoption" = "6" ]
    then
      COMPONENT=$WXDIR/utils/wxgraph
      remove_component
    fi
    if [ "$compoption" = "7" ]
    then
      COMPONENT=$WXDIR/utils/wxhelp
      remove_component
    fi
    if [ "$compoption" = "8" ]
    then
      COMPONENT=$WXDIR/utils/tex2rtf
      remove_component
    fi
    if [ "$compoption" = "9" ]
    then
      COMPONENT=$WXDIR/utils/colours
      remove_component
    fi
    if [ "$compoption" = "10" ]
    then
      COMPONENT=$WXDIR/utils/image
      remove_component
    fi
    if [ "$compoption" = "11" ]
    then
      COMPONENT=$WXDIR/utils/wxbuild
      remove_component
    fi
  done
}

clean_component()
{
  if [ -d $COMPONENT ]
  then
    cd $COMPONENT
    make -f makefile.unx clean$GUISUFFIX
    cd $CURRENTDIR
  fi
}

clean_samples()
{
  cd $WXDIR/samples
  make -f makefile.unx clean$GUISUFFIX
  cd $CURRENTDIR
}

clean_components()
{
  compoption='none'
  olddu=""
  while [ "$compoption" != "0" ]
  do
    if [ -f $WXDIR/samples/hello/hello$GUISUFFIX -o \
         -f $WXDIR/samples/form/form$GUISUFFIX -o \
         -f $WXDIR/samples/forty/forty$GUISUFFIX -o \
         -f $WXDIR/samples/splitter/splitter$GUISUFFIX -o \
         -f $WXDIR/samples/docview/docview$GUISUFFIX -o \
         -f $WXDIR/samples/pressup/pressup$GUISUFFIX -o \
         -f $WXDIR/samples/bombs/bombs$GUISUFFIX -o \
         -f $WXDIR/samples/wxpoem/wxpoem$GUISUFFIX -o \
         -f $WXDIR/samples/printing/printing$GUISUFFIX -o \
         -f $WXDIR/samples/resource/resource$GUISUFFIX -o \
         -f $WXDIR/samples/layout/layout$GUISUFFIX -o \
         -f $WXDIR/samples/toolbar/test$GUISUFFIX -o \
         -f $WXDIR/samples/dialogs/dialogs$GUISUFFIX -o \
         -f $WXDIR/samples/types/types$GUISUFFIX -o \
         -f $WXDIR/samples/mdi/mdi$GUISUFFIX -o \
         -f $WXDIR/samples/fractal/fractal$GUISUFFIX -o \
         -f $WXDIR/samples/animate/anim$GUISUFFIX -o \
         -f $WXDIR/samples/ipc/server$GUISUFFIX -o \
         -f $WXDIR/samples/minimal/minimal$GUISUFFIX ]
    then
      SAMPLESOK="*"
    else
      SAMPLESOK=" "
    fi

    if [ -f $WXDIR/lib/libwx$GUISUFFIX".a" ]
    then
      WXOK="*"
    else
      WXOK=" "
    fi

    if [ -f $WXDIR/utils/wxhelp/src/objects$GUISUFFIX/wxhelp.o ]
    then
      WXHELPOK="*"
    else
      WXHELPOK=" "
    fi

    if [ -f $WXDIR/utils/tex2rtf/src/objects$GUISUFFIX/tex2rtf.o ]
    then
      TEX2RTFOK="*"
    else
      TEX2RTFOK=" "
    fi

    if [ -f $WXDIR/utils/dialoged/src/dialoged$GUISUFFIX ]
    then
      DIALOGEDOK="*"
    else
      DIALOGEDOK=" "
    fi

    echo
    echo "Cleanup a wxWindows component (* means objects/binaries exist, - means unknown)"
    echo "-----------------------------------------------------"
    echo "wxWindows currently takes up this many KB:"
    newdu=`du -s $WXDIR`
    if [ "$olddu" = "" ]
    then
      theline=$newdu
    else
      theline=$newdu" (previous usage was "$olddu")"
    fi
    echo $theline
    olddu=$newdu
    echo "-----------------------------------------------------"
    echo " 1) "$WXOK"Clean wxWindows library"
    echo " 2) "$SAMPLESOK"Clean all wxWindows samples"
    echo " 3) -Clean all utilities"
    echo " 4) "$WXHELPOK"Clean wxHelp system"
    echo " 5) "$TEX2RTFOK"Clean Tex2RTF/HTML/WinHelp/wxHelp converter"
    echo " 6) "$DIALOGEDOK"Clean Dialoged Editor tool"
    echo "------------------------------------------------------"
    echo " 0) Quit."
    echo
    read compoption

    if [ "$compoption" = "1" ]
    then
      COMPONENT=$WXDIR/src/x
      clean_component
    fi
    if [ "$compoption" = "2" ]
    then
      cd $WXDIR/samples
      make -f makefile.unx clean$GUISUFFIX
      cd $CURRENTDIR
    fi
    if [ "$compoption" = "3" ]
    then
      cd $WXDIR/utils
      make -f makefile.unx clean$GUISUFFIX
      cd $CURRENTDIR
    fi
    if [ "$compoption" = "4" ]
    then
      COMPONENT=$WXDIR/utils/wxhelp/src
      clean_component
    fi
    if [ "$compoption" = "5" ]
    then
      COMPONENT=$WXDIR/utils/tex2rtf/src
      clean_component
    fi
    if [ "$compoption" = "6" ]
    then
      COMPONENT=$WXDIR/utils/dialoged/src
      clean_component
    fi
  done
}

# Select a target
select_target()
{
  compoption='none'
  selectdone=0
  while [ "$selectdone" = "0" ]
  do
    echo
    echo "Select a target"
    echo "---------------"
    echo " 1) Motif"
    echo " 2) XView"
    echo
    read compoption

    if [ "$compoption" = "1" ]
    then
      selectdone=1
      GUITARGET=motif
      GUISUFFIX=_motif
    fi
    if [ "$compoption" = "2" ]
    then
      selectdone=1
      GUITARGET=xview
      GUISUFFIX=_ol
    fi
  done
}

# Select a target
select_dir()
{
  echo ""
  echo "Select wxWindows directory"
  echo "--------------------------"
  echo ""
  echo "Current directory: " $WXDIR
  echo ""
  echo "New directory: (return for existing value):"
  read inp
  if [ "$inp" != "" ]
  then
    WXDIR=$inp
  fi
}

### View manual ###

view_manual()
{
  if [ ! -d $WXDIR ]
  then
    echo "Sorry -- you must unarchive the distribution before you can"
    echo "look at the manual."
  else
    manoption='none'
    while [ "$manoption" != "0" ]
    do
      echo
      echo "View wxWindows documentation"
      echo "----------------------------"
      echo "1) The installation instructions, using "$MYPAGER
      echo "2) readme.txt, using "$MYPAGER
      echo "3) The change log, using "$MYPAGER
      echo "4) The PostScript User Manual, using "$POSTSCRIPTVIEWER
      echo "5) The PostScript Reference Manual, using "$POSTSCRIPTVIEWER
      echo "6) The HTML manual hierarchy, using $HTMLVIEWER"
      echo "--------------------"
      echo "0) Quit."
      echo
      read manoption

      if [ "$manoption" = "1" ]
      then
        if [ -f $WXDIR"/install/install.txt" ]
        then
          $MYPAGER $WXDIR/install/install.txt
        else
          if [ -f "install.txt" ]
          then
            $MYPAGER "install.txt"
          else
            if [ -f $WXDIR/"install.txt" ]
            then
              $MYPAGER $WXDIR/"install.txt"
            else
              echo
              echo "Sorry, cannot find install.txt. Perhaps you did not ftp"
              echo "it along with the archives, and/or you haven't unarchived"
              echo "the sources yet. Please press return to continue."
              echo
              read ans
            fi
          fi
        fi
      fi
      if [ "$manoption" = "2" ]
      then
        if [ -f $WXDIR"/docs/readme.txt" ]
        then
          $MYPAGER $WXDIR/docs/readme.txt
        else
          if [ -f "readme.txt" ]
          then
            $MYPAGER "readme.txt"
          else
            if [ -f $WXDIR/"readme.txt" ]
            then
              $MYPAGER $WXDIR/"readme.txt"
            else
              echo
              echo "Sorry, cannot find readme.txt. Perhaps you did not ftp"
              echo "it along with the archives, and/or you haven't unarchived"
              echo "the sources yet. Please press return to continue."
              echo
              read ans
            fi
          fi
        fi
      fi
      if [ "$manoption" = "3" ]
      then
        if [ -f $WXDIR"/docs/changes.txt" ]
        then
          $MYPAGER $WXDIR/docs/changes.txt
        else
          if [ -f "changes.txt" ]
          then
            $MYPAGER "changes.txt"
          else
            if [ -f $WXDIR/"changes.txt" ]
            then
              $MYPAGER $WXDIR/"changes.txt"
            else
              echo
              echo "Sorry, cannot find changes.txt. Perhaps you did not ftp"
              echo "it along with the archives, and/or you haven't unarchived"
              echo "the sources yet. Please press return to continue."
              echo
              read ans
            fi
          fi
        fi
      fi
      if [ "$manoption" = "4" ]
      then
        $POSTSCRIPTVIEWER $WXDIR/docs/ps/manual.ps
      fi
      if [ "$manoption" = "5" ]
      then
        $POSTSCRIPTVIEWER $WXDIR/docs/ps/referenc.ps
      fi
      if [ "$manoption" = "6" ]
      then
          $HTMLVIEWER $WXDIR"/docs/html/index.htm"
      fi
    done
  fi
}

preliminary_notes()
{
  selectdone1=0
  ans="n"
  while [ "$ans" != "y" ]
  do
#    clear
    echo
    echo The GUI target is GUITARGET=$GUITARGET "(out of motif, xview)."
    echo
    echo The directory to install to is WXDIR=$WXDIR
    echo
    arg=$PLATFORM
    platform_description
    echo The selected platform is $arg
    echo
    echo "Please check these settings carefully."
    echo "Are they correct for your system? (y/n)"
    echo

    read ans

    if [ "$ans" != "y" ]
    then
      select_target
      select_dir
      select_platform
    fi
  done

    clear
    echo ""
    echo "Configuring wxWindows"
    echo "---------------------"
    echo ""
    echo "Most makefile settings to do with compilers, platforms and"
    echo "directories are kept in "$WXDIR"/src/make.env."
    echo ""
    echo "If you get a compiler error or warning, please strongly"
    echo "suspect this file, and if necessary edit it from the first"
    echo "option on the Main Menu."
    echo ""
    echo "Some suggestions for settings are contained in make.env,"
    echo "and further information is in "$WXDIR"/install/install.txt"
    echo "and the Frequently Asked Questions list,"
    echo $WXDIR"/docs/faq.txt or " $WXDIR"/docs/ps/faq.ps."
    echo
    echo wxWindows itself can be tailored to remove certain features
    echo "(such as PostScript support), or select library preferences, by"
    echo "editing the file "$WXDIR"/include/base/wx_setup.h."
    echo
    echo The wx_setup.h defaults are probably ok for now though.
    echo
    echo "Please press return to continue."
    read ans
    echo
    clear
    echo ""
    echo "Configuring wxWindows (cont'd)"
    echo "--------------------- --------"
    echo ""
    echo "By default (at least for GNU compiler use), debugging information"
    echo "is included. This will make the libraries and binaries"
    echo "a lot bigger than if you left debugging information out."
    echo
    echo "So you might want to set DEBUG to nothing in make.env"
    echo "to disable debugging information, at least for a first look at wxWindows."
    echo
    echo "Please press return to continue."
    read ans
    echo
    clear
    echo
    echo "You may wish to choose 'View documentation' now..."
}

  ############# MAIN BIT OF THE SCRIPT #################
  clear
  echo
  echo "-------------------------------------------"
  echo "Welcome to the wxWindows 1.67 installation."
  echo "-------------------------------------------"
  echo
  echo "This script will install from the archives:"
  echo ""
  echo "  "$ARCHIVE"_1/2.tgz"
  echo ""
  echo "and, if present, HTML and PostScript archives."
  echo ""
  echo "This installation is best done from a new directory where"
  echo "wxWindows will be installed, and which contains the .tgz files."
  echo "For example, ~/wx."
  preliminary_notes

  useroption='none'
  while [ "$useroption" != "0" ]
  do
    echo
    echo "wxWindows Installation Main Menu"
    echo "--------------------------------"
    echo
    echo " 1) Install from archive."
    echo " 2) Make main wxWindows library."
    echo " 3) Make a peripheral component."
    echo " 4) Make a sample."
    echo " 5) Make absolutely everything."
    echo " 6) Run a sample."
    echo " 7) View documentation."
    echo " 8) Clean objects/binaries, saving space."
    echo " 9) Remove wxWindows components from disk."
    echo "10) Edit make.env."
    echo "-----------------------------------"
    echo " 0) Exit from installation."
    echo
    read useroption

    if [ "$useroption" = "1" ]
    then
      install_from_archive
    fi
    if [ "$useroption" = "2" ]
    then
      make_main_library
    fi
    if [ "$useroption" = "3" ]
    then
      make_peripheral_components
    fi
    if [ "$useroption" = "4" ]
    then
      make_samples
    fi
    if [ "$useroption" = "5" ]
    then
      make_all
    fi
    if [ "$useroption" = "6" ]
    then
      run_samples
    fi
    if [ "$useroption" = "7" ]
    then
      view_manual
    fi
    if [ "$useroption" = "8" ]
    then
      clean_components
    fi
    if [ "$useroption" = "9" ]
    then
      remove_components
    fi
    if [ "$useroption" = "10" ]
    then
      edit_make_env
    fi
  done
  clear
  echo ""
  echo "Goodbye! I hope your wxWindows installation was successful."
  echo ""
  echo "You can subscribe to the mailing list wxwin-users"
  echo "for further assistance from experienced users."
  echo ""
  echo "Information is also available via the World Wide Web at:"
  echo ""
  echo "http://web.ukonline.co.uk/julian.smart/wxwin"
  echo ""
  echo "If all else fails, please contact me, Julian Smart, at:"
  echo ""
  echo "julian.smart@ukonline.co.uk"
  echo ""
  echo "If you have any suggestions, bug reports or patches,"
  echo "please email me at the above address."
  echo ""


