Fix handling of build-time grub-bin2h and grub-mkfont when doing

full Canadian cross. Tested with build=x86_64, host=arm,
	target=ppc-ieee1275.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-08-14 10:56:55 +02:00
parent 816719c8d4
commit 7c9d0c39af
9 changed files with 143 additions and 149 deletions

View file

@ -1,3 +1,9 @@
2013-08-14 Vladimir Serbinenko <phcoder@gmail.com>
Fix handling of build-time grub-bin2h and grub-mkfont when doing
full Canadian cross. Tested with build=x86_64, host=arm,
target=ppc-ieee1275.
2013-08-14 Vladimir Serbinenko <phcoder@gmail.com> 2013-08-14 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Error if no $BUILD_CC could be found. * configure.ac: Error if no $BUILD_CC could be found.

View file

@ -60,26 +60,30 @@ grub_fstest_init.c: grub_fstest_init.lst $(top_srcdir)/geninit.sh
sh $(top_srcdir)/geninit.sh `cat $<` > $@ || (rm -f $@; exit 1) sh $(top_srcdir)/geninit.sh `cat $<` > $@ || (rm -f $@; exit 1)
CLEANFILES += grub_fstest_init.c CLEANFILES += grub_fstest_init.c
if COND_GRUB_MKFONT
if COND_HAVE_FONT_SOURCE if COND_HAVE_FONT_SOURCE
pkgdata_DATA += unicode.pf2 ascii.pf2 euro.pf2 ascii.h widthspec.h pkgdata_DATA += unicode.pf2 ascii.pf2 euro.pf2 ascii.h widthspec.h
endif endif
endif
starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0 starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0
build-grub-mkfont: util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/argp_common.c grub-core/kern/emu/misc.c util/misc.c grub-core/gnulib/progname.c
$(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -I$(top_srcdir)/grub-core/gnulib -DGRUB_MKFONT=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) $(LIBINTL)
build-grub-bin2h: util/bin2h.c
$(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $<
if COND_STARFIELD if COND_STARFIELD
starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files) starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files)
dejavu_10.pf2: $(DJVU_FONT_SOURCE) grub-mkfont dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
./grub-mkfont -s 10 -o $@ $(DJVU_FONT_SOURCE) ./build-grub-mkfont -s 10 -o $@ $(DJVU_FONT_SOURCE)
dejavu_12.pf2: $(DJVU_FONT_SOURCE) grub-mkfont dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
./grub-mkfont -s 12 -o $@ $(DJVU_FONT_SOURCE) ./build-grub-mkfont -s 12 -o $@ $(DJVU_FONT_SOURCE)
dejavu_14.pf2: $(DJVU_FONT_SOURCE) grub-mkfont dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
./grub-mkfont -s 14 -o $@ $(DJVU_FONT_SOURCE) ./build-grub-mkfont -s 14 -o $@ $(DJVU_FONT_SOURCE)
dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) grub-mkfont dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
./grub-mkfont -b -s 14 -o $@ $(DJVU_FONT_SOURCE) ./build-grub-mkfont -b -s 14 -o $@ $(DJVU_FONT_SOURCE)
dejavu_16.pf2: $(DJVU_FONT_SOURCE) grub-mkfont dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
./grub-mkfont -s 16 -o $@ $(DJVU_FONT_SOURCE) ./build-grub-mkfont -s 16 -o $@ $(DJVU_FONT_SOURCE)
else else
starfield_DATA = starfield_DATA =
endif endif
@ -87,36 +91,36 @@ endif
EXTRA_DIST += $(starfield_theme_files) EXTRA_DIST += $(starfield_theme_files)
EXTRA_DIST += $(srcdir)/themes/starfield/src/slider_s.xcf $(srcdir)/themes/starfield/src/slider_n.xcf $(srcdir)/themes/starfield/src/slider_c.xcf $(srcdir)/themes/starfield/src/blob_nw.xcf $(srcdir)/themes/starfield/src/bootmenu/center.xcf $(srcdir)/themes/starfield/src/bootmenu/corner.xcf $(srcdir)/themes/starfield/src/bootmenu/side.xcf $(srcdir)/themes/starfield/src/terminalbox/side.xcf $(srcdir)/themes/starfield/src/terminalbox/corner.xcf $(srcdir)/themes/starfield/src/terminalbox/center.xcf EXTRA_DIST += $(srcdir)/themes/starfield/src/slider_s.xcf $(srcdir)/themes/starfield/src/slider_n.xcf $(srcdir)/themes/starfield/src/slider_c.xcf $(srcdir)/themes/starfield/src/blob_nw.xcf $(srcdir)/themes/starfield/src/bootmenu/center.xcf $(srcdir)/themes/starfield/src/bootmenu/corner.xcf $(srcdir)/themes/starfield/src/bootmenu/side.xcf $(srcdir)/themes/starfield/src/terminalbox/side.xcf $(srcdir)/themes/starfield/src/terminalbox/corner.xcf $(srcdir)/themes/starfield/src/terminalbox/center.xcf
unicode.pf2: $(FONT_SOURCE) grub-mkfont unicode.pf2: $(FONT_SOURCE) build-grub-mkfont
./grub-mkfont -o $@ $(FONT_SOURCE) ./build-grub-mkfont -o $@ $(FONT_SOURCE)
CLEANFILES += unicode.pf2 CLEANFILES += unicode.pf2
# Arrows and lines are needed to draw the menu, so always include them # Arrows and lines are needed to draw the menu, so always include them
UNICODE_ARROWS=0x2190-0x2193 UNICODE_ARROWS=0x2190-0x2193
UNICODE_LINES=0x2501-0x251B UNICODE_LINES=0x2501-0x251B
ascii.pf2: $(FONT_SOURCE) grub-mkfont ascii.pf2: $(FONT_SOURCE) build-grub-mkfont
./grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) ./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES)
CLEANFILES += ascii.pf2 CLEANFILES += ascii.pf2
euro.pf2: $(FONT_SOURCE) grub-mkfont euro.pf2: $(FONT_SOURCE) build-grub-mkfont
./grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES) ./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES)
CLEANFILES += euro.pf2 CLEANFILES += euro.pf2
ascii.bitmaps: $(FONT_SOURCE) grub-mkfont ascii.bitmaps: $(FONT_SOURCE) build-grub-mkfont
./grub-mkfont --ascii-bitmaps -o $@ $(FONT_SOURCE) ./build-grub-mkfont --ascii-bitmaps -o $@ $(FONT_SOURCE)
CLEANFILES += ascii.bitmaps CLEANFILES += ascii.bitmaps
ascii.h: ascii.bitmaps grub-bin2h ascii.h: ascii.bitmaps build-grub-bin2h
./grub-bin2h ascii_bitmaps < $< > $@ ./build-grub-bin2h ascii_bitmaps < $< > $@
CLEANFILES += ascii.h $(top_builddir)/grub-core/include/ascii.h CLEANFILES += ascii.h $(top_builddir)/grub-core/include/ascii.h
widthspec.bin: $(FONT_SOURCE) grub-mkfont widthspec.bin: $(FONT_SOURCE) build-grub-mkfont
./grub-mkfont --width-spec -o $@ $(FONT_SOURCE) ./build-grub-mkfont --width-spec -o $@ $(FONT_SOURCE)
CLEANFILES += widthspec.bin CLEANFILES += widthspec.bin
widthspec.h: widthspec.bin grub-bin2h widthspec.h: widthspec.bin build-grub-bin2h
./grub-bin2h widthspec < $< > $@ ./build-grub-bin2h widthspec < $< > $@
CLEANFILES += widthspec.h CLEANFILES += widthspec.h
# Install config.h into platformdir # Install config.h into platformdir

