factorize m4 macros and add one to set X extensions

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Vincent Torri 2008-08-31 10:33:31 +02:00 committed by Julien Danjou
parent bcf662c1b4
commit 2d04a1e6ce
4 changed files with 190 additions and 147 deletions

View File

@ -27,7 +27,7 @@ endif
if BUILD_RENDER if BUILD_RENDER
pkgconfig_DATA += xcb-render.pc pkgconfig_DATA += xcb-render.pc
endif endif
if BUILD_RES if BUILD_RESOURCE
pkgconfig_DATA += xcb-res.pc pkgconfig_DATA += xcb-res.pc
endif endif
if BUILD_SCREENSAVER if BUILD_SCREENSAVER
@ -45,7 +45,7 @@ endif
if BUILD_XEVIE if BUILD_XEVIE
pkgconfig_DATA += xcb-xevie.pc pkgconfig_DATA += xcb-xevie.pc
endif endif
if BUILD_XF86DRI if BUILD_XFREE86_DRI
pkgconfig_DATA += xcb-xf86dri.pc pkgconfig_DATA += xcb-xf86dri.pc
endif endif
if BUILD_XFIXES if BUILD_XFIXES

View File

@ -1,14 +1,16 @@
dnl Detection and configuration of the visibility feature of gcc dnl Detection and configuration of the visibility feature of gcc
dnl Vincent Torri 2006-02-11 dnl Vincent Torri 2006-02-11
dnl dnl
dnl GCC_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl XCB_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Check the visibility feature of gcc dnl Check the visibility feature of gcc
dnl dnl
AC_DEFUN([GCC_CHECK_VISIBILITY], AC_DEFUN([XCB_CHECK_VISIBILITY],
[AC_MSG_CHECKING([whether ${CC} supports symbol visibility]) [
save_CFLAGS=${CFLAGS} AC_MSG_CHECKING([whether ${CC} supports symbol visibility])
CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
AC_COMPILE_IFELSE( save_CFLAGS=${CFLAGS}
CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM( [AC_LANG_PROGRAM(
[[ [[
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
@ -25,21 +27,24 @@ extern void f(int);
AC_MSG_RESULT(yes)], AC_MSG_RESULT(yes)],
[m4_if([$2], [], [:], [$2]) [m4_if([$2], [], [:], [$2])
AC_MSG_RESULT(no)]) AC_MSG_RESULT(no)])
CFLAGS=${save_CFLAGS}
]) CFLAGS=${save_CFLAGS}
])
dnl Configure script for doxygen dnl Configure script for doxygen
dnl Vincent Torri 2006-05-11 dnl Vincent Torri 2006-05-11
dnl dnl
dnl AM_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl XCB_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for the doxygen program, and define BUILD_DOCS and DOXYGEN. dnl Test for the doxygen program, and define BUILD_DOCS and DOXYGEN.
dnl dnl
AC_DEFUN([AM_CHECK_DOXYGEN], AC_DEFUN([XCB_CHECK_DOXYGEN],
[ [
DOXYGEN="doxygen" DOXYGEN="doxygen"
dnl
dnl Disable the build of the documentation dnl
dnl dnl Disable the build of the documentation
AC_ARG_ENABLE( dnl
AC_ARG_ENABLE(
[build_docs], [build_docs],
AC_HELP_STRING( AC_HELP_STRING(
[--disable-build-docs], [--disable-build-docs],
@ -51,13 +56,13 @@ AC_DEFUN([AM_CHECK_DOXYGEN],
fi], fi],
[enable_build_docs="yes"]) [enable_build_docs="yes"])
if test "$enable_build_docs" = "no" ; then if test "$enable_build_docs" = "no" ; then
BUILD_DOCS=no BUILD_DOCS=no
else else
dnl dnl
dnl Get the prefix where doxygen is installed. dnl Get the prefix where doxygen is installed.
dnl dnl
AC_ARG_WITH( AC_ARG_WITH(
[doxygen], [doxygen],
AC_HELP_STRING( AC_HELP_STRING(
[--with-doxygen=FILE], [--with-doxygen=FILE],
@ -92,18 +97,41 @@ AC_DEFUN([AM_CHECK_DOXYGEN],
echo "" echo ""
echo "If this is the case make sure you have the packages installed, AND" echo "If this is the case make sure you have the packages installed, AND"
echo "that the doxygen program is in your execute path (see your" echo "that the doxygen program is in your execute path (see your"
echo "shell's manual page on setting the \$PATH environment variable), OR" echo "shell manual page on setting the \$PATH environment variable), OR"
echo "alternatively, specify the program to use with --with-doxygen." echo "alternatively, specify the program to use with --with-doxygen."
AC_MSG_WARN( AC_MSG_WARN(
[Warning: no doxygen detected. Documentation will not be built]) [Warning: no doxygen detected. Documentation will not be built])
fi]) fi])
fi fi
AC_MSG_CHECKING([whether documentation is built]) AC_MSG_CHECKING([whether documentation is built])
AC_MSG_RESULT([${BUILD_DOCS}]) AC_MSG_RESULT([${BUILD_DOCS}])
dnl
dnl Substitution dnl
dnl dnl Substitution
AC_SUBST([DOXYGEN]) dnl
AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes") AC_SUBST([DOXYGEN])
])
AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes")
])
dnl Detection and configuration of the visibility feature of gcc
dnl Vincent Torri 2006-02-11
dnl
dnl XCB_EXTENSION(name, default)
dnl set the X extension
dnl
AC_DEFUN([XCB_EXTENSION],
[
pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
AC_ARG_ENABLE(DOWN,
[AS_HELP_STRING([--enable-[]DOWN], [Build XCB $1 Extension (default: $2)])],
[BUILD_[]UP=$enableval],
[BUILD_[]UP=$2])
AM_CONDITIONAL(BUILD_[]UP, [test "x$BUILD_[]UP" = "xyes"])
])
dnl End of acinclude.m4 dnl End of acinclude.m4

View File

@ -92,7 +92,7 @@ else
fi fi
AC_SUBST(CWARNFLAGS) AC_SUBST(CWARNFLAGS)
GCC_CHECK_VISIBILITY() XCB_CHECK_VISIBILITY()
# htmldir is not defined prior to autoconf 2.59c, so on earlier versions # htmldir is not defined prior to autoconf 2.59c, so on earlier versions
# set an equivalent value. # set an equivalent value.
@ -100,57 +100,72 @@ AC_PREREQ([2.59c], [], [AC_SUBST([htmldir], [m4_ifset([AC_PACKAGE_TARNAME],
['${datadir}/doc/${PACKAGE_TARNAME}'], ['${datadir}/doc/${PACKAGE_TARNAME}'],
['${datadir}/doc/${PACKAGE}']) ['${datadir}/doc/${PACKAGE}'])
])]) ])])
AM_CHECK_DOXYGEN()
AC_ARG_ENABLE(composite, AS_HELP_STRING([--enable-composite], [Build XCB Composite Extension (default: yes)]), [BUILD_COMPOSITE=$enableval], [BUILD_COMPOSITE=yes]) XCB_CHECK_DOXYGEN()
AM_CONDITIONAL(BUILD_COMPOSITE, [test "x$BUILD_COMPOSITE" = xyes])
AC_ARG_ENABLE(damage, AS_HELP_STRING([--enable-damage], [Build XCB Damage Extension (default: yes)]), [BUILD_DAMAGE=$enableval], [BUILD_DAMAGE=yes]) XCB_EXTENSION(Composite, "yes")
AM_CONDITIONAL(BUILD_DAMAGE, [test "x$BUILD_DAMAGE" = xyes]) XCB_EXTENSION(Damage, "yes")
AC_ARG_ENABLE(dpms, AS_HELP_STRING([--enable-dpms], [Build XCB DPMS Extension (default: yes)]), [BUILD_DPMS=$enableval], [BUILD_DPMS=yes]) XCB_EXTENSION(DPMS, "yes")
AM_CONDITIONAL(BUILD_DPMS, [test "x$BUILD_DPMS" = xyes]) XCB_EXTENSION(GLX, "yes")
AC_ARG_ENABLE(glx, AS_HELP_STRING([--enable-glx], [Build XCB GLX Extension (default: yes)]), [BUILD_GLX=$enableval], [BUILD_GLX=yes]) XCB_EXTENSION(RandR, "yes")
AM_CONDITIONAL(BUILD_GLX, [test "x$BUILD_GLX" = xyes]) XCB_EXTENSION(Record, "yes")
AC_ARG_ENABLE(randr, AS_HELP_STRING([--enable-randr], [Build XCB RandR Extension (default: yes)]), [BUILD_RANDR=$enableval], [BUILD_RANDR=yes]) XCB_EXTENSION(Render, "yes")
AM_CONDITIONAL(BUILD_RANDR, [test "x$BUILD_RANDR" = xyes]) XCB_EXTENSION(Resource, "yes")
AC_ARG_ENABLE(record, AS_HELP_STRING([--enable-record], [Build XCB Record Extension (default: yes)]), [BUILD_RECORD=$enableval], [BUILD_RECORD=yes]) XCB_EXTENSION(Screensaver, "yes")
AM_CONDITIONAL(BUILD_RECORD, [test "x$BUILD_RECORD" = xyes]) XCB_EXTENSION(Shape, "yes")
AC_ARG_ENABLE(render, AS_HELP_STRING([--enable-render], [Build XCB Render Extension (default: yes)]), [BUILD_RENDER=$enableval], [BUILD_RENDER=yes]) XCB_EXTENSION(Shm, "yes")
AM_CONDITIONAL(BUILD_RENDER, [test "x$BUILD_RENDER" = xyes]) XCB_EXTENSION(Sync, "yes")
AC_ARG_ENABLE(res, AS_HELP_STRING([--enable-res], [Build XCB X-Resource Extension (default: yes)]), [BUILD_RES=$enableval], [BUILD_RES=yes]) XCB_EXTENSION(Xevie, "yes")
AM_CONDITIONAL(BUILD_RES, [test "x$BUILD_RES" = xyes]) XCB_EXTENSION(XFixes, "yes")
AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--enable-screensaver], [Build XCB Screensaver Extension (default: yes)]), [BUILD_SCREENSAVER=$enableval], [BUILD_SCREENSAVER=yes]) XCB_EXTENSION(XFree86-DRI, "yes")
AM_CONDITIONAL(BUILD_SCREENSAVER, [test "x$BUILD_SCREENSAVER" = xyes]) XCB_EXTENSION(Xinerama, "yes")
AC_ARG_ENABLE(shape, AS_HELP_STRING([--enable-shape], [Build XCB Shape Extension (default: yes)]), [BUILD_SHAPE=$enableval], [BUILD_SHAPE=yes]) XCB_EXTENSION(XInput, "no")
AM_CONDITIONAL(BUILD_SHAPE, [test "x$BUILD_SHAPE" = xyes]) XCB_EXTENSION(Xprint, "yes")
AC_ARG_ENABLE(shm, AS_HELP_STRING([--enable-shm], [Build XCB Shm Extension (default: yes)]), [BUILD_SHM=$enableval], [BUILD_SHM=yes]) XCB_EXTENSION(SELinux, "no")
AM_CONDITIONAL(BUILD_SHM, [test "x$BUILD_SHM" = xyes]) XCB_EXTENSION(XTest, "yes")
AC_ARG_ENABLE(sync, AS_HELP_STRING([--enable-sync], [Build XCB Sync Extension (default: yes)]), [BUILD_SYNC=$enableval], [BUILD_SYNC=yes]) XCB_EXTENSION(Xv, "yes")
AM_CONDITIONAL(BUILD_SYNC, [test "x$BUILD_SYNC" = xyes]) XCB_EXTENSION(XvMC, "yes")
AC_ARG_ENABLE(xevie, AS_HELP_STRING([--enable-xevie], [Build XCB Xevie Extension (default: yes)]), [BUILD_XEVIE=$enableval], [BUILD_XEVIE=yes]) XCB_EXTENSION(Composite, "yes")
AM_CONDITIONAL(BUILD_XEVIE, [test "x$BUILD_XEVIE" = xyes]) XCB_EXTENSION(Composite, "yes")
AC_ARG_ENABLE(xf86dri, AS_HELP_STRING([--enable-xf86dri], [Build XCB XFree86-DRI Extension (default: yes)]), [BUILD_XF86DRI=$enableval], [BUILD_XF86DRI=yes])
AM_CONDITIONAL(BUILD_XF86DRI, [test "x$BUILD_XF86DRI" = xyes])
AC_ARG_ENABLE(xfixes, AS_HELP_STRING([--enable-xfixes], [Build XCB XFixes Extension (default: yes)]), [BUILD_XFIXES=$enableval], [BUILD_XFIXES=yes])
AM_CONDITIONAL(BUILD_XFIXES, [test "x$BUILD_XFIXES" = xyes])
AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--enable-xinerama], [Build XCB Xinerama Extension (default: yes)]), [BUILD_XINERAMA=$enableval], [BUILD_XINERAMA=yes])
AM_CONDITIONAL(BUILD_XINERAMA, [test "x$BUILD_XINERAMA" = xyes])
AC_ARG_ENABLE(xinput, AS_HELP_STRING([--enable-xinput], [Build XCB XInput Extension (EXPERIMENTAL) (default: no)]), [BUILD_XINPUT=$enableval], [BUILD_XINPUT=no])
AM_CONDITIONAL(BUILD_XINPUT, [test "x$BUILD_XINPUT" = xyes])
AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build XCB Xprint Extension (default: yes)]), [BUILD_XPRINT=$enableval], [BUILD_XPRINT=yes])
AM_CONDITIONAL(BUILD_XPRINT, [test "x$BUILD_XPRINT" = xyes])
AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build XCB SELinux Extension (default: no)]), [BUILD_SELINUX=$enableval], [BUILD_SELINUX=no])
AM_CONDITIONAL(BUILD_SELINUX, [test "x$BUILD_SELINUX" = xyes])
AC_ARG_ENABLE(xtest, AS_HELP_STRING([--enable-xtest], [Build XCB XTEST Extension (default: yes)]), [BUILD_XTEST=$enableval], [BUILD_XTEST=yes])
AM_CONDITIONAL(BUILD_XTEST, [test "x$BUILD_XTEST" = xyes])
AC_ARG_ENABLE(xv, AS_HELP_STRING([--enable-xv], [Build XCB Xv Extension (default: yes)]), [BUILD_XV=$enableval], [BUILD_XV=yes])
AM_CONDITIONAL(BUILD_XV, [test "x$BUILD_XV" = xyes])
AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--enable-xvmc], [Build XCB XvMC Extension (default: yes)]), [BUILD_XVMC=$enableval], [BUILD_XVMC=yes])
AM_CONDITIONAL(BUILD_XVMC, [test "x$BUILD_XVMC" = xyes])
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile doc/Makefile]) AC_CONFIG_FILES([
AC_CONFIG_FILES([xcb.pc xcb-xlib.pc xcb-composite.pc xcb-damage.pc xcb-dpms.pc xcb-glx.pc xcb-randr.pc xcb-record.pc xcb-render.pc xcb-res.pc xcb-screensaver.pc xcb-shape.pc xcb-shm.pc xcb-sync.pc xcb-xevie.pc xcb-xf86dri.pc xcb-xfixes.pc xcb-xinerama.pc xcb-xinput.pc xcb-xprint.pc xcb-xselinux.pc xcb-xtest.pc xcb-xv.pc xcb-xvmc.pc]) Makefile
AC_CONFIG_FILES([doc/xcb.doxygen]) doc/Makefile
src/Makefile
tests/Makefile
])
AC_CONFIG_FILES([
xcb.pc
xcb-xlib.pc
xcb-composite.pc
xcb-damage.pc
xcb-dpms.pc
xcb-glx.pc
xcb-randr.pc
xcb-record.pc
xcb-render.pc
xcb-res.pc
xcb-screensaver.pc
xcb-shape.pc
xcb-shm.pc
xcb-sync.pc
xcb-xevie.pc
xcb-xf86dri.pc
xcb-xfixes.pc
xcb-xinerama.pc
xcb-xinput.pc
xcb-xprint.pc
xcb-xselinux.pc
xcb-xtest.pc
xcb-xv.pc
xcb-xvmc.pc
])
AC_CONFIG_FILES([
doc/xcb.doxygen
])
AC_OUTPUT AC_OUTPUT

