]> git.proxmox.com Git - grub2.git/blame - autogen.sh
Release 2.06-13+deb12u1
[grub2.git] / autogen.sh
CommitLineData
9e860d54 1#! /usr/bin/env bash
6a161fa9 2
3set -e
4
35b90906
CW
5if [ ! -e grub-core/lib/gnulib/stdlib.in.h ]; then
6 echo "Gnulib not yet bootstrapped; run ./bootstrap instead." >&2
7 exit 1
8fi
9
be41c1cf
JM
10# Set ${PYTHON} to plain 'python' if not set already
11: ${PYTHON:=python}
12
18dd6b47
VS
13export LC_COLLATE=C
14unset LC_ALL
15
f39f1ec5 16find . -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 17find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
965fa829 18
297f0c2b 19echo "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 22echo "Importing libgcrypt..."
be41c1cf 23${PYTHON} util/import_gcry.py grub-core/lib/libgcrypt/ grub-core
5e3b8dcb 24sed -n -f util/import_gcrypth.sed < grub-core/lib/libgcrypt/src/gcrypt.h.in > include/grub/gcrypt/gcrypt.h
4d7219f9
VS
25if [ -f include/grub/gcrypt/g10lib.h ]; then
26 rm include/grub/gcrypt/g10lib.h
27fi
28if [ -d grub-core/lib/libgcrypt-grub/mpi/generic ]; then
29 rm -rf grub-core/lib/libgcrypt-grub/mpi/generic
30fi
ae66efc6 31cp grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10lib.h
5e3b8dcb
VS
32cp -R grub-core/lib/libgcrypt/mpi/generic grub-core/lib/libgcrypt-grub/mpi/generic
33
34for 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 39done
0ef45b93 40
ab4f1501 41echo "Generating Automake input..."
e1fd1939
CW
42
43# Automake doesn't like including files from a path outside the project.
44rm -f contrib grub-core/contrib
45if [ "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
48fi
49
dcd73ec0 50UTIL_DEFS='Makefile.util.def Makefile.utilgcry.def'
e1fd1939
CW
51CORE_DEFS='grub-core/Makefile.core.def grub-core/Makefile.gcry.def'
52
53for extra in contrib/*/Makefile.util.def; do
54 if test -e "$extra"; then
55 UTIL_DEFS="$UTIL_DEFS $extra"
56 fi
57done
58
59for extra in contrib/*/Makefile.core.def; do
60 if test -e "$extra"; then
61 CORE_DEFS="$CORE_DEFS $extra"
62 fi
63done
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
68for 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
73done
74
75for extra in contrib/*/Makefile.util.common; do
76 if test -e "$extra"; then
77 echo "include $extra" >> Makefile.util.am
78 fi
79done
80
81for extra in contrib/*/Makefile.core.common; do
82 if test -e "$extra"; then
83 echo "include $extra" >> grub-core/Makefile.core.am
84 fi
85done
3d9d3542 86
a60f6ee1 87echo "Saving timestamps..."
8c411768 88echo timestamp > stamp-h.in
6a161fa9 89
35b90906
CW
90if [ -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
101fi
102
6a161fa9 103exit 0