This adds unifont.hex processing to the build system, when ever that file
is found, and generates/installs common pff files as detailed in
http://grub.enbug.org/gfxterm

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
2007-12-23  Robert Millan  <[EMAIL PROTECTED]>

	* configure.ac: Search for possible unifont.hex locations, and
	define UNIFONT_HEX if found.

	* Makefile.in (UNIFONT_HEX): Define variable.
	(DATA): Rename to ...
	(PKGLIB): ... this.  Update all users.
	(PKGDATA): New variable.
	(pkgdata_IMAGES): Rename to ...
	(pkglib_IMAGES): ... this. Update all users.
	(pkgdata_MODULES): Rename to ...
	(pkglib_MODULES): ... this. Update all users.
	(pkgdata_PROGRAMS): Rename to ...
	(pkglib_PROGRAMS): ... this. Update all users.
	(pkgdata_DATA): Rename to ...
	(pkglib_DATA): ... this. Update all users.
	(CLEANFILES): Redefine to `$(pkglib_DATA) $(pkgdata_DATA)'.
	(unicode.pff, ascii.pff): New rules.
	(all-local): Add `$(PKGDATA)' dependency.
	(install-local): Process `$(PKGDATA)'.

	* util/update-grub_lib.in (font_path): Search for *.pff files in
	a few more locations, including `${pkgdata}'.

diff -x '*.mk' -Nur grub2-1.95+20071223.old/conf/common.rmk grub2-1.95+20071223/conf/common.rmk
--- grub2-1.95+20071223.old/conf/common.rmk	2007-12-23 19:21:01.000000000 +0100
+++ grub2-1.95+20071223/conf/common.rmk	2007-12-23 19:22:07.000000000 +0100
@@ -79,7 +79,7 @@
 
 
 # Filing systems.
-pkgdata_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod		\
+pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod		\
 	ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod	\
 	affs.mod sfs.mod hfsplus.mod
 
@@ -154,7 +154,7 @@
 hfsplus_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # Partition maps.
-pkgdata_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod
+pkglib_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod
 
 # For amiga.mod
 amiga_mod_SOURCES = partmap/amiga.c
@@ -188,7 +188,7 @@
 
 # Special disk structures
 
-pkgdata_MODULES += raid.mod lvm.mod
+pkglib_MODULES += raid.mod lvm.mod
 
 # For raid.mod
 raid_mod_SOURCES = disk/raid.c
@@ -201,7 +201,7 @@
 lvm_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # Commands.
-pkgdata_MODULES += hello.mod boot.mod terminal.mod ls.mod	\
+pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod	\
 	cmp.mod cat.mod help.mod font.mod search.mod		\
 	loopback.mod configfile.mod				\
 	terminfo.mod test.mod blocklist.mod hexdump.mod
@@ -287,7 +287,7 @@
 hexdump_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # Misc.
-pkgdata_MODULES += gzio.mod elf.mod
+pkglib_MODULES += gzio.mod elf.mod
 
 # For elf.mod.
 elf_mod_SOURCES = kern/elf.c
diff -x '*.mk' -Nur grub2-1.95+20071223.old/conf/i386-efi.rmk grub2-1.95+20071223/conf/i386-efi.rmk
--- grub2-1.95+20071223.old/conf/i386-efi.rmk	2007-12-23 19:21:01.000000000 +0100
+++ grub2-1.95+20071223/conf/i386-efi.rmk	2007-12-23 19:22:07.000000000 +0100
@@ -76,7 +76,7 @@
 grub_install_SOURCES = util/i386/efi/grub-install.in
 
 # Modules.
-pkgdata_MODULES = kernel.mod normal.mod _chain.mod chain.mod \
+pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod \
 	_linux.mod linux.mod cpuid.mod
 
 # For kernel.mod.
diff -x '*.mk' -Nur grub2-1.95+20071223.old/conf/i386-linuxbios.rmk grub2-1.95+20071223/conf/i386-linuxbios.rmk
--- grub2-1.95+20071223.old/conf/i386-linuxbios.rmk	2007-12-23 19:21:01.000000000 +0100
+++ grub2-1.95+20071223/conf/i386-linuxbios.rmk	2007-12-23 19:22:07.000000000 +0100
@@ -5,7 +5,7 @@
 COMMON_LDFLAGS	= -nostdlib -static -lgcc
 
 # Images.
-pkgdata_PROGRAMS = kernel.elf
+pkglib_PROGRAMS = kernel.elf
 
 # For kernel.elf.
 kernel_elf_SOURCES = kern/i386/linuxbios/startup.S kern/i386/linuxbios/init.c \
