Skip to contentSkip to conversation

SDL support

PATCH In review Vladimir 'phcoder' Serbinenko 3 participants 6 messages Jul 23, 2009 – Jul 25, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 SDL support

Hello. Here is already-discussed SDL support

Signature · 4 lines
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
Makefile.in +2 -0
index 25acce7..b9b9cda 100644
@@ -95,12 +95,14 @@ endif
 AWK = @AWK@
 LIBCURSES = @LIBCURSES@
 LIBUSB = @LIBUSB@
+LIBSDL = @LIBSDL@
 YACC = @YACC@
 UNIFONT_BDF = @UNIFONT_BDF@
 
 # Options.
 enable_grub_emu = @enable_grub_emu@
 enable_grub_emu_usb = @enable_grub_emu_usb@
+enable_grub_emu_sdl = @enable_grub_emu_sdl@
 enable_grub_fstest = @enable_grub_fstest@
 enable_grub_pe2elf = @enable_grub_pe2elf@
 enable_grub_mkfont = @enable_grub_mkfont@
conf/i386-pc.rmk +12 -1
index 5b7b8c0..eb33781 100644
@@ -150,6 +150,12 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c			\
 	fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c				\
 	\
+	video/video.c video/fb/video_fb.c video/fb/fbblit.c 		\
+	video/fb/fbfill.c video/fb/fbutil.c commands/videotest.c 	\
+	video/bitmap.c video/readers/tga.c video/readers/jpeg.c		\
+	video/readers/png.c font/font_cmd.c font/font.c term/gfxterm.c	\
+	io/bufio.c			\
+	\
 	util/console.c util/hostfs.c util/grub-emu.c util/misc.c	\
 	util/hostdisk.c util/getroot.c					\
 	\
@@ -163,7 +169,12 @@ grub_emu_LDFLAGS = $(LIBCURSES)
 ifeq ($(enable_grub_emu_usb), yes)
 grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c	\
 		commands/usbtest.c
-grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB)
+grub_emu_LDFLAGS += $(LIBUSB)
+endif
+
+ifeq ($(enable_grub_emu_sdl), yes)
+grub_emu_SOURCES += util/sdl.c
+grub_emu_LDFLAGS += $(LIBSDL)
 endif
 
 # Scripts.