View File

@ -108,7 +108,7 @@ endif
EXTHEADERS += res.h EXTHEADERS += res.h
EXTSOURCES += res.c EXTSOURCES += res.c
EXTENSION_XML += res.xml EXTENSION_XML += res.xml
if BUILD_RES if BUILD_RESOURCE
lib_LTLIBRARIES += libxcb-res.la lib_LTLIBRARIES += libxcb-res.la
libxcb_res_la_LDFLAGS = -version-info 0:0:0 libxcb_res_la_LDFLAGS = -version-info 0:0:0
libxcb_res_la_LIBADD = $(XCB_LIBS) libxcb_res_la_LIBADD = $(XCB_LIBS)
@ -168,7 +168,7 @@ endif
EXTHEADERS += xf86dri.h EXTHEADERS += xf86dri.h
EXTSOURCES += xf86dri.c EXTSOURCES += xf86dri.c
EXTENSION_XML += xf86dri.xml EXTENSION_XML += xf86dri.xml
if BUILD_XF86DRI if BUILD_XFREE86_DRI
lib_LTLIBRARIES += libxcb-xf86dri.la lib_LTLIBRARIES += libxcb-xf86dri.la
libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0
libxcb_xf86dri_la_LIBADD = $(XCB_LIBS) libxcb_xf86dri_la_LIBADD = $(XCB_LIBS)