Skip to contentSkip to conversation

SDL

PATCH In review Vladimir 'phcoder' Serbinenko 2 participants 2 messages Aug 30, 2009 – Aug 31, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SDL

Rediffed SDL patch. On top of my videomask, autogfx and doublebuf patches. HTH for debugging before making release

Signature · 4 lines
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
Makefile.in +2 -0
index 8e2cdc6..5bb7231 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 ca74a40..ba51711 100644
@@ -148,6 +148,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/ufs2.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					\
 	\
@@ -161,7 +167,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 +33 -0
index 549b35c..cb90cdc 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
@@ -511,8 +515,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 +619,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 +263 -0

263 lines not on this page · raw message

#1 lore raw

2009/8/30 Vladimir 'phcoder' Serbinenko <[email protected]>:

Quoted 3 lines

Rediffed SDL patch. On top of my videomask, autogfx and doublebuf patches. HTH for debugging before making release

Does SDL support rotation/mirroring of the graphical output? It would be nice if we could test that in SDL as well.

Thanks

Michal