@@ -95,7 +95,7 @@
 grub_emu_LDFLAGS = $(LIBCURSES)
 
 # Modules.
-pkgdata_MODULES = _linux.mod linux.mod normal.mod	\
+pkglib_MODULES = _linux.mod linux.mod normal.mod	\
 	_multiboot.mod multiboot.mod play.mod		\
 	cpuid.mod serial.mod ata.mod
 
diff -x '*.mk' -Nur grub2-1.95+20071223.old/conf/i386-pc.rmk grub2-1.95+20071223/conf/i386-pc.rmk
--- grub2-1.95+20071223.old/conf/i386-pc.rmk	2007-12-23 19:21:01.000000000 +0100
+++ grub2-1.95+20071223/conf/i386-pc.rmk	2007-12-23 19:22:07.000000000 +0100
@@ -5,7 +5,7 @@
 COMMON_LDFLAGS = -m32 -nostdlib
 
 # Images.
-pkgdata_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img
+pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img
 
 # For boot.img.
 boot_img_SOURCES = boot/i386/pc/boot.S
@@ -132,7 +132,7 @@
 grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in
 
 # Modules.
-pkgdata_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \
+pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \
 	_multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod	\
 	vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \
 	videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod ata.mod \
diff -x '*.mk' -Nur grub2-1.95+20071223.old/conf/powerpc-ieee1275.rmk grub2-1.95+20071223/conf/powerpc-ieee1275.rmk
--- grub2-1.95+20071223.old/conf/powerpc-ieee1275.rmk	2007-12-23 19:21:01.000000000 +0100
+++ grub2-1.95+20071223/conf/powerpc-ieee1275.rmk	2007-12-23 19:22:07.000000000 +0100
@@ -22,7 +22,7 @@
 	/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
 
 # Programs
-pkgdata_PROGRAMS = kernel.elf
+pkglib_PROGRAMS = kernel.elf
 
 # Utilities.
 bin_UTILITIES = grub-mkimage
@@ -101,7 +101,7 @@
 grub_install_SOURCES = util/powerpc/ieee1275/grub-install.in
 
 # Modules.
-pkgdata_MODULES = halt.mod \
+pkglib_MODULES = halt.mod \
 	_linux.mod \
 	linux.mod \
 	normal.mod \
diff -x '*.mk' -Nur grub2-1.95+20071223.old/conf/sparc64-ieee1275.rmk grub2-1.95+20071223/conf/sparc64-ieee1275.rmk
--- grub2-1.95+20071223.old/conf/sparc64-ieee1275.rmk	2007-12-23 19:21:01.000000000 +0100
+++ grub2-1.95+20071223/conf/sparc64-ieee1275.rmk	2007-12-23 19:22:07.000000000 +0100
@@ -26,7 +26,7 @@
 	/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
 
 # Programs
-pkgdata_PROGRAMS = kernel.elf
+pkglib_PROGRAMS = kernel.elf
 
 # Utilities.
 #bin_UTILITIES = grub-mkimage
@@ -78,7 +78,7 @@
 
 # Modules.
 #_linux.mod linux.mod
-pkgdata_MODULES = fat.mod ufs.mod ext2.mod minix.mod \
+pkglib_MODULES = fat.mod ufs.mod ext2.mod minix.mod \
 	hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \
 	boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \
 	pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \
diff -x '*.mk' -Nur grub2-1.95+20071223.old/configure.ac grub2-1.95+20071223/configure.ac
--- grub2-1.95+20071223.old/configure.ac	2007-12-23 19:21:01.000000000 +0100
+++ grub2-1.95+20071223/configure.ac	2007-12-23 19:22:07.000000000 +0100
@@ -103,6 +103,13 @@
   AC_MSG_ERROR([bison is not found])
 fi
 
+for file in /usr/share/unifont/unifont.hex ; do
+  if test -e $file ; then
+    AC_SUBST([UNIFONT_HEX], [$file])
+    break
+  fi
+done
+
 AC_PROG_INSTALL
 AC_PROG_AWK
 AC_PROG_MAKE_SET
diff -x '*.mk' -Nur grub2-1.95+20071223.old/Makefile.in grub2-1.95+20071223/Makefile.in
--- grub2-1.95+20071223.old/Makefile.in	2007-12-23 19:21:01.000000000 +0100
+++ grub2-1.95+20071223/Makefile.in	2007-12-23 19:22:07.000000000 +0100
@@ -75,6 +75,7 @@
 LIBCURSES = @LIBCURSES@
 LIBLZO = @LIBLZO@
 YACC = @YACC@
+UNIFONT_HEX = @UNIFONT_HEX@
 
 # Options.
 enable_grub_emu = @enable_grub_emu@
@@ -85,8 +86,9 @@
 	sparc64-ieee1275.rmk i386-efi.rmk)
 MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES))
 
-DATA = $(pkgdata_IMAGES) $(pkgdata_MODULES) $(pkgdata_PROGRAMS) \
-	$(pkgdata_DATA) $(lib_DATA)
+PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \
+	$(pkglib_DATA) $(lib_DATA)
+PKGDATA = $(pkgdata_DATA)
 PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES)
 SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(update-grub_SCRIPTS)
 
@@ -112,8 +114,8 @@
 
 ### General targets.
 
-CLEANFILES += moddep.lst command.lst fs.lst
-pkgdata_DATA += moddep.lst command.lst fs.lst
+CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA)
+pkglib_DATA += moddep.lst command.lst fs.lst
 moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk
 	cat $(DEFSYMFILES) /dev/null \
 	  | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \
@@ -125,18 +127,35 @@
 fs.lst: $(FSFILES)
 	cat $^ /dev/null | sort > $@
 
-all-local: $(PROGRAMS) $(DATA) $(SCRIPTS) $(MKFILES)
+ifeq (, $(UNIFONT_HEX))
+else
+pkgdata_DATA += unicode.pff ascii.pff
+unicode.pff: $(UNIFONT_HEX)
+	ruby $(srcdir)/util/unifont2pff.rb $(UNIFONT_HEX) > $@
+
+ascii.pff: $(UNIFONT_HEX)
+	ruby $(srcdir)/util/unifont2pff.rb 0-127 $(UNIFONT_HEX) > $@
+endif
+
+all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES)
 
 install: install-local
 
 install-local: all
 	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
-	@list='$(DATA)'; \
+	@list='$(PKGLIB)'; \
 	for file in $$list; do \
 	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
 	  dest="`echo $$file | sed 's,.*/,,'`"; \
 	  $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \
 	done
+	$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
+	@list='$(PKGDATA)'; \
+	for file in $$list; do \
+	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
+	  dest="`echo $$file | sed 's,.*/,,'`"; \
+	  $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \
+	done
 	$(mkinstalldirs) $(DESTDIR)$(bindir)
 	@list='$(bin_UTILITIES)'; for file in $$list; do \
 	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
@@ -182,11 +201,16 @@
 	$(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" install
 
 uninstall:
-	@list='$(DATA)'; \
+	@list='$(PKGLIB)'; \
 	for file in $$list; do \
 	  dest="`echo $$file | sed 's,.*/,,'`"; \
 	  rm -f $(DESTDIR)$(pkglibdir)/$$dest; \
 	done
+	@list='$(PKGDATA)'; \
+	for file in $$list; do \
+	  dest="`echo $$file | sed 's,.*/,,'`"; \
+	  rm -f $(DESTDIR)$(pkgdatadir)/$$dest; \
+	done
 	@list='$(bin_UTILITIES) $(bin_SCRIPTS)'; for file in $$list; do \
 	  dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
 	  rm -f $(DESTDIR)$(bindir)/$$dest; \
diff -x '*.mk' -Nur grub2-1.95+20071223.old/util/update-grub_lib.in grub2-1.95+20071223/util/update-grub_lib.in
--- grub2-1.95+20071223.old/util/update-grub_lib.in	2007-12-23 19:21:01.000000000 +0100
+++ grub2-1.95+20071223/util/update-grub_lib.in	2007-12-23 19:22:38.000000000 +0100
@@ -18,7 +18,9 @@
 
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
[EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
+pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`
 
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 
@@ -98,12 +100,15 @@
 
   # Prefer system path for space reasons (/boot/grub might be a very small
   # partition in case of OpenFirmware, etc).
-  for i in /usr/share/grub/unifont.pff /boot/grub/unifont.pff ; do
-    if path=`convert_system_path_to_grub_path $i` ; then
-      GRUB_FONT_PATH="${path}"
-      echo "${GRUB_FONT_PATH}"
-      return 0
-    fi
+  for dir in ${pkgdatadir} /usr/share/grub /boot/grub ; do
+    # Prefer complete fonts over incomplete ones.
+    for basename in unicode unifont ascii ; do
+      if path=`convert_system_path_to_grub_path ${dir}/${basename}.pff` ; then
+        GRUB_FONT_PATH="${path}"
+        echo "${GRUB_FONT_PATH}"
+        return 0
+      fi
+    done
   done
 
   return 1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to