View file

@ -148,17 +148,6 @@ library = {
common = grub-core/lib/xzembed/xz_dec_stream.c; common = grub-core/lib/xzembed/xz_dec_stream.c;
}; };
program = {
name = grub-bin2h;
common = util/bin2h.c;
ldadd = libgrubmods.a;
ldadd = libgrubgcry.a;
ldadd = libgrubkern.a;
ldadd = grub-core/gnulib/libgnu.a;
ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
installdir = noinst;
};
program = { program = {
name = grub-mkimage; name = grub-mkimage;
mansection = 1; mansection = 1;
@ -292,15 +281,15 @@ program = {
common = util/grub-mkfont.c; common = util/grub-mkfont.c;
common = grub-core/unidata.c; common = grub-core/unidata.c;
common = grub-core/kern/emu/argp_common.c; common = grub-core/kern/emu/argp_common.c;
common = grub-core/kern/emu/misc.c;
common = util/misc.c;
common = grub-core/gnulib/progname.c;
cflags = '$(freetype_cflags)'; cflags = '$(freetype_cflags)';
cppflags = '-DGRUB_MKFONT=1';
ldadd = libgrubmods.a;
ldadd = libgrubgcry.a;
ldadd = libgrubkern.a;
ldadd = grub-core/gnulib/libgnu.a;
ldadd = '$(freetype_libs)'; ldadd = '$(freetype_libs)';
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; ldadd = '$(LIBINTL)';
condition = COND_GRUB_MKFONT; condition = COND_GRUB_MKFONT;
}; };

View file

@ -59,6 +59,7 @@ CPPFLAGS_DEFAULT += -I$(top_builddir)/include
CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/include CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/include
CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/src/ CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/src/
CCASFLAGS_DEFAULT = $(CPPFLAGS_DEFAULT) -DASM_FILE=1 CCASFLAGS_DEFAULT = $(CPPFLAGS_DEFAULT) -DASM_FILE=1
BUILD_CPPFLAGS += $(CPPFLAGS_DEFAULT)
LDADD_KERNEL = LDADD_KERNEL =

View file

@ -73,6 +73,8 @@ if test "x$TARGET_CFLAGS" = x; then
TARGET_CFLAGS="$TARGET_CFLAGS -Os" TARGET_CFLAGS="$TARGET_CFLAGS -Os"
fi fi
BUILD_CPPFLAGS="$BUILD_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\""
# Default HOST_CPPFLAGS # Default HOST_CPPFLAGS
HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W" HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
@ -282,23 +284,6 @@ if test "x$YACC" = x; then
AC_MSG_ERROR([bison is not found]) AC_MSG_ERROR([bison is not found])
fi fi
FONT_SOURCE=
for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni /usr/share/fonts/truetype/unifont /usr/share/fonts/misc; do
if test -f "$dir/unifont.$ext"; then
FONT_SOURCE="$dir/unifont.$ext"
break 2
fi
done
done
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips); then
AC_MSG_ERROR([qemu and loongson ports need unifont])
fi
AC_SUBST([FONT_SOURCE])
AC_PROG_RANLIB AC_PROG_RANLIB
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_AWK AC_PROG_AWK
@ -438,6 +423,8 @@ else
fi fi
AC_SUBST(HOST_CC) AC_SUBST(HOST_CC)
AC_SUBST(BUILD_CC) AC_SUBST(BUILD_CC)
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(BUILD_CPPFLAGS)
AC_SUBST(TARGET_CC) AC_SUBST(TARGET_CC)
# Test the C compiler for the target environment. # Test the C compiler for the target environment.
@ -985,21 +972,62 @@ enable_grub_mkfont=yes
else else
enable_grub_mkfont=no enable_grub_mkfont=no
fi fi
if test x"$enable_grub_mkfont" = xno && test "x$platform" = xloongson; then
AC_MSG_ERROR([loongson port needs grub-mkfont])
fi
AC_SUBST([enable_grub_mkfont]) AC_SUBST([enable_grub_mkfont])
AC_SUBST([freetype_cflags]) AC_SUBST([freetype_cflags])
AC_SUBST([freetype_libs]) AC_SUBST([freetype_libs])
SAVED_CC="$CC"
SAVED_CFLAGS="$CFLAGS"
SAVED_CPPFLAGS="$CPPFLAGS"
CC="$BUILD_CC"
CFLAGS="$BUILD_CFLAGS"
CPPFLAGS="$SAVED_CPPFLAGS"
if test x"$grub_build_mkfont_excuse" = x ; then
# Check for freetype libraries.
AC_CHECK_TOOLS([BUILD_FREETYPE], [freetype-config])
if test "x$BUILD_FREETYPE" = x ; then
grub_build_mkfont_excuse=["need freetype2 library"]
fi
fi
if test x"$grub_build_mkfont_excuse" = x ; then
# Check for freetype libraries.
build_freetype_cflags=`$BUILD_FREETYPE --cflags`
build_freetype_libs=`$BUILD_FREETYPE --libs`
SAVED_CPPFLAGS_2="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $build_freetype_cflags"
AC_CHECK_HEADERS([ft2build.h], [],
[grub_build_mkfont_excuse=["need freetype2 headers"]])
CPPFLAGS="$SAVED_CPPFLAGS_2"
fi
if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then
AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled])
fi
if test x"$grub_build_mkfont_excuse" = x ; then
enable_build_grub_mkfont=yes
else
enable_build_grub_mkfont=no
starfield_excuse="No build-time grub-mkfont"
FONT_SOURCE=
fi
if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips ); then
AC_MSG_ERROR([loongson port needs build-time grub-mkfont])
fi
AC_SUBST([build_freetype_cflags])
AC_SUBST([build_freetype_libs])
CC="$SAVED_CC"
CFLAGS="$SAVED_CFLAGS"
CPPFLAGS="$SAVED_CPPFLAGS"
DJVU_FONT_SOURCE= DJVU_FONT_SOURCE=
starfield_excuse= starfield_excuse=
if test x$enable_grub_mkfont = xno; then
starfield_excuse="No grub-mkfont"
fi
if test x"$starfield_excuse" = x; then if test x"$starfield_excuse" = x; then
for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do
@ -1017,6 +1045,28 @@ fi
AC_SUBST([DJVU_FONT_SOURCE]) AC_SUBST([DJVU_FONT_SOURCE])
FONT_SOURCE=
for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni /usr/share/fonts/truetype/unifont /usr/share/fonts/misc; do
if test -f "$dir/unifont.$ext"; then
FONT_SOURCE="$dir/unifont.$ext"
break 2
fi
done
done
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips ); then
AC_MSG_ERROR([qemu and loongson ports need unifont])
fi
AC_SUBST([FONT_SOURCE])
if test x"$FONT_SOURCE" = x && test x"$DJVU_FONT_SOURCE" = x; then
grub_build_mkfont_excuse="no fonts"
fi
AC_ARG_ENABLE([grub-mount], AC_ARG_ENABLE([grub-mount],
[AS_HELP_STRING([--enable-grub-mount], [AS_HELP_STRING([--enable-grub-mount],
[build and install the `grub-mount' utility (default=guessed)])]) [build and install the `grub-mount' utility (default=guessed)])])
@ -1193,6 +1243,7 @@ AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes]) AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes]) AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes]) AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
AM_CONDITIONAL([COND_BUILD_GRUB_MKFONT], [test x$enable_build_grub_mkfont = xyes])
AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes]) AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes])
AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x]) AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x]) AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x])
@ -1306,11 +1357,17 @@ echo With libzfs support: Yes
else else
echo With libzfs support: No "($libzfs_excuse)" echo With libzfs support: No "($libzfs_excuse)"
fi fi
if [ x"$build_grub_mkfont_excuse" = x ]; then
echo Build-time grub-mkfont: Yes
if test "x$FONT_SOURCE" = x ; then if test "x$FONT_SOURCE" = x ; then
echo "Without unifont" echo "Without unifont"
else else
echo "With unifont from $FONT_SOURCE" echo "With unifont from $FONT_SOURCE"
fi fi
else
echo Build-time grub-mkfont: No "($build_grub_mkfont_excuse)"
echo "Without unifont (no build-time grub-mkfont)"
fi
if test "x$LIBLZMA" = x ; then if test "x$LIBLZMA" = x ; then
echo "Without liblzma (no support for XZ-compressed mips images)" echo "Without liblzma (no support for XZ-compressed mips images)"
else else

