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,109 +1,137 @@
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}
[AC_LANG_PROGRAM( CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
[[ AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
extern void f(int); extern void f(int);
#pragma GCC visibility pop #pragma GCC visibility pop
]], ]],
[[]] [[]]
)], )],
[AC_DEFINE( [AC_DEFINE(
GCC_HAS_VISIBILITY, GCC_HAS_VISIBILITY,
[], [],
[Defined if GCC supports the visibility feature]) [Defined if GCC supports the visibility feature])
m4_if([$1], [], [:], [$1]) m4_if([$1], [], [:], [$1])
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
AC_ARG_ENABLE(
[build_docs],
AC_HELP_STRING(
[--disable-build-docs],
[Disable the build of the documentation]),
[if test x"$enableval" != x"yes" ; then
enable_build_docs="no"
else
enable_build_docs="yes"
fi],
[enable_build_docs="yes"])
if test "$enable_build_docs" = "no" ; then dnl
BUILD_DOCS=no dnl Disable the build of the documentation
dnl
AC_ARG_ENABLE(
[build_docs],
AC_HELP_STRING(
[--disable-build-docs],
[Disable the build of the documentation]),
[if test x"$enableval" != x"yes" ; then
enable_build_docs="no"
else else
dnl enable_build_docs="yes"
dnl Get the prefix where doxygen is installed. fi],
dnl [enable_build_docs="yes"])
AC_ARG_WITH(
[doxygen], if test "$enable_build_docs" = "no" ; then
AC_HELP_STRING( BUILD_DOCS=no
[--with-doxygen=FILE], else
[doxygen program to use (eg /usr/bin/doxygen)]), dnl
dnl dnl Get the prefix where doxygen is installed.
dnl Check the given doxygen program. dnl
dnl AC_ARG_WITH(
[DOXYGEN=${withval} [doxygen],
AC_CHECK_PROG( AC_HELP_STRING(
[BUILD_DOCS], [--with-doxygen=FILE],
[${DOXYGEN}], [doxygen program to use (eg /usr/bin/doxygen)]),
[yes], dnl
[no]) dnl Check the given doxygen program.
if test $BUILD_DOCS = no; then dnl
echo "WARNING:" [DOXYGEN=${withval}
echo "The doxygen program you specified:" AC_CHECK_PROG(
echo "$DOXYGEN" [BUILD_DOCS],
echo "was not found. Please check the path and make sure " [${DOXYGEN}],
echo "the program exists and is executable." [yes],
AC_MSG_WARN( [no])
[Warning: no doxygen detected. Documentation will not be built]) if test $BUILD_DOCS = no; then
fi], echo "WARNING:"
[AC_CHECK_PROG( echo "The doxygen program you specified:"
[BUILD_DOCS], echo "$DOXYGEN"
[${DOXYGEN}], echo "was not found. Please check the path and make sure "
[yes], echo "the program exists and is executable."
[no]) AC_MSG_WARN(
if test ${BUILD_DOCS} = no; then [Warning: no doxygen detected. Documentation will not be built])
echo "WARNING:" fi],
echo "The doxygen program was not found in your execute" [AC_CHECK_PROG(
echo "You may have doxygen installed somewhere not covered by your path." [BUILD_DOCS],
echo "" [${DOXYGEN}],
echo "If this is the case make sure you have the packages installed, AND" [yes],
echo "that the doxygen program is in your execute path (see your" [no])
echo "shell's manual page on setting the \$PATH environment variable), OR" if test ${BUILD_DOCS} = no; then
echo "alternatively, specify the program to use with --with-doxygen." echo "WARNING:"
AC_MSG_WARN( echo "The doxygen program was not found in your execute"
[Warning: no doxygen detected. Documentation will not be built]) echo "You may have doxygen installed somewhere not covered by your path."
fi]) echo ""
fi echo "If this is the case make sure you have the packages installed, AND"
AC_MSG_CHECKING([whether documentation is built]) echo "that the doxygen program is in your execute path (see your"
AC_MSG_RESULT([${BUILD_DOCS}]) echo "shell manual page on setting the \$PATH environment variable), OR"
dnl echo "alternatively, specify the program to use with --with-doxygen."
dnl Substitution AC_MSG_WARN(
dnl [Warning: no doxygen detected. Documentation will not be built])
AC_SUBST([DOXYGEN]) fi])
AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes") fi
]) AC_MSG_CHECKING([whether documentation is built])
AC_MSG_RESULT([${BUILD_DOCS}])
dnl
dnl Substitution
dnl
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

@ -77,7 +77,7 @@ AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
[ #include <sys/types.h> [ #include <sys/types.h>
#include <sys/un.h> #include <sys/un.h>
]) ])
xcbincludedir='${includedir}/xcb' xcbincludedir='${includedir}/xcb'
AC_SUBST(xcbincludedir) AC_SUBST(xcbincludedir)
@ -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)