]>
Commit | Line | Data |
---|---|---|
9e860d54 | 1 | #! /usr/bin/env bash |
6a161fa9 | 2 | |
3 | set -e | |
4 | ||
18dd6b47 VS |
5 | export LC_COLLATE=C |
6 | unset LC_ALL | |
7 | ||
9ae393da | 8 | 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' |sort > po/POTFILES.in |
273349fe | 9 | find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in |
965fa829 | 10 | |
40a4a8a9 | 11 | autogen --version >/dev/null || exit 1 |
ff174dbe | 12 | |
297f0c2b BC |
13 | echo "Importing unicode..." |
14 | python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c | |
15 | ||
a60f6ee1 | 16 | echo "Importing libgcrypt..." |
6304d292 | 17 | python util/import_gcry.py grub-core/lib/libgcrypt/ grub-core |
5e3b8dcb | 18 | sed -n -f util/import_gcrypth.sed < grub-core/lib/libgcrypt/src/gcrypt.h.in > include/grub/gcrypt/gcrypt.h |
4d7219f9 VS |
19 | if [ -f include/grub/gcrypt/g10lib.h ]; then |
20 | rm include/grub/gcrypt/g10lib.h | |
21 | fi | |
22 | if [ -d grub-core/lib/libgcrypt-grub/mpi/generic ]; then | |
23 | rm -rf grub-core/lib/libgcrypt-grub/mpi/generic | |
24 | fi | |
5e3b8dcb VS |
25 | ln -s ../../../grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10lib.h |
26 | cp -R grub-core/lib/libgcrypt/mpi/generic grub-core/lib/libgcrypt-grub/mpi/generic | |
27 | ||
28 | 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 | 29 | if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ] || [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then |
4d7219f9 VS |
30 | rm grub-core/lib/libgcrypt-grub/mpi/"$x" |
31 | fi | |
5e3b8dcb VS |
32 | ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x" |
33 | done | |
0ef45b93 | 34 | |
3d9d3542 BC |
35 | echo "Creating Makefile.tpl..." |
36 | python gentpl.py | sed -e '/^$/{N;/^\n$/D;}' > Makefile.tpl | |
37 | ||
38 | echo "Running autogen..." | |
e1fd1939 CW |
39 | |
40 | # Automake doesn't like including files from a path outside the project. | |
41 | rm -f contrib grub-core/contrib | |
42 | if [ "x${GRUB_CONTRIB}" != x ]; then | |
43 | [ "${GRUB_CONTRIB}" = contrib ] || ln -s "${GRUB_CONTRIB}" contrib | |
44 | [ "${GRUB_CONTRIB}" = grub-core/contrib ] || ln -s ../contrib grub-core/contrib | |
45 | fi | |
46 | ||
dcd73ec0 | 47 | UTIL_DEFS='Makefile.util.def Makefile.utilgcry.def' |
e1fd1939 CW |
48 | CORE_DEFS='grub-core/Makefile.core.def grub-core/Makefile.gcry.def' |
49 | ||
50 | for extra in contrib/*/Makefile.util.def; do | |
51 | if test -e "$extra"; then | |
52 | UTIL_DEFS="$UTIL_DEFS $extra" | |
53 | fi | |
54 | done | |
55 | ||
56 | for extra in contrib/*/Makefile.core.def; do | |
57 | if test -e "$extra"; then | |
58 | CORE_DEFS="$CORE_DEFS $extra" | |
59 | fi | |
60 | done | |
61 | ||
62 | cat $UTIL_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > Makefile.util.am | |
63 | cat $CORE_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > grub-core/Makefile.core.am | |
64 | ||
65 | for extra in contrib/*/Makefile.common; do | |
66 | if test -e "$extra"; then | |
67 | echo "include $extra" >> Makefile.util.am | |
68 | echo "include $extra" >> grub-core/Makefile.core.am | |
69 | fi | |
70 | done | |
71 | ||
72 | for extra in contrib/*/Makefile.util.common; do | |
73 | if test -e "$extra"; then | |
74 | echo "include $extra" >> Makefile.util.am | |
75 | fi | |
76 | done | |
77 | ||
78 | for extra in contrib/*/Makefile.core.common; do | |
79 | if test -e "$extra"; then | |
80 | echo "include $extra" >> grub-core/Makefile.core.am | |
81 | fi | |
82 | done | |
3d9d3542 | 83 | |
a60f6ee1 | 84 | echo "Saving timestamps..." |
8c411768 | 85 | echo timestamp > stamp-h.in |
6a161fa9 | 86 | |
a60f6ee1 BC |
87 | echo "Running autoreconf..." |
88 | autoreconf -vi | |
6a161fa9 | 89 | exit 0 |