configure.ac 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. dnl Copyright © 2003-2005 Keith Packard, Daniel Stone
  2. dnl Copyright © 2013 Lauri Kasanen
  3. dnl
  4. dnl Permission to use, copy, modify, distribute, and sell this software and its
  5. dnl documentation for any purpose is hereby granted without fee, provided that
  6. dnl the above copyright notice appear in all copies and that both that
  7. dnl copyright notice and this permission notice appear in supporting
  8. dnl documentation, and that the names of Keith Packard and Daniel Stone not be
  9. dnl used in advertising or publicity pertaining to distribution of the software
  10. dnl without specific, written prior permission. Keith Packard and Daniel Stone
  11. dnl make no representations about the suitability of this software for any
  12. dnl purpose. It is provided "as is" without express or implied warranty.
  13. dnl
  14. dnl KEITH PACKARD AND DANIEL STONE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
  15. dnl SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
  16. dnl IN NO EVENT SHALL KEITH PACKARD OR DANIEL STONE BE LIABLE FOR ANY SPECIAL,
  17. dnl INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  18. dnl LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  19. dnl OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. dnl PERFORMANCE OF THIS SOFTWARE.
  21. dnl
  22. dnl Process this file with autoconf to create configure.
  23. AC_PREREQ(2.57)
  24. AC_INIT([tinyx], 1.3)
  25. AC_CONFIG_SRCDIR([Makefile.am])
  26. AC_CONFIG_MACRO_DIR([m4])
  27. AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip foreign -Wall])
  28. dnl this gets generated by autoheader, and thus contains all the defines. we
  29. dnl don't ever actually use it, internally.
  30. AC_CONFIG_HEADERS(include/do-not-use-config.h)
  31. dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just
  32. dnl dix/).
  33. AC_CONFIG_HEADERS(include/dix-config.h)
  34. dnl kdrive-config.h covers the kdrive DDX
  35. AC_CONFIG_HEADERS(include/kdrive-config.h)
  36. AC_PROG_CC
  37. AM_PROG_AS
  38. AC_PROG_INSTALL
  39. AC_PROG_LN_S
  40. AC_DISABLE_SHARED
  41. AC_PROG_LIBTOOL
  42. PKG_PROG_PKG_CONFIG
  43. AC_PROG_LEX
  44. AC_PROG_YACC
  45. AC_HEADER_DIRENT
  46. AC_HEADER_STDC
  47. AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
  48. dnl Checks for typedefs, structures, and compiler characteristics.
  49. AC_C_CONST
  50. AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])
  51. AC_CHECK_SIZEOF([unsigned long])
  52. if test "$ac_cv_sizeof_unsigned_long" = 8; then
  53. AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.])
  54. fi
  55. AC_TYPE_PID_T
  56. dnl Checks for library functions.
  57. AC_FUNC_VPRINTF
  58. AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
  59. strtol getopt getopt_long vsnprintf])
  60. AC_FUNC_ALLOCA
  61. dnl Old HAS_* names used in os/*.c.
  62. AC_CHECK_FUNC([getdtablesize],
  63. AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the `getdtablesize' function.]))
  64. AC_CHECK_FUNC([getifaddrs],
  65. AC_DEFINE(HAS_GETIFADDRS, 1, [Have the `getifaddrs' function.]))
  66. AC_CHECK_FUNC([getpeereid],
  67. AC_DEFINE(HAS_GETPEEREID, 1, [Have the `getpeereid' function.]))
  68. AC_CHECK_FUNC([getpeerucred],
  69. AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the `getpeerucred' function.]))
  70. AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no)
  71. AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno])
  72. AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno])
  73. dnl Check for mmap support for Xvfb
  74. AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the `mmap' function.]))
  75. dnl Find the math libary
  76. AC_CHECK_LIB(m, sqrt)
  77. dnl APM header
  78. AC_CHECK_HEADERS([linux/apm_bios.h], LNXAPM=yes)
  79. AM_CONDITIONAL(LNXAPM, [test "x$LNXAPM" = xyes])
  80. dnl fbdev header
  81. AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes)
  82. AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes])
  83. dnl MTRR header
  84. AC_CHECK_HEADERS([asm/mtrr.h], ac_cv_asm_mtrr_h=yes)
  85. if test "x$ac_cv_asm_mtrr_h" = xyes; then
  86. HAVE_MTRR=yes
  87. fi
  88. dnl BSD MTRR header
  89. AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes)
  90. if test "x$ac_cv_memrange_h" = xyes; then
  91. HAVE_MTRR=yes
  92. fi
  93. if test "x$HAVE_MTRR" = xyes; then
  94. AC_DEFINE(HAS_MTRR_SUPPORT, 1, [MTRR support available])
  95. fi
  96. dnl A NetBSD MTRR header
  97. AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_machine_mtrr_h=yes)
  98. if test "x$ac_cv_machine_mtrr_h" = xyes; then
  99. AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR
  100. support is available])
  101. fi
  102. dnl ---------------------------------------------------------------------------
  103. dnl Bus options and CPU capabilities. Replaces logic in
  104. dnl hw/xfree86/os-support/bus/Makefile.am, among others.
  105. dnl ---------------------------------------------------------------------------
  106. DEFAULT_INT10="x86emu"
  107. dnl Override defaults as needed for specific platforms:
  108. case $host_cpu in
  109. alpha*)
  110. ALPHA_VIDEO=yes
  111. case $host_os in
  112. *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;;
  113. esac
  114. ;;
  115. arm*)
  116. ARM_VIDEO=yes
  117. ;;
  118. i*86)
  119. I386_VIDEO=yes
  120. case $host_os in
  121. *linux*) DEFAULT_INT10=vm86 ;;
  122. *freebsd*) AC_DEFINE(USE_DEV_IO) ;;
  123. *netbsd*) AC_DEFINE(USE_I386_IOPL)
  124. SYS_LIBS=-li386
  125. ;;
  126. *openbsd*) AC_DEFINE(USE_I386_IOPL)
  127. SYS_LIBS=-li386
  128. ;;
  129. esac
  130. ;;
  131. powerpc*)
  132. PPC_VIDEO=yes
  133. case $host_os in
  134. *freebsd*) DEFAULT_INT10=stub ;;
  135. esac
  136. ;;
  137. sparc*)
  138. xorg_loader_sparcmuldiv="yes"
  139. SPARC64_VIDEO=yes
  140. BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
  141. ;;
  142. x86_64*|amd64*)
  143. I386_VIDEO=yes
  144. case $host_os in
  145. *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
  146. *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
  147. SYS_LIBS=-lx86_64
  148. ;;
  149. *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl])
  150. SYS_LIBS=-lamd64
  151. ;;
  152. esac
  153. ;;
  154. esac
  155. dnl BSD *_video.c selection
  156. AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])
  157. AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes])
  158. AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes])
  159. AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
  160. AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
  161. dnl it would be nice to autodetect these *CONS_SUPPORTs
  162. case $host_os in
  163. *freebsd*)
  164. case $host_os in
  165. kfreebsd*-gnu) ;;
  166. *) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;;
  167. esac
  168. ;;
  169. *netbsd*)
  170. AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
  171. ;;
  172. *openbsd*)
  173. AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
  174. ;;
  175. esac
  176. OSNAME=`uname -srm`
  177. AC_DEFINE_UNQUOTED(OSNAME, "$OSNAME",
  178. [Define to OS Name string to display for build OS in Xorg log])
  179. DEFAULT_VENDOR_NAME="TinyCore Linux"
  180. DEFAULT_VENDOR_NAME_SHORT="TinyCore"
  181. VERSION_MAJOR=1
  182. VERSION_MINOR=0
  183. VERSION_PATCH=0
  184. VERSION_SNAP=0
  185. RELEASE_DATE="22 Sep 2015"
  186. DEFAULT_VENDOR_WEB="http://tinycorelinux.com"
  187. m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
  188. dnl Build options.
  189. AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],
  190. [Treat warnings as errors (default: disabled)]),
  191. [WERROR=$enableval], [WERROR=no])
  192. AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
  193. [Enable debugging (default: disabled)]),
  194. [DEBUGGING=$enableval], [DEBUGGING=no])
  195. AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]),
  196. [INT10="$withval"],
  197. [INT10="$DEFAULT_INT10"])
  198. AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-string=VENDOR],
  199. [Vendor string reported by the server]),
  200. [ VENDOR_STRING="$withval" ],
  201. [ VENDOR_STRING="$DEFAULT_VENDOR_NAME" ])
  202. AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-string-short=VENDOR],
  203. [Short version of vendor string reported by the server]),
  204. [ VENDOR_STRING_SHORT="$withval" ],
  205. [ VENDOR_STRING_SHORT="$DEFAULT_VENDOR_NAME_SHORT" ])
  206. AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL],
  207. [Vendor web address reported by the server]),
  208. [ VENDOR_WEB="$withval" ],
  209. [ VENDOR_WEB="$DEFAULT_VENDOR_WEB" ])
  210. AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS],
  211. [Builder address (default: xorg@lists.freedesktop.org)]),
  212. [ BUILDERADDR="$withval" ],
  213. [ BUILDERADDR="xorg@lists.freedesktop.org" ])
  214. AC_ARG_WITH(fontdir, AS_HELP_STRING([--with-fontdir=FONTDIR], [Path to top level dir where fonts are installed (default: ${libdir}/X11/fonts)]),
  215. [ FONTDIR="$withval" ],
  216. [ FONTDIR="${libdir}/X11/fonts" ])
  217. DEFAULT_FONT_PATH="${FONTDIR}/misc/,${FONTDIR}/100dpi/,${FONTDIR}/75dpi/"
  218. AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
  219. [ FONTPATH="$withval" ],
  220. [ FONTPATH="${DEFAULT_FONT_PATH}" ])
  221. dnl Extensions.
  222. AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
  223. AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes])
  224. AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto])
  225. AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto])
  226. AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
  227. AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes])
  228. AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
  229. dnl kdrive and its subsystems
  230. AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: yes)]), [KDRIVE=$enableval], [KDRIVE=yes])
  231. dnl chown/chmod to be setuid root as part of build
  232. dnl Replaces InstallXserverSetUID in imake
  233. AC_ARG_ENABLE(install-setuid,
  234. AS_HELP_STRING([--enable-install-setuid],
  235. [Install Xorg server as owned by root with setuid bit (default: auto)]),
  236. [SETUID=$enableval], [SETUID=auto])
  237. AC_MSG_CHECKING([to see if we can install the Xorg server as root])
  238. if test "x$SETUID" = "xauto" ; then
  239. case $host_os in
  240. darwin*) SETUID="no" ;;
  241. *)
  242. case $host_cpu in
  243. sparc) SETUID="no" ;;
  244. *) SETUID="yes" ;;
  245. esac
  246. esac
  247. if test "x$SETUID" = xyes; then
  248. touch testfile
  249. chown root testfile > /dev/null 2>&1 || SETUID="no"
  250. rm -f testfile
  251. fi
  252. fi
  253. AC_MSG_RESULT([$SETUID])
  254. AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"])
  255. dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro
  256. dnl was not expanded, since xorg-server with no transport types is rather useless.
  257. dnl
  258. dnl If you're seeing an error here, be sure you installed the lib/xtrans module
  259. dnl first and if it's not in the default location, that you set the ACLOCAL
  260. dnl environment variable to find it, such as:
  261. dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
  262. m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$])
  263. # Transport selection macro from xtrans.m4
  264. XTRANS_CONNECTION_FLAGS
  265. # Secure RPC detection macro from xtrans.m4
  266. XTRANS_SECURE_RPC_FLAGS
  267. AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86])
  268. AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu])
  269. AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub])
  270. if test "x$INT10" = xyes; then
  271. dnl VM86 headers
  272. AC_CHECK_HEADERS([sys/vm86.h sys/io.h])
  273. fi
  274. dnl ---------------------------------------------------------------------------
  275. dnl Extension section
  276. dnl ---------------------------------------------------------------------------
  277. XEXT_INC='-I$(top_srcdir)/Xext'
  278. XEXT_LIB='$(top_builddir)/Xext/libXext.la'
  279. XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
  280. dnl Core modules for most extensions, et al.
  281. REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto xproto xtrans xf86bigfontproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto [kbproto >= 1.0.3]"
  282. REQUIRED_LIBS="xfont fontenc"
  283. AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes])
  284. if test "x$SCREENSAVER" = xyes; then
  285. AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension])
  286. fi
  287. AM_CONDITIONAL(RES, [test "x$RES" = xyes])
  288. if test "x$RES" = xyes; then
  289. AC_DEFINE(RES, 1, [Support X resource extension])
  290. REQUIRED_MODULES="$REQUIRED_MODULES resourceproto"
  291. fi
  292. AM_CONDITIONAL(DBE, [test "x$DBE" = xyes])
  293. if test "x$DBE" = xyes; then
  294. AC_DEFINE(DBE, 1, [Support DBE extension])
  295. DBE_LIB='$(top_builddir)/dbe/libdbe.la'
  296. fi
  297. AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes])
  298. if test "x$XF86BIGFONT" = xyes; then
  299. AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension])
  300. fi
  301. AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes])
  302. if test "x$DPMSExtension" = xyes; then
  303. AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
  304. fi
  305. RENDER_LIB='$(top_builddir)/render/librender.la'
  306. RENDER_INC='-I$(top_srcdir)/render'
  307. RANDR_LIB='$(top_builddir)/randr/librandr.la'
  308. RANDR_INC='-I$(top_srcdir)/randr'
  309. FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la'
  310. FIXES_INC='-I$(top_srcdir)/xfixes'
  311. DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
  312. DAMAGE_INC='-I$(top_srcdir)/damageext'
  313. MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
  314. MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
  315. AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1,
  316. [Do not have `strcasecmp'.]))
  317. PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"])
  318. if test "x$have_libxdmcp" = xyes; then
  319. AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS])
  320. fi
  321. if test "x$XDMCP" = xauto; then
  322. if test "x$have_libxdmcp" = xyes; then
  323. XDMCP=yes
  324. else
  325. XDMCP=no
  326. fi
  327. fi
  328. if test "x$XDMAUTH" = xauto; then
  329. if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then
  330. XDMAUTH=yes
  331. else
  332. XDMAUTH=no
  333. fi
  334. fi
  335. AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes])
  336. if test "x$XDMCP" = xyes; then
  337. AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol])
  338. REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
  339. XDMCP_MODULES="xdmcp"
  340. fi
  341. AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes])
  342. if test "x$XDMAUTH" = xyes; then
  343. AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1])
  344. if ! test "x$XDMCP" = xyes; then
  345. REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
  346. XDMCP_MODULES="xdmcp"
  347. fi
  348. fi
  349. VENDOR_RELEASE="((($VERSION_MAJOR) * 10000000) + (($VERSION_MINOR) * 100000) + (($VERSION_PATCH) * 1000) + $VERSION_SNAP)"
  350. if test $VERSION_SNAP = "0"; then
  351. if test $VERSION_PATCH = "0"; then
  352. VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}"
  353. else
  354. VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
  355. fi
  356. else
  357. VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_SNAP}"
  358. fi
  359. VENDOR_RELEASE_STRING="Release ${VENDOR_VERSION_STRING}"
  360. VENDOR_MAN_VERSION="Version ${VENDOR_VERSION_STRING}"
  361. AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
  362. AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path])
  363. AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_STRING"], [Vendor name])
  364. AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_STRING_SHORT"], [Short vendor name])
  365. AC_DEFINE_UNQUOTED(XORG_RELEASE, ["$VENDOR_RELEASE_STRING"], [Vendor release])
  366. AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release])
  367. AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
  368. AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address])
  369. AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name])
  370. AC_SUBST([VENDOR_STRING])
  371. AC_SUBST([VENDOR_STRING_SHORT])
  372. AC_SUBST([VENDOR_RELEASE])
  373. AC_SUBST([VENDOR_MAN_VERSION])
  374. AC_DEFINE(SMART_SCHEDULE, 1, [Include time-based scheduler])
  375. AM_CONDITIONAL(DEBUG, test "x$DEBUGGING" = xyes)
  376. if ! test "x$DEBUGGING" = xyes; then
  377. AC_DEFINE(NDEBUG, 1, [Disable some debugging code])
  378. fi
  379. DIX_LIB='$(top_builddir)/dix/libdix.la'
  380. OS_LIB='$(top_builddir)/os/libos.la'
  381. MI_LIB='$(top_builddir)/mi/libmi.la'
  382. MI_EXT_LIB='$(top_builddir)/mi/libmiext.la'
  383. MI_INC='-I$(top_srcdir)/mi'
  384. FB_LIB='$(top_builddir)/fb/libfb.la'
  385. FB_INC='-I$(top_srcdir)/fb'
  386. MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow'
  387. MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
  388. CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
  389. PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
  390. PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
  391. XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS}"
  392. XSERVER_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} -lm"
  393. AC_SUBST([SYS_LIBS])
  394. AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes],
  395. [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt],
  396. [have_clock_gettime=no])])
  397. AC_MSG_CHECKING([for a useful monotonic clock ...])
  398. if ! test "x$have_clock_gettime" = xno; then
  399. if ! test "x$have_clock_gettime" = xyes; then
  400. LIBS="$have_clock_gettime"
  401. else
  402. LIBS=""
  403. fi
  404. AC_RUN_IFELSE([AC_LANG_SOURCE([
  405. #define _POSIX_C_SOURCE 199309L
  406. #include <time.h>
  407. int main(int argc, char *argv[]) {
  408. struct timespec tp;
  409. if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
  410. return 0;
  411. else
  412. return 1;
  413. }
  414. ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
  415. [MONOTONIC_CLOCK="cross compiling"])
  416. else
  417. MONOTONIC_CLOCK=no
  418. fi
  419. AC_MSG_RESULT([$MONOTONIC_CLOCK])
  420. if test "x$MONOTONIC_CLOCK" = xyes; then
  421. AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()])
  422. XSERVER_LIBS="$XSERVER_LIBS $LIBS"
  423. fi
  424. XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $DAMAGE_INC $FIXES_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC"
  425. AC_DEFINE_UNQUOTED(X_BYTE_ORDER,[$ENDIAN],[Endian order])
  426. AC_SUBST([XSERVER_LIBS])
  427. dnl ---------------------------------------------------------------------------
  428. dnl DDX section.
  429. dnl ---------------------------------------------------------------------------
  430. # XORG_CORE_LIBS is needed even if you're not building the Xorg DDX
  431. XORG_CORE_LIBS="$DIX_LIB"
  432. AC_SUBST([XORG_CORE_LIBS])
  433. xorg_bus_linuxpci=no
  434. xorg_bus_freebsdpci=no
  435. xorg_bus_netbsdpci=no
  436. xorg_bus_ix86pci=no
  437. xorg_bus_ppcpci=no
  438. xorg_bus_sparcpci=no
  439. xorg_bus_sparc=no
  440. AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
  441. AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
  442. AM_CONDITIONAL([XORG_BUS_FREEBSDPCI], [test "x$xorg_bus_freebsdpci" = xyes])
  443. AM_CONDITIONAL([XORG_BUS_NETBSDPCI], [test "x$xorg_bus_netbsdpci" = xyes])
  444. AM_CONDITIONAL([XORG_BUS_IX86PCI], [test "x$xorg_bus_ix86pci" = xyes])
  445. AM_CONDITIONAL([XORG_BUS_PPCPCI], [test "x$xorg_bus_ppcpci" = xyes])
  446. AM_CONDITIONAL([XORG_BUS_SPARCPCI], [test "x$xorg_bus_sparcpci" = xyes])
  447. AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
  448. AM_CONDITIONAL([XORG_LOADER_SPARC], [test "x$xorg_loader_sparcmuldiv" = xyes])
  449. AM_CONDITIONAL([LINUX_IA64], [test "x$linux_ia64" = xyes])
  450. AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
  451. AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
  452. dnl kdrive DDX
  453. AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes])
  454. if test "$KDRIVE" = yes; then
  455. AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server])
  456. AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx])
  457. AC_CHECK_HEADERS([asm/vm86.h sys/io.h])
  458. if test "$ac_cv_header_asm_vm86_h" = yes; then
  459. AC_DEFINE(KDRIVEVESA, 1, [Build VESA-based kdrive servers])
  460. fi
  461. AC_CHECK_HEADERS([linux/fb.h])
  462. if test "$ac_cv_header_linux_fb_h" = yes; then
  463. AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server])
  464. fi
  465. # damage shadow extension fb mi
  466. KDRIVE_INC='-I$(top_srcdir)/kdrive/src'
  467. KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC"
  468. KDRIVE_OS_INC='-I$(top_srcdir)/kdrive/linux'
  469. KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC"
  470. KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H"
  471. # dix os fb mi extension glx (NOTYET) damage shadow
  472. #KDRIVE_PURE_LIBS="$DIX_LIB $OS_LIB $FB_LIB $XEXT_LIB $MIEXT_DAMAGE_LIB \
  473. # $MIEXT_SHADOW_LIB"
  474. KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $OS_LIB"
  475. KDRIVE_LIB='$(top_builddir)/kdrive/src/libkdrive.a'
  476. case $host_os in
  477. *linux*)
  478. KDRIVE_OS_LIB='$(top_builddir)/kdrive/linux/liblinux.a'
  479. KDRIVELINUX=yes
  480. ;;
  481. esac
  482. KDRIVE_STUB_LIB='$(top_builddir)/kdrive/src/libkdrivestubs.a'
  483. KDRIVE_LIBS="$DIX_LIB $KDRIVE_LIB $KDRIVE_OS_LIB $KDRIVE_PURE_LIBS $KDRIVE_STUB_LIB"
  484. fi
  485. AC_SUBST(KDRIVE_INCS)
  486. AC_SUBST(KDRIVE_PURE_INCS)
  487. AC_SUBST(KDRIVE_CFLAGS)
  488. AC_SUBST(KDRIVE_PURE_LIBS)
  489. AC_SUBST(KDRIVE_LIBS)
  490. AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes])
  491. AM_CONDITIONAL(KDRIVEVESA, [test x"$ac_cv_header_asm_vm86_h" = xyes])
  492. AM_CONDITIONAL(KDRIVEFBDEV, [test x"$ac_cv_header_linux_fb_h" = xyes])
  493. dnl and the rest of these are generic, so they're in config.h
  494. AC_DEFINE(XResExtension, 1, [Build XRes extension])
  495. AC_TRY_COMPILE([
  496. #include <features.h>
  497. #ifndef __GLIBC__
  498. #error not glibc
  499. #endif
  500. ], [], [AC_DEFINE(_GNU_SOURCE, 1,
  501. [ Enable GNU and other extensions to the C environment for glibc])])
  502. dnl ---------- Compiler arguments
  503. AX_CHECK_COMPILE_FLAG([-flto],
  504. [CFLAGS="$CFLAGS -flto"; LDFLAGS="$LDFLAGS -flto"; ac_cv_lto_supported=yes],
  505. [ac_cv_lto_supported=no],
  506. [])
  507. if test x"$ac_cv_lto_supported" = xno; then
  508. AC_MSG_NOTICE([LTO not supported, checking sections instead...])
  509. AX_CHECK_COMPILE_FLAG([-ffunction-sections],
  510. [CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
  511. LDFLAGS="$LDFLAGS -Wl,-gc-sections"
  512. ac_cv_sections_supported=yes],
  513. [ac_cv_sections_supported=no],
  514. [])
  515. fi
  516. AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
  517. [CFLAGS="$CFLAGS -fvisibility=hidden"; ac_cv_visibility_supported=yes],
  518. [ac_cv_visiblity_supported=no],
  519. [])
  520. # Defeat .eh_frame bloat (gcc 4.6.3 x86-32 defconfig: 20% smaller busybox binary)
  521. AX_CHECK_COMPILE_FLAG([-fno-unwind-tables],
  522. [CFLAGS="$CFLAGS -fno-unwind-tables"],
  523. [],
  524. [])
  525. AX_CHECK_COMPILE_FLAG([-fno-asynchronous-unwind-tables],
  526. [CFLAGS="$CFLAGS -fno-asynchronous-unwind-tables"],
  527. [],
  528. [])
  529. AX_CHECK_LINK_FLAG([-Wl,-as-needed], [LDFLAGS="$LDFLAGS -Wl,-as-needed"],
  530. [], [])
  531. dnl ----------
  532. AC_CHECK_LIB([ife],[meaning])
  533. CFLAGS="$XSERVER_CFLAGS $CFLAGS -Wall"
  534. AC_SUBST([CFLAGS])
  535. LDFLAGS="$LDFLAGS -Wl,-O1"
  536. AC_SUBST([LDFLAGS])
  537. BUILD_DATE="$(date +'%Y%m%d')"
  538. AC_SUBST([BUILD_DATE])
  539. DIX_CFLAGS="-DHAVE_DIX_CONFIG_H"
  540. AC_SUBST([DIX_CFLAGS])
  541. AC_SUBST([libdir])
  542. AC_SUBST([exec_prefix])
  543. AC_SUBST([prefix])
  544. # XORG in this case refers to the roll-up releases, not the Xorg DDX.
  545. XORG_RELEASE_VERSION
  546. AC_OUTPUT([
  547. Makefile
  548. include/Makefile
  549. damageext/Makefile
  550. dbe/Makefile
  551. dix/Makefile
  552. fb/Makefile
  553. mi/Makefile
  554. miext/Makefile
  555. miext/damage/Makefile
  556. miext/shadow/Makefile
  557. os/Makefile
  558. randr/Makefile
  559. render/Makefile
  560. Xext/Makefile
  561. xfixes/Makefile
  562. kdrive/Makefile
  563. kdrive/fbdev/Makefile
  564. kdrive/linux/Makefile
  565. kdrive/src/Makefile
  566. kdrive/vesa/Makefile
  567. ])