configure.ac +34 -0
index 549b35c..a2140cd 100644
@@ -460,6 +460,10 @@ AC_ARG_ENABLE([grub-emu],
 AC_ARG_ENABLE([grub-emu-usb],
 	      [AS_HELP_STRING([--enable-grub-emu-usb],
                              [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
+AC_ARG_ENABLE([grub-emu-sdl],
+	      [AS_HELP_STRING([--enable-grub-emu-sdl],
+                             [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])])
+
 if test x"$enable_grub_emu" = xno ; then
   grub_emu_excuse="explicitly disabled"
 fi
@@ -487,6 +491,7 @@ enable_grub_emu=yes
 else
 enable_grub_emu=no
 grub_emu_usb_excuse="grub-emu isn't built"
+grub_emu_sdl_excuse="grub-emu isn't built"
 fi
 if test x"$enable_grub_emu_usb" = xno ; then
   grub_emu_usb_excuse="explicitly disabled"
@@ -511,8 +516,32 @@ else
 enable_grub_emu_usb=no
 fi
 
+if test x"$enable_grub_emu_sdl" = xno ; then
+  grub_emu_sdl_excuse="explicitely disabled"
+fi
+[if [ x"$grub_emu_sdl_excuse" = x ]; then
+    # Check for libSDL libraries.]
+AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
+    [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]])
+    AC_SUBST([LIBSDL])
+[fi]
+[if [ x"$grub_emu_sdl_excuse" = x ]; then
+    # Check for headers.]
+    AC_CHECK_HEADERS([SDL/SDL.h], [],
+      [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]])
+[fi]
+if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
+  AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled])
+fi
+if test x"$grub_emu_sdl_excuse" = x ; then
+enable_grub_emu_sdl=yes
+else
+enable_grub_emu_sdl=no
+fi
+
 AC_SUBST([enable_grub_emu])
 AC_SUBST([enable_grub_emu_usb])
+AC_SUBST([enable_grub_emu_sdl])
 
 AC_ARG_ENABLE([grub-fstest],
 	      [AS_HELP_STRING([--enable-grub-fstest],
@@ -591,6 +620,11 @@ echo USB support for grub-emu: Yes
 else
 echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
 fi
+if [ x"$grub_emu_sdl_excuse" = x ]; then
+echo SDL support for grub-emu: Yes
+else
+echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)"
+fi
 if [ x"$enable_mm_debug" = xyes ]; then
 echo With memory debugging: Yes
 else
util/sdl.c new file +253 -0

253 lines not on this page · raw message

#1 lore raw
Quoted 1 line · Vladimir 'phcoder' Serbinenko

Hello. Here is already-discussed SDL support

The patch refers to video/fb/video_fb.c, which is not included.

Also, please check the changes I made to your changes to configure.ac. Please check the spelling of "explicitly". There is no need for verbose excuses, it's enough to say "need SDL library" or "need SDL headers".

"build and install the `grub-emu' debugging utility with SDL support" is also too long and not quite correct. --enable-grub-emu-sdl decides whether SDL support will be in grub-emu. Since it's the default, maybe it's better to describe --disable-grub-emu-sdl. Obviously, it applies to grub-emu-usb as well, I just didn't have a chance to clean it up.

Signature · 2 lines
Regards,
Pavel Roskin
#2 lore raw
Quoted 4 lines · Pavel Roskin
Quoted 1 line · Vladimir 'phcoder' Serbinenko

Hello. Here is already-discussed SDL support

The patch refers to video/fb/video_fb.c, which is not included.

Well it's PATCH 2/2 and PATCH 1/2 is framebuffer split which is the pre-requisite for this patch. I had some problems with sending but now I checked the archives and see that the patch 1 successfully arrived

Quoted 11 lines

Also, please check the changes I made to your changes to configure.ac. Please check the spelling of "explicitly".  There is no need for verbose excuses, it's enough to say "need SDL library" or "need SDL headers".

"build and install the `grub-emu' debugging utility with SDL support" is also too long and not quite correct.  --enable-grub-emu-sdl decides whether SDL support will be in grub-emu.  Since it's the default, maybe it's better to describe --disable-grub-emu-sdl.  Obviously, it applies to grub-emu-usb as well, I just didn't have a chance to clean it up.

Agreed. Will fix at better time of the day

Quoted 10 lines

--
Regards,
Pavel Roskin

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 4 lines
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
#3 lore raw
Quoted 8 lines · Vladimir 'phcoder' Serbinenko
Quoted 4 lines · Pavel Roskin
Quoted 1 line · Vladimir 'phcoder' Serbinenko

Hello. Here is already-discussed SDL support

The patch refers to video/fb/video_fb.c, which is not included.

Well it's PATCH 2/2 and PATCH 1/2 is framebuffer split which is the pre-requisite for this patch. I had some problems with sending but now I checked the archives and see that the patch 1 successfully arrived

Sorry, I missed that.

When testing the patches together, there is a warning in grub_video_sdl_enable_double_buffering(). The "enable" argument should be marked as unused.

Also, when compiling on PowerPC, configure reports that SDL is enabled, but it is not. The same applies to USB support.

Signature · 2 lines
Regards,
Pavel Roskin
#4 lore raw
Quoted 3 lines · Pavel Roskin

Also, when compiling on PowerPC, configure reports that SDL is enabled, but it is not. The same applies to USB support.

Shouldn't it be enabled in all architectures? Unfortunately, the grub-emu definition is arch-specific, but other than this the rest is portable.

This would be the first time gfxterm works on powerpc.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#5 lore raw
Quoted 7 lines · Robert Millan
Quoted 3 lines · Pavel Roskin

Also, when compiling on PowerPC, configure reports that SDL is enabled, but it is not. The same applies to USB support.

Shouldn't it be enabled in all architectures? Unfortunately, the grub-emu definition is arch-specific, but other than this the rest is portable.

Yes, we should try to keep grub-emu the same on all architectures. That's a necessary step to the build system reorganization.

Quoted 1 line

This would be the first time gfxterm works on powerpc.

Yes, it would be great to be able to compile that code on a big-endian system.

Signature · 2 lines
Regards,
Pavel Roskin