configure.ac 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. # Copyright 2005 Adam Jackson.
  2. #
  3. # Permission is hereby granted, free of charge, to any person obtaining a
  4. # copy of this software and associated documentation files (the "Software"),
  5. # to deal in the Software without restriction, including without limitation
  6. # on the rights to use, copy, modify, merge, publish, distribute, sub
  7. # license, and/or sell copies of the Software, and to permit persons to whom
  8. # the Software is furnished to do so, subject to the following conditions:
  9. #
  10. # The above copyright notice and this permission notice (including the next
  11. # paragraph) shall be included in all copies or substantial portions of the
  12. # Software.
  13. #
  14. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  17. # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  18. # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. #
  21. # Process this file with autoconf to produce a configure script
  22. # Initialize Autoconf
  23. AC_PREREQ(2.60)
  24. AC_INIT([xf86-video-geode],
  25. [2.11.16],
  26. [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode],
  27. [xf86-video-geode],
  28. [http://www.x.org/wiki/GeodeDriver])
  29. AC_CONFIG_SRCDIR([Makefile.am])
  30. AC_CONFIG_HEADERS([config.h])
  31. AC_CONFIG_MACRO_DIR([m4])
  32. AC_CONFIG_AUX_DIR([build-aux])
  33. # Initialize Automake
  34. AM_INIT_AUTOMAKE([foreign dist-bzip2])
  35. AM_MAINTAINER_MODE
  36. # Initialize libtool
  37. AC_DISABLE_STATIC
  38. AC_PROG_LIBTOOL
  39. # Require xorg-macros: XORG_DEFAULT_OPTIONS
  40. m4_ifndef([XORG_MACROS_VERSION],
  41. [m4_fatal([must install xorg-macros 1.4 or later before running autoconf/autogen])])
  42. XORG_MACROS_VERSION(1.4)
  43. XORG_DEFAULT_OPTIONS
  44. # Checks for programs.
  45. AC_DISABLE_STATIC
  46. AC_PROG_LIBTOOL
  47. AH_TOP([#include "xorg-server.h"])
  48. # -----------------------------------------------------------------------------
  49. # Configuration options
  50. # -----------------------------------------------------------------------------
  51. # Define a configure option for an alternate input module directory
  52. AC_ARG_WITH(xorg-module-dir,
  53. AS_HELP_STRING([--with-xorg-module-dir=DIR],
  54. [Default xorg module directory [[default=$libdir/xorg/modules]]]),
  55. [moduledir="$withval"],
  56. [moduledir="$libdir/xorg/modules"])
  57. AC_SUBST([moduledir])
  58. # Define a configure option to enable/disable lcd panel support
  59. AC_ARG_ENABLE(geodegx-panel,
  60. AS_HELP_STRING([--disable-geodegx-panel],
  61. [Disable support for flatpanels with the Geode GX]),
  62. [ ],
  63. [ PANEL_CPPFLAGS=-DPNL_SUP ])
  64. AC_SUBST(PANEL_CPPFLAGS)
  65. # Define a configure option to enable/disable ztv
  66. AC_ARG_ENABLE(ztv,
  67. AS_HELP_STRING([--enable-ztv],
  68. [Enable Video For Linux based ZTV driver (default: auto-detected)]),
  69. [ztv=$enableval],
  70. [ztv=auto])
  71. # Check for Video4Linux Version 2 (V4L2) availability
  72. AC_CHECK_HEADERS([linux/videodev2.h],[v4l2=yes],[v4l2=no])
  73. if test "x$ztv" != "xno" ; then
  74. if test "x$v4l2" = "xno" ; then
  75. if test "x$ztv" = "xyes" ; then
  76. # User really wants ztv but V4L2 is not found
  77. AC_MSG_ERROR([ZTV driver requested, but videodev2.h not found.])
  78. fi
  79. else
  80. BUILD_ZTV=yes
  81. fi
  82. fi
  83. AM_CONDITIONAL(BUILD_ZTV, [test "x$BUILD_ZTV" = xyes])
  84. # Check if GCC supports compiling in 32 bit mode for 64 bit computers
  85. case $host_cpu in
  86. x86_64*|amd64*)
  87. if test "x$GCC" = xyes ; then
  88. SAVE_CFLAGS="$CFLAGS"
  89. CFLAGS="$CFLAGS -m32"
  90. AC_MSG_CHECKING([if $CC supports the -m32 Intel/AMD option])
  91. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  92. #include <unistd.h>
  93. int
  94. main ()
  95. {
  96. ;
  97. return 0;
  98. }]])],
  99. [m32_support=yes; M32_CFLAGS=-m32],
  100. [m32_support=no])
  101. AC_MSG_RESULT([$m32_support])
  102. CFLAGS="$SAVE_CFLAGS"
  103. fi
  104. ;;
  105. esac
  106. AC_SUBST([M32_CFLAGS])
  107. # Store the list of server defined optional extensions in REQUIRED_MODULES
  108. XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
  109. XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
  110. XORG_DRIVER_CHECK_EXT(XV, videoproto)
  111. XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
  112. # Obtain compiler/linker options for the Geode driver dependencies
  113. PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES])
  114. PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
  115. HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
  116. HAVE_XEXTPROTO_71="no")
  117. # Define a configure option to enable/disable XAA support;
  118. # handles unavailability of XAA since xserver-1.13
  119. AC_ARG_ENABLE(xaa,
  120. AS_HELP_STRING([--enable-xaa],
  121. [Enable legacy X Acceleration Architecture (XAA) [default=auto]]))
  122. AS_IF([test "x$enable_xaa" != "xno"],
  123. [
  124. save_CFLAGS=$CFLAGS
  125. save_CPPFLAGS=$CPPFLAGS
  126. CFLAGS=$XORG_CFLAGS
  127. CPPFLAGS="$XORG_CFLAGS"
  128. AC_CHECK_HEADERS([xaa.h], have_XAA=yes, have_XAA=no)
  129. CFLAGS=$save_CFLAGS
  130. CPPFLAGS=$save_CPPFLAGS
  131. ])
  132. AC_MSG_CHECKING([whether to include XAA support])
  133. AS_IF([test "x$have_XAA" = "xyes"],
  134. [AC_MSG_RESULT([yes])],
  135. [AS_IF([test "x$enable_xaa" = "xyes"],
  136. [AC_MSG_ERROR([XAA requested but not found (perhaps building against xserver-1.13 or newer?)])],
  137. [AC_MSG_RESULT([no])
  138. ])
  139. ])
  140. # Checks for libpciaccess support.
  141. SAVE_CPPFLAGS="$CPPFLAGS"
  142. CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
  143. AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
  144. [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
  145. [#include "xorg-server.h"])
  146. CPPFLAGS="$SAVE_CPPFLAGS"
  147. if test "x$XSERVER_LIBPCIACCESS" = xyes; then
  148. PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
  149. XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
  150. fi
  151. AC_CONFIG_FILES([
  152. Makefile
  153. src/Makefile
  154. ])
  155. AC_OUTPUT