]> git.proxmox.com Git - grub2.git/blob - autogen.sh
Add a commented-out GRUB_DISABLE_OS_PROBER section
[grub2.git] / autogen.sh
1 #! /usr/bin/env bash
2
3 set -e
4
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
10 # Set ${PYTHON} to plain 'python' if not set already
11 : ${PYTHON:=python}
12
13 export LC_COLLATE=C
14 unset LC_ALL
15
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
17 find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
18
19 echo "Importing unicode..."
20 ${PYTHON} util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
21
22 echo "Importing libgcrypt..."
23 ${PYTHON} util/import_gcry.py grub-core/lib/libgcrypt/ grub-core
24 sed -n -f util/import_gcrypth.sed < grub-core/lib/libgcrypt/src/gcrypt.h.in > include/grub/gcrypt/gcrypt.h
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
31 cp grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10lib.h
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
35 if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ] || [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
36 rm grub-core/lib/libgcrypt-grub/mpi/"$x"
37 fi
38 cp grub-core/lib/libgcrypt-grub/mpi/generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
39 done
40
41 echo "Generating Automake input..."
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
50 UTIL_DEFS='Makefile.util.def Makefile.utilgcry.def'
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
65 ${PYTHON} gentpl.py $UTIL_DEFS > Makefile.util.am
66 ${PYTHON} gentpl.py $CORE_DEFS > grub-core/Makefile.core.am
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
86
87 echo "Saving timestamps..."
88 echo timestamp > stamp-h.in
89
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
103 exit 0