Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / autogen.sh
blobdb719cd1decaed9f75dfbe70a95087c9d0d9aacf
1 #! /usr/bin/env bash
3 set -e
5 export LC_CTYPE=C
6 export LC_COLLATE=C
7 unset LC_ALL
9 autogen --version >/dev/null || exit 1
11 echo "Importing unicode..."
12 python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
14 echo "Importing libgcrypt..."
15 python util/import_gcry.py grub-core/lib/libgcrypt/ grub-core
17 echo "Creating Makefile.tpl..."
18 python gentpl.py | sed -e '/^$/{N;/^\n$/D;}' > Makefile.tpl
20 echo "Running autogen..."
22 # Automake doesn't like including files from a path outside the project.
23 rm -f contrib grub-core/contrib
24 if [ "x${GRUB_CONTRIB}" != x ]; then
25 [ "${GRUB_CONTRIB}" = contrib ] || ln -s "${GRUB_CONTRIB}" contrib
26 [ "${GRUB_CONTRIB}" = grub-core/contrib ] || ln -s ../contrib grub-core/contrib
29 UTIL_DEFS='Makefile.util.def Makefile.utilgcry.def'
30 CORE_DEFS='grub-core/Makefile.core.def grub-core/Makefile.gcry.def'
32 for extra in contrib/*/Makefile.util.def; do
33 if test -e "$extra"; then
34 UTIL_DEFS="$UTIL_DEFS $extra"
36 done
38 for extra in contrib/*/Makefile.core.def; do
39 if test -e "$extra"; then
40 CORE_DEFS="$CORE_DEFS $extra"
42 done
44 cat $UTIL_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > Makefile.util.am
45 cat $CORE_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > grub-core/Makefile.core.am
47 for extra in contrib/*/Makefile.common; do
48 if test -e "$extra"; then
49 echo "include $extra" >> Makefile.util.am
50 echo "include $extra" >> grub-core/Makefile.core.am
52 done
54 for extra in contrib/*/Makefile.util.common; do
55 if test -e "$extra"; then
56 echo "include $extra" >> Makefile.util.am
58 done
60 for extra in contrib/*/Makefile.core.common; do
61 if test -e "$extra"; then
62 echo "include $extra" >> grub-core/Makefile.core.am
64 done
66 echo "Saving timestamps..."
67 echo timestamp > stamp-h.in
69 echo "Running autoreconf..."
70 autoreconf -vi
71 exit 0