#!/bin/sh
#
# Script for patch and build. See notes below.
#
# Usage:
#		sh compile
# or
#		./compile

if ls grub-0.95 > /dev/null 2> /dev/null ; then
	echo grub-0.95 already exists. Please remove it first. exit...
	exit 1
fi
ls grub-0.95.tar.gz || ls ../grub-0.95.tar.gz || exit $?
ls grub-0.95-patch1-startups  || exit $?
ls grub-0.95-patch2-findroot  || exit $?
ls grub-0.95-patch3-ntfs      || exit $?
ls grub-0.95-patch4-emulation || exit $?
ls grub-0.95-patch5-splash    || exit $?
ls grub-0.95-patch6-scdrom    || exit $?
ls grub-0.95-patch7-bioscdrom || exit $?
tar -xzf grub-0.95.tar.gz || tar -xzf ../grub-0.95.tar.gz || exit $?
cd grub-0.95 || exit $?
patch -p1 < ../grub-0.95-patch1-startups  || exit $?
patch -p1 < ../grub-0.95-patch2-findroot  || exit $?
patch -p1 < ../grub-0.95-patch3-ntfs      || exit $?
patch -p1 < ../grub-0.95-patch4-emulation || exit $?
patch -p1 < ../grub-0.95-patch5-splash    || exit $?
patch -p1 < ../grub-0.95-patch6-scdrom    || exit $?
patch -p1 < ../grub-0.95-patch7-bioscdrom || exit $?
autoconf || exit $?
aclocal  || exit $?
automake || exit $?
#
# patch2-findroot now includes a preset menu (by Chris Semler. Thanks!)
# FINDROOT has been merged into FIND. Example:
#
#	find --set-root /boot/grub/menu.lst
#
./configure --enable-preset-menu=preset_menu.lst || ./configure || exit $?
make || exit $?
exit

patch1 is for booting via DOS/NT/LILO/GRUB/KEXEC.
patch2 is optional. It adds an option '--set-root' for FIND after patch1.
patch3 is optional. It adds NTFS support after patch2.
patch4 is optional. It adds disk emulation after patch3.
patch5 is optional. It adds splash image support after patch4.
patch6 is experimental. It adds atapi cdrom support after patch5.
patch7 is initiative. It adds bios cdrom routine support after patch6.

This assumes autoconf-2.59(or later) and automake-1.8.5(or later) are installed on your system. Someone told me that the recent autoconf/automake cannot work.

For more information on disk-emulation and DOS/NT/LILO/GRUB/KEXEC boot-method, go to the GRUB for DOS page at
http://newdos.yginfo.net/grubdos.htm
http://grub4dos.sourceforge.net/

