Merge branch 'new-autogen'

This commit is contained in:
Colin Watson 2013-11-27 10:57:27 +00:00
commit cf8c80ff77
7 changed files with 618 additions and 401 deletions

1
.gitignore vendored
View file

@ -159,7 +159,6 @@ GPATH
GRTAGS GRTAGS
GSYMS GSYMS
GTAGS GTAGS
Makefile.tpl
compile compile
depcomp depcomp
mdate-sh mdate-sh

View file

@ -1,3 +1,9 @@
2013-11-27 Colin Watson <cjwatson@ubuntu.com>
Generate Makefile.*.am directly from gentpl.py, eliminating the use
of Autogen. The Autogen definitions files remain intact as they
offer a useful abstraction.
2013-11-27 Colin Watson <cjwatson@ubuntu.com> 2013-11-27 Colin Watson <cjwatson@ubuntu.com>
Add grub_util_disable_fd_syncs call to turn grub_util_fd_sync calls Add grub_util_disable_fd_syncs call to turn grub_util_fd_sync calls

View file

@ -55,7 +55,6 @@ need the following.
* Python 2.5.2 or later * Python 2.5.2 or later
* Autoconf 2.60 or later * Autoconf 2.60 or later
* Automake 1.10.1 or later * Automake 1.10.1 or later
* Autogen 5.10 or later
Prerequisites for make-check: Prerequisites for make-check:

View file

@ -8,8 +8,6 @@ unset LC_ALL
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 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
find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
autogen --version >/dev/null || exit 1
echo "Importing unicode..." echo "Importing unicode..."
python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
@ -32,10 +30,7 @@ for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul
ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x" ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
done done
echo "Creating Makefile.tpl..." echo "Generating Automake input..."
python gentpl.py | sed -e '/^$/{N;/^\n$/D;}' > Makefile.tpl
echo "Running autogen..."
# Automake doesn't like including files from a path outside the project. # Automake doesn't like including files from a path outside the project.
rm -f contrib grub-core/contrib rm -f contrib grub-core/contrib
@ -59,8 +54,8 @@ for extra in contrib/*/Makefile.core.def; do
fi fi
done done
cat $UTIL_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > Makefile.util.am python gentpl.py $UTIL_DEFS > Makefile.util.am
cat $CORE_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > grub-core/Makefile.core.am python gentpl.py $CORE_DEFS > grub-core/Makefile.core.am
for extra in contrib/*/Makefile.common; do for extra in contrib/*/Makefile.common; do
if test -e "$extra"; then if test -e "$extra"; then

View file

@ -131,20 +131,15 @@ EXTRA_DIST =
CLEANFILES = CLEANFILES =
BUILT_SOURCES = BUILT_SOURCES =
# Rules for autogen definition files # Rules for Automake input
.PRECIOUS: $(top_srcdir)/Makefile.tpl
$(top_srcdir)/Makefile.tpl: $(top_srcdir)/gentpl.py
python $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
mv $@.new $@
.PRECIOUS: $(top_srcdir)/Makefile.util.am .PRECIOUS: $(top_srcdir)/Makefile.util.am
$(top_srcdir)/Makefile.util.am: $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def $(top_srcdir)/Makefile.tpl $(top_srcdir)/Makefile.util.am: $(top_srcdir)/gentpl.py $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def
cat $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def | autogen -T $(top_srcdir)/Makefile.tpl | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1) python $^ > $@.new || (rm -f $@.new; exit 1)
mv $@.new $@ mv $@.new $@
.PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am .PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am
$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def $(top_srcdir)/Makefile.tpl $(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/gentpl.py $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def
if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi
cat $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def | autogen -T $(top_srcdir)/Makefile.tpl | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1) python $^ > $@.new || (rm -f $@.new; exit 1)
mv $@.new $@ mv $@.new $@

View file

@ -2,7 +2,6 @@ EXTRA_DIST += autogen.sh
EXTRA_DIST += geninit.sh EXTRA_DIST += geninit.sh
EXTRA_DIST += gentpl.py EXTRA_DIST += gentpl.py
EXTRA_DIST += Makefile.tpl
EXTRA_DIST += Makefile.util.def EXTRA_DIST += Makefile.util.def
EXTRA_DIST += Makefile.utilgcry.def EXTRA_DIST += Makefile.utilgcry.def

984
gentpl.py

File diff suppressed because it is too large Load diff