]>
Commit | Line | Data |
---|---|---|
9e860d54 | 1 | #! /usr/bin/env bash |
6a161fa9 | 2 | |
3 | set -e | |
4 | ||
35b90906 CW |
5 | if [ ! -e grub-core/lib/gnulib/stdlib.in.h ]; then |
6 | echo "Gnulib not yet bootstrapped; run ./bootstrap instead." >&2 | |
7 | exit 1 | |
8 | fi | |
9 | ||
be41c1cf JM |
10 | # Set ${PYTHON} to plain 'python' if not set already |
11 | : ${PYTHON:=python} | |
12 | ||
18dd6b47 VS |
13 | export LC_COLLATE=C |
14 | unset LC_ALL | |
15 | ||
f39f1ec5 | 16 | find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' ! -ipath './gnulib/*' ! -ipath './grub-core/lib/gnulib/*' |sort > po/POTFILES.in |
273349fe | 17 | find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in |
965fa829 | 18 | |
297f0c2b | 19 | echo "Importing unicode..." |
be41c1cf | 20 | ${PYTHON} util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c |
297f0c2b | 21 | |
a60f6ee1 | 22 | echo "Importing libgcrypt..." |
be41c1cf | 23 | ${PYTHON} util/import_gcry.py grub-core/lib/libgcrypt/ grub-core |
5e3b8dcb | 24 | sed -n -f util/import_gcrypth.sed < grub-core/lib/libgcrypt/src/gcrypt.h.in > include/grub/gcrypt/gcrypt.h |
4d7219f9 VS |
25 | if [ -f include/grub/gcrypt/g10lib.h ]; then |
26 | rm include/grub/gcrypt/g10lib.h | |
27 | fi | |
28 | if [ -d grub-core/lib/libgcrypt-grub/mpi/generic ]; then | |
29 | rm -rf grub-core/lib/libgcrypt-grub/mpi/generic | |
30 | fi | |
ae66efc6 | 31 | cp grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10lib.h |
5e3b8dcb VS |
32 | cp -R grub-core/lib/libgcrypt/mpi/generic grub-core/lib/libgcrypt-grub/mpi/generic |
33 | ||
34 | for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul3.c mpih-lshift.c mpih-rshift.c; do | |
740201f3 | 35 | if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ] || [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then |
4d7219f9 VS |
36 | rm grub-core/lib/libgcrypt-grub/mpi/"$x" |
37 | fi | |
ae66efc6 | 38 | cp grub-core/lib/libgcrypt-grub/mpi/generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x" |
5e3b8dcb | 39 | done |
0ef45b93 | 40 | |
ab4f1501 | 41 | echo "Generating Automake input..." |
e1fd1939 CW |
42 | |
43 | # Automake doesn't like including files from a path outside the project. | |
44 | rm -f contrib grub-core/contrib | |
45 | if [ "x${GRUB_CONTRIB}" != x ]; then | |
46 | [ "${GRUB_CONTRIB}" = contrib ] || ln -s "${GRUB_CONTRIB}" contrib | |
47 | [ "${GRUB_CONTRIB}" = grub-core/contrib ] || ln -s ../contrib grub-core/contrib | |
48 | fi | |
49 | ||
dcd73ec0 | 50 | UTIL_DEFS='Makefile.util.def Makefile.utilgcry.def' |
e1fd1939 CW |
51 | CORE_DEFS='grub-core/Makefile.core.def grub-core/Makefile.gcry.def' |
52 | ||
53 | for extra in contrib/*/Makefile.util.def; do | |
54 | if test -e "$extra"; then | |
55 | UTIL_DEFS="$UTIL_DEFS $extra" | |
56 | fi | |
57 | done | |
58 | ||
59 | for extra in contrib/*/Makefile.core.def; do | |
60 | if test -e "$extra"; then | |
61 | CORE_DEFS="$CORE_DEFS $extra" | |
62 | fi | |
63 | done | |
64 | ||
be41c1cf JM |
65 | ${PYTHON} gentpl.py $UTIL_DEFS > Makefile.util.am |
66 | ${PYTHON} gentpl.py $CORE_DEFS > grub-core/Makefile.core.am | |
e1fd1939 CW |
67 | |
68 | for extra in contrib/*/Makefile.common; do | |
69 | if test -e "$extra"; then | |
70 | echo "include $extra" >> Makefile.util.am | |
71 | echo "include $extra" >> grub-core/Makefile.core.am | |
72 | fi | |
73 | done | |
74 | ||
75 | for extra in contrib/*/Makefile.util.common; do | |
76 | if test -e "$extra"; then | |
77 | echo "include $extra" >> Makefile.util.am | |
78 | fi | |
79 | done | |
80 | ||
81 | for extra in contrib/*/Makefile.core.common; do | |
82 | if test -e "$extra"; then | |
83 | echo "include $extra" >> grub-core/Makefile.core.am | |
84 | fi | |
85 | done | |
3d9d3542 | 86 | |
a60f6ee1 | 87 | echo "Saving timestamps..." |
8c411768 | 88 | echo timestamp > stamp-h.in |
6a161fa9 | 89 | |
35b90906 CW |
90 | if [ -z "$FROM_BOOTSTRAP" ]; then |
91 | # Unaided autoreconf is likely to install older versions of many files | |
92 | # than the ones provided by Gnulib, but in most cases this won't matter | |
93 | # very much. This mode is provided so that you can run ./autogen.sh to | |
94 | # regenerate the GRUB build system in an unpacked release tarball (perhaps | |
95 | # after patching it), even on systems that don't have access to | |
96 | # gnulib.git. | |
97 | echo "Running autoreconf..." | |
98 | cp -a INSTALL INSTALL.grub | |
99 | autoreconf -vif | |
100 | mv INSTALL.grub INSTALL | |
101 | fi | |
102 | ||
6a161fa9 | 103 | exit 0 |