xorg-server.m4 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. dnl Copyright 2005 Red Hat, Inc
  2. dnl
  3. dnl Permission to use, copy, modify, distribute, and sell this software and its
  4. dnl documentation for any purpose is hereby granted without fee, provided that
  5. dnl the above copyright notice appear in all copies and that both that
  6. dnl copyright notice and this permission notice appear in supporting
  7. dnl documentation.
  8. dnl
  9. dnl The above copyright notice and this permission notice shall be included
  10. dnl in all copies or substantial portions of the Software.
  11. dnl
  12. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  15. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  16. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  17. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  18. dnl OTHER DEALINGS IN THE SOFTWARE.
  19. dnl
  20. dnl Except as contained in this notice, the name of the copyright holders shall
  21. dnl not be used in advertising or otherwise to promote the sale, use or
  22. dnl other dealings in this Software without prior written authorization
  23. dnl from the copyright holders.
  24. dnl
  25. # XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
  26. # --------------------------
  27. # Checks for the MACRO define in xorg-server.h (from the sdk). If it
  28. # is defined, then add the given PROTO to $REQUIRED_MODULES.
  29. AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
  30. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  31. SAVE_CFLAGS="$CFLAGS"
  32. CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
  33. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  34. #include "xorg-server.h"
  35. #if !defined $1
  36. #error $1 not defined
  37. #endif
  38. ]])],
  39. [_EXT_CHECK=yes],
  40. [_EXT_CHECK=no])
  41. CFLAGS="$SAVE_CFLAGS"
  42. AC_MSG_CHECKING([if $1 is defined])
  43. AC_MSG_RESULT([$_EXT_CHECK])
  44. if test "$_EXT_CHECK" != no; then
  45. REQUIRED_MODULES="$REQUIRED_MODULES $2"
  46. fi
  47. ])