changeset 654:21f944e79b19

Use --with-backend to specify display backend.
author Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
date Sat, 31 Jul 2010 17:31:00 +0800
parents 34710e86b4a2
children 689e15edbf72
files build-mipsel.sh configure.ac examples/Makefile.am include/mb.h include/mb_config.h.in src/Makefile.am
diffstat 6 files changed, 29 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/build-mipsel.sh	Sat Jul 31 16:36:53 2010 +0800
+++ b/build-mipsel.sh	Sat Jul 31 17:31:00 2010 +0800
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 autoreconf -ifs
-./configure --host mipsel-linux --build i686-pc-linux-gnu --prefix ${TANGO} --disable-sh_text --disable-X_supp
+./configure --host mipsel-linux --build i686-pc-linux-gnu --prefix ${TANGO} --disable-sh_text --with-backend=dfb
 make && make install
--- a/configure.ac	Sat Jul 31 16:36:53 2010 +0800
+++ b/configure.ac	Sat Jul 31 17:31:00 2010 +0800
@@ -64,13 +64,14 @@
     AC_DEFINE([SH_STEXT])
 [fi]
 
-AC_ARG_ENABLE([X_supp],
-        [AS_HELP_STRING([--disable-X_supp],[Turn off X backend])],
-        [case "${enableval}" in
-            (yes) X_supp=true ;;
-            (no) X_supp=false ;;
-            (*) AC_MSG_ERROR([bad value ${enableval} for --disable-X_supp]) ;;
-        esac],[X_supp=true])
+AC_ARG_WITH([backend],
+        [AS_HELP_STRING([--with-backend=FOO],[Use FOO as display backend (default is 'X')])],
+        [case "${withval}" in
+            ('X') backend='X' ;;
+            ('dfb') backend='dfb' ;;
+            ('no') backend='none' ;;
+            (*) AC_MSG_ERROR([bad value ${withval} for --with-backend]) ;;
+        esac],[backend='X'])
 
 AC_ARG_ENABLE([skia],
         [AS_HELP_STRING([--enable-skia],[Turn on Skia instead of Cairo])],
@@ -114,12 +115,18 @@
     AC_DEFINE([SH_TEXT])
 [fi]
 
-# Define AM and AC variable for X_supp
+# Define AM and AC variable for display backend
+
+AM_CONDITIONAL([X_BACKEND], [test x$backend = x'X' -a x$cairo = xtrue])
 
-AM_CONDITIONAL([X_SUPP], [test x$X_supp = xtrue -a x$cairo = xtrue])
+[if [ x"${backend}" = x'X' -a x"${cairo}" = xtrue ]; then]
+    AC_DEFINE([X_BACKEND])
+[fi]
 
-[if [ x"${X_supp}" = xtrue -a x"${cairo}" = xtrue ]; then]
-    AC_DEFINE([X_SUPP])
+AM_CONDITIONAL([DFB_BACKEND], [test x$backend = x'dfb' -a x$cairo = xtrue])
+
+[if [ x"${backend}" = x'dfb' -a x"${cairo}" = xtrue ]; then]
+    AC_DEFINE([DFB_BACKEND])
 [fi]
 
 # Checks for libraries.
@@ -153,6 +160,7 @@
 AH_TEMPLATE([SH_STEXT],[Enable sh_stext object])
 AH_TEMPLATE([SKIA_GRAPH_ENGINE], [Enable Skia Graphic Engine])
 AH_TEMPLATE([CAIRO_GRAPH_ENGINE], [Enable Cairo Graphic Engine])
-AH_TEMPLATE([X_SUPP], [Enable X backend])
+AH_TEMPLATE([X_BACKEND], [Enable X backend])
+AH_TEMPLATE([DFB_BACKEND], [Enable DirectFB backend])
 
 AC_OUTPUT
--- a/examples/Makefile.am	Sat Jul 31 16:36:53 2010 +0800
+++ b/examples/Makefile.am	Sat Jul 31 17:31:00 2010 +0800
@@ -1,3 +1,3 @@
-if X_SUPP
+if X_BACKEND
 SUBDIRS = calculator svg2code_ex tank dynamic drag menu
 endif
--- a/include/mb.h	Sat Jul 31 16:36:53 2010 +0800
+++ b/include/mb.h	Sat Jul 31 17:31:00 2010 +0800
@@ -5,7 +5,7 @@
 
 #include "mb_types.h"
 #include "mb_redraw_man.h"
-#ifdef X_SUPP
+#ifdef X_BACKEND
 #include "mb_X_supp.h"
 #endif
 #include "mb_animate.h"
--- a/include/mb_config.h.in	Sat Jul 31 16:36:53 2010 +0800
+++ b/include/mb_config.h.in	Sat Jul 31 17:31:00 2010 +0800
@@ -14,6 +14,9 @@
 #undef SH_STEXT
 
 /* Enable X backend */
-#undef X_SUPP
+#undef X_BACKEND
+
+/* Enable DirectFB backend */
+#undef DFB_BACKEND
 
 #endif /* __MB_CONFIG_H_ */
--- a/src/Makefile.am	Sat Jul 31 16:36:53 2010 +0800
+++ b/src/Makefile.am	Sat Jul 31 17:31:00 2010 +0800
@@ -12,7 +12,7 @@
 noinst_PROGRAMS += testcase
 endif
 
-if X_SUPP
+if X_BACKEND
 MBAF_SOURCES=mbaf/mbapp.c mbaf/mbbutton.c mbaf/mbobject.c mbaf/animated_menu.c
 else
 MBAF_SOURCES=
@@ -32,7 +32,7 @@
 libmbfly_la_SOURCES += shape_stext.c
 endif
 
-if X_SUPP
+if X_BACKEND
 libmbfly_la_SOURCES += X_supp.c
 endif