View file

@ -8,11 +8,9 @@ CC=$(TARGET_CC)
CPP=$(TARGET_CC) CPP=$(TARGET_CC)
CCAS=$(TARGET_CC) CCAS=$(TARGET_CC)
if COND_GRUB_MKFONT
if COND_HAVE_FONT_SOURCE if COND_HAVE_FONT_SOURCE
TARGET_CFLAGS += -DUSE_ASCII_FALLBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 TARGET_CFLAGS += -DUSE_ASCII_FALLBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1
endif endif
endif
MACHO2IMG=$(top_builddir)/grub-macho2img MACHO2IMG=$(top_builddir)/grub-macho2img
@ -32,7 +30,7 @@ CCASFLAGS_LIBRARY += $(CCASFLAGS_PLATFORM)
# gentrigtables # gentrigtables
gentrigtables: gentrigtables.c gentrigtables: gentrigtables.c
$(BUILD_CC) -o $@ -I$(top_srcdir)/include $(CPPFLAGS) $< -lm $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -lm
CLEANFILES += gentrigtables CLEANFILES += gentrigtables
# trigtables.c # trigtables.c
@ -151,11 +149,6 @@ if COND_mips_qemu_mips
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/serial.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/serial.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h

View file

@ -145,6 +145,7 @@ xstrdup (const char *str)
return newstr; return newstr;
} }
#ifndef GRUB_MKFONT
char * char *
xasprintf (const char *fmt, ...) xasprintf (const char *fmt, ...)
{ {
@ -158,6 +159,7 @@ xasprintf (const char *fmt, ...)
return result; return result;
} }
#endif
void void
grub_exit (void) grub_exit (void)

