# HG changeset patch # User Thinker K.F. Li # Date 1258031773 -28800 # Node ID 271212f325b4504cb7db348a52320c64666278ec # Parent aa2b388fba4eaee78b77254e4157aff5fb386cf8 Conditional compile with Cairo and Skia. Some components are also affected. For example, sh_text, sh_stext, X_supp...etc. All affected ones are conditional compiled. diff -r aa2b388fba4e -r 271212f325b4 configure.ac --- a/configure.ac Sun Nov 08 00:37:29 2009 +0800 +++ b/configure.ac Thu Nov 12 21:16:13 2009 +0800 @@ -12,10 +12,6 @@ LT_INIT AC_PROG_LIBTOOL -# Checks for libraries. -PKG_CHECK_MODULES([cairo], [cairo >= 1.6], , AC_MSG_ERROR([cairo >= 1.6 not found])) -PKG_CHECK_MODULES([pangocairo], [pangocairo >= 1.0], , AC_MSG_ERROR([pangocairo >= 1.0 not found])) - # Checks for header files. AC_PATH_X AC_HEADER_STDC @@ -36,7 +32,7 @@ AC_CHECK_FUNCS([gettimeofday memset select sqrt strdup]) AC_ARG_ENABLE([testcase], - [--enable-testcase Enable testcase], + [ --enable-testcase Enable testcase], [case "${enableval}" in yes) testcase=true ;; no) testcase=false ;; @@ -45,19 +41,15 @@ AM_CONDITIONAL([TESTCASE], [test x$testcase = xtrue]) AC_ARG_ENABLE([sh_text], - [--disable-sh_text Turn off sh_text], + [ --disable-sh_text Turn off sh_text], [case "${enableval}" in yes) sh_text=true ;; no) sh_text=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --disable-sh_text]) ;; esac],[sh_text=true]) -AM_CONDITIONAL([SH_TEXT], [test x$sh_text = xtrue]) -[if [ x"${sh_text}" = xtrue ]; then] -AC_DEFINE([SH_TEXT]) -[fi] AC_ARG_ENABLE([sh_stext], - [--disable-sh_stext Turn off sh_stext], + [ --disable-sh_stext Turn off sh_stext], [case "${enableval}" in yes) sh_stext=true ;; no) sh_stext=false ;; @@ -68,6 +60,50 @@ AC_DEFINE([SH_STEXT]) [fi] +AC_ARG_ENABLE([X_supp], + [ --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_ENABLE([skia], + [ --enable-skia Turn on Skia instead of Cairo], +[case "${enableval}" in + yes) skia=true ;; + no) skia=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-skia]) ;; +esac],[skia=false]) +AM_CONDITIONAL([SKIA_BACKEND], [test x$skia = xtrue]) +AM_CONDITIONAL([CAIRO_BACKEND], [test x$skia != xtrue]) +[if [ x"${skia}" = xtrue ]; then ] +AC_DEFINE([SKIA_BACKEND]) +cairo=false +[else] +AC_DEFINE([CAIRO_BACKEND]) +cairo=true +[fi] + +# Define AM and AC variable for sh_text +AM_CONDITIONAL([SH_TEXT], [test x$sh_text = xtrue -a x$cairo = xtrue]) +[if [ x"${sh_text}" = xtrue -a x$cairo = xtrue ]; then] +AC_DEFINE([SH_TEXT]) +[fi] + +# Define AM and AC variable for X_supp +AM_CONDITIONAL([X_SUPP], + [test \( x$X_supp = xtrue \) -a \( x$cairo = xtrue \)]) +[if [ \( x"${X_supp}" = xtrue \) -a \( x"${cairo}" = xture \) ]; then] +AC_DEFINE([X_SUPP]) +[fi] + +# Checks for libraries. +[if [ x"${cairo}" = xtrue ]; then] +PKG_CHECK_MODULES([cairo], [cairo >= 1.6], , AC_MSG_ERROR([cairo >= 1.6 not found])) +PKG_CHECK_MODULES([pangocairo], [pangocairo >= 1.0], , AC_MSG_ERROR([pangocairo >= 1.0 not found])) +[fi] + AC_CONFIG_FILES([Makefile libmbfly.pc libmbfly-uninstalled.pc @@ -85,5 +121,8 @@ AH_TEMPLATE([SH_TEXT],[Enable sh_text object]) AH_TEMPLATE([SH_STEXT],[Enable sh_stext object]) +AH_TEMPLATE([SKIA_BACKEND], [Enable Skia Graphic Engine]) +AH_TEMPLATE([CAIRO_BACKEND], [Enable Cairo Graphic Engine]) +AH_TEMPLATE([X_SUPP], [Enable X backend]) AC_OUTPUT diff -r aa2b388fba4e -r 271212f325b4 examples/Makefile.am --- a/examples/Makefile.am Sun Nov 08 00:37:29 2009 +0800 +++ b/examples/Makefile.am Thu Nov 12 21:16:13 2009 +0800 @@ -1,1 +1,3 @@ +if X_SUPP SUBDIRS = calculator svg2code_ex tank dynamic drag menu +endif diff -r aa2b388fba4e -r 271212f325b4 src/Makefile.am --- a/src/Makefile.am Sun Nov 08 00:37:29 2009 +0800 +++ b/src/Makefile.am Thu Nov 12 21:16:13 2009 +0800 @@ -16,7 +16,7 @@ libmbfly_la_SOURCES= animate.c chgcolor.c coord.c event.c geo.c \ observer.c paint.c redraw_man.c rotate.c shape_path.c \ shape_rect.c shift.c subtree_free.c timer.c \ - timertool.c tools.c visibility.c X_supp.c prop.c sprite.c \ + timertool.c tools.c visibility.c prop.c sprite.c \ mouse.c shape_image.c img_ldr.c $(MBAF_SOURCES) if SH_TEXT @@ -27,6 +27,10 @@ libmbfly_la_SOURCES += shape_stext.c endif +if X_SUPP +libmbfly_la_SOURCES += X_supp.c +endif + libmbfly_la_CPPFLAGS = @cairo_CFLAGS@ @pangocairo_CFLAGS@ libmbfly_la_LDFLAGS = @cairo_LIBS@ @pangocairo_LIBS@