configure.ac 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699
  1. dnl Copyright © 2003-2007 Keith Packard, Daniel Stone
  2. dnl
  3. dnl Permission is hereby granted, free of charge, to any person obtaining a
  4. dnl copy of this software and associated documentation files (the "Software"),
  5. dnl to deal in the Software without restriction, including without limitation
  6. dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
  7. dnl and/or sell copies of the Software, and to permit persons to whom the
  8. dnl Software is furnished to do so, subject to the following conditions:
  9. dnl
  10. dnl The above copyright notice and this permission notice (including the next
  11. dnl paragraph) shall be included in all copies or substantial portions of the
  12. dnl Software.
  13. dnl
  14. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. dnl DEALINGS IN THE SOFTWARE.
  21. dnl
  22. dnl Authors: Keith Packard <keithp@keithp.com>
  23. dnl Daniel Stone <daniel@fooishbar.org>
  24. dnl an unwitting cast of miscellaneous others
  25. dnl
  26. dnl Process this file with autoconf to create configure.
  27. AC_PREREQ(2.60)
  28. AC_INIT([xorg-server], 1.16.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
  29. RELEASE_DATE="2014-12-20"
  30. RELEASE_NAME="Marionberry Pie"
  31. AC_CONFIG_SRCDIR([Makefile.am])
  32. AC_CONFIG_MACRO_DIR([m4])
  33. AM_INIT_AUTOMAKE([foreign dist-bzip2])
  34. AC_USE_SYSTEM_EXTENSIONS
  35. # Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS
  36. m4_ifndef([XORG_MACROS_VERSION],
  37. [m4_fatal([must install xorg-macros 1.14 or later before running autoconf/autogen])])
  38. XORG_MACROS_VERSION(1.14)
  39. XORG_DEFAULT_OPTIONS
  40. XORG_WITH_DOXYGEN(1.6.1)
  41. XORG_CHECK_SGML_DOCTOOLS(1.8)
  42. XORG_ENABLE_DOCS
  43. XORG_ENABLE_DEVEL_DOCS
  44. XORG_WITH_XMLTO(0.0.20)
  45. XORG_WITH_FOP
  46. XORG_WITH_XSLTPROC
  47. XORG_ENABLE_UNIT_TESTS
  48. XORG_LD_WRAP([optional])
  49. m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install font-util 1.1 or later before running autoconf/autogen])])
  50. XORG_FONT_MACROS_VERSION(1.1)
  51. dnl this gets generated by autoheader, and thus contains all the defines. we
  52. dnl don't ever actually use it, internally.
  53. AC_CONFIG_HEADERS(include/do-not-use-config.h)
  54. dnl xorg-server.h is an external header, designed to be included by loadable
  55. dnl drivers.
  56. AC_CONFIG_HEADERS(include/xorg-server.h)
  57. dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just
  58. dnl dix/).
  59. AC_CONFIG_HEADERS(include/dix-config.h)
  60. dnl xorg-config.h covers the Xorg DDX.
  61. AC_CONFIG_HEADERS(include/xorg-config.h)
  62. dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs.
  63. AC_CONFIG_HEADERS(include/xkb-config.h)
  64. dnl xwin-config.h covers the XWin DDX.
  65. AC_CONFIG_HEADERS(include/xwin-config.h)
  66. dnl kdrive-config.h covers the kdrive DDX
  67. AC_CONFIG_HEADERS(include/kdrive-config.h)
  68. dnl version-config.h covers the version numbers so they can be bumped without
  69. dnl forcing an entire recompile.x
  70. AC_CONFIG_HEADERS(include/version-config.h)
  71. AM_PROG_AS
  72. AC_PROG_LN_S
  73. LT_PREREQ([2.2])
  74. LT_INIT([disable-static win32-dll])
  75. PKG_PROG_PKG_CONFIG
  76. AC_PROG_LEX
  77. AC_PROG_YACC
  78. AC_SYS_LARGEFILE
  79. XORG_PROG_RAWCPP
  80. # Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow
  81. # easier overrides at build time.
  82. XSERVER_CFLAGS='$(CWARNFLAGS)'
  83. dnl Explicitly add -fno-strict-aliasing since this option should disappear
  84. dnl from util-macros CWARNFLAGS
  85. if test "x$GCC" = xyes ; then
  86. XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
  87. fi
  88. dnl Check for dtrace program (needed to build Xserver dtrace probes)
  89. dnl Also checks for <sys/sdt.h>, since some Linux distros have an
  90. dnl ISDN trace program named dtrace
  91. AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH],
  92. [Enable dtrace probes (default: enabled if dtrace found)]),
  93. [WDTRACE=$withval], [WDTRACE=auto])
  94. if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
  95. AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin])
  96. if test "x$DTRACE" = "xnot_found" ; then
  97. if test "x$WDTRACE" = "xyes" ; then
  98. AC_MSG_FAILURE([dtrace requested but not found])
  99. fi
  100. WDTRACE="no"
  101. else
  102. AC_CHECK_HEADER(sys/sdt.h, [HAS_SDT_H="yes"], [HAS_SDT_H="no"])
  103. if test "x$WDTRACE" = "xauto" -a "x$HAS_SDT_H" = "xno" ; then
  104. WDTRACE="no"
  105. fi
  106. fi
  107. fi
  108. if test "x$WDTRACE" != "xno" ; then
  109. AC_DEFINE(XSERVER_DTRACE, 1,
  110. [Define to 1 if the DTrace Xserver provider probes should be built in.])
  111. # Solaris/OpenSolaris require dtrace -G to build dtrace probe information into
  112. # object files, and require linking with those as relocatable objects, not .a
  113. # archives. MacOS X handles all this in the normal compiler toolchain, and on
  114. # some releases (like Tiger), will error out on dtrace -G. For now, other
  115. # platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux
  116. # ports appear to, based on my web searches, but have not yet been tested).
  117. case $host_os in
  118. darwin*) SPECIAL_DTRACE_OBJECTS=no ;;
  119. *) SPECIAL_DTRACE_OBJECTS=yes ;;
  120. esac
  121. fi
  122. AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"])
  123. AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"])
  124. AC_HEADER_DIRENT
  125. AC_HEADER_STDC
  126. AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \
  127. fnmatch.h sys/mkdev.h sys/utsname.h])
  128. dnl Checks for typedefs, structures, and compiler characteristics.
  129. AC_C_CONST
  130. AC_C_TYPEOF
  131. AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])
  132. AC_CHECK_SIZEOF([unsigned long])
  133. if test "$ac_cv_sizeof_unsigned_long" = 8; then
  134. AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.])
  135. fi
  136. AC_TYPE_PID_T
  137. # Checks for headers/macros for byte swapping
  138. # Known variants:
  139. # <byteswap.h> bswap_16, bswap_32, bswap_64 (glibc)
  140. # <sys/endian.h> __swap16, __swap32, __swap64 (OpenBSD)
  141. # <sys/endian.h> bswap16, bswap32, bswap64 (other BSD's)
  142. # and a fallback to local macros if none of the above are found
  143. # if <byteswap.h> is found, assume it's the correct version
  144. AC_CHECK_HEADERS([byteswap.h])
  145. # if <sys/endian.h> is found, have to check which version
  146. AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"])
  147. if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then
  148. AC_MSG_CHECKING([for __swap16 variant of <sys/endian.h> byteswapping macros])
  149. AC_LINK_IFELSE([AC_LANG_PROGRAM([
  150. #include <sys/types.h>
  151. #include <sys/endian.h>
  152. ], [
  153. int a = 1, b;
  154. b = __swap16(a);
  155. ])
  156. ], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no'])
  157. AC_MSG_RESULT([$SYS_ENDIAN__SWAP])
  158. AC_MSG_CHECKING([for bswap16 variant of <sys/endian.h> byteswapping macros])
  159. AC_LINK_IFELSE([AC_LANG_PROGRAM([
  160. #include <sys/types.h>
  161. #include <sys/endian.h>
  162. ], [
  163. int a = 1, b;
  164. b = bswap16(a);
  165. ])
  166. ], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no'])
  167. AC_MSG_RESULT([$SYS_ENDIAN_BSWAP])
  168. if test "$SYS_ENDIAN_BSWAP" = "yes" ; then
  169. USE_SYS_ENDIAN_H=yes
  170. BSWAP=bswap
  171. else
  172. if test "$SYS_ENDIAN__SWAP" = "yes" ; then
  173. USE_SYS_ENDIAN_H=yes
  174. BSWAP=__swap
  175. else
  176. USE_SYS_ENDIAN_H=no
  177. fi
  178. fi
  179. if test "$USE_SYS_ENDIAN_H" = "yes" ; then
  180. AC_DEFINE([USE_SYS_ENDIAN_H], 1,
  181. [Define to use byteswap macros from <sys/endian.h>])
  182. AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16,
  183. [Define to 16-bit byteswap macro])
  184. AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32,
  185. [Define to 32-bit byteswap macro])
  186. AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64,
  187. [Define to 64-bit byteswap macro])
  188. fi
  189. fi
  190. dnl Check to see if dlopen is in default libraries (like Solaris, which
  191. dnl has it in libc), or if libdl is needed to get it.
  192. AC_CHECK_FUNC([dlopen], [],
  193. AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
  194. AC_SUBST(DLOPEN_LIBS)
  195. dnl Checks for library functions.
  196. AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \
  197. getdtablesize getifaddrs getpeereid getpeerucred getzoneid \
  198. mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext])
  199. AC_REPLACE_FUNCS([strcasecmp strcasestr strlcat strlcpy strndup])
  200. dnl Find the math libary, then check for cbrt function in it.
  201. AC_CHECK_LIB(m, sqrt)
  202. AC_CHECK_FUNCS([cbrt])
  203. AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
  204. dnl AGPGART headers
  205. AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes)
  206. AM_CONDITIONAL(AGP, [test "x$AGP" = xyes])
  207. dnl fbdev header
  208. AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes)
  209. AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes])
  210. dnl MTRR header
  211. AC_CHECK_HEADERS([asm/mtrr.h], ac_cv_asm_mtrr_h=yes)
  212. if test "x$ac_cv_asm_mtrr_h" = xyes; then
  213. HAVE_MTRR=yes
  214. fi
  215. dnl BSD MTRR header
  216. AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes)
  217. if test "x$ac_cv_memrange_h" = xyes; then
  218. HAVE_MTRR=yes
  219. fi
  220. if test "x$HAVE_MTRR" = xyes; then
  221. AC_DEFINE(HAS_MTRR_SUPPORT, 1, [MTRR support available])
  222. fi
  223. dnl A NetBSD MTRR header
  224. AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_machine_mtrr_h=yes)
  225. if test "x$ac_cv_machine_mtrr_h" = xyes; then
  226. AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR
  227. support is available])
  228. fi
  229. dnl FreeBSD kldload support (sys/linker.h)
  230. AC_CHECK_HEADERS([sys/linker.h],
  231. [ac_cv_sys_linker_h=yes],
  232. [ac_cv_sys_linker_h=no],
  233. [#include <sys/param.h>])
  234. AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes])
  235. AC_CACHE_CHECK([for SYSV IPC],
  236. ac_cv_sysv_ipc,
  237. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  238. #include <sys/types.h>
  239. #include <sys/ipc.h>
  240. #include <sys/shm.h>
  241. #include <sys/stat.h>
  242. ]],[[
  243. {
  244. int id;
  245. id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR);
  246. if (id < 0) return -1;
  247. return shmctl(id, IPC_RMID, 0);
  248. }]])],
  249. [ac_cv_sysv_ipc=yes],
  250. [ac_cv_sysv_ipc=no])])
  251. if test "x$ac_cv_sysv_ipc" = xyes; then
  252. AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available])
  253. fi
  254. dnl OpenBSD /dev/xf86 aperture driver
  255. if test -c /dev/xf86 ; then
  256. AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver])
  257. fi
  258. dnl BSD APM support
  259. AC_CHECK_HEADER([machine/apmvar.h],[
  260. AC_CHECK_HEADER([sys/event.h],
  261. ac_cv_BSD_KQUEUE_APM=yes,
  262. ac_cv_BSD_APM=yes)])
  263. AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes])
  264. AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes])
  265. dnl glibc backtrace support check
  266. AC_CHECK_HEADER([execinfo.h],[
  267. AC_CHECK_LIB(c, backtrace, [
  268. AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support])
  269. AC_DEFINE(HAVE_EXECINFO_H, 1, [Have execinfo.h])
  270. ])]
  271. )
  272. dnl ---------------------------------------------------------------------------
  273. dnl Bus options and CPU capabilities. Replaces logic in
  274. dnl hw/xfree86/os-support/bus/Makefile.am, among others.
  275. dnl ---------------------------------------------------------------------------
  276. DEFAULT_INT10="x86emu"
  277. dnl Override defaults as needed for specific platforms:
  278. case $host_cpu in
  279. alpha*)
  280. ALPHA_VIDEO=yes
  281. case $host_os in
  282. *freebsd*) SYS_LIBS=-lio ;;
  283. *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;;
  284. *openbsd*) SYS_LIBS=-lalpha ;;
  285. esac
  286. GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
  287. ;;
  288. arm*)
  289. ARM_VIDEO=yes
  290. DEFAULT_INT10="stub"
  291. ;;
  292. i*86)
  293. I386_VIDEO=yes
  294. case $host_os in
  295. *freebsd*) AC_DEFINE(USE_DEV_IO) ;;
  296. *dragonfly*) AC_DEFINE(USE_DEV_IO) ;;
  297. *netbsd*) AC_DEFINE(USE_I386_IOPL)
  298. SYS_LIBS=-li386
  299. ;;
  300. *openbsd*) AC_DEFINE(USE_I386_IOPL)
  301. SYS_LIBS=-li386
  302. ;;
  303. esac
  304. ;;
  305. powerpc*)
  306. PPC_VIDEO=yes
  307. case $host_os in
  308. *freebsd*) DEFAULT_INT10=stub ;;
  309. esac
  310. ;;
  311. m68k)
  312. HP300_VIDEO=yes
  313. BSD_ARCH_SOURCES="hp300_video.c ioperm_noop.c"
  314. ;;
  315. m88k)
  316. LUNA88K_VIDEO=yes
  317. BSD_ARCH_SOURCES="luna88k_video.c ioperm_noop.c"
  318. ;;
  319. mips*)
  320. SGI_VIDEO=yes
  321. BSD_ARCH_SOURCES="sgi_video.c ioperm_noop.c"
  322. ;;
  323. sparc*)
  324. SPARC64_VIDEO=yes
  325. BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
  326. GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
  327. ;;
  328. x86_64*|amd64*)
  329. I386_VIDEO=yes
  330. case $host_os in
  331. *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
  332. *dragonfly*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
  333. *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
  334. SYS_LIBS=-lx86_64
  335. ;;
  336. *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl])
  337. SYS_LIBS=-lamd64
  338. ;;
  339. esac
  340. GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
  341. ;;
  342. ia64*)
  343. GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
  344. ;;
  345. s390*)
  346. GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
  347. ;;
  348. hppa*)
  349. case $host_os in
  350. *openbsd*) HPPA_VIDEO=yes
  351. ;;
  352. esac
  353. ;;
  354. esac
  355. AC_SUBST(GLX_ARCH_DEFINES)
  356. dnl BSD *_video.c selection
  357. AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])
  358. AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes])
  359. AM_CONDITIONAL(HP300_VIDEO, [test "x$HP300_VIDEO" = xyes])
  360. AM_CONDITIONAL(HPPA_VIDEO, [test "x$HPPA_VIDEO" = xyes])
  361. AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes])
  362. AM_CONDITIONAL(LUNA88K_VIDEO, [test "x$LUNA88K_VIDEO" = xyes])
  363. AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
  364. AM_CONDITIONAL(SGI_VIDEO, [test "x$SGI_VIDEO" = xyes])
  365. AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
  366. DRI=no
  367. USE_SIGIO_BY_DEFAULT="yes"
  368. dnl it would be nice to autodetect these *CONS_SUPPORTs
  369. case $host_os in
  370. *freebsd* | *dragonfly*)
  371. case $host_os in
  372. kfreebsd*-gnu) ;;
  373. *) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;;
  374. esac
  375. AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
  376. AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
  377. AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console])
  378. DRI=yes
  379. ;;
  380. *netbsd*)
  381. AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
  382. AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
  383. AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
  384. AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
  385. DRI=yes
  386. ;;
  387. *openbsd*)
  388. AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
  389. AC_DEFINE(PCVT_SUPPORT, 1, [System has PC console])
  390. AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
  391. # Disable use of SIGIO by default; it breaks multi-card
  392. # configurations. We don't want to run thousands of lines of
  393. # potentially signal-unsafe code for no particular benefit.
  394. USE_SIGIO_BY_DEFAULT="no"
  395. ;;
  396. *linux*)
  397. DRI=yes
  398. ;;
  399. *solaris*)
  400. PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no)
  401. # Disable use of SIGIO by default until some system bugs are
  402. # fixed - see Sun/OpenSolaris bug id 6879897
  403. USE_SIGIO_BY_DEFAULT="no"
  404. ;;
  405. darwin*)
  406. AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
  407. ;;
  408. cygwin*|mingw*)
  409. CFLAGS="$CFLAGS -DFD_SETSIZE=256"
  410. ;;
  411. esac
  412. dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the
  413. dnl major number
  414. PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`
  415. PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1`
  416. if test "x$PVS" = "x"; then
  417. PVS="0"
  418. fi
  419. VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)"
  420. VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}"
  421. VENDOR_NAME="The X.Org Foundation"
  422. VENDOR_NAME_SHORT="X.Org"
  423. VENDOR_WEB="http://wiki.x.org"
  424. dnl Build options.
  425. AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],
  426. [Obsolete - use --enable-strict-compilation instead]),
  427. AC_MSG_ERROR([--enable-werror has been replaced by --enable-strict-compilation]))
  428. AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
  429. [Enable debugging (default: disabled)]),
  430. [DEBUGGING=$enableval], [DEBUGGING=no])
  431. AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default]
  432. [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]),
  433. [USE_SIGIO_BY_DEFAULT=$enableval], [])
  434. AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]),
  435. [INT10="$withval"],
  436. [INT10="$DEFAULT_INT10"])
  437. AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR],
  438. [Vendor string reported by the server]),
  439. [ VENDOR_NAME="$withval" ], [])
  440. AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR],
  441. [Short version of vendor string reported by the server]),
  442. [ VENDOR_NAME_SHORT="$withval" ], [])
  443. AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL],
  444. [Vendor web address reported by the server]),
  445. [ VENDOR_WEB="$withval" ], [])
  446. AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR],
  447. [Directory where modules are installed (default: $libdir/xorg/modules)]),
  448. [ moduledir="$withval" ],
  449. [ moduledir="${libdir}/xorg/modules" ])
  450. AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR],
  451. [Directory where log files are kept (default: $localstatedir/log)]),
  452. [ logdir="$withval" ],
  453. [ logdir="$localstatedir/log" ])
  454. AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS],
  455. [Builder address (default: xorg@lists.freedesktop.org)]),
  456. [ BUILDERADDR="$withval" ],
  457. [ BUILDERADDR="xorg@lists.freedesktop.org" ])
  458. AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: output of "uname -srm")]),
  459. [ OSNAME="$withval" ],
  460. [ OSNAME=`uname -srm` ])
  461. AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]),
  462. [ OSVENDOR="$withval" ],
  463. [ OSVENDOR="" ])
  464. AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]),
  465. [ BUILDERSTRING="$withval" ]
  466. [ ])
  467. AC_ARG_ENABLE(listen-tcp, AS_HELP_STRING([--enable-listen-tcp],
  468. [Listen on TCP by default (default:disabled)]),
  469. [LISTEN_TCP=$enableval], [LISTEN_TCP=no])
  470. AC_ARG_ENABLE(listen-unix, AS_HELP_STRING([--disable-listen-unix],
  471. [Listen on Unix by default (default:enabled)]),
  472. [LISTEN_UNIX=$enableval], [LISTEN_UNIX=yes])
  473. AC_ARG_ENABLE(listen-local, AS_HELP_STRING([--disable-listen-local],
  474. [Listen on local by default (default:enabled)]),
  475. [LISTEN_LOCAL=$enableval], [LISTEN_LOCAL=yes])
  476. dnl Determine font path
  477. XORG_FONTROOTDIR
  478. XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc)
  479. XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF)
  480. XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF)
  481. XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1)
  482. XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi)
  483. XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi)
  484. dnl Uses --with-default-font-path if set, otherwise uses standard
  485. dnl subdirectories of FONTROOTDIR. Some distros set the default font path to
  486. dnl "catalogue:/etc/X11/fontpath.d,built-ins"
  487. DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/"
  488. case $host_os in
  489. darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
  490. esac
  491. AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
  492. [ FONTPATH="$withval" ],
  493. [ FONTPATH="${DEFAULT_FONT_PATH}" ])
  494. AC_MSG_CHECKING([for default font path])
  495. AC_MSG_RESULT([$FONTPATH])
  496. AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]),
  497. [ XKBPATH="$withval" ],
  498. [ XKBPATH="${datadir}/X11/xkb" ])
  499. AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
  500. [ XKBOUTPUT="$withval" ],
  501. [ XKBOUTPUT="compiled" ])
  502. AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES],
  503. [Keyboard ruleset (default: base/evdev)]),
  504. [ XKB_DFLT_RULES="$withval" ],
  505. [ XKB_DFLT_RULES="" ])
  506. AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL],
  507. [Keyboard model (default: pc105)]),
  508. [ XKB_DFLT_MODEL="$withval" ],
  509. [ XKB_DFLT_MODEL="pc105" ])
  510. AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT],
  511. [Keyboard layout (default: us)]),
  512. [ XKB_DFLT_LAYOUT="$withval" ],
  513. [ XKB_DFLT_LAYOUT="us" ])
  514. AC_ARG_WITH(default-xkb-variant, AS_HELP_STRING([--with-default-xkb-variant=VARIANT],
  515. [Keyboard variant (default: (none))]),
  516. [ XKB_DFLT_VARIANT="$withval" ],
  517. [ XKB_DFLT_VARIANT="" ])
  518. AC_ARG_WITH(default-xkb-options, AS_HELP_STRING([--with-default-xkb-options=OPTIONS],
  519. [Keyboard layout options (default: (none))]),
  520. [ XKB_DFLT_OPTIONS="$withval" ],
  521. [ XKB_DFLT_OPTIONS="" ])
  522. AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH],
  523. [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]),
  524. [ SERVERCONFIG="$withval" ],
  525. [ SERVERCONFIG="${libdir}/xorg" ])
  526. AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: /Applications/Utilities)]),
  527. [ APPLE_APPLICATIONS_DIR="${withval}" ],
  528. [ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ])
  529. AC_SUBST([APPLE_APPLICATIONS_DIR])
  530. AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name=NAME], [Name for the .app (default: X11)]),
  531. [ APPLE_APPLICATION_NAME="${withval}" ],
  532. [ APPLE_APPLICATION_NAME="X11" ])
  533. AC_SUBST([APPLE_APPLICATION_NAME])
  534. AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Deprecated: Use --with-bundle-id-prefix.]),
  535. [ BUNDLE_ID_PREFIX="${withval}" ],
  536. [ BUNDLE_ID_PREFIX="org.x" ])
  537. AC_ARG_WITH(bundle-id-prefix, AS_HELP_STRING([--with-bundle-id-prefix=PATH], [Prefix to use for bundle identifiers (default: org.x)]),
  538. [ BUNDLE_ID_PREFIX="${withval}" ])
  539. AC_SUBST([BUNDLE_ID_PREFIX])
  540. AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$BUNDLE_ID_PREFIX", [Prefix to use for bundle identifiers])
  541. AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]),
  542. [ XQUARTZ_SPARKLE="${enableval}" ],
  543. [ XQUARTZ_SPARKLE="no" ])
  544. AC_SUBST([XQUARTZ_SPARKLE])
  545. AC_ARG_ENABLE(install-libxf86config,
  546. AS_HELP_STRING([--enable-install-libxf86config],
  547. [Install libxf86config (default: disabled)]),
  548. [INSTALL_LIBXF86CONFIG=$enableval],
  549. [INSTALL_LIBXF86CONFIG=no])
  550. AC_ARG_ENABLE(visibility, AS_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]),
  551. [SYMBOL_VISIBILITY=$enableval],
  552. [SYMBOL_VISIBILITY=auto])
  553. dnl GLX build options
  554. AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]),
  555. [AIGLX=$enableval],
  556. [AIGLX=yes])
  557. XORG_TLS
  558. AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]),
  559. [GLX_USE_TLS=$enableval
  560. if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then
  561. AC_MSG_ERROR([GLX with TLS support requested, but the compiler does not support it.])
  562. fi],
  563. [GLX_USE_TLS=no
  564. if test "${ac_cv_tls}" != "none" ; then
  565. GLX_USE_TLS=yes
  566. fi])
  567. AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
  568. AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Path to Khronos OpenGL registry database files (default: auto)]),
  569. [KHRONOS_SPEC_DIR="${withval}"],
  570. [KHRONOS_SPEC_DIR=auto])
  571. dnl Privsep
  572. AC_ARG_ENABLE(privsep,
  573. AC_HELP_STRING([--enable-privsep],
  574. [Build support for X server privilege separation (default is NO)]),
  575. [ENABLE_PRIVSEP="$enableval"], [ENABLE_PRIVSEP="no"])
  576. if test x$ENABLE_PRIVSEP = xyes ; then
  577. AC_DEFINE(X_PRIVSEP, 1, [Use X server privilege separation])
  578. fi
  579. AM_CONDITIONAL(X_PRIVSEP, [test x$ENABLE_PRIVSEP = xyes])
  580. dnl Extensions.
  581. AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes])
  582. AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
  583. AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: auto)]), [MITSHM=$enableval], [MITSHM=auto])
  584. AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
  585. AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
  586. AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
  587. AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
  588. AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto])
  589. AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes])
  590. AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto])
  591. AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto])
  592. AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes])
  593. AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval])
  594. AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval], [DRI2=auto])
  595. AC_ARG_ENABLE(dri3, AS_HELP_STRING([--enable-dri3], [Build DRI3 extension (default: auto)]), [DRI3=$enableval], [DRI3=auto])
  596. AC_ARG_ENABLE(present, AS_HELP_STRING([--disable-present], [Build Present extension (default: enabled)]), [PRESENT=$enableval], [PRESENT=yes])
  597. AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
  598. AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto])
  599. AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
  600. AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no])
  601. AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--enable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no])
  602. AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no])
  603. AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
  604. AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no])
  605. AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
  606. AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto])
  607. AC_ARG_ENABLE(config-udev-kms, AS_HELP_STRING([--enable-config-udev-kms], [Build udev kms support (default: auto)]), [CONFIG_UDEV_KMS=$enableval], [CONFIG_UDEV_KMS=auto])
  608. AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
  609. AC_ARG_ENABLE(config-wscons, AS_HELP_STRING([--enable-config-wscons], [Build wscons config support (default: auto)]), [CONFIG_WSCONS=$enableval], [CONFIG_WSCONS=auto])
  610. AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
  611. AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes])
  612. AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes])
  613. AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes])
  614. AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no])
  615. AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes])
  616. AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes])
  617. AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes])
  618. AC_ARG_ENABLE(linux_acpi, AS_HELP_STRING([--disable-linux-acpi], [Disable building ACPI support on Linux (if available).]), [enable_linux_acpi=$enableval], [enable_linux_acpi=yes])
  619. AC_ARG_ENABLE(linux_apm, AS_HELP_STRING([--disable-linux-apm], [Disable building APM support on Linux (if available).]), [enable_linux_apm=$enableval], [enable_linux_apm=yes])
  620. AC_ARG_ENABLE(systemd-logind, AS_HELP_STRING([--enable-systemd-logind], [Build systemd-logind support (default: auto)]), [SYSTEMD_LOGIND=$enableval], [SYSTEMD_LOGIND=auto])
  621. AC_ARG_ENABLE(suid-wrapper, AS_HELP_STRING([--enable-suid-wrapper], [Build suid-root wrapper for legacy driver support on rootless xserver systems (default: no)]), [SUID_WRAPPER=$enableval], [SUID_WRAPPER=no])
  622. dnl DDXes.
  623. AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
  624. AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: no)]), [DMX=$enableval], [DMX=no])
  625. AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
  626. AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
  627. AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
  628. AC_ARG_ENABLE(xwayland, AS_HELP_STRING([--enable-xwayland], [Build Xwayland server (default: auto)]), [XWAYLAND=$enableval], [XWAYLAND=auto])
  629. AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no])
  630. AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
  631. AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: no)]), [GLAMOR=$enableval], [GLAMOR=no])
  632. dnl kdrive and its subsystems
  633. AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no])
  634. AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])
  635. AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto])
  636. AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto])
  637. dnl kdrive options
  638. AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto])
  639. AC_ARG_ENABLE(kdrive-mouse, AS_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto])
  640. AC_ARG_ENABLE(kdrive-evdev, AS_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto])
  641. AC_ARG_ENABLE(libunwind, AS_HELP_STRING([--enable-libunwind], [Use libunwind for backtracing (default: auto)]), [LIBUNWIND="$enableval"], [LIBUNWIND="auto"])
  642. dnl chown/chmod to be setuid root as part of build
  643. dnl Replaces InstallXserverSetUID in imake
  644. AC_ARG_ENABLE(install-setuid,
  645. AS_HELP_STRING([--enable-install-setuid],
  646. [Install Xorg server as owned by root with setuid bit (default: auto)]),
  647. [SETUID=$enableval], [SETUID=auto])
  648. AC_MSG_CHECKING([to see if we can install the Xorg server as root])
  649. if test "x$SETUID" = "xauto" ; then
  650. case $host_os in
  651. cygwin*) SETUID="no" ;;
  652. mingw*) SETUID="no" ;;
  653. darwin*) SETUID="no" ;;
  654. *)
  655. case $host_cpu in
  656. sparc) SETUID="no" ;;
  657. *) SETUID="yes" ;;
  658. esac
  659. esac
  660. if test "x$SETUID" = xyes; then
  661. touch testfile
  662. chown root testfile > /dev/null 2>&1 || SETUID="no"
  663. rm -f testfile
  664. fi
  665. fi
  666. AC_MSG_RESULT([$SETUID])
  667. AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"])
  668. dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro
  669. dnl was not expanded, since xorg-server with no transport types is rather useless.
  670. dnl
  671. dnl If you're seeing an error here, be sure you installed the lib/xtrans module
  672. dnl first and if it's not in the default location, that you set the ACLOCAL
  673. dnl environment variable to find it, such as:
  674. dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
  675. m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$])
  676. # Transport selection macro from xtrans.m4
  677. XTRANS_CONNECTION_FLAGS
  678. # Secure RPC detection macro from xtrans.m4
  679. XTRANS_SECURE_RPC_FLAGS
  680. AM_CONDITIONAL(SECURE_RPC, [test "x$SECURE_RPC" = xyes])
  681. AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86])
  682. AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu])
  683. AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub])
  684. dnl Handle installing libxf86config
  685. AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
  686. dnl DDX Detection... Yes, it's ugly to have it here... but we need to
  687. dnl handle this early on so that we don't require unsupported extensions
  688. case $host_os in
  689. cygwin* | mingw*)
  690. CONFIG_HAL=no
  691. CONFIG_UDEV=no
  692. CONFIG_UDEV_KMS=no
  693. DGA=no
  694. DRI2=no
  695. DRI3=no
  696. INT10MODULE=no
  697. PCI=no
  698. VGAHW=no
  699. VBE=no
  700. XF86UTILS=no
  701. XF86VIDMODE=no
  702. XSELINUX=no
  703. XV=no
  704. SYMBOL_VISIBILITY=no
  705. ;;
  706. darwin*)
  707. PCI=no
  708. INT10MODULE=no
  709. VGAHW=no
  710. VBE=no
  711. DRM=no
  712. DRI2=no
  713. DRI3=no
  714. if test x$XQUARTZ = xauto; then
  715. AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
  716. save_LDFLAGS=$LDFLAGS
  717. LDFLAGS="$LDFLAGS -framework Carbon"
  718. AC_LINK_IFELSE([AC_LANG_SOURCE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}])],
  719. [xorg_cv_Carbon_framework=yes],
  720. [xorg_cv_Carbon_framework=no])
  721. LDFLAGS=$save_LDFLAGS])
  722. if test "X$xorg_cv_Carbon_framework" = Xyes; then
  723. XQUARTZ=yes
  724. else
  725. XQUARTZ=no
  726. fi
  727. fi
  728. AC_CHECK_FUNC(dispatch_async,
  729. AC_DEFINE([HAVE_LIBDISPATCH], 1, [Define to 1 if you have the libdispatch (GCD) available]),
  730. [])
  731. if test "x$XQUARTZ" = xyes ; then
  732. XQUARTZ=yes
  733. XVFB=no
  734. XNEST=no
  735. XWAYLAND=no
  736. COMPOSITE=no
  737. DGA=no
  738. DPMSExtension=no
  739. XF86VIDMODE=no
  740. fi
  741. ;;
  742. *) XQUARTZ=no ;;
  743. esac
  744. dnl ---------------------------------------------------------------------------
  745. dnl Extension section
  746. dnl ---------------------------------------------------------------------------
  747. XEXT_INC='-I$(top_srcdir)/Xext'
  748. XEXT_LIB='$(top_builddir)/Xext/libXext.la'
  749. dnl Optional modules
  750. VIDEOPROTO="videoproto"
  751. COMPOSITEPROTO="compositeproto >= 0.4"
  752. RECORDPROTO="recordproto >= 1.13.99.1"
  753. SCRNSAVERPROTO="scrnsaverproto >= 1.1"
  754. RESOURCEPROTO="resourceproto >= 1.2.0"
  755. DRIPROTO="xf86driproto >= 2.1.0"
  756. DRI2PROTO="dri2proto >= 2.8"
  757. DRI3PROTO="dri3proto >= 1.0"
  758. XINERAMAPROTO="xineramaproto"
  759. BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
  760. DGAPROTO="xf86dgaproto >= 2.0.99.1"
  761. GLPROTO="glproto >= 1.4.17"
  762. DMXPROTO="dmxproto >= 2.2.99.1"
  763. VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
  764. WINDOWSWMPROTO="windowswmproto"
  765. APPLEWMPROTO="applewmproto >= 1.4"
  766. XSHMFENCE="xshmfence >= 1.1"
  767. dnl Required modules
  768. XPROTO="xproto >= 7.0.26"
  769. RANDRPROTO="randrproto >= 1.4.0"
  770. RENDERPROTO="renderproto >= 0.11"
  771. XEXTPROTO="xextproto >= 7.2.99.901"
  772. INPUTPROTO="inputproto >= 2.3"
  773. KBPROTO="kbproto >= 1.0.3"
  774. FONTSPROTO="fontsproto >= 2.1.3"
  775. FIXESPROTO="fixesproto >= 5.0"
  776. DAMAGEPROTO="damageproto >= 1.1"
  777. XCMISCPROTO="xcmiscproto >= 1.2.0"
  778. BIGREQSPROTO="bigreqsproto >= 1.1.0"
  779. XTRANS="xtrans >= 1.3.3"
  780. PRESENTPROTO="presentproto >= 1.0"
  781. dnl List of libraries that require a specific version
  782. LIBAPPLEWM="applewm >= 1.4"
  783. LIBDMX="dmx >= 1.0.99.1"
  784. LIBDRI="dri >= 7.8.0"
  785. LIBDRM="libdrm >= 2.3.0"
  786. LIBEGL="egl"
  787. LIBGBM="gbm >= 10.2.0"
  788. LIBGL="gl >= 7.1.0"
  789. LIBXEXT="xext >= 1.0.99.4"
  790. LIBXFONT="xfont >= 1.4.2"
  791. LIBXI="xi >= 1.2.99.1"
  792. LIBXTST="xtst >= 1.0.99.2"
  793. LIBPCIACCESS="pciaccess >= 0.12.901"
  794. LIBUDEV="libudev >= 143"
  795. LIBSELINUX="libselinux >= 2.0.86"
  796. LIBDBUS="dbus-1 >= 1.0"
  797. LIBPIXMAN="pixman-1 >= 0.27.2"
  798. dnl Pixman is always required, but we separate it out so we can link
  799. dnl specific modules against it
  800. PKG_CHECK_MODULES(PIXMAN, $LIBPIXMAN)
  801. REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau"
  802. dnl Core modules for most extensions, et al.
  803. SDK_REQUIRED_MODULES="$XPROTO $RANDRPROTO $RENDERPROTO $XEXTPROTO $INPUTPROTO $KBPROTO $FONTSPROTO $LIBPIXMAN"
  804. # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
  805. AC_SUBST(SDK_REQUIRED_MODULES)
  806. REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES"
  807. dnl systemd socket activation
  808. dnl activate the code in libxtrans that grabs systemd's socket fds
  809. AC_ARG_WITH([systemd-daemon],
  810. AS_HELP_STRING([--with-systemd-daemon],
  811. [support systemd socket activation (default: auto)]),
  812. [WITH_SYSTEMD_DAEMON=$withval], [WITH_SYSTEMD_DAEMON=auto])
  813. PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
  814. [HAVE_SYSTEMD_DAEMON=yes], [HAVE_SYSTEMD_DAEMON=no])
  815. if test "x$WITH_SYSTEMD_DAEMON" = xauto; then
  816. WITH_SYSTEMD_DAEMON="$HAVE_SYSTEMD_DAEMON"
  817. fi
  818. if test "x$WITH_SYSTEMD_DAEMON" = xyes; then
  819. if test "x$HAVE_SYSTEMD_DAEMON" = xno; then
  820. AC_MSG_ERROR([systemd support requested but no library has been found])
  821. fi
  822. AC_DEFINE(HAVE_SYSTEMD_DAEMON, 1, [Define to 1 if libsystemd-daemon is available])
  823. REQUIRED_LIBS="$REQUIRED_LIBS libsystemd-daemon"
  824. fi
  825. AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = "xyes"])
  826. if test "x$CONFIG_UDEV" = xyes && test "x$CONFIG_HAL" = xyes; then
  827. AC_MSG_ERROR([Hotplugging through both libudev and hal not allowed])
  828. fi
  829. PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
  830. if test "x$CONFIG_UDEV" = xauto; then
  831. CONFIG_UDEV="$HAVE_LIBUDEV"
  832. fi
  833. AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes])
  834. if test "x$CONFIG_UDEV" = xyes; then
  835. CONFIG_HAL=no
  836. if test "x$CONFIG_UDEV_KMS" = xauto; then
  837. CONFIG_UDEV_KMS="$HAVE_LIBUDEV"
  838. fi
  839. if ! test "x$HAVE_LIBUDEV" = xyes; then
  840. AC_MSG_ERROR([udev configuration API requested, but libudev is not installed])
  841. fi
  842. AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug])
  843. if test "x$CONFIG_UDEV_KMS" = xyes; then
  844. AC_DEFINE(CONFIG_UDEV_KMS, 1, [Use libudev for kms enumeration])
  845. fi
  846. SAVE_LIBS=$LIBS
  847. SAVE_CFLAGS=$CFLAGS
  848. CFLAGS=$UDEV_CFLAGS
  849. LIBS=$UDEV_LIBS
  850. AC_CHECK_FUNCS([udev_monitor_filter_add_match_tag])
  851. AC_CHECK_FUNCS([udev_enumerate_add_match_tag])
  852. LIBS=$SAVE_LIBS
  853. CFLAGS=$SAVE_CFLAGS
  854. fi
  855. AM_CONDITIONAL(CONFIG_UDEV_KMS, [test "x$CONFIG_UDEV_KMS" = xyes])
  856. PKG_CHECK_MODULES(DBUS, $LIBDBUS, [HAVE_DBUS=yes], [HAVE_DBUS=no])
  857. if test "x$HAVE_DBUS" = xyes; then
  858. AC_DEFINE(HAVE_DBUS, 1, [Have D-Bus support])
  859. fi
  860. AM_CONDITIONAL(HAVE_DBUS, [test "x$HAVE_DBUS" = xyes])
  861. PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no])
  862. if test "x$CONFIG_HAL" = xauto; then
  863. CONFIG_HAL="$HAVE_HAL"
  864. fi
  865. if test "x$CONFIG_HAL" = xyes; then
  866. if ! test "x$HAVE_HAL" = xyes; then
  867. AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.])
  868. fi
  869. AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API])
  870. NEED_DBUS="yes"
  871. fi
  872. AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes])
  873. if test "x$SYSTEMD_LOGIND" = xauto; then
  874. if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes ; then
  875. SYSTEMD_LOGIND=yes
  876. else
  877. SYSTEMD_LOGIND=no
  878. fi
  879. fi
  880. if test "x$SYSTEMD_LOGIND" = xyes; then
  881. if ! test "x$HAVE_DBUS" = xyes; then
  882. AC_MSG_ERROR([systemd-logind requested, but D-Bus is not installed.])
  883. fi
  884. if ! test "x$CONFIG_UDEV" = xyes ; then
  885. AC_MSG_ERROR([systemd-logind is only supported in combination with udev configuration.])
  886. fi
  887. AC_DEFINE(SYSTEMD_LOGIND, 1, [Enable systemd-logind integration])
  888. NEED_DBUS="yes"
  889. fi
  890. AM_CONDITIONAL(SYSTEMD_LOGIND, [test "x$SYSTEMD_LOGIND" = xyes])
  891. if test "x$SUID_WRAPPER" = xyes; then
  892. dnl The wrapper uses libdrm headers, so ensure they are available
  893. PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
  894. dnl This is a define so that if some platforms want to put the wrapper
  895. dnl somewhere else this can be easily changed
  896. AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install Xorg.bin and Xorg.wrap])
  897. SETUID="no"
  898. fi
  899. AM_CONDITIONAL(SUID_WRAPPER, [test "x$SUID_WRAPPER" = xyes])
  900. if test "x$NEED_DBUS" = xyes; then
  901. AC_DEFINE(NEED_DBUS, 1, [Enable D-Bus core])
  902. fi
  903. AM_CONDITIONAL(NEED_DBUS, [test "x$NEED_DBUS" = xyes])
  904. if test "x$CONFIG_WSCONS" = xauto; then
  905. case $host_os in
  906. *openbsd*)
  907. CONFIG_WSCONS=yes;
  908. ;;
  909. *)
  910. CONFIG_WSCONS=no;
  911. ;;
  912. esac
  913. fi
  914. AM_CONDITIONAL(CONFIG_WSCONS, [test "x$CONFIG_WSCONS" = xyes])
  915. if test "x$CONFIG_WSCONS" = xyes; then
  916. AC_DEFINE(CONFIG_WSCONS, 1, [Use wscons for input auto configuration])
  917. fi
  918. if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then
  919. USE_SIGIO_BY_DEFAULT_VALUE=TRUE
  920. else
  921. USE_SIGIO_BY_DEFAULT_VALUE=FALSE
  922. fi
  923. AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE],
  924. [Use SIGIO handlers for input device events by default])
  925. AC_MSG_CHECKING([for glibc...])
  926. AC_PREPROC_IFELSE([AC_LANG_SOURCE([
  927. #include <features.h>
  928. #ifndef __GLIBC__
  929. #error
  930. #endif
  931. ])], glibc=yes, glibc=no)
  932. AC_MSG_RESULT([$glibc])
  933. AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes],
  934. [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt],
  935. [have_clock_gettime=no])])
  936. AC_MSG_CHECKING([for a useful monotonic clock ...])
  937. if ! test "x$have_clock_gettime" = xno; then
  938. if ! test "x$have_clock_gettime" = xyes; then
  939. CLOCK_LIBS="$have_clock_gettime"
  940. else
  941. CLOCK_LIBS=""
  942. fi
  943. LIBS_SAVE="$LIBS"
  944. LIBS="$CLOCK_LIBS"
  945. CPPFLAGS_SAVE="$CPPFLAGS"
  946. if test x"$glibc" = xyes; then
  947. CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
  948. fi
  949. AC_RUN_IFELSE([AC_LANG_SOURCE([
  950. #include <time.h>
  951. int main(int argc, char *argv[[]]) {
  952. struct timespec tp;
  953. if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
  954. return 0;
  955. else
  956. return 1;
  957. }
  958. ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
  959. [MONOTONIC_CLOCK="cross compiling"])
  960. LIBS="$LIBS_SAVE"
  961. CPPFLAGS="$CPPFLAGS_SAVE"
  962. else
  963. MONOTONIC_CLOCK=no
  964. fi
  965. AC_MSG_RESULT([$MONOTONIC_CLOCK])
  966. if test "x$MONOTONIC_CLOCK" = xyes; then
  967. AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()])
  968. LIBS="$LIBS $CLOCK_LIBS"
  969. fi
  970. AM_CONDITIONAL(XV, [test "x$XV" = xyes])
  971. if test "x$XV" = xyes; then
  972. AC_DEFINE(XV, 1, [Support Xv extension])
  973. AC_DEFINE(XvExtension, 1, [Build Xv extension])
  974. REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO"
  975. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $VIDEOPROTO"
  976. else
  977. XVMC=no
  978. fi
  979. AM_CONDITIONAL(XVMC, [test "x$XVMC" = xyes])
  980. if test "x$XVMC" = xyes; then
  981. AC_DEFINE(XvMCExtension, 1, [Build XvMC extension])
  982. fi
  983. AM_CONDITIONAL(XREGISTRY, [test "x$XREGISTRY" = xyes])
  984. if test "x$XREGISTRY" = xyes; then
  985. AC_DEFINE(XREGISTRY, 1, [Build registry module])
  986. fi
  987. AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes])
  988. if test "x$COMPOSITE" = xyes; then
  989. AC_DEFINE(COMPOSITE, 1, [Support Composite Extension])
  990. REQUIRED_MODULES="$REQUIRED_MODULES $COMPOSITEPROTO"
  991. COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la'
  992. COMPOSITE_INC='-I$(top_srcdir)/composite'
  993. fi
  994. if test "x$MITSHM" = xauto; then
  995. MITSHM="$ac_cv_sysv_ipc"
  996. fi
  997. AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes])
  998. if test "x$MITSHM" = xyes; then
  999. AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension])
  1000. AC_DEFINE(HAS_SHM, 1, [Support SHM])
  1001. fi
  1002. AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes])
  1003. if test "x$RECORD" = xyes; then
  1004. AC_DEFINE(XRECORD, 1, [Support Record extension])
  1005. REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO"
  1006. RECORD_LIB='$(top_builddir)/record/librecord.la'
  1007. fi
  1008. AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes])
  1009. if test "x$SCREENSAVER" = xyes; then
  1010. AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension])
  1011. REQUIRED_MODULES="$REQUIRED_MODULES $SCRNSAVERPROTO"
  1012. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $SCRNSAVERPROTO"
  1013. fi
  1014. AM_CONDITIONAL(RES, [test "x$RES" = xyes])
  1015. if test "x$RES" = xyes; then
  1016. AC_DEFINE(RES, 1, [Support X resource extension])
  1017. REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO"
  1018. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $RESOURCEPROTO"
  1019. fi
  1020. if test "x$LISTEN_TCP" = xyes; then
  1021. AC_DEFINE(LISTEN_TCP, 1, [Listen on TCP socket])
  1022. fi
  1023. if test "x$LISTEN_UNIX" = xyes; then
  1024. AC_DEFINE(LISTEN_UNIX, 1, [Listen on Unix socket])
  1025. fi
  1026. if test "x$LISTEN_LOCAL" = xyes; then
  1027. AC_DEFINE(LISTEN_LOCAL, 1, [Listen on local socket])
  1028. fi
  1029. # The XRes extension may support client ID tracking only if it has
  1030. # been specifically enabled. Client ID tracking is implicitly not
  1031. # supported if XRes extension is disabled.
  1032. AC_MSG_CHECKING([whether to track client ids])
  1033. if test "x$RES" = xyes && test "x$CLIENTIDS" = xyes; then
  1034. AC_DEFINE(CLIENTIDS, 1, [Support client ID tracking])
  1035. else
  1036. CLIENTIDS=no
  1037. fi
  1038. if test "x$CLIENTIDS" = xyes; then
  1039. case $host_os in
  1040. openbsd*)
  1041. SYS_LIBS="$SYS_LIBS -lkvm"
  1042. ;;
  1043. esac
  1044. fi
  1045. AC_MSG_RESULT([$CLIENTIDS])
  1046. AM_CONDITIONAL(CLIENTIDS, [test "x$CLIENTIDS" = xyes])
  1047. AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
  1048. if test "x$DRI" = xyes; then
  1049. AC_DEFINE(XF86DRI, 1, [Build DRI extension])
  1050. REQUIRED_MODULES="$REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
  1051. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
  1052. fi
  1053. PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO,
  1054. [HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no])
  1055. case "$DRI2,$HAVE_DRI2PROTO" in
  1056. yes,no)
  1057. AC_MSG_ERROR([DRI2 requested, but dri2proto not found.])
  1058. ;;
  1059. yes,yes | auto,yes)
  1060. AC_DEFINE(DRI2, 1, [Build DRI2 extension])
  1061. DRI2=yes
  1062. LIBGL="gl >= 9.2.0"
  1063. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO"
  1064. ;;
  1065. esac
  1066. AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
  1067. dnl
  1068. dnl Locate a suitable tmp file system for creating shared memeory files
  1069. dnl
  1070. AC_ARG_WITH(shared-memory-dir, AS_HELP_STRING([--with-shared-memory-dir=PATH], [Path to directory in a world-writable temporary directory for anonymous shared memory (default: auto)]),
  1071. [],
  1072. [with_shared_memory_dir=yes])
  1073. shmdirs="/run/shm /var/tmp /tmp"
  1074. case x"$with_shared_memory_dir" in
  1075. xyes)
  1076. for dir in $shmdirs; do
  1077. case x"$with_shared_memory_dir" in
  1078. xyes)
  1079. echo Checking temp dir "$dir"
  1080. if test -d "$dir"; then
  1081. with_shared_memory_dir="$dir"
  1082. fi
  1083. ;;
  1084. esac
  1085. done
  1086. ;;
  1087. x/*)
  1088. ;;
  1089. xno)
  1090. ;;
  1091. *)
  1092. AC_MSG_ERROR([Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir])
  1093. ;;
  1094. esac
  1095. case x"$with_shared_memory_dir" in
  1096. xyes)
  1097. AC_MSG_ERROR([No directory found for shared memory temp files.])
  1098. ;;
  1099. xno)
  1100. ;;
  1101. *)
  1102. AC_DEFINE_UNQUOTED(SHMDIR, ["$with_shared_memory_dir"], [Directory for shared memory temp files])
  1103. ;;
  1104. esac
  1105. AC_ARG_ENABLE(xtrans-send-fds, AS_HELP_STRING([--disable-xtrans-send-fds], [Use Xtrans support for fd passing (default: auto)]), [XTRANS_SEND_FDS=$enableval], [XTRANS_SEND_FDS=auto])
  1106. case "x$XTRANS_SEND_FDS" in
  1107. xauto)
  1108. case "$host_os" in
  1109. linux*|openbsd*|solaris*)
  1110. XTRANS_SEND_FDS=yes
  1111. ;;
  1112. *)
  1113. XTRANS_SEND_FDS=no
  1114. ;;
  1115. esac
  1116. esac
  1117. case "x$XTRANS_SEND_FDS" in
  1118. xyes)
  1119. AC_DEFINE(XTRANS_SEND_FDS, 1, [Enable xtrans fd passing support])
  1120. ;;
  1121. esac
  1122. case "$DRI3,$XTRANS_SEND_FDS" in
  1123. yes,yes | auto,yes)
  1124. ;;
  1125. yes,no)
  1126. AC_MSG_ERROR([DRI3 requested, but xtrans fd passing support not found.])
  1127. DRI3=no
  1128. ;;
  1129. no,*)
  1130. ;;
  1131. *)
  1132. AC_MSG_NOTICE([DRI3 disabled because xtrans fd passing support not found.])
  1133. DRI3=no
  1134. ;;
  1135. esac
  1136. PKG_CHECK_MODULES([DRI3PROTO], $DRI3PROTO,
  1137. [HAVE_DRI3PROTO=yes], [HAVE_DRI3PROTO=no])
  1138. case "$DRI3,$HAVE_DRI3PROTO" in
  1139. yes,yes | auto,yes)
  1140. ;;
  1141. yes,no)
  1142. AC_MSG_ERROR([DRI3 requested, but dri3proto not found.])
  1143. DRI3=no
  1144. ;;
  1145. no,*)
  1146. ;;
  1147. *)
  1148. AC_MSG_NOTICE([DRI3 disabled because dri3proto not found.])
  1149. DRI3=no
  1150. ;;
  1151. esac
  1152. AC_CHECK_FUNCS([sigaction])
  1153. BUSFAULT=no
  1154. case x"$ac_cv_func_sigaction" in
  1155. xyes)
  1156. AC_DEFINE(HAVE_SIGACTION, 1, [Have sigaction function])
  1157. BUSFAULT=yes
  1158. ;;
  1159. esac
  1160. case x"$BUSFAULT" in
  1161. xyes)
  1162. AC_DEFINE(BUSFAULT, 1, [Include busfault OS API])
  1163. ;;
  1164. esac
  1165. AM_CONDITIONAL(BUSFAULT, test x"$BUSFAULT" = xyes)
  1166. PKG_CHECK_MODULES([XSHMFENCE], $XSHMFENCE,
  1167. [HAVE_XSHMFENCE=yes], [HAVE_XSHMFENCE=no])
  1168. AM_CONDITIONAL(XSHMFENCE, test "x$HAVE_XSHMFENCE" = xyes)
  1169. case x"$HAVE_XSHMFENCE" in
  1170. xyes)
  1171. AC_DEFINE(HAVE_XSHMFENCE, 1, [Have X Shared Memory Fence library])
  1172. REQUIRED_LIBS="$REQUIRED_LIBS xshmfence"
  1173. ;;
  1174. esac
  1175. case "$DRI3,$HAVE_XSHMFENCE" in
  1176. yes,yes | auto,yes)
  1177. ;;
  1178. yes,no)
  1179. AC_MSG_ERROR([DRI3 requested, but xshmfence not found.])
  1180. DRI3=no
  1181. ;;
  1182. no,*)
  1183. ;;
  1184. *)
  1185. AC_MSG_NOTICE([DRI3 disabled because xshmfence not found.])
  1186. DRI3=no
  1187. ;;
  1188. esac
  1189. case x"$DRI3" in
  1190. xyes|xauto)
  1191. DRI3=yes
  1192. AC_DEFINE(DRI3, 1, [Build DRI3 extension])
  1193. DRI3_LIB='$(top_builddir)/dri3/libdri3.la'
  1194. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI3PROTO"
  1195. AC_MSG_NOTICE([DRI3 enabled]);
  1196. ;;
  1197. esac
  1198. AM_CONDITIONAL(DRI3, test "x$DRI3" = xyes)
  1199. if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then
  1200. if test "x$DRM" = xyes; then
  1201. AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
  1202. PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
  1203. fi
  1204. fi
  1205. if test "x$DRI2" = xyes; then
  1206. save_CFLAGS=$CFLAGS
  1207. CFLAGS="$GL_CFLAGS $LIBDRM_CFLAGS"
  1208. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <GL/gl.h>
  1209. #include <GL/internal/dri_interface.h>
  1210. #ifndef __DRI_DRI2
  1211. #error DRI2 extension not available.
  1212. #endif]])],
  1213. [HAVE_DRI2EXTENSION=yes],
  1214. [HAVE_DRI2EXTENSION=no])
  1215. CFLAGS=$save_CFLAGS
  1216. if test "x$HAVE_DRI2EXTENSION" = xyes; then
  1217. AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader])
  1218. DRI2_AIGLX=yes
  1219. else
  1220. AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.])
  1221. DRI2_AIGLX=no
  1222. fi
  1223. fi
  1224. AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes)
  1225. if test "x$GLX" = xyes; then
  1226. PKG_CHECK_MODULES([XLIB], [x11])
  1227. PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
  1228. AC_SUBST(XLIB_CFLAGS)
  1229. AC_DEFINE(GLXEXT, 1, [Build GLX extension])
  1230. GLX_LIBS='$(top_builddir)/glx/libglx.la'
  1231. GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS"
  1232. else
  1233. GLX=no
  1234. fi
  1235. AM_CONDITIONAL(GLX, test "x$GLX" = xyes)
  1236. if test "x$GLX" = xno; then
  1237. AIGLX=no
  1238. fi
  1239. if test "x$AIGLX" = xyes -a \( "x$DRI2" = xyes \); then
  1240. AC_DEFINE(AIGLX, 1, [Build AIGLX loader])
  1241. fi
  1242. AM_CONDITIONAL(AIGLX_DRI_LOADER, { test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes)
  1243. if test "x$GLX_USE_TLS" = xyes ; then
  1244. GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS"
  1245. GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread"
  1246. fi
  1247. AC_SUBST([GLX_DEFINES])
  1248. AC_SUBST([GLX_SYS_LIBS])
  1249. AM_CONDITIONAL(PRESENT, [test "x$PRESENT" = xyes])
  1250. if test "x$PRESENT" = xyes; then
  1251. AC_DEFINE(PRESENT, 1, [Support Present extension])
  1252. REQUIRED_MODULES="$REQUIRED_MODULES $PRESENTPROTO"
  1253. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $PRESENTPROTO"
  1254. PRESENT_INC='-I$(top_srcdir)/present'
  1255. PRESENT_LIB='$(top_builddir)/present/libpresent.la'
  1256. fi
  1257. # link Xorg with pthreads for llvm-pipe driver on OpenBSD
  1258. if test "x$DRI2" = xyes; then
  1259. case $host_os in
  1260. openbsd*)
  1261. XORG_SYS_LIBS="-lpthread"
  1262. ;;
  1263. esac
  1264. fi
  1265. AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes])
  1266. if test "x$XINERAMA" = xyes; then
  1267. AC_DEFINE(XINERAMA, 1, [Support Xinerama extension])
  1268. AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama])
  1269. REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO"
  1270. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $XINERAMAPROTO"
  1271. fi
  1272. AM_CONDITIONAL(XACE, [test "x$XACE" = xyes])
  1273. if test "x$XACE" = xyes; then
  1274. AC_DEFINE(XACE, 1, [Build X-ACE extension])
  1275. fi
  1276. AM_CONDITIONAL(XSELINUX, [test "x$XSELINUX" = xyes])
  1277. if test "x$XSELINUX" = xyes; then
  1278. if test "x$XACE" != xyes; then
  1279. AC_MSG_ERROR([cannot build SELinux extension without X-ACE])
  1280. fi
  1281. AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers]))
  1282. AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library]))
  1283. PKG_CHECK_MODULES([SELINUX], $LIBSELINUX)
  1284. SELINUX_LIBS="$SELINUX_LIBS -laudit"
  1285. AC_DEFINE(XSELINUX, 1, [Build SELinux extension])
  1286. fi
  1287. AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes])
  1288. if test "x$XCSECURITY" = xyes; then
  1289. if test "x$XACE" != xyes; then
  1290. AC_MSG_ERROR([cannot build Security extension without X-ACE])
  1291. fi
  1292. AC_DEFINE(XCSECURITY, 1, [Build Security extension])
  1293. fi
  1294. AM_CONDITIONAL(DBE, [test "x$DBE" = xyes])
  1295. if test "x$DBE" = xyes; then
  1296. AC_DEFINE(DBE, 1, [Support DBE extension])
  1297. DBE_LIB='$(top_builddir)/dbe/libdbe.la'
  1298. DBE_INC='-I$(top_srcdir)/dbe'
  1299. fi
  1300. AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes])
  1301. if test "x$XF86BIGFONT" = xyes; then
  1302. AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension])
  1303. REQUIRED_MODULES="$REQUIRED_MODULES $BIGFONTPROTO"
  1304. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $BIGFONTPROTO"
  1305. fi
  1306. AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes])
  1307. if test "x$DPMSExtension" = xyes; then
  1308. AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
  1309. fi
  1310. AC_DEFINE(RENDER, 1, [Support RENDER extension])
  1311. RENDER_LIB='$(top_builddir)/render/librender.la'
  1312. RENDER_INC='-I$(top_srcdir)/render'
  1313. AC_DEFINE(RANDR, 1, [Support RANDR extension])
  1314. RANDR_LIB='$(top_builddir)/randr/librandr.la'
  1315. RANDR_INC='-I$(top_srcdir)/randr'
  1316. AC_DEFINE(XFIXES,1,[Support XFixes extension])
  1317. FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la'
  1318. FIXES_INC='-I$(top_srcdir)/xfixes'
  1319. AC_DEFINE(DAMAGE,1,[Support Damage extension])
  1320. DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
  1321. DAMAGE_INC='-I$(top_srcdir)/damageext'
  1322. MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
  1323. MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
  1324. # XINPUT extension is integral part of the server
  1325. AC_DEFINE(XINPUT, 1, [Support X Input extension])
  1326. XI_LIB='$(top_builddir)/Xi/libXi.la'
  1327. XI_INC='-I$(top_srcdir)/Xi'
  1328. AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes)
  1329. AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes)
  1330. AM_CONDITIONAL(VBE, test "x$VBE" = xyes)
  1331. AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes)
  1332. AC_DEFINE(SHAPE, 1, [Support SHAPE extension])
  1333. AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data])
  1334. AC_ARG_WITH(xkb-bin-directory,
  1335. AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program (default: ${bindir})]),
  1336. [XKB_BIN_DIRECTORY="$withval"],
  1337. [XKB_BIN_DIRECTORY="$bindir"])
  1338. AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir])
  1339. dnl Make sure XKM_OUTPUT_DIR is an absolute path
  1340. XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
  1341. if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then
  1342. XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
  1343. fi
  1344. dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed
  1345. dnl XKB_COMPILED_DIR (used in Makefiles) must not or install-sh gets confused
  1346. XKBOUTPUT=`echo $XKBOUTPUT/ | $SED 's|/*$|/|'`
  1347. XKB_COMPILED_DIR=`echo $XKBOUTPUT | $SED 's|/*$||'`
  1348. AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir])
  1349. AC_SUBST(XKB_COMPILED_DIR)
  1350. if test "x$XKB_DFLT_RULES" = x; then
  1351. case $host_os in
  1352. linux*)
  1353. dnl doesn't take AutoAddDevices into account, but whatever.
  1354. XKB_DFLT_RULES="evdev"
  1355. ;;
  1356. *)
  1357. XKB_DFLT_RULES="base"
  1358. ;;
  1359. esac
  1360. fi
  1361. AC_DEFINE_UNQUOTED(XKB_DFLT_RULES, ["$XKB_DFLT_RULES"], [Default XKB ruleset])
  1362. AC_DEFINE_UNQUOTED(XKB_DFLT_MODEL, ["$XKB_DFLT_MODEL"], [Default XKB model])
  1363. AC_DEFINE_UNQUOTED(XKB_DFLT_LAYOUT, ["$XKB_DFLT_LAYOUT"], [Default XKB layout])
  1364. AC_DEFINE_UNQUOTED(XKB_DFLT_VARIANT, ["$XKB_DFLT_VARIANT"], [Default XKB variant])
  1365. AC_DEFINE_UNQUOTED(XKB_DFLT_OPTIONS, ["$XKB_DFLT_OPTIONS"], [Default XKB options])
  1366. AC_SUBST([XKB_DFLT_RULES])
  1367. AC_SUBST([XKB_DFLT_MODEL])
  1368. AC_SUBST([XKB_DFLT_LAYOUT])
  1369. AC_SUBST([XKB_DFLT_VARIANT])
  1370. AC_SUBST([XKB_DFLT_OPTIONS])
  1371. XKB_LIB='$(top_builddir)/xkb/libxkb.la'
  1372. XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
  1373. REQUIRED_MODULES="$REQUIRED_MODULES xkbfile"
  1374. PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"])
  1375. if test "x$have_libxdmcp" = xyes; then
  1376. AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS])
  1377. fi
  1378. if test "x$XDMCP" = xauto; then
  1379. if test "x$have_libxdmcp" = xyes; then
  1380. XDMCP=yes
  1381. else
  1382. XDMCP=no
  1383. fi
  1384. fi
  1385. if test "x$XDMAUTH" = xauto; then
  1386. if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then
  1387. XDMAUTH=yes
  1388. else
  1389. XDMAUTH=no
  1390. fi
  1391. fi
  1392. AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes])
  1393. if test "x$XDMCP" = xyes; then
  1394. AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol])
  1395. REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
  1396. XDMCP_MODULES="xdmcp"
  1397. fi
  1398. AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes])
  1399. if test "x$XDMAUTH" = xyes; then
  1400. AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1])
  1401. if ! test "x$XDMCP" = xyes; then
  1402. REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
  1403. XDMCP_MODULES="xdmcp"
  1404. fi
  1405. fi
  1406. AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
  1407. AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path])
  1408. AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path])
  1409. dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri`
  1410. AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path])
  1411. AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name])
  1412. AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name])
  1413. AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release])
  1414. AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
  1415. AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address])
  1416. if test -z "$OSNAME"; then
  1417. OSNAME="UNKNOWN"
  1418. fi
  1419. AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name])
  1420. AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor])
  1421. AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string])
  1422. AC_SUBST([VENDOR_NAME_SHORT])
  1423. AC_DEFINE_UNQUOTED(VENDOR_NAME, ["$VENDOR_NAME"], [Vendor name])
  1424. AC_DEFINE_UNQUOTED(VENDOR_NAME_SHORT, ["$VENDOR_NAME_SHORT"], [Vendor name])
  1425. AC_DEFINE_UNQUOTED(VENDOR_RELEASE, [$VENDOR_RELEASE], [Vendor release])
  1426. AC_DEFINE_UNQUOTED(VENDOR_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
  1427. AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper])
  1428. if test "x$DEBUGGING" = xyes; then
  1429. AC_DEFINE(DEBUG, 1, [Enable debugging code])
  1430. fi
  1431. AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
  1432. AC_DEFINE(XTEST, 1, [Support XTest extension])
  1433. AC_DEFINE(XSYNC, 1, [Support XSync extension])
  1434. AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
  1435. AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
  1436. if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
  1437. DIX_LIB='$(top_builddir)/dix/dix.O'
  1438. OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)'
  1439. else
  1440. DIX_LIB='$(top_builddir)/dix/libdix.la'
  1441. OS_LIB='$(top_builddir)/os/libos.la'
  1442. fi
  1443. AC_SUBST([DIX_LIB])
  1444. AC_SUBST([OS_LIB])
  1445. MAIN_LIB='$(top_builddir)/dix/libmain.la'
  1446. AC_SUBST([MAIN_LIB])
  1447. MI_LIB='$(top_builddir)/mi/libmi.la'
  1448. MI_EXT_LIB='$(top_builddir)/mi/libmiext.la'
  1449. MI_INC='-I$(top_srcdir)/mi'
  1450. FB_LIB='$(top_builddir)/fb/libfb.la'
  1451. FB_INC='-I$(top_srcdir)/fb'
  1452. MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow'
  1453. MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
  1454. MIEXT_SYNC_INC='-I$(top_srcdir)/miext/sync'
  1455. MIEXT_SYNC_LIB='$(top_builddir)/miext/sync/libsync.la'
  1456. CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
  1457. # SHA1 hashing
  1458. AC_ARG_WITH([sha1],
  1459. [AS_HELP_STRING([--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
  1460. [choose SHA1 implementation])])
  1461. AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
  1462. if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
  1463. with_sha1=libc
  1464. fi
  1465. if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then
  1466. AC_MSG_ERROR([libc requested but not found])
  1467. fi
  1468. if test "x$with_sha1" = xlibc; then
  1469. AC_DEFINE([HAVE_SHA1_IN_LIBC], [1],
  1470. [Use libc SHA1 functions])
  1471. SHA1_LIBS=""
  1472. fi
  1473. AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes])
  1474. if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then
  1475. with_sha1=CommonCrypto
  1476. fi
  1477. if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then
  1478. AC_MSG_ERROR([CommonCrypto requested but not found])
  1479. fi
  1480. if test "x$with_sha1" = xCommonCrypto; then
  1481. AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1],
  1482. [Use CommonCrypto SHA1 functions])
  1483. SHA1_LIBS=""
  1484. fi
  1485. dnl stdcall functions cannot be tested with AC_CHECK_LIB
  1486. AC_CHECK_HEADER([wincrypt.h], [HAVE_SHA1_IN_CRYPTOAPI=yes], [], [#include <windows.h>])
  1487. if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_CRYPTOAPI" = xyes; then
  1488. with_sha1=CryptoAPI
  1489. fi
  1490. if test "x$with_sha1" = xCryptoAPI && test "x$HAVE_SHA1_IN_CRYPTOAPI" != xyes; then
  1491. AC_MSG_ERROR([CryptoAPI requested but not found])
  1492. fi
  1493. if test "x$with_sha1" = xCryptoAPI; then
  1494. AC_DEFINE([HAVE_SHA1_IN_CRYPTOAPI], [1],
  1495. [Use CryptoAPI SHA1 functions])
  1496. SHA1_LIBS=""
  1497. fi
  1498. AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
  1499. if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
  1500. with_sha1=libmd
  1501. fi
  1502. if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then
  1503. AC_MSG_ERROR([libmd requested but not found])
  1504. fi
  1505. if test "x$with_sha1" = xlibmd; then
  1506. AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
  1507. [Use libmd SHA1 functions])
  1508. SHA1_LIBS=-lmd
  1509. fi
  1510. PKG_CHECK_MODULES([LIBSHA1], [libsha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no])
  1511. if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then
  1512. with_sha1=libsha1
  1513. fi
  1514. if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then
  1515. AC_MSG_ERROR([libsha1 requested but not found])
  1516. fi
  1517. if test "x$with_sha1" = xlibsha1; then
  1518. AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1],
  1519. [Use libsha1 for SHA1])
  1520. SHA1_LIBS=-lsha1
  1521. fi
  1522. AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes])
  1523. if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then
  1524. with_sha1=libnettle
  1525. fi
  1526. if test "x$with_sha1" = xlibnettle && test "x$HAVE_LIBNETTLE" != xyes; then
  1527. AC_MSG_ERROR([libnettle requested but not found])
  1528. fi
  1529. if test "x$with_sha1" = xlibnettle; then
  1530. AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1],
  1531. [Use libnettle SHA1 functions])
  1532. SHA1_LIBS=-lnettle
  1533. fi
  1534. AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
  1535. if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then
  1536. with_sha1=libgcrypt
  1537. fi
  1538. if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then
  1539. AC_MSG_ERROR([libgcrypt requested but not found])
  1540. fi
  1541. if test "x$with_sha1" = xlibgcrypt; then
  1542. AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1],
  1543. [Use libgcrypt SHA1 functions])
  1544. SHA1_LIBS=-lgcrypt
  1545. fi
  1546. # We don't need all of the OpenSSL libraries, just libcrypto
  1547. AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes])
  1548. PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes],
  1549. [HAVE_OPENSSL_PKC=no])
  1550. if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then
  1551. if test "x$with_sha1" = x; then
  1552. with_sha1=libcrypto
  1553. fi
  1554. else
  1555. if test "x$with_sha1" = xlibcrypto; then
  1556. AC_MSG_ERROR([OpenSSL libcrypto requested but not found])
  1557. fi
  1558. fi
  1559. if test "x$with_sha1" = xlibcrypto; then
  1560. if test "x$HAVE_LIBCRYPTO" = xyes; then
  1561. SHA1_LIBS=-lcrypto
  1562. else
  1563. SHA1_LIBS="$OPENSSL_LIBS"
  1564. SHA1_CFLAGS="$OPENSSL_CFLAGS"
  1565. fi
  1566. fi
  1567. AC_MSG_CHECKING([for SHA1 implementation])
  1568. if test "x$with_sha1" = x; then
  1569. AC_MSG_ERROR([No suitable SHA1 implementation found])
  1570. fi
  1571. AC_MSG_RESULT([$with_sha1])
  1572. AC_SUBST(SHA1_LIBS)
  1573. AC_SUBST(SHA1_CFLAGS)
  1574. PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
  1575. PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
  1576. PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
  1577. if test "x$LIBUNWIND" = "xauto"; then
  1578. LIBUNWIND="$HAVE_LIBUNWIND"
  1579. fi
  1580. if test "x$LIBUNWIND" = "xyes"; then
  1581. if test "x$HAVE_LIBUNWIND" != "xyes"; then
  1582. AC_MSG_ERROR([libunwind requested but not installed.])
  1583. fi
  1584. AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
  1585. fi
  1586. AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$LIBUNWIND" = xyes])
  1587. # Autotools has some unfortunate issues with library handling. In order to
  1588. # get a server to rebuild when a dependency in the tree is changed, it must
  1589. # be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be
  1590. # listed there, or some versions of autotools will break (especially if a -L
  1591. # is required to find the library). So, we keep two sets of libraries
  1592. # detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which
  1593. # will go into the _DEPENDENCIES and _LDADD of the server, and
  1594. # NAMESPACE_SYS_LIBS which will go into only the _LDADD. The
  1595. # NAMESPACEMODULES_LIBS detected from pkgconfig should always go in
  1596. # NAMESPACE_SYS_LIBS.
  1597. #
  1598. # XSERVER_LIBS is the set of in-tree libraries which all servers require.
  1599. # XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers
  1600. # require.
  1601. #
  1602. XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}"
  1603. XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB"
  1604. XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
  1605. AC_SUBST([XSERVER_LIBS])
  1606. AC_SUBST([XSERVER_SYS_LIBS])
  1607. UTILS_SYS_LIBS="${SYS_LIBS}"
  1608. AC_SUBST([UTILS_SYS_LIBS])
  1609. # The Xorg binary needs to export symbols so that they can be used from modules
  1610. # Some platforms require extra flags to do this. libtool should set the
  1611. # necessary flags for each platform when -export-dynamic is passed to it.
  1612. LD_EXPORT_SYMBOLS_FLAG="-export-dynamic"
  1613. case $host_os in
  1614. openbsd*)
  1615. case $host_cpu in
  1616. m68k|m88k|vax)
  1617. LD_EXPORT_SYMBOLS_FLAGS=""
  1618. ;;
  1619. *)
  1620. LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-dynamic"
  1621. ;;
  1622. esac
  1623. ;;
  1624. esac
  1625. LD_NO_UNDEFINED_FLAG=
  1626. XORG_DRIVER_LIBS=
  1627. case "$host_os" in
  1628. cygwin*)
  1629. LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\$@.a"
  1630. LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a"
  1631. XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined"
  1632. CYGWIN=yes
  1633. ;;
  1634. solaris*)
  1635. # We use AC_LINK_IFELSE to generate a temporary program conftest$EXEEXT
  1636. # that we can link against for testing if the system linker is new
  1637. # enough to support -z parent=<program> for verifying loadable modules
  1638. # are only calling functions defined in either the loading program or
  1639. # the libraries they're linked with.
  1640. AC_LINK_IFELSE(
  1641. [AC_LANG_SOURCE([int main(int argc, char **argv) { return 0; }])],
  1642. [mv conftest$EXEEXT conftest.parent
  1643. XORG_CHECK_LINKER_FLAGS([-Wl,-z,parent=conftest.parent -G],
  1644. [LD_NO_UNDEFINED_FLAG="-Wl,-z,defs -Wl,-z,parent=\$(top_builddir)/hw/xfree86/Xorg"
  1645. # Not set yet, since this gets exported in xorg-server.pc to all the drivers,
  1646. # and they're not all fixed to build correctly with it yet.
  1647. # XORG_DRIVER_LIBS="-Wl,-z,defs -Wl,-z,parent=${bindir}/Xorg"
  1648. ],[],
  1649. [AC_LANG_SOURCE([extern int main(int argc, char **argv);
  1650. int call_main(void) { return main(0, NULL); }])])
  1651. rm -f conftest.parent
  1652. ])
  1653. ;;
  1654. esac
  1655. AC_SUBST([LD_EXPORT_SYMBOLS_FLAG])
  1656. AC_SUBST([LD_NO_UNDEFINED_FLAG])
  1657. AC_SUBST([XORG_DRIVER_LIBS])
  1658. AM_CONDITIONAL([CYGWIN], [test x"$CYGWIN" = xyes])
  1659. AM_CONDITIONAL([NO_UNDEFINED], [test x"$LD_NO_UNDEFINED_FLAG" != x])
  1660. dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so
  1661. dnl we need to replicate that here until those can all be fixed
  1662. AC_MSG_CHECKING([if SVR4 needs to be defined])
  1663. AC_EGREP_CPP([I_AM_SVR4],[
  1664. #if defined(SVR4) || defined(__svr4__) || defined(__SVR4)
  1665. I_AM_SVR4
  1666. #endif
  1667. ],[
  1668. AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
  1669. AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
  1670. XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC $DBE_INC $PRESENT_INC"
  1671. dnl ---------------------------------------------------------------------------
  1672. dnl DDX section.
  1673. dnl ---------------------------------------------------------------------------
  1674. dnl Xvfb DDX
  1675. AC_MSG_CHECKING([whether to build Xvfb DDX])
  1676. AC_MSG_RESULT([$XVFB])
  1677. AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
  1678. if test "x$XVFB" = xyes; then
  1679. XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB"
  1680. XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS"
  1681. AC_SUBST([XVFB_LIBS])
  1682. AC_SUBST([XVFB_SYS_LIBS])
  1683. fi
  1684. dnl Xnest DDX
  1685. PKG_CHECK_MODULES(XNESTMODULES, [$LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
  1686. AC_MSG_CHECKING([whether to build Xnest DDX])
  1687. if test "x$XNEST" = xauto; then
  1688. XNEST="$have_xnest"
  1689. fi
  1690. AC_MSG_RESULT([$XNEST])
  1691. AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
  1692. if test "x$XNEST" = xyes; then
  1693. if test "x$have_xnest" = xno; then
  1694. AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.])
  1695. fi
  1696. XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB"
  1697. XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
  1698. AC_SUBST([XNEST_LIBS])
  1699. AC_SUBST([XNEST_SYS_LIBS])
  1700. fi
  1701. dnl Xorg DDX
  1702. AC_MSG_CHECKING([whether to build Xorg DDX])
  1703. if test "x$XORG" = xauto; then
  1704. XORG="yes"
  1705. case $host_os in
  1706. cygwin*) XORG="no" ;;
  1707. mingw*) XORG="no" ;;
  1708. darwin*) XORG="no" ;;
  1709. esac
  1710. fi
  1711. AC_MSG_RESULT([$XORG])
  1712. if test "x$XORG" = xyes; then
  1713. XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
  1714. XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
  1715. XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
  1716. XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
  1717. XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB"
  1718. dnl ==================================================================
  1719. dnl symbol visibility
  1720. symbol_visibility=
  1721. have_visibility=disabled
  1722. if test x$SYMBOL_VISIBILITY != xno; then
  1723. AC_MSG_CHECKING(for symbol visibility support)
  1724. if test x$GCC = xyes; then
  1725. VISIBILITY_CFLAGS="-fvisibility=hidden"
  1726. else
  1727. if test x$SUNCC = xyes; then
  1728. VISIBILITY_CFLAGS="-xldscope=hidden"
  1729. else
  1730. have_visibility=no
  1731. fi
  1732. fi
  1733. if test x$have_visibility != xno; then
  1734. save_CFLAGS="$CFLAGS"
  1735. proto_inc=`$PKG_CONFIG --cflags xproto`
  1736. CFLAGS="$CFLAGS $VISIBILITY_CFLAGS $proto_inc"
  1737. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  1738. [#include <X11/Xfuncproto.h>
  1739. extern _X_HIDDEN int hidden_int;
  1740. extern _X_EXPORT int public_int;
  1741. extern _X_HIDDEN int hidden_int_func(void);
  1742. extern _X_EXPORT int public_int_func(void);]],
  1743. [])],
  1744. have_visibility=yes,
  1745. have_visibility=no)
  1746. CFLAGS=$save_CFLAGS
  1747. fi
  1748. AC_MSG_RESULT([$have_visibility])
  1749. if test x$have_visibility != xno; then
  1750. symbol_visibility=$VISIBILITY_CFLAGS
  1751. XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS"
  1752. XSERVER_CFLAGS="$XSERVER_CFLAGS $VISIBILITY_CFLAGS"
  1753. fi
  1754. fi
  1755. dnl added to xorg-server.pc
  1756. AC_SUBST([symbol_visibility])
  1757. dnl ===================================================================
  1758. dnl ===================================================================
  1759. dnl ================= beginning of PCI configuration ==================
  1760. dnl ===================================================================
  1761. xorg_bus_bsdpci=no
  1762. xorg_bus_sparc=no
  1763. AC_MSG_CHECKING([whether to build Xorg PCI functions])
  1764. if test "x$PCI" = xyes; then
  1765. PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
  1766. SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS"
  1767. XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $LIBDRM_LIBS"
  1768. XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS"
  1769. AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
  1770. AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
  1771. case $host_os in
  1772. gnu* | freebsd* | kfreebsd*-gnu | netbsd* | openbsd* | solaris* | dragonfly*)
  1773. xorg_bus_bsdpci="yes"
  1774. ;;
  1775. esac
  1776. case $host_cpu in
  1777. sparc*)
  1778. case $host_os in
  1779. openbsd*)
  1780. xorg_bus_sparc="no"
  1781. ;;
  1782. *)
  1783. xorg_bus_sparc="yes"
  1784. ;;
  1785. esac
  1786. ;;
  1787. esac
  1788. else
  1789. if test "x$CONFIG_UDEV_KMS" = xyes; then
  1790. AC_MSG_ERROR([Platform device enumeration requires libpciaccess])
  1791. fi
  1792. if test "x$INT10MODULE" = xyes && test "x$INT10" != xstub; then
  1793. AC_MSG_ERROR([Cannot build int10 without libpciaccess])
  1794. fi
  1795. fi
  1796. AC_MSG_RESULT([$PCI])
  1797. if test "x$CONFIG_UDEV_KMS" = xyes; then
  1798. AC_DEFINE(XSERVER_PLATFORM_BUS, 1, [X server supports platform device enumeration])
  1799. fi
  1800. AC_MSG_RESULT([$XSERVER_PLATFORM_BUS])
  1801. dnl ===================================================================
  1802. dnl ==================== end of PCI configuration =====================
  1803. dnl ===================================================================
  1804. case $host_os in
  1805. linux*)
  1806. XORG_OS_SUBDIR="linux"
  1807. linux_acpi="no"
  1808. case $host_cpu in
  1809. alpha*)
  1810. linux_alpha=yes
  1811. ;;
  1812. i*86|amd64*|x86_64*|ia64*)
  1813. linux_acpi=$enable_linux_acpi
  1814. ;;
  1815. *)
  1816. ;;
  1817. esac
  1818. dnl APM header
  1819. AC_CHECK_HEADERS([linux/apm_bios.h], [linux_apm=$enable_linux_apm])
  1820. if test "x$linux_apm" = xyes -o "x$linux_acpi" = xyes; then
  1821. AC_DEFINE(XF86PM, 1, [Support APM/ACPI power management in the server])
  1822. fi
  1823. ;;
  1824. freebsd* | kfreebsd*-gnu | dragonfly*)
  1825. XORG_OS_SUBDIR="bsd"
  1826. ;;
  1827. netbsd*)
  1828. XORG_OS_SUBDIR="bsd"
  1829. ;;
  1830. openbsd*)
  1831. if test "x$ac_cv_BSD_APM" = xyes \
  1832. -o "x$ac_cv_BSD_KQUEUE_APM" = xyes; then
  1833. XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
  1834. fi
  1835. XORG_OS_SUBDIR="bsd"
  1836. ;;
  1837. solaris*)
  1838. XORG_OS_SUBDIR="solaris"
  1839. XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
  1840. AC_CHECK_HEADERS([sys/kd.h])
  1841. AC_CHECK_HEADERS([sys/vt.h], [solaris_vt=yes], [solaris_vt=no])
  1842. # Check for minimum supported release
  1843. AC_MSG_CHECKING([Solaris version])
  1844. OS_MINOR=`echo ${host_os}|$SED -e 's/^.*solaris2\.//' -e s'/\..*$//'`
  1845. if test "${OS_MINOR}" -ge 7 ; then
  1846. AC_MSG_RESULT(Solaris ${OS_MINOR})
  1847. else
  1848. AC_MSG_RESULT(Solaris `echo ${host_os}|$SED -e 's/^.*solaris//`)
  1849. fi
  1850. if test "${OS_MINOR}" -lt 8 ; then
  1851. AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.])
  1852. fi
  1853. AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"])
  1854. case $host_cpu in
  1855. sparc*)
  1856. SOLARIS_INOUT_ARCH="sparcv8plus"
  1857. ;;
  1858. i*86)
  1859. if test x$SOLARIS_64 = xyes ; then
  1860. SOLARIS_INOUT_ARCH="amd64"
  1861. else
  1862. SOLARIS_INOUT_ARCH="ia32"
  1863. fi
  1864. ;;
  1865. *)
  1866. AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \
  1867. are supported on Solaris in this release. If you are \
  1868. interested in porting Xorg to your platform, please email \
  1869. xorg@lists.freedesktop.org.]) ;;
  1870. esac
  1871. AC_SUBST([SOLARIS_INOUT_ARCH])
  1872. ;;
  1873. gnu*)
  1874. XORG_OS_SUBDIR="hurd"
  1875. ;;
  1876. *)
  1877. XORG_OS_SUBDIR="stub"
  1878. AC_MSG_NOTICE([m4_text_wrap(m4_join([ ],
  1879. [Your OS is unknown. Xorg currently only supports Linux,],
  1880. [Free/Open/Net/DragonFlyBSD, Solaris/OpenSolaris, & GNU Hurd.],
  1881. [If you are interested in porting Xorg to your platform,],
  1882. [please email xorg@lists.freedesktop.org.]))])
  1883. ;;
  1884. esac
  1885. if test "x$DGA" = xauto; then
  1886. PKG_CHECK_MODULES(DGA, $DGAPROTO, [DGA=yes], [DGA=no])
  1887. fi
  1888. if test "x$DGA" = xyes; then
  1889. XORG_MODULES="$XORG_MODULES $DGAPROTO"
  1890. PKG_CHECK_MODULES(DGA, $DGAPROTO)
  1891. AC_DEFINE(DGA, 1, [Support DGA extension])
  1892. AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
  1893. fi
  1894. if test "x$XF86VIDMODE" = xauto; then
  1895. PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no])
  1896. fi
  1897. if test "x$XF86VIDMODE" = xyes; then
  1898. XORG_MODULES="$XORG_MODULES $VIDMODEPROTO"
  1899. PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO)
  1900. AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
  1901. fi
  1902. if test -n "$XORG_MODULES"; then
  1903. PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES])
  1904. XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS"
  1905. XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS"
  1906. fi
  1907. AC_SUBST([XORG_LIBS])
  1908. AC_SUBST([XORG_SYS_LIBS])
  1909. AC_SUBST([XORG_INCS])
  1910. AC_SUBST([XORG_OS_SUBDIR])
  1911. AC_SUBST([XORG_CFLAGS])
  1912. dnl these only go in xorg-config.h
  1913. XF86CONFIGFILE="xorg.conf"
  1914. XF86CONFIGDIR="xorg.conf.d"
  1915. AC_SUBST(XF86CONFIGDIR)
  1916. CONFIGFILE="$sysconfdir/$XF86CONFIGFILE"
  1917. LOGPREFIX="Xorg."
  1918. XDG_DATA_HOME=".local/share"
  1919. XDG_DATA_HOME_LOGDIR="xorg"
  1920. AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
  1921. AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
  1922. AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
  1923. AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
  1924. AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
  1925. AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
  1926. AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
  1927. AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file])
  1928. AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
  1929. AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory])
  1930. AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path])
  1931. AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path])
  1932. AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location])
  1933. AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default logfile prefix])
  1934. AC_DEFINE_DIR(DEFAULT_XDG_DATA_HOME, XDG_DATA_HOME, [Default XDG_DATA dir under HOME])
  1935. AC_DEFINE_DIR(DEFAULT_XDG_DATA_HOME_LOGDIR, XDG_DATA_HOME_LOGDIR, [Default log dir under XDG_DATA_HOME])
  1936. AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
  1937. if test "x$VGAHW" = xyes; then
  1938. AC_DEFINE(WITH_VGAHW, 1, [Building vgahw module])
  1939. fi
  1940. driverdir="$moduledir/drivers"
  1941. AC_SUBST([moduledir])
  1942. AC_SUBST([driverdir])
  1943. sdkdir="$includedir/xorg"
  1944. extdir="$includedir/X11/extensions"
  1945. sysconfigdir="$datadir/X11/$XF86CONFIGDIR"
  1946. AC_SUBST([sdkdir])
  1947. AC_SUBST([extdir])
  1948. AC_SUBST([sysconfigdir])
  1949. AC_SUBST([logdir])
  1950. # stuff the ABI versions into the pc file too
  1951. extract_abi() {
  1952. grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }'
  1953. }
  1954. abi_ansic=`extract_abi ANSIC`
  1955. abi_videodrv=`extract_abi VIDEODRV`
  1956. abi_xinput=`extract_abi XINPUT`
  1957. abi_extension=`extract_abi EXTENSION`
  1958. AC_SUBST([abi_ansic])
  1959. AC_SUBST([abi_videodrv])
  1960. AC_SUBST([abi_xinput])
  1961. AC_SUBST([abi_extension])
  1962. fi
  1963. AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
  1964. AM_CONDITIONAL([XORG_BUS_PCI], [test "x$PCI" = xyes])
  1965. AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
  1966. AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
  1967. AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
  1968. AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
  1969. AM_CONDITIONAL([LNXAPM], [test "x$linux_apm" = xyes])
  1970. AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes])
  1971. AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
  1972. AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
  1973. AM_CONDITIONAL([XORG_BUS_PLATFORM], [test "x$CONFIG_UDEV_KMS" = xyes])
  1974. dnl glamor
  1975. AM_CONDITIONAL([GLAMOR], [test "x$GLAMOR" = xyes])
  1976. if test "x$GLAMOR" = xyes; then
  1977. AC_DEFINE(GLAMOR, 1, [Build glamor])
  1978. PKG_CHECK_MODULES([GLAMOR], [epoxy])
  1979. PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no])
  1980. if test "x$GBM" = xyes; then
  1981. AC_DEFINE(GLAMOR_HAS_GBM, 1,
  1982. [Build glamor with GBM-based EGL support])
  1983. fi
  1984. fi
  1985. AM_CONDITIONAL([GLAMOR_EGL], [test "x$GBM" = xyes])
  1986. dnl XWin DDX
  1987. AC_MSG_CHECKING([whether to build XWin DDX])
  1988. if test "x$XWIN" = xauto; then
  1989. case $host_os in
  1990. cygwin*) XWIN="yes" ;;
  1991. mingw*) XWIN="yes" ;;
  1992. *) XWIN="no" ;;
  1993. esac
  1994. fi
  1995. AC_MSG_RESULT([$XWIN])
  1996. if test "x$XWIN" = xyes; then
  1997. AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location])
  1998. AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
  1999. AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
  2000. AC_CHECK_TOOL(WINDRES, windres)
  2001. PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau])
  2002. if test "x$WINDOWSWM" = xauto; then
  2003. PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
  2004. fi
  2005. if test "x$WINDOWSWM" = xyes ; then
  2006. PKG_CHECK_MODULES(WINDOWSWM, $WINDOWSWMPROTO)
  2007. XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS $WINDOWSWM_CFLAGS"
  2008. AC_DEFINE(ROOTLESS,1,[Build Rootless code])
  2009. fi
  2010. case $host_os in
  2011. cygwin*)
  2012. XWIN_SERVER_NAME=XWin
  2013. AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages])
  2014. ;;
  2015. mingw*)
  2016. XWIN_SERVER_NAME=Xming
  2017. AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location])
  2018. AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets])
  2019. XWIN_SYS_LIBS="-lpthread -lws2_32"
  2020. ;;
  2021. esac
  2022. XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB"
  2023. XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS"
  2024. AC_SUBST(XWIN_LIBS)
  2025. AC_SUBST(XWIN_SERVER_NAME)
  2026. AC_SUBST(XWIN_SYS_LIBS)
  2027. if test "x$DEBUGGING" = xyes; then
  2028. AC_DEFINE(CYGDEBUG, 1, [Simple debug messages])
  2029. AC_DEFINE(CYGWINDOWING_DEBUG, 1, [Debug messages for window handling])
  2030. AC_DEFINE(CYGMULTIWINDOW_DEBUG, 1, [Debug window manager])
  2031. fi
  2032. AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF])
  2033. AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ])
  2034. dnl XWin with AIGLX requires OpenGL spec files in order to generate wrapper code for native GL functions
  2035. if [test "x$XWIN" = xyes && test "x$AIGLX" = xyes] ; then
  2036. AC_CHECK_PROG(PYTHON3, python3, python3)
  2037. if test -z "$PYTHON3"; then
  2038. AC_MSG_ERROR([python3 not found])
  2039. fi
  2040. AC_MSG_CHECKING(for python module lxml)
  2041. $PYTHON3 -c "import lxml;"
  2042. if test $? -ne 0 ; then
  2043. AC_MSG_ERROR([not found])
  2044. fi
  2045. AC_MSG_RESULT(yes)
  2046. if test "x$KHRONOS_SPEC_DIR" = "xauto" ; then
  2047. PKG_CHECK_MODULES([KHRONOS_OPENGL_REGISTRY], [khronos-opengl-registry])
  2048. KHRONOS_SPEC_DIR=`pkg-config khronos-opengl-registry --variable=specdir`
  2049. fi
  2050. AC_SUBST(KHRONOS_SPEC_DIR)
  2051. fi
  2052. fi
  2053. AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
  2054. AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes])
  2055. AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
  2056. AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes])
  2057. AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$AIGLX" = xyes])
  2058. AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes])
  2059. AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes])
  2060. AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
  2061. AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes])
  2062. dnl Darwin / OS X DDX
  2063. if test "x$XQUARTZ" = xyes; then
  2064. AC_DEFINE(XQUARTZ,1,[Have Quartz])
  2065. AC_DEFINE(ROOTLESS,1,[Build Rootless code])
  2066. XQUARTZ_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $PRESENT_LIB"
  2067. AC_SUBST([XQUARTZ_LIBS])
  2068. AC_CHECK_LIB([Xplugin],[xp_init],[:])
  2069. CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
  2070. PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
  2071. if test "x$XQUARTZ_SPARKLE" = xyes ; then
  2072. AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.])
  2073. fi
  2074. if test "x$STANDALONE_XPBPROXY" = xyes ; then
  2075. AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy])
  2076. fi
  2077. fi
  2078. AM_CONDITIONAL(PSEUDORAMIX, [test "x$XQUARTZ" = xyes -o "x$XWIN" = xyes ])
  2079. # Support for objc in autotools is minimal and not documented.
  2080. OBJC='$(CC)'
  2081. OBJCLD='$(CCLD)'
  2082. OBJCLINK='$(LINK)'
  2083. OBJCFLAGS='$(CFLAGS)'
  2084. AC_SUBST([OBJC])
  2085. AC_SUBST([OBJCCLD])
  2086. AC_SUBST([OBJCLINK])
  2087. AC_SUBST([OBJCFLAGS])
  2088. # internal, undocumented automake func follows :(
  2089. _AM_DEPENDENCIES([OBJC])
  2090. AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
  2091. AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"])
  2092. AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
  2093. dnl DMX DDX
  2094. PKG_CHECK_MODULES(
  2095. [DMXMODULES],
  2096. [xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES],
  2097. [PKG_CHECK_MODULES(
  2098. [XDMXCONFIG_DEP],
  2099. [xaw7 xmu xt xpm x11],
  2100. [have_dmx=yes],
  2101. [have_dmx=no])],
  2102. [have_dmx=no])
  2103. AC_MSG_CHECKING([whether to build Xdmx DDX])
  2104. if test "x$DMX" = xauto; then
  2105. DMX="$have_dmx"
  2106. case $host_os in
  2107. cygwin*) DMX="no" ;;
  2108. mingw*) DMX="no" ;;
  2109. darwin*) DMX="no" ;;
  2110. esac
  2111. fi
  2112. AC_MSG_RESULT([$DMX])
  2113. AM_CONDITIONAL(DMX, [test "x$DMX" = xyes])
  2114. if test "x$DMX" = xyes; then
  2115. if test "x$have_dmx" = xno; then
  2116. AC_MSG_ERROR([Xdmx build explicitly requested, but required
  2117. modules not found.])
  2118. fi
  2119. DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
  2120. XDMX_CFLAGS="$DMXMODULES_CFLAGS"
  2121. XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
  2122. XDMX_SYS_LIBS="$DMXMODULES_LIBS"
  2123. AC_SUBST([XDMX_CFLAGS])
  2124. AC_SUBST([XDMX_LIBS])
  2125. AC_SUBST([XDMX_SYS_LIBS])
  2126. dnl USB sources in DMX require <linux/input.h>
  2127. AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes",
  2128. DMX_BUILD_USB="no")
  2129. dnl Linux sources in DMX require <linux/keyboard.h>
  2130. AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes",
  2131. DMX_BUILD_LNX="no")
  2132. AC_SUBST(XDMXCONFIG_DEP_CFLAGS)
  2133. AC_SUBST(XDMXCONFIG_DEP_LIBS)
  2134. PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11])
  2135. AC_SUBST(DMXEXAMPLES_DEP_LIBS)
  2136. PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11])
  2137. AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS)
  2138. PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11])
  2139. AC_SUBST(DMXXIEXAMPLES_DEP_LIBS)
  2140. PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11])
  2141. AC_SUBST(XTSTEXAMPLES_DEP_LIBS)
  2142. PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11])
  2143. AC_SUBST(XRESEXAMPLES_DEP_LIBS)
  2144. PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11])
  2145. AC_SUBST(X11EXAMPLES_DEP_LIBS)
  2146. fi
  2147. AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes])
  2148. AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes])
  2149. dnl kdrive DDX
  2150. XEPHYR_LIBS=
  2151. XEPHYR_INCS=
  2152. AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes])
  2153. if test "$KDRIVE" = yes; then
  2154. AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server])
  2155. AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx])
  2156. AC_CHECK_HEADERS([linux/fb.h])
  2157. if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then
  2158. XFBDEV=yes
  2159. fi
  2160. if test "x$XFBDEV" = xyes; then
  2161. KDRIVEFBDEVLIB=yes
  2162. AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server])
  2163. fi
  2164. PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"])
  2165. if test "x$HAVE_TSLIB" = xno; then
  2166. AC_CHECK_LIB(ts, ts_open, [
  2167. HAVE_TSLIB="yes"
  2168. TSLIB_LIBS="-lts"
  2169. ])
  2170. fi
  2171. if test "xTSLIB" = xauto; then
  2172. TSLIB="$HAVE_TSLIB"
  2173. fi
  2174. if test "x$TSLIB" = xyes; then
  2175. if ! test "x$HAVE_TSLIB" = xyes; then
  2176. AC_MSG_ERROR([tslib must be installed to build the tslib driver. See http://tslib.berlios.de/])
  2177. else
  2178. AC_DEFINE(TSLIB, 1, [Have tslib support])
  2179. fi
  2180. fi
  2181. if test "x$KDRIVE_KBD" = xyes; then
  2182. AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver])
  2183. fi
  2184. if test "x$KDRIVE_EVDEV" = xyes; then
  2185. AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver])
  2186. fi
  2187. if test "x$KDRIVE_MOUSE" = xyes; then
  2188. AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver])
  2189. fi
  2190. XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms"
  2191. if test "x$XV" = xyes; then
  2192. XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv"
  2193. fi
  2194. if test "x$DRI" = xyes && test "x$GLX" = xyes; then
  2195. XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS libdrm xcb-glx xcb-xf86dri > 1.6"
  2196. fi
  2197. if test "x$GLAMOR" = xyes; then
  2198. XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS x11-xcb"
  2199. fi
  2200. if test "x$XEPHYR" = xauto; then
  2201. PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [XEPHYR="yes"], [XEPHYR="no"])
  2202. elif test "x$XEPHYR" = xyes ; then
  2203. PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS)
  2204. fi
  2205. # Xephyr needs nanosleep() which is in librt on Solaris
  2206. AC_CHECK_FUNC([nanosleep], [],
  2207. AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt"))
  2208. # damage shadow extension glx (NOTYET) fb mi
  2209. KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src'
  2210. KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC"
  2211. KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux'
  2212. KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC"
  2213. KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS"
  2214. KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB"
  2215. KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la'
  2216. case $host_os in
  2217. *linux*)
  2218. KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la'
  2219. KDRIVELINUX=yes
  2220. if test "x$KDRIVE_EVDEV" = xauto; then
  2221. KDRIVE_EVDEV=yes
  2222. fi
  2223. if test "x$KDRIVE_KBD" = xauto; then
  2224. KDRIVE_KBD=yes
  2225. fi
  2226. if test "x$KDRIVE_MOUSE" = xauto; then
  2227. KDRIVE_MOUSE=yes
  2228. fi
  2229. ;;
  2230. *)
  2231. if test "x$KDRIVE_EVDEV" = xauto; then
  2232. KDRIVE_EVDEV=no
  2233. fi
  2234. if test "x$KDRIVE_KBD" = xauto; then
  2235. KDRIVE_KBD=no
  2236. fi
  2237. if test "x$KDRIVE_MOUSE" = xauto; then
  2238. KDRIVE_MOUSE=no
  2239. fi
  2240. ;;
  2241. esac
  2242. KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB"
  2243. KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
  2244. KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB"
  2245. KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS"
  2246. AC_SUBST([XEPHYR_LIBS])
  2247. AC_SUBST([XEPHYR_INCS])
  2248. fi
  2249. AC_SUBST([KDRIVE_INCS])
  2250. AC_SUBST([KDRIVE_PURE_INCS])
  2251. AC_SUBST([KDRIVE_CFLAGS])
  2252. AC_SUBST([KDRIVE_PURE_LIBS])
  2253. AC_SUBST([KDRIVE_LOCAL_LIBS])
  2254. AC_SUBST([KDRIVE_LIBS])
  2255. AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes])
  2256. AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes])
  2257. AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes])
  2258. AM_CONDITIONAL(KDRIVE_MOUSE, [test "x$KDRIVE_MOUSE" = xyes])
  2259. AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes])
  2260. AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes])
  2261. AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])
  2262. AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes])
  2263. AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
  2264. dnl Xwayland DDX
  2265. PKG_CHECK_MODULES(XWAYLANDMODULES, [wayland-client >= 1.3.0 libdrm epoxy], [have_xwayland=yes], [have_xwayland=no])
  2266. AC_MSG_CHECKING([whether to build Xwayland DDX])
  2267. if test "x$XWAYLAND" = xauto; then
  2268. XWAYLAND="$have_xwayland"
  2269. fi
  2270. AC_MSG_RESULT([$XWAYLAND])
  2271. AM_CONDITIONAL(XWAYLAND, [test "x$XWAYLAND" = xyes])
  2272. if test "x$XWAYLAND" = xyes; then
  2273. if test "x$have_xwayland" = xno; then
  2274. AC_MSG_ERROR([Xwayland build explicitly requested, but required modules not found.])
  2275. fi
  2276. XWAYLAND_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB"
  2277. XWAYLAND_SYS_LIBS="$XWAYLANDMODULES_LIBS $GLX_SYS_LIBS"
  2278. AC_SUBST([XWAYLAND_LIBS])
  2279. AC_SUBST([XWAYLAND_SYS_LIBS])
  2280. WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
  2281. AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
  2282. [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
  2283. fi
  2284. dnl and the rest of these are generic, so they're in config.h
  2285. dnl
  2286. dnl though, thanks to the passing of some significant amount of time, the
  2287. dnl above is probably a complete fallacy, and you should not rely on it.
  2288. dnl but this is still actually better than imake, honest. -daniels
  2289. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  2290. #include <features.h>
  2291. #ifndef __GLIBC__
  2292. #error not glibc
  2293. #endif
  2294. ]], [])], [AC_DEFINE(_GNU_SOURCE, 1,
  2295. [ Enable GNU and other extensions to the C environment for glibc])])
  2296. AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
  2297. AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [sysconfdir])
  2298. AC_SUBST([RELEASE_DATE])
  2299. BUILD_DATE="`date +'%Y%m%d'`"
  2300. AC_SUBST([BUILD_DATE])
  2301. BUILD_TIME="`date +'1%H%M%S'`"
  2302. AC_SUBST([BUILD_TIME])
  2303. DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
  2304. AC_SUBST([DIX_CFLAGS])
  2305. AC_SUBST([libdir])
  2306. AC_SUBST([exec_prefix])
  2307. AC_SUBST([prefix])
  2308. AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/sdksyms.dep])
  2309. if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then
  2310. AC_MSG_WARN([
  2311. ***********************************************
  2312. Neither HAL nor udev backend will be enabled.
  2313. Input device hotplugging will not be available!
  2314. ***********************************************])
  2315. fi
  2316. AC_CONFIG_FILES([
  2317. Makefile
  2318. glx/Makefile
  2319. include/Makefile
  2320. composite/Makefile
  2321. damageext/Makefile
  2322. dbe/Makefile
  2323. dix/Makefile
  2324. doc/Makefile
  2325. doc/dtrace/Makefile
  2326. man/Makefile
  2327. fb/Makefile
  2328. glamor/Makefile
  2329. record/Makefile
  2330. config/Makefile
  2331. mi/Makefile
  2332. miext/Makefile
  2333. miext/sync/Makefile
  2334. miext/damage/Makefile
  2335. miext/shadow/Makefile
  2336. miext/rootless/Makefile
  2337. os/Makefile
  2338. pseudoramiX/Makefile
  2339. randr/Makefile
  2340. render/Makefile
  2341. xkb/Makefile
  2342. Xext/Makefile
  2343. Xi/Makefile
  2344. xfixes/Makefile
  2345. exa/Makefile
  2346. dri3/Makefile
  2347. present/Makefile
  2348. hw/Makefile
  2349. hw/xfree86/Makefile
  2350. hw/xfree86/Xorg.sh
  2351. hw/xfree86/common/Makefile
  2352. hw/xfree86/common/xf86Build.h
  2353. hw/xfree86/ddc/Makefile
  2354. hw/xfree86/dixmods/Makefile
  2355. hw/xfree86/doc/Makefile
  2356. hw/xfree86/dri/Makefile
  2357. hw/xfree86/dri2/Makefile
  2358. hw/xfree86/exa/Makefile
  2359. hw/xfree86/exa/man/Makefile
  2360. hw/xfree86/fbdevhw/Makefile
  2361. hw/xfree86/fbdevhw/man/Makefile
  2362. hw/xfree86/glamor_egl/Makefile
  2363. hw/xfree86/i2c/Makefile
  2364. hw/xfree86/int10/Makefile
  2365. hw/xfree86/loader/Makefile
  2366. hw/xfree86/man/Makefile
  2367. hw/xfree86/modes/Makefile
  2368. hw/xfree86/os-support/Makefile
  2369. hw/xfree86/os-support/bsd/Makefile
  2370. hw/xfree86/os-support/bus/Makefile
  2371. hw/xfree86/os-support/hurd/Makefile
  2372. hw/xfree86/os-support/misc/Makefile
  2373. hw/xfree86/os-support/linux/Makefile
  2374. hw/xfree86/os-support/solaris/Makefile
  2375. hw/xfree86/os-support/stub/Makefile
  2376. hw/xfree86/parser/Makefile
  2377. hw/xfree86/ramdac/Makefile
  2378. hw/xfree86/shadowfb/Makefile
  2379. hw/xfree86/vbe/Makefile
  2380. hw/xfree86/vgahw/Makefile
  2381. hw/xfree86/x86emu/Makefile
  2382. hw/xfree86/utils/Makefile
  2383. hw/xfree86/utils/man/Makefile
  2384. hw/xfree86/utils/cvt/Makefile
  2385. hw/xfree86/utils/gtf/Makefile
  2386. hw/dmx/config/Makefile
  2387. hw/dmx/config/man/Makefile
  2388. hw/dmx/doc/Makefile
  2389. hw/dmx/doxygen/doxygen.conf
  2390. hw/dmx/doxygen/Makefile
  2391. hw/dmx/examples/Makefile
  2392. hw/dmx/input/Makefile
  2393. hw/dmx/glxProxy/Makefile
  2394. hw/dmx/Makefile
  2395. hw/dmx/man/Makefile
  2396. hw/vfb/Makefile
  2397. hw/vfb/man/Makefile
  2398. hw/xnest/Makefile
  2399. hw/xnest/man/Makefile
  2400. hw/xwin/Makefile
  2401. hw/xwin/glx/Makefile
  2402. hw/xwin/man/Makefile
  2403. hw/xquartz/Makefile
  2404. hw/xquartz/GL/Makefile
  2405. hw/xquartz/bundle/Makefile
  2406. hw/xquartz/man/Makefile
  2407. hw/xquartz/mach-startup/Makefile
  2408. hw/xquartz/pbproxy/Makefile
  2409. hw/xquartz/xpr/Makefile
  2410. hw/kdrive/Makefile
  2411. hw/kdrive/ephyr/Makefile
  2412. hw/kdrive/ephyr/man/Makefile
  2413. hw/kdrive/fake/Makefile
  2414. hw/kdrive/fbdev/Makefile
  2415. hw/kdrive/linux/Makefile
  2416. hw/kdrive/src/Makefile
  2417. hw/xwayland/Makefile
  2418. test/Makefile
  2419. test/xi1/Makefile
  2420. test/xi2/Makefile
  2421. xserver.ent
  2422. xorg-server.pc
  2423. ])
  2424. AC_OUTPUT