View file

@ -15,82 +15,19 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <config.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#define _GNU_SOURCE 1
#include <getopt.h>
#include "progname.h"
static struct option options[] =
{
{"help", no_argument, 0, 'h' },
{"version", no_argument, 0, 'V' },
{0, 0, 0, 0 }
};
static void __attribute__ ((noreturn))
usage (int status)
{
if (status)
fprintf (stderr,
"Try ``%s --help'' for more information.\n", program_name);
else
printf ("\
Usage: %s [OPTIONS] SYMBOL-NAME\n\
\n\
Convert a binary file to a C header.\n\
\n\
-h, --help display this message and exit\n\
-V, --version print version information and exit\n\
\n\
Report bugs to <%s>.\n\
", program_name, PACKAGE_BUGREPORT);
exit (status);
}
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
int b, i; int b, i;
char *sym; char *sym;
set_program_name (argv[0]); if (2 != argc)
return 1;
/* Check for options. */ sym = argv[1];
while (1)
{
int c = getopt_long (argc, argv, "snm:r:hVv", options, 0);
if (c == -1)
break;
else
switch (c)
{
case 'h':
usage (0);
break;
case 'V':
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
default:
usage (1);
break;
}
}
if (optind >= argc)
usage (1);
if (optind + 1 != argc)
usage (1);
sym = argv[optind];
b = getchar (); b = getchar ();
if (b == EOF) if (b == EOF)

