From: devilhorns Date: Thu, 14 Jul 2011 15:46:30 +0000 (+0000) Subject: Ecore: Add autofoo magic for building XCB-based ecore_x. X-Git-Tag: accepted/2.0/20130306.224007~181^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1aaac777c33cd115faa5401fc408a1f93a0fdde9;p=profile%2Fivi%2Fecore.git Ecore: Add autofoo magic for building XCB-based ecore_x. NB: IF you are going to try this, build evas with `--enable-software-xcb` AND build ecore with `--enable-ecore-x-xcb --disable-ecore-evas-opengl-x11`. NB: OpenGL does NOT work with the xcb stuff yet. E itself does NOT work with this yet either (still have to commit those changes). git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@61385 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/configure.ac b/configure.ac index 1569955..fd8a328 100644 --- a/configure.ac +++ b/configure.ac @@ -141,6 +141,7 @@ want_ecore_x_xprint="yes" want_ecore_x_xtest="yes" want_ecore_x_cursor="yes" want_ecore_x_input="yes" +want_ecore_x_dri="yes" # ecore_evas modules want_ecore_evas="yes" @@ -212,7 +213,7 @@ case "$host_os" in want_ecore_evas_opengl_x11="yes" want_ecore_evas_software_16_x11="yes" want_ecore_evas_software_8_x11="yes" - want_ecore_evas_software_xcb="yes" + want_ecore_evas_software_xcb="no" want_ecore_evas_software_sdl="yes" want_ecore_evas_gl_sdl="yes" want_ecore_evas_directfb="yes" @@ -638,20 +639,129 @@ AC_ARG_ENABLE(ecore-x-input, @<:@default=detect@:>@])], [want_ecore_x_input=$enableval]) +AC_ARG_ENABLE(ecore-x-dri, + [AC_HELP_STRING([--disable-ecore-x-dri], + [disable the ecore_x support for DRI extension. + @<:@default=detect@:>@])], + [want_ecore_x_dri=$enableval]) AC_ARG_ENABLE(ecore-x-xcb, [AC_HELP_STRING([--enable-ecore-x-xcb], [enable the ecore_x module with XCB backend. @<:@default=disabled@:>@])], - [want_ecore_x_xcb=$enableval], - [want_ecore_x_xcb="no"]) + [want_ecore_x_xcb=$enableval]) AC_MSG_CHECKING(whether ecore_x with XCB backend is to be built) AC_MSG_RESULT($want_ecore_x_xcb) if test "x$want_ecore_x_xcb" = "xyes" ; then - PKG_CHECK_MODULES(XCB, xcb xcb-icccm xcb-image xcb-keysyms pixman-1, + + AC_MSG_CHECKING([keysym definitions]) + KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11 + FILES="keysymdef.h XF86keysym.h Sunkeysym.h DECkeysym.h HPkeysym.h" + for i in $FILES; do + if test -f "$KEYSYMDEFDIR/$i"; then + KEYSYMDEFS="$KEYSYMDEFS $KEYSYMDEFDIR/$i" + elif test "x$i" = "xkeysymdef.h"; then + AC_MSG_ERROR([Cannot find keysymdef.h]) + fi + done + AC_MSG_RESULT([$KEYSYMDEFS]) + AC_SUBST(KEYSYMDEFS) + + have_iconv="no" + AC_ARG_WITH([iconv-link], + AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]), + [ + LIBS="$withval $LIBS" + have_iconv="yes" + ]) + + AC_MSG_CHECKING(for explicit iconv link options) + if test "x${iconv_libs}" = "x" ; then + AC_MSG_RESULT([no explicit iconv link option]) + else + AC_MSG_RESULT([$iconv_libs]) + fi + + if test "x${have_iconv}" = "xno" ; then + AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"]) + + if test "x${have_iconv}" = "xyes" ; then + AC_MSG_CHECKING([whether iconv() is in libc]) + + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + ]], + [[ + iconv_t ic; + size_t count = iconv(ic, NULL, NULL, NULL, NULL); + ]])], + [have_iconv="yes"], + [have_iconv="no"]) + + AC_MSG_RESULT([${have_iconv}]) + fi + + if test "x${have_iconv}" = "xno" ; then + AC_MSG_CHECKING([whether iconv() is in libiconv.a]) + + LIBS_save="${LIBS}" + LIBS="-liconv $LIBS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + ]], + [[ + iconv_t ic; + size_t count; + count = iconv(ic, NULL, NULL, NULL, NULL); + ]])], + [have_iconv="yes"], + [ + have_iconv="no" + LIBS=${LIBS_save} + ]) + + AC_MSG_RESULT([${have_iconv}]) + fi + + if test "x${have_iconv}" = "xno" ; then + AC_MSG_CHECKING([whether iconv() is in libiconv_plug.a]) + + LIBS_save="${LIBS}" + LIBS="-liconv_plug $LIBS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + ]], + [[ + iconv_t ic; + size_t count = iconv(ic, NULL, NULL, NULL, NULL); + ]])], + [have_iconv="yes"], + [ + have_iconv="no" + LIBS=${LIBS_save} + ]) + + AC_MSG_RESULT([${have_iconv}]) + fi + + if test "x${have_iconv}" = "xyes" ; then + AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed]) + fi + fi + + PKG_CHECK_MODULES(XCB, xcb xcb-shm xcb-icccm xcb-image xcb-keysyms pixman-1, [ have_ecore_x_xcb="yes" - requirements_ecore_x="xcb xcb-icccm xcb-image xcb-keysyms pixman-1 ${requirements_ecore_x}" ], + requirements_ecore_x="xcb xcb-shm xcb-icccm xcb-image xcb-keysyms pixman-1 ${requirements_ecore_x}" ], [ have_ecore_x_xcb="no" ]) if test "x$have_ecore_x_xcb" = "xyes" ; then @@ -700,9 +810,9 @@ if test "x$want_ecore_x_xcb" = "xyes" ; then fi if test "x$want_ecore_x_render" != "xno"; then - PKG_CHECK_MODULES(XCB_RENDER, xcb-render, + PKG_CHECK_MODULES(XCB_RENDER, xcb-render xcb-renderutil, [ have_ecore_x_xcb_render="yes" - requirements_ecore_x="xcb-render ${requirements_ecore_x}" + requirements_ecore_x="xcb-render xcb-renderutil ${requirements_ecore_x}" AC_DEFINE(ECORE_XCB_RENDER, 1, [Build support for XCB render]) ], [ have_ecore_x_xcb_render="no" ]) else @@ -747,7 +857,7 @@ if test "x$want_ecore_x_xcb" = "xyes" ; then PKG_CHECK_MODULES(XCB_XFIXES, xcb-xfixes, [ have_ecore_x_xcb_xfixes="yes" requirements_ecore_x="xcb-xfixes ${requirements_ecore_x}" - AC_DEFINE(ECORE_XCB_FIXES, 1, [Build support for XCB xfixes]) ], + AC_DEFINE(ECORE_XCB_XFIXES, 1, [Build support for XCB xfixes]) ], [ have_ecore_x_xcb_xfixes="no" ]) else have_ecore_x_xcb_xfixes="no" @@ -787,6 +897,41 @@ if test "x$want_ecore_x_xcb" = "xyes" ; then AC_MSG_NOTICE("xtest extension explicitly disabled") fi +# input extension disabled currently in xcb as xcb-input has some issues + want_ecore_x_input="no" + if test "x$want_ecore_x_input" != "xno"; then + PKG_CHECK_MODULES(XCB_XINPUT, xcb-xinput, + [ have_ecore_x_xcb_xinput="yes" + requirements_ecore_x="xcb-xinput ${requirements_ecore_x}" + AC_DEFINE(ECORE_XCB_XINPUT, 1, [Build support for XCB xinput]) ], + [ have_ecore_x_xcb_xinput="no" ]) + else + have_ecore_x_xcb_xinput="no" + AC_MSG_NOTICE("xinput extension explicitly disabled") + fi + + if test "x$want_ecore_x_cursor" != "xno"; then + PKG_CHECK_MODULES(XCB_CURSOR, xcb-render xcb-renderutil, + [ have_ecore_x_xcb_cursor="yes" + requirements_ecore_x="xcb-render xcb-renderutil ${requirements_ecore_x}" + AC_DEFINE(ECORE_XCB_CURSOR, 1, [Build support for XCB cursor]) ], + [ have_ecore_x_xcb_cursor="no" ]) + else + have_ecore_x_xcb_cursor="no" + AC_MSG_NOTICE("cursor extension explicitly disabled") + fi + + if test "x$want_ecore_x_dri" != "xno"; then + PKG_CHECK_MODULES(XCB_DRI, xcb-dri2, + [ have_ecore_x_xcb_dri="yes" + requirements_ecore_x="xcb-dri2 ${requirements_ecore_x}" + AC_DEFINE(ECORE_XCB_DRI, 1, [Build support for XCB dri/dri2]) ], + [ have_ecore_x_xcb_dri="no" ]) + else + have_ecore_x_xcb_dri="no" + AC_MSG_NOTICE("dri extension explicitly disabled") + fi + AC_DEFINE(HAVE_ECORE_X_XCB, 1, [Defined to 1 if XCB is enabled.]) x_cflags=$XCB_CFLAGS @@ -1308,6 +1453,30 @@ ECORE_EVAS_CHECK_MODULE([opengl-x11], [OpenGL Xlib], [${have_ecore_x_xlib}]) +have_ecore_evas_opengl_xlib="no" +have_ecore_evas_opengl_xcb="no" +if test "x${have_ecore_evas_opengl_x11}" = "xyes" -o "x${have_ecore_evas_opengl_x11}" = "xstatic" ; then + have_ecore_evas_opengl_xlib=`${PKG_CONFIG} --variable=Xlib evas-opengl-x11` + if test "x${have_ecore_evas_opengl_xlib}" = "xyes" -a "x${have_ecore_x}" = "xyes" ; then + AC_DEFINE(BUILD_ECORE_EVAS_OPENGL_XLIB, 1, [OpenGL Xlib rendering backend]) + fi + +# opengl does not work with xcb (yet) + have_ecore_evas_opengl_xcb=`${PKG_CONFIG} --variable=XCB evas-opengl-x11` + if test "x${have_ecore_evas_opengl_xcb}" = "xyes" -a "x${have_ecore_x}" = "xyes" ; then + PKG_CHECK_MODULES(XCB_X11, x11-xcb, + [ have_ecore_x_opengl_xcb="yes" + requirements_ecore_x="x11-xcb ${requirements_ecore_x}" + AC_DEFINE(BUILD_ECORE_X_OPENGL_XCB, 1, [Build support for XCB-based OpenGL]) + AC_DEFINE(BUILD_ECORE_EVAS_OPENGL_XCB, 1, [OpenGL XCB rendering backend]) + ], + [ have_ecore_x_opengl_xcb="no" ]) + else + have_ecore_x_opengl_xcb="no" + AC_MSG_NOTICE("XCB-based OpenGL explicitly disabled") + fi +fi + # ecore_evas_software_x11 16 bits ECORE_EVAS_CHECK_MODULE([software-16-x11], @@ -1455,6 +1624,7 @@ doc/ecore.dox doc/Makefile doc/Doxyfile src/Makefile +src/util/Makefile src/bin/Makefile src/lib/Makefile src/lib/ecore/Makefile @@ -1600,7 +1770,11 @@ if test "x${have_ecore_evas}" = "xyes" ; then else echo " Software X11...............: $have_ecore_evas_software_x11" fi - echo " OpenGL X11.................: $have_ecore_evas_opengl_x11" + if test "x${have_ecore_evas_opengl_x11}" = "xyes" ; then + echo " OpenGL X11.................: $have_ecore_evas_opengl_x11 (Xlib=${have_ecore_evas_opengl_xlib}) (XCB=${have_ecore_evas_opengl_xcb})" + else + echo " OpenGL X11.................: $have_ecore_evas_opengl_x11" + fi echo " Software GDI...............: $have_ecore_evas_software_gdi" echo " Software DirectDraw........: $have_ecore_evas_software_ddraw" echo " Direct3D...................: $have_ecore_evas_direct3d"