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