View file

@ -850,7 +850,7 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file)
{ {
FILE *file; FILE *file;
grub_uint32_t leng; grub_uint32_t leng;
char style_name[20], *font_name; char style_name[20], *font_name, *ptr;
int offset; int offset;
struct grub_glyph_info *cur; struct grub_glyph_info *cur;
@ -885,8 +885,13 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file)
if (! style_name[0]) if (! style_name[0])
strcpy (style_name, " Regular"); strcpy (style_name, " Regular");
font_name = xasprintf ("%s %s %d", font_info->name, &style_name[1], font_name = xmalloc (strlen (font_info->name) + strlen (&style_name[1])
font_info->size); + 3 + 20);
ptr = stpcpy (font_name, font_info->name);
*ptr++ = ' ';
ptr = stpcpy (ptr, &style_name[1]);
*ptr++ = ' ';
snprintf (ptr, 20, "%d", font_info->size);
write_string_section (FONT_FORMAT_SECTION_NAMES_FONT_NAME, write_string_section (FONT_FORMAT_SECTION_NAMES_FONT_NAME,
font_name, &offset, file, output_file); font_name, &offset, file, output_file);
@ -1210,7 +1215,7 @@ main (int argc, char *argv[])
arguments.font_index, &ft_face); arguments.font_index, &ft_face);
if (err) if (err)
{ {
grub_printf (_("can't open file %s, index %d: error %d"), printf (_("can't open file %s, index %d: error %d"),
arguments.files[i], arguments.files[i],
arguments.font_index, err); arguments.font_index, err);
if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs)) if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs))