From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GbebH-0007QO-QE for mharc-grub-devel@gnu.org; Sun, 22 Oct 2006 10:46:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GbebG-0007OG-2y for grub-devel@gnu.org; Sun, 22 Oct 2006 10:46:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GbebE-0007MB-Hk for grub-devel@gnu.org; Sun, 22 Oct 2006 10:46:52 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GbebE-0007M8-Bk for grub-devel@gnu.org; Sun, 22 Oct 2006 10:46:52 -0400 Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GbebE-0000HX-Cv for grub-devel@gnu.org; Sun, 22 Oct 2006 10:46:52 -0400 Received: from tschwinge by fencepost.gnu.org with local (Exim 4.34) id 1GbebD-00011F-Ko for grub-devel@gnu.org; Sun, 22 Oct 2006 10:46:51 -0400 Date: Sun, 22 Oct 2006 16:46:51 +0200 From: Thomas Schwinge To: grub-devel@gnu.org Message-ID: <20061022144651.GD6928@fencepost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yVhtmJPUSI46BTXb" Content-Disposition: inline X-Homepage: http://nic-nac-project.de/~schwinge/ User-Agent: Mutt/1.5.6+20040907i Subject: Conditionally building `grub-emu' X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Oct 2006 14:46:54 -0000 --yVhtmJPUSI46BTXb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello! On request / suggestion / whatever ;-) of Marco I created the following patch. Its origin: I was trying to build GRUB2 on a system where no (n)curses header files were installed (which configure even detected correctly, but didn't complain about it) and then the build stopped with an error when building `grub-emu''s object files. As `grub-emu' is considered to ``only'' be a debugging tool, the patch disables it for a default build (and thusly also avoids the (n)curses dependency for a default build). The only remaining problem --- which only happens if building without having `grub-emu' enabled --- is the following one: #v+ [...] cc -Iloader/i386/pc -I../loader/i386/pc -I. -Iinclude -I../include -Wall -W= -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstr= ict-prototypes -g -Os -falign-jumps=3D1 -falign-loops=3D1 -falign-functions= =3D1 -fno-builtin -mrtd -mregparm=3D3 -m32 -MD -c -o chain_mod-loader_i386_= pc_chainloader_normal.o ../loader/i386/pc/chainloader_normal.c In file included from ../include/grub/normal.h:28, from ../loader/i386/pc/chainloader_normal.c:23: =2E./include/grub/script.h:27:29: error: grub_script.tab.h: No such file or= directory In file included from ../include/grub/normal.h:28, from ../loader/i386/pc/chainloader_normal.c:23: =2E./include/grub/script.h:242: error: expected ')' before '*' token make: *** [chain_mod-loader_i386_pc_chainloader_normal.o] Error 1 #v- Running `make grub_script.tab.h' and then again `make' makes the build succeed. So my guess is that there is a missing dependency somewhere and it wasn't a problem so far because the file was built earlier (for `grub-emu'?). Someone who knows the dependencies between the source files should be able to quickly spot the missing one. 2006-10-22 Thomas Schwinge * Makefile.in (enable_grub_emu): New variable. * configure.ac (--enable-grub-emu): New option. Do the checks for (n)curses only if `--enable-grub-emu' is requested. * conf/i386-efi.rmk (sbin_UTILITIES): Add `grub-emu' only if requested. * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk (bin_UTILITIES): Likewise. Index: Makefile.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/grub/grub2/Makefile.in,v retrieving revision 1.22 diff -u -p -r1.22 Makefile.in --- Makefile.in 28 May 2006 23:01:43 -0000 1.22 +++ Makefile.in 22 Oct 2006 14:35:10 -0000 @@ -73,6 +73,9 @@ LIBCURSES =3D @LIBCURSES@ LIBLZO =3D @LIBLZO@ YACC =3D @YACC@ =20 +# Options. +enable_grub_emu =3D @enable_grub_emu@ + ### General variables. =20 RMKFILES =3D $(addprefix conf/,common.rmk i386-pc.rmk powerpc-ieee1275.rmk= \ Index: configure.ac =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/grub/grub2/configure.ac,v retrieving revision 1.34 diff -u -p -r1.34 configure.ac --- configure.ac 15 Oct 2006 13:53:59 -0000 1.34 +++ configure.ac 22 Oct 2006 14:35:12 -0000 @@ -145,14 +145,6 @@ if test "$target_cpu"-"$platform" =3D i386 AC_CHECK_HEADERS(lzo/lzo1x.h lzo1x.h) fi =20 -# Check for curses. -AC_CHECK_LIB(ncurses, wgetch, [LIBCURSES=3D"-lncurses"], - [AC_CHECK_LIB(curses, wgetch, [LIBCURSES=3D"-lcurses"])]) -AC_SUBST(LIBCURSES) - -# Check for headers. -AC_CHECK_HEADERS(ncurses/curses.h ncurses.h curses.h) - # Check for functions. AC_CHECK_FUNCS(posix_memalign memalign) =20 @@ -265,13 +257,35 @@ CPPFLAGS=3D"$tmp_CPPFLAGS" LDFLAGS=3D"$tmp_LDFLAGS" LIBS=3D"$tmp_LIBS" =20 +# # Check for options. +# + +# Memory manager debugging. AC_ARG_ENABLE([mm-debug],=20 AS_HELP_STRING([--enable-mm-debug], [include memory manager debugging]), [AC_DEFINE([MM_DEBUG], [1], [Define to 1 if you enable memory manager debuggi= ng.])]) =20 +AC_ARG_ENABLE([grub-emu], + [AS_HELP_STRING([--enable-grub-emu], + [build and install the `grub-emu' debugging u= tility])]) +[if [ x"$enable_grub_emu" =3D xyes ]; then + # Check for curses libraries.] + AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES=3D"-lncurses"], + [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES=3D"-lcurses"], + [AC_MSG_ERROR([(n)curses libraries are required to build `grub-emu']= )])]) + AC_SUBST([LIBCURSES]) + + [# Check for headers.] + AC_CHECK_HEADERS([ncurses/curses.h], [], + [AC_CHECK_HEADERS([ncurses.h], [], + [AC_CHECK_HEADERS([curses.h], [], + [AC_MSG_ERROR([(n)curses header files are required to build `grub-emu'])]= )])]) +[fi] +AC_SUBST([enable_grub_emu]) + # Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform]) Index: conf/i386-efi.rmk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/grub/grub2/conf/i386-efi.rmk,v retrieving revision 1.11 diff -u -p -r1.11 i386-efi.rmk --- conf/i386-efi.rmk 14 Oct 2006 18:59:34 -0000 1.11 +++ conf/i386-efi.rmk 22 Oct 2006 14:35:13 -0000 @@ -6,7 +6,10 @@ COMMON_LDFLAGS =3D -melf_i386 -nostdlib =20 # Utilities. bin_UTILITIES =3D grub-mkimage -#sbin_UTILITIES =3D grub-setup grub-emu grub-mkdevicemap grub-probe +#sbin_UTILITIES =3D grub-setup grub-mkdevicemap grub-probe +#ifeq ($(enable_grub_emu), yes) +#sbin_UTILITIES +=3D grub-emu +#endif =20 # For grub-mkimage. grub_mkimage_SOURCES =3D util/i386/efi/grub-mkimage.c util/misc.c \ Index: conf/i386-pc.rmk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/grub/grub2/conf/i386-pc.rmk,v retrieving revision 1.72 diff -u -p -r1.72 i386-pc.rmk --- conf/i386-pc.rmk 14 Oct 2006 18:59:34 -0000 1.72 +++ conf/i386-pc.rmk 22 Oct 2006 14:35:13 -0000 @@ -51,7 +51,10 @@ kernel_syms.lst: $(addprefix include/gru =20 # Utilities. bin_UTILITIES =3D grub-mkimage -sbin_UTILITIES =3D grub-setup grub-emu grub-mkdevicemap grub-probe +sbin_UTILITIES =3D grub-setup grub-mkdevicemap grub-probe +ifeq ($(enable_grub_emu), yes) +sbin_UTILITIES +=3D grub-emu +endif =20 # For grub-mkimage. grub_mkimage_SOURCES =3D util/i386/pc/grub-mkimage.c util/misc.c \ Index: conf/powerpc-ieee1275.rmk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/grub/grub2/conf/powerpc-ieee1275.rmk,v retrieving revision 1.60 diff -u -p -r1.60 powerpc-ieee1275.rmk --- conf/powerpc-ieee1275.rmk 22 Sep 2006 19:36:32 -0000 1.60 +++ conf/powerpc-ieee1275.rmk 22 Oct 2006 14:35:13 -0000 @@ -27,7 +27,9 @@ pkgdata_PROGRAMS =3D kernel.elf =20 # Utilities. bin_UTILITIES =3D grub-mkimage -sbin_UTILITIES =3D grub-emu=20 +ifeq ($(enable_grub_emu), yes) +sbin_UTILITIES =3D grub-emu +endif =20 # For grub-mkimage. grub_mkimage_SOURCES =3D util/powerpc/ieee1275/grub-mkimage.c util/misc.c \ Index: conf/sparc64-ieee1275.rmk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/grub/grub2/conf/sparc64-ieee1275.rmk,v retrieving revision 1.14 diff -u -p -r1.14 sparc64-ieee1275.rmk --- conf/sparc64-ieee1275.rmk 22 Sep 2006 19:36:31 -0000 1.14 +++ conf/sparc64-ieee1275.rmk 22 Oct 2006 14:35:14 -0000 @@ -30,7 +30,10 @@ kernel_syms.lst: $(addprefix include/gru pkgdata_PROGRAMS =3D kernel.elf =20 # Utilities. -#bin_UTILITIES =3D grub-emu grub-mkimage +#bin_UTILITIES =3D grub-mkimage +#ifeq ($(enable_grub_emu), yes) +#bin_UTILITIES +=3D grub-emu +#endif =20 # For grub-mkimage. grub_mkimage_SOURCES =3D util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ Regards, Thomas --yVhtmJPUSI46BTXb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFFO4Rbgfzh735dTTURAr65AKCpXoBK6WApdKdGrWxsIr+P6JPQ9wCfZgGu CiiEorlKW4gTPZQfAxmE+IE= =YXvl -----END PGP SIGNATURE----- --yVhtmJPUSI46BTXb--