# HG changeset patch # User Thinker K.F. Li # Date 1281326626 -28800 # Node ID 7e64e0f70cb688bebcbd1611a76f4d8f43dd9b22 # Parent 8b7964869f7a9f54dd2adcd532f72a21853f6e1c Switch XSHM with autoconf diff -r 8b7964869f7a -r 7e64e0f70cb6 configure.ac --- a/configure.ac Mon Aug 09 10:03:54 2010 +0800 +++ b/configure.ac Mon Aug 09 12:03:46 2010 +0800 @@ -81,6 +81,14 @@ (*) AC_MSG_ERROR([bad value ${enableval} for --enable-skia]) ;; esac],[skia=false]) +AC_ARG_ENABLE([xshm], + [AS_HELP_STRING([--disable-xshm],[Turn off XSHM supporting])], + [case "${enableval}" in + (yes) xshm=true ;; + (no) xshm=false ;; + (*) AC_MSG_ERROR([bad value ${enableval} for --disable-xshm]) ;; + esac], [xshm=true]) + AM_CONDITIONAL([SKIA_GRAPH_ENGINE], [test x$skia = xtrue]) AM_CONDITIONAL([CAIRO_GRAPH_ENGINE], [test x$skia != xtrue]) @@ -129,6 +137,12 @@ AC_DEFINE([DFB_BACKEND]) [fi] +AM_CONDITIONAL([XSHM], [test x"${xshm}" = xtrue -a x"${cairo}" = xtrue -a x$backend = x'X']) + +[if [ x"${xshm}" = xtrue -a x"${cairo}" = xtrue -a x$backend = x'X' ]; then] + AC_DEFINE([XSHM]) +[fi] + # Checks for libraries. [if [ x"${cairo}" = xtrue ]; then] @@ -162,5 +176,6 @@ AH_TEMPLATE([CAIRO_GRAPH_ENGINE], [Enable Cairo Graphic Engine]) AH_TEMPLATE([X_BACKEND], [Enable X backend]) AH_TEMPLATE([DFB_BACKEND], [Enable DirectFB backend]) +AH_TEMPLATE([XSHM], [Enable XSHM]) AC_OUTPUT diff -r 8b7964869f7a -r 7e64e0f70cb6 nodejs/Makefile.am --- a/nodejs/Makefile.am Mon Aug 09 10:03:54 2010 +0800 +++ b/nodejs/Makefile.am Mon Aug 09 12:03:46 2010 +0800 @@ -5,7 +5,11 @@ -I$(abs_top_srcdir)/include \ -I$(prefix)/include \ @pangocairo_CFLAGS@ $(CFLAGS) -mbfly_node_LDFLAGS = -L$(abs_top_builddir)/src/.libs @pangocairo_LIBS@ -lXext +mbfly_node_LDFLAGS = -L$(abs_top_builddir)/src/.libs @pangocairo_LIBS@ + +if XSHM +mbfly_node_LDFLAGS += -lXext +endif all: mbfly.node clean: clean-mbfly-node diff -r 8b7964869f7a -r 7e64e0f70cb6 src/Makefile.am --- a/src/Makefile.am Mon Aug 09 10:03:54 2010 +0800 +++ b/src/Makefile.am Mon Aug 09 12:03:46 2010 +0800 @@ -36,11 +36,17 @@ libmbfly_la_SOURCES += X_supp.c endif +libmbfly_la_LDFLAGS = + if CAIRO_GRAPH_ENGINE libmbfly_la_SOURCES += graph_engine_cairo.c libmbfly_la_CPPFLAGS = @cairo_CFLAGS@ @pangocairo_CFLAGS@ -libmbfly_la_LDFLAGS = @cairo_LIBS@ @pangocairo_LIBS@ -lXext +libmbfly_la_LDFLAGS += @cairo_LIBS@ @pangocairo_LIBS@ +endif + +if XSHM +libmbfly_la_LDFLAGS += -lXext endif if SKIA_GRAPH_ENGINE diff -r 8b7964869f7a -r 7e64e0f70cb6 src/X_supp.c --- a/src/X_supp.c Mon Aug 09 10:03:54 2010 +0800 +++ b/src/X_supp.c Mon Aug 09 12:03:46 2010 +0800 @@ -8,8 +8,7 @@ #include "mb_redraw_man.h" #include "mb_timer.h" #include "mb_X_supp.h" - -#define XSHM 1 +#include "config.h" #ifdef XSHM /* \sa http://www.xfree86.org/current/mit-shm.html */