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