aclocal.m4 115 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193
  1. # generated automatically by aclocal 1.12.6 -*- Autoconf -*-
  2. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  3. # This file is free software; the Free Software Foundation
  4. # gives unlimited permission to copy and/or distribute it,
  5. # with or without modifications, as long as this notice is preserved.
  6. # This program is distributed in the hope that it will be useful,
  7. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  8. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. # PARTICULAR PURPOSE.
  10. m4_ifndef([AC_AUTOCONF_VERSION],
  11. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  12. m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
  13. [m4_warning([this file was generated for autoconf 2.69.
  14. You have another version of autoconf. It may work, but is not guaranteed to.
  15. If you have problems, you may need to regenerate the build system entirely.
  16. To do so, use the procedure documented by the package, typically 'autoreconf'.])])
  17. # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
  18. # serial 1 (pkg-config-0.24)
  19. #
  20. # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  21. #
  22. # This program is free software; you can redistribute it and/or modify
  23. # it under the terms of the GNU General Public License as published by
  24. # the Free Software Foundation; either version 2 of the License, or
  25. # (at your option) any later version.
  26. #
  27. # This program is distributed in the hope that it will be useful, but
  28. # WITHOUT ANY WARRANTY; without even the implied warranty of
  29. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  30. # General Public License for more details.
  31. #
  32. # You should have received a copy of the GNU General Public License
  33. # along with this program; if not, write to the Free Software
  34. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  35. #
  36. # As a special exception to the GNU General Public License, if you
  37. # distribute this file as part of a program that contains a
  38. # configuration script generated by Autoconf, you may include it under
  39. # the same distribution terms that you use for the rest of that program.
  40. # PKG_PROG_PKG_CONFIG([MIN-VERSION])
  41. # ----------------------------------
  42. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  43. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  44. m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
  45. m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
  46. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
  47. AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
  48. AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
  49. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  50. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  51. fi
  52. if test -n "$PKG_CONFIG"; then
  53. _pkg_min_version=m4_default([$1], [0.9.0])
  54. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  55. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  56. AC_MSG_RESULT([yes])
  57. else
  58. AC_MSG_RESULT([no])
  59. PKG_CONFIG=""
  60. fi
  61. fi[]dnl
  62. ])# PKG_PROG_PKG_CONFIG
  63. # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  64. #
  65. # Check to see whether a particular set of modules exists. Similar
  66. # to PKG_CHECK_MODULES(), but does not set variables or print errors.
  67. #
  68. # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  69. # only at the first occurence in configure.ac, so if the first place
  70. # it's called might be skipped (such as if it is within an "if", you
  71. # have to call PKG_CHECK_EXISTS manually
  72. # --------------------------------------------------------------
  73. AC_DEFUN([PKG_CHECK_EXISTS],
  74. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  75. if test -n "$PKG_CONFIG" && \
  76. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  77. m4_default([$2], [:])
  78. m4_ifvaln([$3], [else
  79. $3])dnl
  80. fi])
  81. # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  82. # ---------------------------------------------
  83. m4_define([_PKG_CONFIG],
  84. [if test -n "$$1"; then
  85. pkg_cv_[]$1="$$1"
  86. elif test -n "$PKG_CONFIG"; then
  87. PKG_CHECK_EXISTS([$3],
  88. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
  89. test "x$?" != "x0" && pkg_failed=yes ],
  90. [pkg_failed=yes])
  91. else
  92. pkg_failed=untried
  93. fi[]dnl
  94. ])# _PKG_CONFIG
  95. # _PKG_SHORT_ERRORS_SUPPORTED
  96. # -----------------------------
  97. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  98. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  99. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  100. _pkg_short_errors_supported=yes
  101. else
  102. _pkg_short_errors_supported=no
  103. fi[]dnl
  104. ])# _PKG_SHORT_ERRORS_SUPPORTED
  105. # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  106. # [ACTION-IF-NOT-FOUND])
  107. #
  108. #
  109. # Note that if there is a possibility the first call to
  110. # PKG_CHECK_MODULES might not happen, you should be sure to include an
  111. # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  112. #
  113. #
  114. # --------------------------------------------------------------
  115. AC_DEFUN([PKG_CHECK_MODULES],
  116. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  117. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  118. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  119. pkg_failed=no
  120. AC_MSG_CHECKING([for $1])
  121. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  122. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  123. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  124. and $1[]_LIBS to avoid the need to call pkg-config.
  125. See the pkg-config man page for more details.])
  126. if test $pkg_failed = yes; then
  127. AC_MSG_RESULT([no])
  128. _PKG_SHORT_ERRORS_SUPPORTED
  129. if test $_pkg_short_errors_supported = yes; then
  130. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
  131. else
  132. $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
  133. fi
  134. # Put the nasty error message in config.log where it belongs
  135. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  136. m4_default([$4], [AC_MSG_ERROR(
  137. [Package requirements ($2) were not met:
  138. $$1_PKG_ERRORS
  139. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  140. installed software in a non-standard prefix.
  141. _PKG_TEXT])[]dnl
  142. ])
  143. elif test $pkg_failed = untried; then
  144. AC_MSG_RESULT([no])
  145. m4_default([$4], [AC_MSG_FAILURE(
  146. [The pkg-config script could not be found or is too old. Make sure it
  147. is in your PATH or set the PKG_CONFIG environment variable to the full
  148. path to pkg-config.
  149. _PKG_TEXT
  150. To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
  151. ])
  152. else
  153. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  154. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  155. AC_MSG_RESULT([yes])
  156. $3
  157. fi[]dnl
  158. ])# PKG_CHECK_MODULES
  159. # PKG_INSTALLDIR(DIRECTORY)
  160. # -------------------------
  161. # Substitutes the variable pkgconfigdir as the location where a module
  162. # should install pkg-config .pc files. By default the directory is
  163. # $libdir/pkgconfig, but the default can be changed by passing
  164. # DIRECTORY. The user can override through the --with-pkgconfigdir
  165. # parameter.
  166. AC_DEFUN([PKG_INSTALLDIR],
  167. [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
  168. m4_pushdef([pkg_description],
  169. [pkg-config installation directory @<:@]pkg_default[@:>@])
  170. AC_ARG_WITH([pkgconfigdir],
  171. [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
  172. [with_pkgconfigdir=]pkg_default)
  173. AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
  174. m4_popdef([pkg_default])
  175. m4_popdef([pkg_description])
  176. ]) dnl PKG_INSTALLDIR
  177. # PKG_NOARCH_INSTALLDIR(DIRECTORY)
  178. # -------------------------
  179. # Substitutes the variable noarch_pkgconfigdir as the location where a
  180. # module should install arch-independent pkg-config .pc files. By
  181. # default the directory is $datadir/pkgconfig, but the default can be
  182. # changed by passing DIRECTORY. The user can override through the
  183. # --with-noarch-pkgconfigdir parameter.
  184. AC_DEFUN([PKG_NOARCH_INSTALLDIR],
  185. [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
  186. m4_pushdef([pkg_description],
  187. [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
  188. AC_ARG_WITH([noarch-pkgconfigdir],
  189. [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
  190. [with_noarch_pkgconfigdir=]pkg_default)
  191. AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
  192. m4_popdef([pkg_default])
  193. m4_popdef([pkg_description])
  194. ]) dnl PKG_NOARCH_INSTALLDIR
  195. # Copyright (C) 2002-2012 Free Software Foundation, Inc.
  196. #
  197. # This file is free software; the Free Software Foundation
  198. # gives unlimited permission to copy and/or distribute it,
  199. # with or without modifications, as long as this notice is preserved.
  200. # AM_AUTOMAKE_VERSION(VERSION)
  201. # ----------------------------
  202. # Automake X.Y traces this macro to ensure aclocal.m4 has been
  203. # generated from the m4 files accompanying Automake X.Y.
  204. # (This private macro should not be called outside this file.)
  205. AC_DEFUN([AM_AUTOMAKE_VERSION],
  206. [am__api_version='1.12'
  207. dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
  208. dnl require some minimum version. Point them to the right macro.
  209. m4_if([$1], [1.12.6], [],
  210. [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
  211. ])
  212. # _AM_AUTOCONF_VERSION(VERSION)
  213. # -----------------------------
  214. # aclocal traces this macro to find the Autoconf version.
  215. # This is a private macro too. Using m4_define simplifies
  216. # the logic in aclocal, which can simply ignore this definition.
  217. m4_define([_AM_AUTOCONF_VERSION], [])
  218. # AM_SET_CURRENT_AUTOMAKE_VERSION
  219. # -------------------------------
  220. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
  221. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
  222. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  223. [AM_AUTOMAKE_VERSION([1.12.6])dnl
  224. m4_ifndef([AC_AUTOCONF_VERSION],
  225. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  226. _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
  227. # AM_AUX_DIR_EXPAND -*- Autoconf -*-
  228. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  229. #
  230. # This file is free software; the Free Software Foundation
  231. # gives unlimited permission to copy and/or distribute it,
  232. # with or without modifications, as long as this notice is preserved.
  233. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
  234. # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
  235. # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
  236. #
  237. # Of course, Automake must honor this variable whenever it calls a
  238. # tool from the auxiliary directory. The problem is that $srcdir (and
  239. # therefore $ac_aux_dir as well) can be either absolute or relative,
  240. # depending on how configure is run. This is pretty annoying, since
  241. # it makes $ac_aux_dir quite unusable in subdirectories: in the top
  242. # source directory, any form will work fine, but in subdirectories a
  243. # relative path needs to be adjusted first.
  244. #
  245. # $ac_aux_dir/missing
  246. # fails when called from a subdirectory if $ac_aux_dir is relative
  247. # $top_srcdir/$ac_aux_dir/missing
  248. # fails if $ac_aux_dir is absolute,
  249. # fails when called from a subdirectory in a VPATH build with
  250. # a relative $ac_aux_dir
  251. #
  252. # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
  253. # are both prefixed by $srcdir. In an in-source build this is usually
  254. # harmless because $srcdir is '.', but things will broke when you
  255. # start a VPATH build or use an absolute $srcdir.
  256. #
  257. # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
  258. # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
  259. # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
  260. # and then we would define $MISSING as
  261. # MISSING="\${SHELL} $am_aux_dir/missing"
  262. # This will work as long as MISSING is not called from configure, because
  263. # unfortunately $(top_srcdir) has no meaning in configure.
  264. # However there are other variables, like CC, which are often used in
  265. # configure, and could therefore not use this "fixed" $ac_aux_dir.
  266. #
  267. # Another solution, used here, is to always expand $ac_aux_dir to an
  268. # absolute PATH. The drawback is that using absolute paths prevent a
  269. # configured tree to be moved without reconfiguration.
  270. AC_DEFUN([AM_AUX_DIR_EXPAND],
  271. [dnl Rely on autoconf to set up CDPATH properly.
  272. AC_PREREQ([2.50])dnl
  273. # expand $ac_aux_dir to an absolute path
  274. am_aux_dir=`cd $ac_aux_dir && pwd`
  275. ])
  276. # AM_CONDITIONAL -*- Autoconf -*-
  277. # Copyright (C) 1997-2012 Free Software Foundation, Inc.
  278. #
  279. # This file is free software; the Free Software Foundation
  280. # gives unlimited permission to copy and/or distribute it,
  281. # with or without modifications, as long as this notice is preserved.
  282. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  283. # -------------------------------------
  284. # Define a conditional.
  285. AC_DEFUN([AM_CONDITIONAL],
  286. [AC_PREREQ([2.52])dnl
  287. m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  288. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  289. AC_SUBST([$1_TRUE])dnl
  290. AC_SUBST([$1_FALSE])dnl
  291. _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  292. _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  293. m4_define([_AM_COND_VALUE_$1], [$2])dnl
  294. if $2; then
  295. $1_TRUE=
  296. $1_FALSE='#'
  297. else
  298. $1_TRUE='#'
  299. $1_FALSE=
  300. fi
  301. AC_CONFIG_COMMANDS_PRE(
  302. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  303. AC_MSG_ERROR([[conditional "$1" was never defined.
  304. Usually this means the macro was only invoked conditionally.]])
  305. fi])])
  306. # Copyright (C) 1999-2012 Free Software Foundation, Inc.
  307. #
  308. # This file is free software; the Free Software Foundation
  309. # gives unlimited permission to copy and/or distribute it,
  310. # with or without modifications, as long as this notice is preserved.
  311. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
  312. # written in clear, in which case automake, when reading aclocal.m4,
  313. # will think it sees a *use*, and therefore will trigger all it's
  314. # C support machinery. Also note that it means that autoscan, seeing
  315. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  316. # _AM_DEPENDENCIES(NAME)
  317. # ----------------------
  318. # See how the compiler implements dependency checking.
  319. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
  320. # We try a few techniques and use that to set a single cache variable.
  321. #
  322. # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  323. # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  324. # dependency, and given that the user is not expected to run this macro,
  325. # just rely on AC_PROG_CC.
  326. AC_DEFUN([_AM_DEPENDENCIES],
  327. [AC_REQUIRE([AM_SET_DEPDIR])dnl
  328. AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  329. AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  330. AC_REQUIRE([AM_DEP_TRACK])dnl
  331. m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
  332. [$1], [CXX], [depcc="$CXX" am_compiler_list=],
  333. [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  334. [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
  335. [$1], [UPC], [depcc="$UPC" am_compiler_list=],
  336. [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
  337. [depcc="$$1" am_compiler_list=])
  338. AC_CACHE_CHECK([dependency style of $depcc],
  339. [am_cv_$1_dependencies_compiler_type],
  340. [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  341. # We make a subdir and do the tests there. Otherwise we can end up
  342. # making bogus files that we don't know about and never remove. For
  343. # instance it was reported that on HP-UX the gcc test will end up
  344. # making a dummy file named 'D' -- because '-MD' means "put the output
  345. # in D".
  346. rm -rf conftest.dir
  347. mkdir conftest.dir
  348. # Copy depcomp to subdir because otherwise we won't find it if we're
  349. # using a relative directory.
  350. cp "$am_depcomp" conftest.dir
  351. cd conftest.dir
  352. # We will build objects and dependencies in a subdirectory because
  353. # it helps to detect inapplicable dependency modes. For instance
  354. # both Tru64's cc and ICC support -MD to output dependencies as a
  355. # side effect of compilation, but ICC will put the dependencies in
  356. # the current directory while Tru64 will put them in the object
  357. # directory.
  358. mkdir sub
  359. am_cv_$1_dependencies_compiler_type=none
  360. if test "$am_compiler_list" = ""; then
  361. am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  362. fi
  363. am__universal=false
  364. m4_case([$1], [CC],
  365. [case " $depcc " in #(
  366. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  367. esac],
  368. [CXX],
  369. [case " $depcc " in #(
  370. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  371. esac])
  372. for depmode in $am_compiler_list; do
  373. # Setup a source with many dependencies, because some compilers
  374. # like to wrap large dependency lists on column 80 (with \), and
  375. # we should not choose a depcomp mode which is confused by this.
  376. #
  377. # We need to recreate these files for each test, as the compiler may
  378. # overwrite some of them when testing with obscure command lines.
  379. # This happens at least with the AIX C compiler.
  380. : > sub/conftest.c
  381. for i in 1 2 3 4 5 6; do
  382. echo '#include "conftst'$i'.h"' >> sub/conftest.c
  383. # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
  384. # Solaris 10 /bin/sh.
  385. echo '/* dummy */' > sub/conftst$i.h
  386. done
  387. echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  388. # We check with '-c' and '-o' for the sake of the "dashmstdout"
  389. # mode. It turns out that the SunPro C++ compiler does not properly
  390. # handle '-M -o', and we need to detect this. Also, some Intel
  391. # versions had trouble with output in subdirs.
  392. am__obj=sub/conftest.${OBJEXT-o}
  393. am__minus_obj="-o $am__obj"
  394. case $depmode in
  395. gcc)
  396. # This depmode causes a compiler race in universal mode.
  397. test "$am__universal" = false || continue
  398. ;;
  399. nosideeffect)
  400. # After this tag, mechanisms are not by side-effect, so they'll
  401. # only be used when explicitly requested.
  402. if test "x$enable_dependency_tracking" = xyes; then
  403. continue
  404. else
  405. break
  406. fi
  407. ;;
  408. msvc7 | msvc7msys | msvisualcpp | msvcmsys)
  409. # This compiler won't grok '-c -o', but also, the minuso test has
  410. # not run yet. These depmodes are late enough in the game, and
  411. # so weak that their functioning should not be impacted.
  412. am__obj=conftest.${OBJEXT-o}
  413. am__minus_obj=
  414. ;;
  415. none) break ;;
  416. esac
  417. if depmode=$depmode \
  418. source=sub/conftest.c object=$am__obj \
  419. depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  420. $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
  421. >/dev/null 2>conftest.err &&
  422. grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
  423. grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  424. grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
  425. ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  426. # icc doesn't choke on unknown options, it will just issue warnings
  427. # or remarks (even with -Werror). So we grep stderr for any message
  428. # that says an option was ignored or not supported.
  429. # When given -MP, icc 7.0 and 7.1 complain thusly:
  430. # icc: Command line warning: ignoring option '-M'; no argument required
  431. # The diagnosis changed in icc 8.0:
  432. # icc: Command line remark: option '-MP' not supported
  433. if (grep 'ignoring option' conftest.err ||
  434. grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
  435. am_cv_$1_dependencies_compiler_type=$depmode
  436. break
  437. fi
  438. fi
  439. done
  440. cd ..
  441. rm -rf conftest.dir
  442. else
  443. am_cv_$1_dependencies_compiler_type=none
  444. fi
  445. ])
  446. AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  447. AM_CONDITIONAL([am__fastdep$1], [
  448. test "x$enable_dependency_tracking" != xno \
  449. && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  450. ])
  451. # AM_SET_DEPDIR
  452. # -------------
  453. # Choose a directory name for dependency files.
  454. # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
  455. AC_DEFUN([AM_SET_DEPDIR],
  456. [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  457. AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  458. ])
  459. # AM_DEP_TRACK
  460. # ------------
  461. AC_DEFUN([AM_DEP_TRACK],
  462. [AC_ARG_ENABLE([dependency-tracking], [dnl
  463. AS_HELP_STRING(
  464. [--enable-dependency-tracking],
  465. [do not reject slow dependency extractors])
  466. AS_HELP_STRING(
  467. [--disable-dependency-tracking],
  468. [speeds up one-time build])])
  469. if test "x$enable_dependency_tracking" != xno; then
  470. am_depcomp="$ac_aux_dir/depcomp"
  471. AMDEPBACKSLASH='\'
  472. am__nodep='_no'
  473. fi
  474. AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  475. AC_SUBST([AMDEPBACKSLASH])dnl
  476. _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
  477. AC_SUBST([am__nodep])dnl
  478. _AM_SUBST_NOTMAKE([am__nodep])dnl
  479. ])
  480. # Generate code to set up dependency tracking. -*- Autoconf -*-
  481. # Copyright (C) 1999-2012 Free Software Foundation, Inc.
  482. #
  483. # This file is free software; the Free Software Foundation
  484. # gives unlimited permission to copy and/or distribute it,
  485. # with or without modifications, as long as this notice is preserved.
  486. # _AM_OUTPUT_DEPENDENCY_COMMANDS
  487. # ------------------------------
  488. AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  489. [{
  490. # Autoconf 2.62 quotes --file arguments for eval, but not when files
  491. # are listed without --file. Let's play safe and only enable the eval
  492. # if we detect the quoting.
  493. case $CONFIG_FILES in
  494. *\'*) eval set x "$CONFIG_FILES" ;;
  495. *) set x $CONFIG_FILES ;;
  496. esac
  497. shift
  498. for mf
  499. do
  500. # Strip MF so we end up with the name of the file.
  501. mf=`echo "$mf" | sed -e 's/:.*$//'`
  502. # Check whether this is an Automake generated Makefile or not.
  503. # We used to match only the files named 'Makefile.in', but
  504. # some people rename them; so instead we look at the file content.
  505. # Grep'ing the first line is not enough: some people post-process
  506. # each Makefile.in and add a new line on top of each file to say so.
  507. # Grep'ing the whole file is not good either: AIX grep has a line
  508. # limit of 2048, but all sed's we know have understand at least 4000.
  509. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
  510. dirpart=`AS_DIRNAME("$mf")`
  511. else
  512. continue
  513. fi
  514. # Extract the definition of DEPDIR, am__include, and am__quote
  515. # from the Makefile without running 'make'.
  516. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
  517. test -z "$DEPDIR" && continue
  518. am__include=`sed -n 's/^am__include = //p' < "$mf"`
  519. test -z "am__include" && continue
  520. am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
  521. # Find all dependency output files, they are included files with
  522. # $(DEPDIR) in their names. We invoke sed twice because it is the
  523. # simplest approach to changing $(DEPDIR) to its actual value in the
  524. # expansion.
  525. for file in `sed -n "
  526. s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
  527. sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
  528. # Make sure the directory exists.
  529. test -f "$dirpart/$file" && continue
  530. fdir=`AS_DIRNAME(["$file"])`
  531. AS_MKDIR_P([$dirpart/$fdir])
  532. # echo "creating $dirpart/$file"
  533. echo '# dummy' > "$dirpart/$file"
  534. done
  535. done
  536. }
  537. ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  538. # AM_OUTPUT_DEPENDENCY_COMMANDS
  539. # -----------------------------
  540. # This macro should only be invoked once -- use via AC_REQUIRE.
  541. #
  542. # This code is only required when automatic dependency tracking
  543. # is enabled. FIXME. This creates each '.P' file that we will
  544. # need in order to bootstrap the dependency handling code.
  545. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  546. [AC_CONFIG_COMMANDS([depfiles],
  547. [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  548. [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  549. ])
  550. # Do all the work for Automake. -*- Autoconf -*-
  551. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  552. #
  553. # This file is free software; the Free Software Foundation
  554. # gives unlimited permission to copy and/or distribute it,
  555. # with or without modifications, as long as this notice is preserved.
  556. # This macro actually does too much. Some checks are only needed if
  557. # your package does certain things. But this isn't really a big deal.
  558. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  559. # AM_INIT_AUTOMAKE([OPTIONS])
  560. # -----------------------------------------------
  561. # The call with PACKAGE and VERSION arguments is the old style
  562. # call (pre autoconf-2.50), which is being phased out. PACKAGE
  563. # and VERSION should now be passed to AC_INIT and removed from
  564. # the call to AM_INIT_AUTOMAKE.
  565. # We support both call styles for the transition. After
  566. # the next Automake release, Autoconf can make the AC_INIT
  567. # arguments mandatory, and then we can depend on a new Autoconf
  568. # release and drop the old call support.
  569. AC_DEFUN([AM_INIT_AUTOMAKE],
  570. [AC_PREREQ([2.62])dnl
  571. dnl Autoconf wants to disallow AM_ names. We explicitly allow
  572. dnl the ones we care about.
  573. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  574. AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  575. AC_REQUIRE([AC_PROG_INSTALL])dnl
  576. if test "`cd $srcdir && pwd`" != "`pwd`"; then
  577. # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
  578. # is not polluted with repeated "-I."
  579. AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
  580. # test to see if srcdir already configured
  581. if test -f $srcdir/config.status; then
  582. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  583. fi
  584. fi
  585. # test whether we have cygpath
  586. if test -z "$CYGPATH_W"; then
  587. if (cygpath --version) >/dev/null 2>/dev/null; then
  588. CYGPATH_W='cygpath -w'
  589. else
  590. CYGPATH_W=echo
  591. fi
  592. fi
  593. AC_SUBST([CYGPATH_W])
  594. # Define the identity of the package.
  595. dnl Distinguish between old-style and new-style calls.
  596. m4_ifval([$2],
  597. [AC_DIAGNOSE([obsolete],
  598. [$0: two- and three-arguments forms are deprecated. For more info, see:
  599. http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
  600. m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  601. AC_SUBST([PACKAGE], [$1])dnl
  602. AC_SUBST([VERSION], [$2])],
  603. [_AM_SET_OPTIONS([$1])dnl
  604. dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
  605. m4_if(
  606. m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
  607. [ok:ok],,
  608. [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  609. AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  610. AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  611. _AM_IF_OPTION([no-define],,
  612. [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
  613. AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
  614. # Some tools Automake needs.
  615. AC_REQUIRE([AM_SANITY_CHECK])dnl
  616. AC_REQUIRE([AC_ARG_PROGRAM])dnl
  617. AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
  618. AM_MISSING_PROG([AUTOCONF], [autoconf])
  619. AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
  620. AM_MISSING_PROG([AUTOHEADER], [autoheader])
  621. AM_MISSING_PROG([MAKEINFO], [makeinfo])
  622. AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  623. AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
  624. AC_REQUIRE([AC_PROG_MKDIR_P])dnl
  625. # For better backward compatibility. To be removed once Automake 1.9.x
  626. # dies out for good. For more background, see:
  627. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
  628. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
  629. AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
  630. # We need awk for the "check" target. The system "awk" is bad on
  631. # some platforms.
  632. AC_REQUIRE([AC_PROG_AWK])dnl
  633. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  634. AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  635. _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  636. [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  637. [_AM_PROG_TAR([v7])])])
  638. _AM_IF_OPTION([no-dependencies],,
  639. [AC_PROVIDE_IFELSE([AC_PROG_CC],
  640. [_AM_DEPENDENCIES([CC])],
  641. [m4_define([AC_PROG_CC],
  642. m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
  643. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  644. [_AM_DEPENDENCIES([CXX])],
  645. [m4_define([AC_PROG_CXX],
  646. m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
  647. AC_PROVIDE_IFELSE([AC_PROG_OBJC],
  648. [_AM_DEPENDENCIES([OBJC])],
  649. [m4_define([AC_PROG_OBJC],
  650. m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
  651. dnl Support for Objective C++ was only introduced in Autoconf 2.65,
  652. dnl but we still cater to Autoconf 2.62.
  653. m4_ifdef([AC_PROG_OBJCXX],
  654. [AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
  655. [_AM_DEPENDENCIES([OBJCXX])],
  656. [m4_define([AC_PROG_OBJCXX],
  657. m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
  658. ])
  659. _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
  660. dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
  661. dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
  662. dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
  663. AC_CONFIG_COMMANDS_PRE(dnl
  664. [m4_provide_if([_AM_COMPILER_EXEEXT],
  665. [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
  666. ])
  667. dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
  668. dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
  669. dnl mangled by Autoconf and run in a shell conditional statement.
  670. m4_define([_AC_COMPILER_EXEEXT],
  671. m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
  672. # When config.status generates a header, we must update the stamp-h file.
  673. # This file resides in the same directory as the config header
  674. # that is generated. The stamp files are numbered to have different names.
  675. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  676. # loop where config.status creates the headers, so we can generate
  677. # our stamp files there.
  678. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  679. [# Compute $1's index in $config_headers.
  680. _am_arg=$1
  681. _am_stamp_count=1
  682. for _am_header in $config_headers :; do
  683. case $_am_header in
  684. $_am_arg | $_am_arg:* )
  685. break ;;
  686. * )
  687. _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  688. esac
  689. done
  690. echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
  691. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  692. #
  693. # This file is free software; the Free Software Foundation
  694. # gives unlimited permission to copy and/or distribute it,
  695. # with or without modifications, as long as this notice is preserved.
  696. # AM_PROG_INSTALL_SH
  697. # ------------------
  698. # Define $install_sh.
  699. AC_DEFUN([AM_PROG_INSTALL_SH],
  700. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  701. if test x"${install_sh}" != xset; then
  702. case $am_aux_dir in
  703. *\ * | *\ *)
  704. install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  705. *)
  706. install_sh="\${SHELL} $am_aux_dir/install-sh"
  707. esac
  708. fi
  709. AC_SUBST([install_sh])])
  710. # Copyright (C) 2003-2012 Free Software Foundation, Inc.
  711. #
  712. # This file is free software; the Free Software Foundation
  713. # gives unlimited permission to copy and/or distribute it,
  714. # with or without modifications, as long as this notice is preserved.
  715. # Check whether the underlying file-system supports filenames
  716. # with a leading dot. For instance MS-DOS doesn't.
  717. AC_DEFUN([AM_SET_LEADING_DOT],
  718. [rm -rf .tst 2>/dev/null
  719. mkdir .tst 2>/dev/null
  720. if test -d .tst; then
  721. am__leading_dot=.
  722. else
  723. am__leading_dot=_
  724. fi
  725. rmdir .tst 2>/dev/null
  726. AC_SUBST([am__leading_dot])])
  727. # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
  728. # From Jim Meyering
  729. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  730. #
  731. # This file is free software; the Free Software Foundation
  732. # gives unlimited permission to copy and/or distribute it,
  733. # with or without modifications, as long as this notice is preserved.
  734. # AM_MAINTAINER_MODE([DEFAULT-MODE])
  735. # ----------------------------------
  736. # Control maintainer-specific portions of Makefiles.
  737. # Default is to disable them, unless 'enable' is passed literally.
  738. # For symmetry, 'disable' may be passed as well. Anyway, the user
  739. # can override the default with the --enable/--disable switch.
  740. AC_DEFUN([AM_MAINTAINER_MODE],
  741. [m4_case(m4_default([$1], [disable]),
  742. [enable], [m4_define([am_maintainer_other], [disable])],
  743. [disable], [m4_define([am_maintainer_other], [enable])],
  744. [m4_define([am_maintainer_other], [enable])
  745. m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
  746. AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  747. dnl maintainer-mode's default is 'disable' unless 'enable' is passed
  748. AC_ARG_ENABLE([maintainer-mode],
  749. [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
  750. am_maintainer_other[ make rules and dependencies not useful
  751. (and sometimes confusing) to the casual installer])],
  752. [USE_MAINTAINER_MODE=$enableval],
  753. [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
  754. AC_MSG_RESULT([$USE_MAINTAINER_MODE])
  755. AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
  756. MAINT=$MAINTAINER_MODE_TRUE
  757. AC_SUBST([MAINT])dnl
  758. ]
  759. )
  760. AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
  761. # Check to see how 'make' treats includes. -*- Autoconf -*-
  762. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  763. #
  764. # This file is free software; the Free Software Foundation
  765. # gives unlimited permission to copy and/or distribute it,
  766. # with or without modifications, as long as this notice is preserved.
  767. # AM_MAKE_INCLUDE()
  768. # -----------------
  769. # Check to see how make treats includes.
  770. AC_DEFUN([AM_MAKE_INCLUDE],
  771. [am_make=${MAKE-make}
  772. cat > confinc << 'END'
  773. am__doit:
  774. @echo this is the am__doit target
  775. .PHONY: am__doit
  776. END
  777. # If we don't find an include directive, just comment out the code.
  778. AC_MSG_CHECKING([for style of include used by $am_make])
  779. am__include="#"
  780. am__quote=
  781. _am_result=none
  782. # First try GNU make style include.
  783. echo "include confinc" > confmf
  784. # Ignore all kinds of additional output from 'make'.
  785. case `$am_make -s -f confmf 2> /dev/null` in #(
  786. *the\ am__doit\ target*)
  787. am__include=include
  788. am__quote=
  789. _am_result=GNU
  790. ;;
  791. esac
  792. # Now try BSD make style include.
  793. if test "$am__include" = "#"; then
  794. echo '.include "confinc"' > confmf
  795. case `$am_make -s -f confmf 2> /dev/null` in #(
  796. *the\ am__doit\ target*)
  797. am__include=.include
  798. am__quote="\""
  799. _am_result=BSD
  800. ;;
  801. esac
  802. fi
  803. AC_SUBST([am__include])
  804. AC_SUBST([am__quote])
  805. AC_MSG_RESULT([$_am_result])
  806. rm -f confinc confmf
  807. ])
  808. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  809. # Copyright (C) 1997-2012 Free Software Foundation, Inc.
  810. #
  811. # This file is free software; the Free Software Foundation
  812. # gives unlimited permission to copy and/or distribute it,
  813. # with or without modifications, as long as this notice is preserved.
  814. # AM_MISSING_PROG(NAME, PROGRAM)
  815. # ------------------------------
  816. AC_DEFUN([AM_MISSING_PROG],
  817. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  818. $1=${$1-"${am_missing_run}$2"}
  819. AC_SUBST($1)])
  820. # AM_MISSING_HAS_RUN
  821. # ------------------
  822. # Define MISSING if not defined so far and test if it supports --run.
  823. # If it does, set am_missing_run to use it, otherwise, to nothing.
  824. AC_DEFUN([AM_MISSING_HAS_RUN],
  825. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  826. AC_REQUIRE_AUX_FILE([missing])dnl
  827. if test x"${MISSING+set}" != xset; then
  828. case $am_aux_dir in
  829. *\ * | *\ *)
  830. MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  831. *)
  832. MISSING="\${SHELL} $am_aux_dir/missing" ;;
  833. esac
  834. fi
  835. # Use eval to expand $SHELL
  836. if eval "$MISSING --run true"; then
  837. am_missing_run="$MISSING --run "
  838. else
  839. am_missing_run=
  840. AC_MSG_WARN(['missing' script is too old or missing])
  841. fi
  842. ])
  843. # Helper functions for option handling. -*- Autoconf -*-
  844. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  845. #
  846. # This file is free software; the Free Software Foundation
  847. # gives unlimited permission to copy and/or distribute it,
  848. # with or without modifications, as long as this notice is preserved.
  849. # _AM_MANGLE_OPTION(NAME)
  850. # -----------------------
  851. AC_DEFUN([_AM_MANGLE_OPTION],
  852. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  853. # _AM_SET_OPTION(NAME)
  854. # --------------------
  855. # Set option NAME. Presently that only means defining a flag for this option.
  856. AC_DEFUN([_AM_SET_OPTION],
  857. [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
  858. # _AM_SET_OPTIONS(OPTIONS)
  859. # ------------------------
  860. # OPTIONS is a space-separated list of Automake options.
  861. AC_DEFUN([_AM_SET_OPTIONS],
  862. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  863. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  864. # -------------------------------------------
  865. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  866. AC_DEFUN([_AM_IF_OPTION],
  867. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  868. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  869. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  870. #
  871. # This file is free software; the Free Software Foundation
  872. # gives unlimited permission to copy and/or distribute it,
  873. # with or without modifications, as long as this notice is preserved.
  874. # AM_SANITY_CHECK
  875. # ---------------
  876. AC_DEFUN([AM_SANITY_CHECK],
  877. [AC_MSG_CHECKING([whether build environment is sane])
  878. # Reject unsafe characters in $srcdir or the absolute working directory
  879. # name. Accept space and tab only in the latter.
  880. am_lf='
  881. '
  882. case `pwd` in
  883. *[[\\\"\#\$\&\'\`$am_lf]]*)
  884. AC_MSG_ERROR([unsafe absolute working directory name]);;
  885. esac
  886. case $srcdir in
  887. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  888. AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
  889. esac
  890. # Do 'set' in a subshell so we don't clobber the current shell's
  891. # arguments. Must try -L first in case configure is actually a
  892. # symlink; some systems play weird games with the mod time of symlinks
  893. # (eg FreeBSD returns the mod time of the symlink's containing
  894. # directory).
  895. if (
  896. am_has_slept=no
  897. for am_try in 1 2; do
  898. echo "timestamp, slept: $am_has_slept" > conftest.file
  899. set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
  900. if test "$[*]" = "X"; then
  901. # -L didn't work.
  902. set X `ls -t "$srcdir/configure" conftest.file`
  903. fi
  904. if test "$[*]" != "X $srcdir/configure conftest.file" \
  905. && test "$[*]" != "X conftest.file $srcdir/configure"; then
  906. # If neither matched, then we have a broken ls. This can happen
  907. # if, for instance, CONFIG_SHELL is bash and it inherits a
  908. # broken ls alias from the environment. This has actually
  909. # happened. Such a system could not be considered "sane".
  910. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  911. alias in your environment])
  912. fi
  913. if test "$[2]" = conftest.file || test $am_try -eq 2; then
  914. break
  915. fi
  916. # Just in case.
  917. sleep 1
  918. am_has_slept=yes
  919. done
  920. test "$[2]" = conftest.file
  921. )
  922. then
  923. # Ok.
  924. :
  925. else
  926. AC_MSG_ERROR([newly created file is older than distributed files!
  927. Check your system clock])
  928. fi
  929. AC_MSG_RESULT([yes])
  930. # If we didn't sleep, we still need to ensure time stamps of config.status and
  931. # generated files are strictly newer.
  932. am_sleep_pid=
  933. if grep 'slept: no' conftest.file >/dev/null 2>&1; then
  934. ( sleep 1 ) &
  935. am_sleep_pid=$!
  936. fi
  937. AC_CONFIG_COMMANDS_PRE(
  938. [AC_MSG_CHECKING([that generated files are newer than configure])
  939. if test -n "$am_sleep_pid"; then
  940. # Hide warnings about reused PIDs.
  941. wait $am_sleep_pid 2>/dev/null
  942. fi
  943. AC_MSG_RESULT([done])])
  944. rm -f conftest.file
  945. ])
  946. # Copyright (C) 2009-2012 Free Software Foundation, Inc.
  947. #
  948. # This file is free software; the Free Software Foundation
  949. # gives unlimited permission to copy and/or distribute it,
  950. # with or without modifications, as long as this notice is preserved.
  951. # AM_SILENT_RULES([DEFAULT])
  952. # --------------------------
  953. # Enable less verbose build rules; with the default set to DEFAULT
  954. # ("yes" being less verbose, "no" or empty being verbose).
  955. AC_DEFUN([AM_SILENT_RULES],
  956. [AC_ARG_ENABLE([silent-rules], [dnl
  957. AS_HELP_STRING(
  958. [--enable-silent-rules],
  959. [less verbose build output (undo: "make V=1")])
  960. AS_HELP_STRING(
  961. [--disable-silent-rules],
  962. [verbose build output (undo: "make V=0")])dnl
  963. ])
  964. case $enable_silent_rules in @%:@ (((
  965. yes) AM_DEFAULT_VERBOSITY=0;;
  966. no) AM_DEFAULT_VERBOSITY=1;;
  967. *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
  968. esac
  969. dnl
  970. dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
  971. dnl do not support nested variable expansions.
  972. dnl See automake bug#9928 and bug#10237.
  973. am_make=${MAKE-make}
  974. AC_CACHE_CHECK([whether $am_make supports nested variables],
  975. [am_cv_make_support_nested_variables],
  976. [if AS_ECHO([['TRUE=$(BAR$(V))
  977. BAR0=false
  978. BAR1=true
  979. V=1
  980. am__doit:
  981. @$(TRUE)
  982. .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
  983. am_cv_make_support_nested_variables=yes
  984. else
  985. am_cv_make_support_nested_variables=no
  986. fi])
  987. if test $am_cv_make_support_nested_variables = yes; then
  988. dnl Using '$V' instead of '$(V)' breaks IRIX make.
  989. AM_V='$(V)'
  990. AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
  991. else
  992. AM_V=$AM_DEFAULT_VERBOSITY
  993. AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
  994. fi
  995. AC_SUBST([AM_V])dnl
  996. AM_SUBST_NOTMAKE([AM_V])dnl
  997. AC_SUBST([AM_DEFAULT_V])dnl
  998. AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
  999. AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
  1000. AM_BACKSLASH='\'
  1001. AC_SUBST([AM_BACKSLASH])dnl
  1002. _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
  1003. ])
  1004. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  1005. #
  1006. # This file is free software; the Free Software Foundation
  1007. # gives unlimited permission to copy and/or distribute it,
  1008. # with or without modifications, as long as this notice is preserved.
  1009. # AM_PROG_INSTALL_STRIP
  1010. # ---------------------
  1011. # One issue with vendor 'install' (even GNU) is that you can't
  1012. # specify the program used to strip binaries. This is especially
  1013. # annoying in cross-compiling environments, where the build's strip
  1014. # is unlikely to handle the host's binaries.
  1015. # Fortunately install-sh will honor a STRIPPROG variable, so we
  1016. # always use install-sh in "make install-strip", and initialize
  1017. # STRIPPROG with the value of the STRIP variable (set by the user).
  1018. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  1019. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  1020. # Installed binaries are usually stripped using 'strip' when the user
  1021. # run "make install-strip". However 'strip' might not be the right
  1022. # tool to use in cross-compilation environments, therefore Automake
  1023. # will honor the 'STRIP' environment variable to overrule this program.
  1024. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
  1025. if test "$cross_compiling" != no; then
  1026. AC_CHECK_TOOL([STRIP], [strip], :)
  1027. fi
  1028. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  1029. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  1030. # Copyright (C) 2006-2012 Free Software Foundation, Inc.
  1031. #
  1032. # This file is free software; the Free Software Foundation
  1033. # gives unlimited permission to copy and/or distribute it,
  1034. # with or without modifications, as long as this notice is preserved.
  1035. # _AM_SUBST_NOTMAKE(VARIABLE)
  1036. # ---------------------------
  1037. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  1038. # This macro is traced by Automake.
  1039. AC_DEFUN([_AM_SUBST_NOTMAKE])
  1040. # AM_SUBST_NOTMAKE(VARIABLE)
  1041. # --------------------------
  1042. # Public sister of _AM_SUBST_NOTMAKE.
  1043. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  1044. # Check how to create a tarball. -*- Autoconf -*-
  1045. # Copyright (C) 2004-2012 Free Software Foundation, Inc.
  1046. #
  1047. # This file is free software; the Free Software Foundation
  1048. # gives unlimited permission to copy and/or distribute it,
  1049. # with or without modifications, as long as this notice is preserved.
  1050. # _AM_PROG_TAR(FORMAT)
  1051. # --------------------
  1052. # Check how to create a tarball in format FORMAT.
  1053. # FORMAT should be one of 'v7', 'ustar', or 'pax'.
  1054. #
  1055. # Substitute a variable $(am__tar) that is a command
  1056. # writing to stdout a FORMAT-tarball containing the directory
  1057. # $tardir.
  1058. # tardir=directory && $(am__tar) > result.tar
  1059. #
  1060. # Substitute a variable $(am__untar) that extract such
  1061. # a tarball read from stdin.
  1062. # $(am__untar) < result.tar
  1063. AC_DEFUN([_AM_PROG_TAR],
  1064. [# Always define AMTAR for backward compatibility. Yes, it's still used
  1065. # in the wild :-( We should find a proper way to deprecate it ...
  1066. AC_SUBST([AMTAR], ['$${TAR-tar}'])
  1067. m4_if([$1], [v7],
  1068. [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
  1069. [m4_case([$1], [ustar],, [pax],,
  1070. [m4_fatal([Unknown tar format])])
  1071. AC_MSG_CHECKING([how to create a $1 tar archive])
  1072. # Loop over all known methods to create a tar archive until one works.
  1073. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  1074. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  1075. # Do not fold the above two line into one, because Tru64 sh and
  1076. # Solaris sh will not grok spaces in the rhs of '-'.
  1077. for _am_tool in $_am_tools
  1078. do
  1079. case $_am_tool in
  1080. gnutar)
  1081. for _am_tar in tar gnutar gtar;
  1082. do
  1083. AM_RUN_LOG([$_am_tar --version]) && break
  1084. done
  1085. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  1086. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  1087. am__untar="$_am_tar -xf -"
  1088. ;;
  1089. plaintar)
  1090. # Must skip GNU tar: if it does not support --format= it doesn't create
  1091. # ustar tarball either.
  1092. (tar --version) >/dev/null 2>&1 && continue
  1093. am__tar='tar chf - "$$tardir"'
  1094. am__tar_='tar chf - "$tardir"'
  1095. am__untar='tar xf -'
  1096. ;;
  1097. pax)
  1098. am__tar='pax -L -x $1 -w "$$tardir"'
  1099. am__tar_='pax -L -x $1 -w "$tardir"'
  1100. am__untar='pax -r'
  1101. ;;
  1102. cpio)
  1103. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  1104. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  1105. am__untar='cpio -i -H $1 -d'
  1106. ;;
  1107. none)
  1108. am__tar=false
  1109. am__tar_=false
  1110. am__untar=false
  1111. ;;
  1112. esac
  1113. # If the value was cached, stop now. We just wanted to have am__tar
  1114. # and am__untar set.
  1115. test -n "${am_cv_prog_tar_$1}" && break
  1116. # tar/untar a dummy directory, and stop if the command works
  1117. rm -rf conftest.dir
  1118. mkdir conftest.dir
  1119. echo GrepMe > conftest.dir/file
  1120. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  1121. rm -rf conftest.dir
  1122. if test -s conftest.tar; then
  1123. AM_RUN_LOG([$am__untar <conftest.tar])
  1124. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  1125. fi
  1126. done
  1127. rm -rf conftest.dir
  1128. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  1129. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  1130. AC_SUBST([am__tar])
  1131. AC_SUBST([am__untar])
  1132. ]) # _AM_PROG_TAR
  1133. m4_include([m4/libtool.m4])
  1134. m4_include([m4/ltoptions.m4])
  1135. m4_include([m4/ltsugar.m4])
  1136. m4_include([m4/ltversion.m4])
  1137. m4_include([m4/lt~obsolete.m4])
  1138. dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
  1139. dnl
  1140. dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
  1141. dnl
  1142. dnl Permission is hereby granted, free of charge, to any person obtaining a
  1143. dnl copy of this software and associated documentation files (the "Software"),
  1144. dnl to deal in the Software without restriction, including without limitation
  1145. dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
  1146. dnl and/or sell copies of the Software, and to permit persons to whom the
  1147. dnl Software is furnished to do so, subject to the following conditions:
  1148. dnl
  1149. dnl The above copyright notice and this permission notice (including the next
  1150. dnl paragraph) shall be included in all copies or substantial portions of the
  1151. dnl Software.
  1152. dnl
  1153. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1154. dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1155. dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  1156. dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1157. dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  1158. dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  1159. dnl DEALINGS IN THE SOFTWARE.
  1160. # XORG_MACROS_VERSION(required-version)
  1161. # -------------------------------------
  1162. # Minimum version: 1.1.0
  1163. #
  1164. # If you're using a macro added in Version 1.1 or newer, include this in
  1165. # your configure.ac with the minimum required version, such as:
  1166. # XORG_MACROS_VERSION(1.1)
  1167. #
  1168. # To ensure that this macro is defined, also add:
  1169. # m4_ifndef([XORG_MACROS_VERSION],
  1170. # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
  1171. #
  1172. #
  1173. # See the "minimum version" comment for each macro you use to see what
  1174. # version you require.
  1175. m4_defun([XORG_MACROS_VERSION],[
  1176. m4_define([vers_have], [1.19.0])
  1177. m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
  1178. m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
  1179. m4_if(m4_cmp(maj_have, maj_needed), 0,,
  1180. [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
  1181. m4_if(m4_version_compare(vers_have, [$1]), -1,
  1182. [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
  1183. m4_undefine([vers_have])
  1184. m4_undefine([maj_have])
  1185. m4_undefine([maj_needed])
  1186. ]) # XORG_MACROS_VERSION
  1187. # XORG_PROG_RAWCPP()
  1188. # ------------------
  1189. # Minimum version: 1.0.0
  1190. #
  1191. # Find cpp program and necessary flags for use in pre-processing text files
  1192. # such as man pages and config files
  1193. AC_DEFUN([XORG_PROG_RAWCPP],[
  1194. AC_REQUIRE([AC_PROG_CPP])
  1195. AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
  1196. [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
  1197. # Check for flag to avoid builtin definitions - assumes unix is predefined,
  1198. # which is not the best choice for supporting other OS'es, but covers most
  1199. # of the ones we need for now.
  1200. AC_MSG_CHECKING([if $RAWCPP requires -undef])
  1201. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
  1202. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1203. AC_MSG_RESULT([no])
  1204. else
  1205. if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1206. RAWCPPFLAGS=-undef
  1207. AC_MSG_RESULT([yes])
  1208. # under Cygwin unix is still defined even with -undef
  1209. elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1210. RAWCPPFLAGS="-undef -ansi"
  1211. AC_MSG_RESULT([yes, with -ansi])
  1212. else
  1213. AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
  1214. fi
  1215. fi
  1216. rm -f conftest.$ac_ext
  1217. AC_MSG_CHECKING([if $RAWCPP requires -traditional])
  1218. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
  1219. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  1220. AC_MSG_RESULT([no])
  1221. else
  1222. if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  1223. TRADITIONALCPPFLAGS="-traditional"
  1224. RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
  1225. AC_MSG_RESULT([yes])
  1226. else
  1227. AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
  1228. fi
  1229. fi
  1230. rm -f conftest.$ac_ext
  1231. AC_SUBST(RAWCPPFLAGS)
  1232. AC_SUBST(TRADITIONALCPPFLAGS)
  1233. ]) # XORG_PROG_RAWCPP
  1234. # XORG_MANPAGE_SECTIONS()
  1235. # -----------------------
  1236. # Minimum version: 1.0.0
  1237. #
  1238. # Determine which sections man pages go in for the different man page types
  1239. # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
  1240. # Not sure if there's any better way than just hardcoding by OS name.
  1241. # Override default settings by setting environment variables
  1242. # Added MAN_SUBSTS in version 1.8
  1243. # Added AC_PROG_SED in version 1.8
  1244. AC_DEFUN([XORG_MANPAGE_SECTIONS],[
  1245. AC_REQUIRE([AC_CANONICAL_HOST])
  1246. AC_REQUIRE([AC_PROG_SED])
  1247. if test x$APP_MAN_SUFFIX = x ; then
  1248. APP_MAN_SUFFIX=1
  1249. fi
  1250. if test x$APP_MAN_DIR = x ; then
  1251. APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
  1252. fi
  1253. if test x$LIB_MAN_SUFFIX = x ; then
  1254. LIB_MAN_SUFFIX=3
  1255. fi
  1256. if test x$LIB_MAN_DIR = x ; then
  1257. LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
  1258. fi
  1259. if test x$FILE_MAN_SUFFIX = x ; then
  1260. case $host_os in
  1261. solaris*) FILE_MAN_SUFFIX=4 ;;
  1262. *) FILE_MAN_SUFFIX=5 ;;
  1263. esac
  1264. fi
  1265. if test x$FILE_MAN_DIR = x ; then
  1266. FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
  1267. fi
  1268. if test x$MISC_MAN_SUFFIX = x ; then
  1269. case $host_os in
  1270. solaris*) MISC_MAN_SUFFIX=5 ;;
  1271. *) MISC_MAN_SUFFIX=7 ;;
  1272. esac
  1273. fi
  1274. if test x$MISC_MAN_DIR = x ; then
  1275. MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
  1276. fi
  1277. if test x$DRIVER_MAN_SUFFIX = x ; then
  1278. case $host_os in
  1279. solaris*) DRIVER_MAN_SUFFIX=7 ;;
  1280. *) DRIVER_MAN_SUFFIX=4 ;;
  1281. esac
  1282. fi
  1283. if test x$DRIVER_MAN_DIR = x ; then
  1284. DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
  1285. fi
  1286. if test x$ADMIN_MAN_SUFFIX = x ; then
  1287. case $host_os in
  1288. solaris*) ADMIN_MAN_SUFFIX=1m ;;
  1289. *) ADMIN_MAN_SUFFIX=8 ;;
  1290. esac
  1291. fi
  1292. if test x$ADMIN_MAN_DIR = x ; then
  1293. ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
  1294. fi
  1295. AC_SUBST([APP_MAN_SUFFIX])
  1296. AC_SUBST([LIB_MAN_SUFFIX])
  1297. AC_SUBST([FILE_MAN_SUFFIX])
  1298. AC_SUBST([MISC_MAN_SUFFIX])
  1299. AC_SUBST([DRIVER_MAN_SUFFIX])
  1300. AC_SUBST([ADMIN_MAN_SUFFIX])
  1301. AC_SUBST([APP_MAN_DIR])
  1302. AC_SUBST([LIB_MAN_DIR])
  1303. AC_SUBST([FILE_MAN_DIR])
  1304. AC_SUBST([MISC_MAN_DIR])
  1305. AC_SUBST([DRIVER_MAN_DIR])
  1306. AC_SUBST([ADMIN_MAN_DIR])
  1307. XORG_MAN_PAGE="X Version 11"
  1308. AC_SUBST([XORG_MAN_PAGE])
  1309. MAN_SUBSTS="\
  1310. -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1311. -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1312. -e 's|__xservername__|Xorg|g' \
  1313. -e 's|__xconfigfile__|xorg.conf|g' \
  1314. -e 's|__projectroot__|\$(prefix)|g' \
  1315. -e 's|__apploaddir__|\$(appdefaultdir)|g' \
  1316. -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
  1317. -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
  1318. -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
  1319. -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
  1320. -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
  1321. -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
  1322. AC_SUBST([MAN_SUBSTS])
  1323. ]) # XORG_MANPAGE_SECTIONS
  1324. # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
  1325. # ------------------------
  1326. # Minimum version: 1.7.0
  1327. #
  1328. # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
  1329. # provided by xorg-sgml-doctools, if installed.
  1330. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
  1331. AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
  1332. XORG_SGML_PATH=
  1333. PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
  1334. [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
  1335. [m4_ifval([$1],[:],
  1336. [if test x"$cross_compiling" != x"yes" ; then
  1337. AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
  1338. [XORG_SGML_PATH=$prefix/share/sgml])
  1339. fi])
  1340. ])
  1341. # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
  1342. # the path and the name of the doc stylesheet
  1343. if test "x$XORG_SGML_PATH" != "x" ; then
  1344. AC_MSG_RESULT([$XORG_SGML_PATH])
  1345. STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
  1346. XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
  1347. else
  1348. AC_MSG_RESULT([no])
  1349. fi
  1350. AC_SUBST(XORG_SGML_PATH)
  1351. AC_SUBST(STYLESHEET_SRCDIR)
  1352. AC_SUBST(XSL_STYLESHEET)
  1353. AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
  1354. ]) # XORG_CHECK_SGML_DOCTOOLS
  1355. # XORG_CHECK_LINUXDOC
  1356. # -------------------
  1357. # Minimum version: 1.0.0
  1358. #
  1359. # Defines the variable MAKE_TEXT if the necessary tools and
  1360. # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
  1361. # Whether or not the necessary tools and files are found can be checked
  1362. # with the AM_CONDITIONAL "BUILD_LINUXDOC"
  1363. AC_DEFUN([XORG_CHECK_LINUXDOC],[
  1364. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1365. AC_REQUIRE([XORG_WITH_PS2PDF])
  1366. AC_PATH_PROG(LINUXDOC, linuxdoc)
  1367. AC_MSG_CHECKING([whether to build documentation])
  1368. if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
  1369. BUILDDOC=yes
  1370. else
  1371. BUILDDOC=no
  1372. fi
  1373. AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
  1374. AC_MSG_RESULT([$BUILDDOC])
  1375. AC_MSG_CHECKING([whether to build pdf documentation])
  1376. if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
  1377. BUILDPDFDOC=yes
  1378. else
  1379. BUILDPDFDOC=no
  1380. fi
  1381. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1382. AC_MSG_RESULT([$BUILDPDFDOC])
  1383. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
  1384. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
  1385. MAKE_PDF="$PS2PDF"
  1386. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
  1387. AC_SUBST(MAKE_TEXT)
  1388. AC_SUBST(MAKE_PS)
  1389. AC_SUBST(MAKE_PDF)
  1390. AC_SUBST(MAKE_HTML)
  1391. ]) # XORG_CHECK_LINUXDOC
  1392. # XORG_CHECK_DOCBOOK
  1393. # -------------------
  1394. # Minimum version: 1.0.0
  1395. #
  1396. # Checks for the ability to build output formats from SGML DocBook source.
  1397. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
  1398. # indicates whether the necessary tools and files are found and, if set,
  1399. # $(MAKE_XXX) blah.sgml will produce blah.xxx.
  1400. AC_DEFUN([XORG_CHECK_DOCBOOK],[
  1401. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1402. BUILDTXTDOC=no
  1403. BUILDPDFDOC=no
  1404. BUILDPSDOC=no
  1405. BUILDHTMLDOC=no
  1406. AC_PATH_PROG(DOCBOOKPS, docbook2ps)
  1407. AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
  1408. AC_PATH_PROG(DOCBOOKHTML, docbook2html)
  1409. AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
  1410. AC_MSG_CHECKING([whether to build text documentation])
  1411. if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
  1412. test x$BUILD_TXTDOC != xno; then
  1413. BUILDTXTDOC=yes
  1414. fi
  1415. AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
  1416. AC_MSG_RESULT([$BUILDTXTDOC])
  1417. AC_MSG_CHECKING([whether to build PDF documentation])
  1418. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
  1419. test x$BUILD_PDFDOC != xno; then
  1420. BUILDPDFDOC=yes
  1421. fi
  1422. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1423. AC_MSG_RESULT([$BUILDPDFDOC])
  1424. AC_MSG_CHECKING([whether to build PostScript documentation])
  1425. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
  1426. test x$BUILD_PSDOC != xno; then
  1427. BUILDPSDOC=yes
  1428. fi
  1429. AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
  1430. AC_MSG_RESULT([$BUILDPSDOC])
  1431. AC_MSG_CHECKING([whether to build HTML documentation])
  1432. if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
  1433. test x$BUILD_HTMLDOC != xno; then
  1434. BUILDHTMLDOC=yes
  1435. fi
  1436. AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
  1437. AC_MSG_RESULT([$BUILDHTMLDOC])
  1438. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
  1439. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
  1440. MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
  1441. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
  1442. AC_SUBST(MAKE_TEXT)
  1443. AC_SUBST(MAKE_PS)
  1444. AC_SUBST(MAKE_PDF)
  1445. AC_SUBST(MAKE_HTML)
  1446. ]) # XORG_CHECK_DOCBOOK
  1447. # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
  1448. # ----------------
  1449. # Minimum version: 1.5.0
  1450. # Minimum version for optional DEFAULT argument: 1.11.0
  1451. #
  1452. # Documentation tools are not always available on all platforms and sometimes
  1453. # not at the appropriate level. This macro enables a module to test for the
  1454. # presence of the tool and obtain it's path in separate variables. Coupled with
  1455. # the --with-xmlto option, it allows maximum flexibilty in making decisions
  1456. # as whether or not to use the xmlto package. When DEFAULT is not specified,
  1457. # --with-xmlto assumes 'auto'.
  1458. #
  1459. # Interface to module:
  1460. # HAVE_XMLTO: used in makefiles to conditionally generate documentation
  1461. # XMLTO: returns the path of the xmlto program found
  1462. # returns the path set by the user in the environment
  1463. # --with-xmlto: 'yes' user instructs the module to use xmlto
  1464. # 'no' user instructs the module not to use xmlto
  1465. #
  1466. # Added in version 1.10.0
  1467. # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
  1468. # xmlto for text output requires either lynx, links, or w3m browsers
  1469. #
  1470. # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
  1471. #
  1472. AC_DEFUN([XORG_WITH_XMLTO],[
  1473. AC_ARG_VAR([XMLTO], [Path to xmlto command])
  1474. m4_define([_defopt], m4_default([$2], [auto]))
  1475. AC_ARG_WITH(xmlto,
  1476. AS_HELP_STRING([--with-xmlto],
  1477. [Use xmlto to regenerate documentation (default: ]_defopt[)]),
  1478. [use_xmlto=$withval], [use_xmlto=]_defopt)
  1479. m4_undefine([_defopt])
  1480. if test "x$use_xmlto" = x"auto"; then
  1481. AC_PATH_PROG([XMLTO], [xmlto])
  1482. if test "x$XMLTO" = "x"; then
  1483. AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
  1484. have_xmlto=no
  1485. else
  1486. have_xmlto=yes
  1487. fi
  1488. elif test "x$use_xmlto" = x"yes" ; then
  1489. AC_PATH_PROG([XMLTO], [xmlto])
  1490. if test "x$XMLTO" = "x"; then
  1491. AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
  1492. fi
  1493. have_xmlto=yes
  1494. elif test "x$use_xmlto" = x"no" ; then
  1495. if test "x$XMLTO" != "x"; then
  1496. AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
  1497. fi
  1498. have_xmlto=no
  1499. else
  1500. AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
  1501. fi
  1502. # Test for a minimum version of xmlto, if provided.
  1503. m4_ifval([$1],
  1504. [if test "$have_xmlto" = yes; then
  1505. # scrape the xmlto version
  1506. AC_MSG_CHECKING([the xmlto version])
  1507. xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
  1508. AC_MSG_RESULT([$xmlto_version])
  1509. AS_VERSION_COMPARE([$xmlto_version], [$1],
  1510. [if test "x$use_xmlto" = xauto; then
  1511. AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
  1512. have_xmlto=no
  1513. else
  1514. AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
  1515. fi])
  1516. fi])
  1517. # Test for the ability of xmlto to generate a text target
  1518. have_xmlto_text=no
  1519. cat > conftest.xml << "EOF"
  1520. EOF
  1521. AS_IF([test "$have_xmlto" = yes],
  1522. [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
  1523. [have_xmlto_text=yes],
  1524. [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
  1525. rm -f conftest.xml
  1526. AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
  1527. AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
  1528. ]) # XORG_WITH_XMLTO
  1529. # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
  1530. # --------------------------------------------
  1531. # Minimum version: 1.12.0
  1532. # Minimum version for optional DEFAULT argument: 1.12.0
  1533. #
  1534. # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
  1535. # XML-based language used for the transformation of XML documents.
  1536. # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
  1537. # It is used under the cover by xmlto to generate html files from DocBook/XML.
  1538. # The XSLT processor is often used as a standalone tool for transformations.
  1539. # It should not be assumed that this tool is used only to work with documnetation.
  1540. # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
  1541. #
  1542. # Interface to module:
  1543. # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
  1544. # XSLTPROC: returns the path of the xsltproc program found
  1545. # returns the path set by the user in the environment
  1546. # --with-xsltproc: 'yes' user instructs the module to use xsltproc
  1547. # 'no' user instructs the module not to use xsltproc
  1548. # have_xsltproc: returns yes if xsltproc found in PATH or no
  1549. #
  1550. # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
  1551. #
  1552. AC_DEFUN([XORG_WITH_XSLTPROC],[
  1553. AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
  1554. # Preserves the interface, should it be implemented later
  1555. m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
  1556. m4_define([_defopt], m4_default([$2], [auto]))
  1557. AC_ARG_WITH(xsltproc,
  1558. AS_HELP_STRING([--with-xsltproc],
  1559. [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
  1560. [use_xsltproc=$withval], [use_xsltproc=]_defopt)
  1561. m4_undefine([_defopt])
  1562. if test "x$use_xsltproc" = x"auto"; then
  1563. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1564. if test "x$XSLTPROC" = "x"; then
  1565. AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
  1566. have_xsltproc=no
  1567. else
  1568. have_xsltproc=yes
  1569. fi
  1570. elif test "x$use_xsltproc" = x"yes" ; then
  1571. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1572. if test "x$XSLTPROC" = "x"; then
  1573. AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
  1574. fi
  1575. have_xsltproc=yes
  1576. elif test "x$use_xsltproc" = x"no" ; then
  1577. if test "x$XSLTPROC" != "x"; then
  1578. AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
  1579. fi
  1580. have_xsltproc=no
  1581. else
  1582. AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
  1583. fi
  1584. AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
  1585. ]) # XORG_WITH_XSLTPROC
  1586. # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
  1587. # ----------------------------------------
  1588. # Minimum version: 1.15.0
  1589. #
  1590. # PERL (Practical Extraction and Report Language) is a language optimized for
  1591. # scanning arbitrary text files, extracting information from those text files,
  1592. # and printing reports based on that information.
  1593. #
  1594. # When DEFAULT is not specified, --with-perl assumes 'auto'.
  1595. #
  1596. # Interface to module:
  1597. # HAVE_PERL: used in makefiles to conditionally scan text files
  1598. # PERL: returns the path of the perl program found
  1599. # returns the path set by the user in the environment
  1600. # --with-perl: 'yes' user instructs the module to use perl
  1601. # 'no' user instructs the module not to use perl
  1602. # have_perl: returns yes if perl found in PATH or no
  1603. #
  1604. # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
  1605. #
  1606. AC_DEFUN([XORG_WITH_PERL],[
  1607. AC_ARG_VAR([PERL], [Path to perl command])
  1608. # Preserves the interface, should it be implemented later
  1609. m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
  1610. m4_define([_defopt], m4_default([$2], [auto]))
  1611. AC_ARG_WITH(perl,
  1612. AS_HELP_STRING([--with-perl],
  1613. [Use perl for extracting information from files (default: ]_defopt[)]),
  1614. [use_perl=$withval], [use_perl=]_defopt)
  1615. m4_undefine([_defopt])
  1616. if test "x$use_perl" = x"auto"; then
  1617. AC_PATH_PROG([PERL], [perl])
  1618. if test "x$PERL" = "x"; then
  1619. AC_MSG_WARN([perl not found - cannot extract information and report])
  1620. have_perl=no
  1621. else
  1622. have_perl=yes
  1623. fi
  1624. elif test "x$use_perl" = x"yes" ; then
  1625. AC_PATH_PROG([PERL], [perl])
  1626. if test "x$PERL" = "x"; then
  1627. AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
  1628. fi
  1629. have_perl=yes
  1630. elif test "x$use_perl" = x"no" ; then
  1631. if test "x$PERL" != "x"; then
  1632. AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
  1633. fi
  1634. have_perl=no
  1635. else
  1636. AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
  1637. fi
  1638. AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
  1639. ]) # XORG_WITH_PERL
  1640. # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
  1641. # ----------------
  1642. # Minimum version: 1.5.0
  1643. # Minimum version for optional DEFAULT argument: 1.11.0
  1644. #
  1645. # Documentation tools are not always available on all platforms and sometimes
  1646. # not at the appropriate level. This macro enables a module to test for the
  1647. # presence of the tool and obtain it's path in separate variables. Coupled with
  1648. # the --with-asciidoc option, it allows maximum flexibilty in making decisions
  1649. # as whether or not to use the asciidoc package. When DEFAULT is not specified,
  1650. # --with-asciidoc assumes 'auto'.
  1651. #
  1652. # Interface to module:
  1653. # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
  1654. # ASCIIDOC: returns the path of the asciidoc program found
  1655. # returns the path set by the user in the environment
  1656. # --with-asciidoc: 'yes' user instructs the module to use asciidoc
  1657. # 'no' user instructs the module not to use asciidoc
  1658. #
  1659. # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
  1660. #
  1661. AC_DEFUN([XORG_WITH_ASCIIDOC],[
  1662. AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
  1663. m4_define([_defopt], m4_default([$2], [auto]))
  1664. AC_ARG_WITH(asciidoc,
  1665. AS_HELP_STRING([--with-asciidoc],
  1666. [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
  1667. [use_asciidoc=$withval], [use_asciidoc=]_defopt)
  1668. m4_undefine([_defopt])
  1669. if test "x$use_asciidoc" = x"auto"; then
  1670. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1671. if test "x$ASCIIDOC" = "x"; then
  1672. AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
  1673. have_asciidoc=no
  1674. else
  1675. have_asciidoc=yes
  1676. fi
  1677. elif test "x$use_asciidoc" = x"yes" ; then
  1678. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1679. if test "x$ASCIIDOC" = "x"; then
  1680. AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
  1681. fi
  1682. have_asciidoc=yes
  1683. elif test "x$use_asciidoc" = x"no" ; then
  1684. if test "x$ASCIIDOC" != "x"; then
  1685. AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
  1686. fi
  1687. have_asciidoc=no
  1688. else
  1689. AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
  1690. fi
  1691. m4_ifval([$1],
  1692. [if test "$have_asciidoc" = yes; then
  1693. # scrape the asciidoc version
  1694. AC_MSG_CHECKING([the asciidoc version])
  1695. asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
  1696. AC_MSG_RESULT([$asciidoc_version])
  1697. AS_VERSION_COMPARE([$asciidoc_version], [$1],
  1698. [if test "x$use_asciidoc" = xauto; then
  1699. AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
  1700. have_asciidoc=no
  1701. else
  1702. AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
  1703. fi])
  1704. fi])
  1705. AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
  1706. ]) # XORG_WITH_ASCIIDOC
  1707. # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
  1708. # -------------------------------------------
  1709. # Minimum version: 1.5.0
  1710. # Minimum version for optional DEFAULT argument: 1.11.0
  1711. # Minimum version for optional DOT checking: 1.18.0
  1712. #
  1713. # Documentation tools are not always available on all platforms and sometimes
  1714. # not at the appropriate level. This macro enables a module to test for the
  1715. # presence of the tool and obtain it's path in separate variables. Coupled with
  1716. # the --with-doxygen option, it allows maximum flexibilty in making decisions
  1717. # as whether or not to use the doxygen package. When DEFAULT is not specified,
  1718. # --with-doxygen assumes 'auto'.
  1719. #
  1720. # Interface to module:
  1721. # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
  1722. # DOXYGEN: returns the path of the doxygen program found
  1723. # returns the path set by the user in the environment
  1724. # --with-doxygen: 'yes' user instructs the module to use doxygen
  1725. # 'no' user instructs the module not to use doxygen
  1726. #
  1727. # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
  1728. #
  1729. AC_DEFUN([XORG_WITH_DOXYGEN],[
  1730. AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
  1731. AC_ARG_VAR([DOT], [Path to the dot graphics utility])
  1732. m4_define([_defopt], m4_default([$2], [auto]))
  1733. AC_ARG_WITH(doxygen,
  1734. AS_HELP_STRING([--with-doxygen],
  1735. [Use doxygen to regenerate documentation (default: ]_defopt[)]),
  1736. [use_doxygen=$withval], [use_doxygen=]_defopt)
  1737. m4_undefine([_defopt])
  1738. if test "x$use_doxygen" = x"auto"; then
  1739. AC_PATH_PROG([DOXYGEN], [doxygen])
  1740. if test "x$DOXYGEN" = "x"; then
  1741. AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
  1742. have_doxygen=no
  1743. else
  1744. have_doxygen=yes
  1745. fi
  1746. elif test "x$use_doxygen" = x"yes" ; then
  1747. AC_PATH_PROG([DOXYGEN], [doxygen])
  1748. if test "x$DOXYGEN" = "x"; then
  1749. AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
  1750. fi
  1751. have_doxygen=yes
  1752. elif test "x$use_doxygen" = x"no" ; then
  1753. if test "x$DOXYGEN" != "x"; then
  1754. AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
  1755. fi
  1756. have_doxygen=no
  1757. else
  1758. AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
  1759. fi
  1760. m4_ifval([$1],
  1761. [if test "$have_doxygen" = yes; then
  1762. # scrape the doxygen version
  1763. AC_MSG_CHECKING([the doxygen version])
  1764. doxygen_version=`$DOXYGEN --version 2>/dev/null`
  1765. AC_MSG_RESULT([$doxygen_version])
  1766. AS_VERSION_COMPARE([$doxygen_version], [$1],
  1767. [if test "x$use_doxygen" = xauto; then
  1768. AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
  1769. have_doxygen=no
  1770. else
  1771. AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
  1772. fi])
  1773. fi])
  1774. dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
  1775. dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
  1776. dnl HAVE_DOT = @HAVE_DOT@
  1777. HAVE_DOT=no
  1778. if test "x$have_doxygen" = "xyes"; then
  1779. AC_PATH_PROG([DOT], [dot])
  1780. if test "x$DOT" != "x"; then
  1781. HAVE_DOT=yes
  1782. fi
  1783. fi
  1784. AC_SUBST([HAVE_DOT])
  1785. AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
  1786. AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
  1787. ]) # XORG_WITH_DOXYGEN
  1788. # XORG_WITH_GROFF([DEFAULT])
  1789. # ----------------
  1790. # Minimum version: 1.6.0
  1791. # Minimum version for optional DEFAULT argument: 1.11.0
  1792. #
  1793. # Documentation tools are not always available on all platforms and sometimes
  1794. # not at the appropriate level. This macro enables a module to test for the
  1795. # presence of the tool and obtain it's path in separate variables. Coupled with
  1796. # the --with-groff option, it allows maximum flexibilty in making decisions
  1797. # as whether or not to use the groff package. When DEFAULT is not specified,
  1798. # --with-groff assumes 'auto'.
  1799. #
  1800. # Interface to module:
  1801. # HAVE_GROFF: used in makefiles to conditionally generate documentation
  1802. # HAVE_GROFF_MM: the memorandum macros (-mm) package
  1803. # HAVE_GROFF_MS: the -ms macros package
  1804. # GROFF: returns the path of the groff program found
  1805. # returns the path set by the user in the environment
  1806. # --with-groff: 'yes' user instructs the module to use groff
  1807. # 'no' user instructs the module not to use groff
  1808. #
  1809. # Added in version 1.9.0:
  1810. # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
  1811. # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
  1812. # psselect from the psutils package.
  1813. # the ghostcript package. Refer to the grohtml man pages
  1814. #
  1815. # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
  1816. #
  1817. # OS and distros often splits groff in a basic and full package, the former
  1818. # having the groff program and the later having devices, fonts and macros
  1819. # Checking for the groff executable is not enough.
  1820. #
  1821. # If macros are missing, we cannot assume that groff is useless, so we don't
  1822. # unset HAVE_GROFF or GROFF env variables.
  1823. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
  1824. #
  1825. AC_DEFUN([XORG_WITH_GROFF],[
  1826. AC_ARG_VAR([GROFF], [Path to groff command])
  1827. m4_define([_defopt], m4_default([$1], [auto]))
  1828. AC_ARG_WITH(groff,
  1829. AS_HELP_STRING([--with-groff],
  1830. [Use groff to regenerate documentation (default: ]_defopt[)]),
  1831. [use_groff=$withval], [use_groff=]_defopt)
  1832. m4_undefine([_defopt])
  1833. if test "x$use_groff" = x"auto"; then
  1834. AC_PATH_PROG([GROFF], [groff])
  1835. if test "x$GROFF" = "x"; then
  1836. AC_MSG_WARN([groff not found - documentation targets will be skipped])
  1837. have_groff=no
  1838. else
  1839. have_groff=yes
  1840. fi
  1841. elif test "x$use_groff" = x"yes" ; then
  1842. AC_PATH_PROG([GROFF], [groff])
  1843. if test "x$GROFF" = "x"; then
  1844. AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
  1845. fi
  1846. have_groff=yes
  1847. elif test "x$use_groff" = x"no" ; then
  1848. if test "x$GROFF" != "x"; then
  1849. AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
  1850. fi
  1851. have_groff=no
  1852. else
  1853. AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
  1854. fi
  1855. # We have groff, test for the presence of the macro packages
  1856. if test "x$have_groff" = x"yes"; then
  1857. AC_MSG_CHECKING([for ${GROFF} -ms macros])
  1858. if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
  1859. groff_ms_works=yes
  1860. else
  1861. groff_ms_works=no
  1862. fi
  1863. AC_MSG_RESULT([$groff_ms_works])
  1864. AC_MSG_CHECKING([for ${GROFF} -mm macros])
  1865. if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
  1866. groff_mm_works=yes
  1867. else
  1868. groff_mm_works=no
  1869. fi
  1870. AC_MSG_RESULT([$groff_mm_works])
  1871. fi
  1872. # We have groff, test for HTML dependencies, one command per package
  1873. if test "x$have_groff" = x"yes"; then
  1874. AC_PATH_PROGS(GS_PATH, [gs gswin32c])
  1875. AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
  1876. AC_PATH_PROG(PSSELECT_PATH, [psselect])
  1877. if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
  1878. have_groff_html=yes
  1879. else
  1880. have_groff_html=no
  1881. AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
  1882. fi
  1883. fi
  1884. # Set Automake conditionals for Makefiles
  1885. AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
  1886. AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
  1887. AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
  1888. AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
  1889. ]) # XORG_WITH_GROFF
  1890. # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
  1891. # ---------------------------------------
  1892. # Minimum version: 1.6.0
  1893. # Minimum version for optional DEFAULT argument: 1.11.0
  1894. # Minimum version for optional MIN-VERSION argument: 1.15.0
  1895. #
  1896. # Documentation tools are not always available on all platforms and sometimes
  1897. # not at the appropriate level. This macro enables a module to test for the
  1898. # presence of the tool and obtain it's path in separate variables. Coupled with
  1899. # the --with-fop option, it allows maximum flexibilty in making decisions
  1900. # as whether or not to use the fop package. When DEFAULT is not specified,
  1901. # --with-fop assumes 'auto'.
  1902. #
  1903. # Interface to module:
  1904. # HAVE_FOP: used in makefiles to conditionally generate documentation
  1905. # FOP: returns the path of the fop program found
  1906. # returns the path set by the user in the environment
  1907. # --with-fop: 'yes' user instructs the module to use fop
  1908. # 'no' user instructs the module not to use fop
  1909. #
  1910. # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
  1911. #
  1912. AC_DEFUN([XORG_WITH_FOP],[
  1913. AC_ARG_VAR([FOP], [Path to fop command])
  1914. m4_define([_defopt], m4_default([$2], [auto]))
  1915. AC_ARG_WITH(fop,
  1916. AS_HELP_STRING([--with-fop],
  1917. [Use fop to regenerate documentation (default: ]_defopt[)]),
  1918. [use_fop=$withval], [use_fop=]_defopt)
  1919. m4_undefine([_defopt])
  1920. if test "x$use_fop" = x"auto"; then
  1921. AC_PATH_PROG([FOP], [fop])
  1922. if test "x$FOP" = "x"; then
  1923. AC_MSG_WARN([fop not found - documentation targets will be skipped])
  1924. have_fop=no
  1925. else
  1926. have_fop=yes
  1927. fi
  1928. elif test "x$use_fop" = x"yes" ; then
  1929. AC_PATH_PROG([FOP], [fop])
  1930. if test "x$FOP" = "x"; then
  1931. AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
  1932. fi
  1933. have_fop=yes
  1934. elif test "x$use_fop" = x"no" ; then
  1935. if test "x$FOP" != "x"; then
  1936. AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
  1937. fi
  1938. have_fop=no
  1939. else
  1940. AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
  1941. fi
  1942. # Test for a minimum version of fop, if provided.
  1943. m4_ifval([$1],
  1944. [if test "$have_fop" = yes; then
  1945. # scrape the fop version
  1946. AC_MSG_CHECKING([for fop minimum version])
  1947. fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
  1948. AC_MSG_RESULT([$fop_version])
  1949. AS_VERSION_COMPARE([$fop_version], [$1],
  1950. [if test "x$use_fop" = xauto; then
  1951. AC_MSG_WARN([fop version $fop_version found, but $1 needed])
  1952. have_fop=no
  1953. else
  1954. AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
  1955. fi])
  1956. fi])
  1957. AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
  1958. ]) # XORG_WITH_FOP
  1959. # XORG_WITH_M4([MIN-VERSION])
  1960. # ---------------------------
  1961. # Minimum version: 1.19.0
  1962. #
  1963. # This macro attempts to locate an m4 macro processor which supports
  1964. # -I option and is only useful for modules relying on M4 in order to
  1965. # expand macros in source code files.
  1966. #
  1967. # Interface to module:
  1968. # M4: returns the path of the m4 program found
  1969. # returns the path set by the user in the environment
  1970. #
  1971. AC_DEFUN([XORG_WITH_M4], [
  1972. AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
  1973. [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
  1974. [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
  1975. ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
  1976. [AC_MSG_ERROR([could not find m4 that supports -I option])],
  1977. [$PATH:/usr/gnu/bin])])
  1978. AC_SUBST([M4], [$ac_cv_path_M4])
  1979. ]) # XORG_WITH_M4
  1980. # XORG_WITH_PS2PDF([DEFAULT])
  1981. # ----------------
  1982. # Minimum version: 1.6.0
  1983. # Minimum version for optional DEFAULT argument: 1.11.0
  1984. #
  1985. # Documentation tools are not always available on all platforms and sometimes
  1986. # not at the appropriate level. This macro enables a module to test for the
  1987. # presence of the tool and obtain it's path in separate variables. Coupled with
  1988. # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
  1989. # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
  1990. # --with-ps2pdf assumes 'auto'.
  1991. #
  1992. # Interface to module:
  1993. # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
  1994. # PS2PDF: returns the path of the ps2pdf program found
  1995. # returns the path set by the user in the environment
  1996. # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
  1997. # 'no' user instructs the module not to use ps2pdf
  1998. #
  1999. # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
  2000. #
  2001. AC_DEFUN([XORG_WITH_PS2PDF],[
  2002. AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
  2003. m4_define([_defopt], m4_default([$1], [auto]))
  2004. AC_ARG_WITH(ps2pdf,
  2005. AS_HELP_STRING([--with-ps2pdf],
  2006. [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
  2007. [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
  2008. m4_undefine([_defopt])
  2009. if test "x$use_ps2pdf" = x"auto"; then
  2010. AC_PATH_PROG([PS2PDF], [ps2pdf])
  2011. if test "x$PS2PDF" = "x"; then
  2012. AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
  2013. have_ps2pdf=no
  2014. else
  2015. have_ps2pdf=yes
  2016. fi
  2017. elif test "x$use_ps2pdf" = x"yes" ; then
  2018. AC_PATH_PROG([PS2PDF], [ps2pdf])
  2019. if test "x$PS2PDF" = "x"; then
  2020. AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
  2021. fi
  2022. have_ps2pdf=yes
  2023. elif test "x$use_ps2pdf" = x"no" ; then
  2024. if test "x$PS2PDF" != "x"; then
  2025. AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
  2026. fi
  2027. have_ps2pdf=no
  2028. else
  2029. AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
  2030. fi
  2031. AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
  2032. ]) # XORG_WITH_PS2PDF
  2033. # XORG_ENABLE_DOCS (enable_docs=yes)
  2034. # ----------------
  2035. # Minimum version: 1.6.0
  2036. #
  2037. # Documentation tools are not always available on all platforms and sometimes
  2038. # not at the appropriate level. This macro enables a builder to skip all
  2039. # documentation targets except traditional man pages.
  2040. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2041. # maximum flexibilty in controlling documentation building.
  2042. # Refer to:
  2043. # XORG_WITH_XMLTO --with-xmlto
  2044. # XORG_WITH_ASCIIDOC --with-asciidoc
  2045. # XORG_WITH_DOXYGEN --with-doxygen
  2046. # XORG_WITH_FOP --with-fop
  2047. # XORG_WITH_GROFF --with-groff
  2048. # XORG_WITH_PS2PDF --with-ps2pdf
  2049. #
  2050. # Interface to module:
  2051. # ENABLE_DOCS: used in makefiles to conditionally generate documentation
  2052. # --enable-docs: 'yes' user instructs the module to generate docs
  2053. # 'no' user instructs the module not to generate docs
  2054. # parm1: specify the default value, yes or no.
  2055. #
  2056. AC_DEFUN([XORG_ENABLE_DOCS],[
  2057. m4_define([docs_default], m4_default([$1], [yes]))
  2058. AC_ARG_ENABLE(docs,
  2059. AS_HELP_STRING([--enable-docs],
  2060. [Enable building the documentation (default: ]docs_default[)]),
  2061. [build_docs=$enableval], [build_docs=]docs_default)
  2062. m4_undefine([docs_default])
  2063. AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
  2064. AC_MSG_CHECKING([whether to build documentation])
  2065. AC_MSG_RESULT([$build_docs])
  2066. ]) # XORG_ENABLE_DOCS
  2067. # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
  2068. # ----------------
  2069. # Minimum version: 1.6.0
  2070. #
  2071. # This macro enables a builder to skip all developer documentation.
  2072. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2073. # maximum flexibilty in controlling documentation building.
  2074. # Refer to:
  2075. # XORG_WITH_XMLTO --with-xmlto
  2076. # XORG_WITH_ASCIIDOC --with-asciidoc
  2077. # XORG_WITH_DOXYGEN --with-doxygen
  2078. # XORG_WITH_FOP --with-fop
  2079. # XORG_WITH_GROFF --with-groff
  2080. # XORG_WITH_PS2PDF --with-ps2pdf
  2081. #
  2082. # Interface to module:
  2083. # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
  2084. # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
  2085. # 'no' user instructs the module not to generate developer docs
  2086. # parm1: specify the default value, yes or no.
  2087. #
  2088. AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
  2089. m4_define([devel_default], m4_default([$1], [yes]))
  2090. AC_ARG_ENABLE(devel-docs,
  2091. AS_HELP_STRING([--enable-devel-docs],
  2092. [Enable building the developer documentation (default: ]devel_default[)]),
  2093. [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
  2094. m4_undefine([devel_default])
  2095. AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
  2096. AC_MSG_CHECKING([whether to build developer documentation])
  2097. AC_MSG_RESULT([$build_devel_docs])
  2098. ]) # XORG_ENABLE_DEVEL_DOCS
  2099. # XORG_ENABLE_SPECS (enable_specs=yes)
  2100. # ----------------
  2101. # Minimum version: 1.6.0
  2102. #
  2103. # This macro enables a builder to skip all functional specification targets.
  2104. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2105. # maximum flexibilty in controlling documentation building.
  2106. # Refer to:
  2107. # XORG_WITH_XMLTO --with-xmlto
  2108. # XORG_WITH_ASCIIDOC --with-asciidoc
  2109. # XORG_WITH_DOXYGEN --with-doxygen
  2110. # XORG_WITH_FOP --with-fop
  2111. # XORG_WITH_GROFF --with-groff
  2112. # XORG_WITH_PS2PDF --with-ps2pdf
  2113. #
  2114. # Interface to module:
  2115. # ENABLE_SPECS: used in makefiles to conditionally generate specs
  2116. # --enable-specs: 'yes' user instructs the module to generate specs
  2117. # 'no' user instructs the module not to generate specs
  2118. # parm1: specify the default value, yes or no.
  2119. #
  2120. AC_DEFUN([XORG_ENABLE_SPECS],[
  2121. m4_define([spec_default], m4_default([$1], [yes]))
  2122. AC_ARG_ENABLE(specs,
  2123. AS_HELP_STRING([--enable-specs],
  2124. [Enable building the specs (default: ]spec_default[)]),
  2125. [build_specs=$enableval], [build_specs=]spec_default)
  2126. m4_undefine([spec_default])
  2127. AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
  2128. AC_MSG_CHECKING([whether to build functional specifications])
  2129. AC_MSG_RESULT([$build_specs])
  2130. ]) # XORG_ENABLE_SPECS
  2131. # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
  2132. # ----------------------------------------------
  2133. # Minimum version: 1.13.0
  2134. #
  2135. # This macro enables a builder to enable/disable unit testing
  2136. # It makes no assumption about the test cases implementation
  2137. # Test cases may or may not use Automake "Support for test suites"
  2138. # They may or may not use the software utility library GLib
  2139. #
  2140. # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
  2141. # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
  2142. # The variable enable_unit_tests is used by other macros in this file.
  2143. #
  2144. # Interface to module:
  2145. # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
  2146. # enable_unit_tests: used in configure.ac for additional configuration
  2147. # --enable-unit-tests: 'yes' user instructs the module to build tests
  2148. # 'no' user instructs the module not to build tests
  2149. # parm1: specify the default value, yes or no.
  2150. #
  2151. AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
  2152. AC_BEFORE([$0], [XORG_WITH_GLIB])
  2153. AC_BEFORE([$0], [XORG_LD_WRAP])
  2154. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  2155. m4_define([_defopt], m4_default([$1], [auto]))
  2156. AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
  2157. [Enable building unit test cases (default: ]_defopt[)]),
  2158. [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
  2159. m4_undefine([_defopt])
  2160. AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
  2161. AC_MSG_CHECKING([whether to build unit test cases])
  2162. AC_MSG_RESULT([$enable_unit_tests])
  2163. ]) # XORG_ENABLE_UNIT_TESTS
  2164. # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
  2165. # ------------------------------------------------------
  2166. # Minimum version: 1.17.0
  2167. #
  2168. # This macro enables a builder to enable/disable integration testing
  2169. # It makes no assumption about the test cases' implementation
  2170. # Test cases may or may not use Automake "Support for test suites"
  2171. #
  2172. # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
  2173. # usually requires less dependencies and may be built and run under less
  2174. # stringent environments than integration tests.
  2175. #
  2176. # Interface to module:
  2177. # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
  2178. # enable_integration_tests: used in configure.ac for additional configuration
  2179. # --enable-integration-tests: 'yes' user instructs the module to build tests
  2180. # 'no' user instructs the module not to build tests
  2181. # parm1: specify the default value, yes or no.
  2182. #
  2183. AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
  2184. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  2185. m4_define([_defopt], m4_default([$1], [auto]))
  2186. AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
  2187. [Enable building integration test cases (default: ]_defopt[)]),
  2188. [enable_integration_tests=$enableval],
  2189. [enable_integration_tests=]_defopt)
  2190. m4_undefine([_defopt])
  2191. AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
  2192. [test "x$enable_integration_tests" != xno])
  2193. AC_MSG_CHECKING([whether to build unit test cases])
  2194. AC_MSG_RESULT([$enable_integration_tests])
  2195. ]) # XORG_ENABLE_INTEGRATION_TESTS
  2196. # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
  2197. # ----------------------------------------
  2198. # Minimum version: 1.13.0
  2199. #
  2200. # GLib is a library which provides advanced data structures and functions.
  2201. # This macro enables a module to test for the presence of Glib.
  2202. #
  2203. # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
  2204. # Otherwise the value of $enable_unit_tests is blank.
  2205. #
  2206. # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
  2207. # test support usually requires less dependencies and may be built and run under
  2208. # less stringent environments than integration tests.
  2209. #
  2210. # Interface to module:
  2211. # HAVE_GLIB: used in makefiles to conditionally build targets
  2212. # with_glib: used in configure.ac to know if GLib has been found
  2213. # --with-glib: 'yes' user instructs the module to use glib
  2214. # 'no' user instructs the module not to use glib
  2215. #
  2216. AC_DEFUN([XORG_WITH_GLIB],[
  2217. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2218. m4_define([_defopt], m4_default([$2], [auto]))
  2219. AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
  2220. [Use GLib library for unit testing (default: ]_defopt[)]),
  2221. [with_glib=$withval], [with_glib=]_defopt)
  2222. m4_undefine([_defopt])
  2223. have_glib=no
  2224. # Do not probe GLib if user explicitly disabled unit testing
  2225. if test "x$enable_unit_tests" != x"no"; then
  2226. # Do not probe GLib if user explicitly disabled it
  2227. if test "x$with_glib" != x"no"; then
  2228. m4_ifval(
  2229. [$1],
  2230. [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
  2231. [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
  2232. )
  2233. fi
  2234. fi
  2235. # Not having GLib when unit testing has been explicitly requested is an error
  2236. if test "x$enable_unit_tests" = x"yes"; then
  2237. if test "x$have_glib" = x"no"; then
  2238. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  2239. fi
  2240. fi
  2241. # Having unit testing disabled when GLib has been explicitly requested is an error
  2242. if test "x$enable_unit_tests" = x"no"; then
  2243. if test "x$with_glib" = x"yes"; then
  2244. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  2245. fi
  2246. fi
  2247. # Not having GLib when it has been explicitly requested is an error
  2248. if test "x$with_glib" = x"yes"; then
  2249. if test "x$have_glib" = x"no"; then
  2250. AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
  2251. fi
  2252. fi
  2253. AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
  2254. ]) # XORG_WITH_GLIB
  2255. # XORG_LD_WRAP([required|optional])
  2256. # ---------------------------------
  2257. # Minimum version: 1.13.0
  2258. #
  2259. # Check if linker supports -wrap, passed via compiler flags
  2260. #
  2261. # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
  2262. # Otherwise the value of $enable_unit_tests is blank.
  2263. #
  2264. # Argument added in 1.16.0 - default is "required", to match existing behavior
  2265. # of returning an error if enable_unit_tests is yes, and ld -wrap is not
  2266. # available, an argument of "optional" allows use when some unit tests require
  2267. # ld -wrap and others do not.
  2268. #
  2269. AC_DEFUN([XORG_LD_WRAP],[
  2270. XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
  2271. [AC_LANG_PROGRAM([#include <stdlib.h>
  2272. void __wrap_exit(int status) { return; }],
  2273. [exit(0);])])
  2274. # Not having ld wrap when unit testing has been explicitly requested is an error
  2275. if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
  2276. if test "x$have_ld_wrap" = x"no"; then
  2277. AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
  2278. fi
  2279. fi
  2280. AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
  2281. #
  2282. ]) # XORG_LD_WRAP
  2283. # XORG_CHECK_LINKER_FLAGS
  2284. # -----------------------
  2285. # SYNOPSIS
  2286. #
  2287. # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
  2288. #
  2289. # DESCRIPTION
  2290. #
  2291. # Check whether the given linker FLAGS work with the current language's
  2292. # linker, or whether they give an error.
  2293. #
  2294. # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
  2295. # success/failure.
  2296. #
  2297. # PROGRAM-SOURCE is the program source to link with, if needed
  2298. #
  2299. # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
  2300. #
  2301. # LICENSE
  2302. #
  2303. # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
  2304. # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
  2305. # Copyright (c) 2009 Matteo Frigo
  2306. #
  2307. # This program is free software: you can redistribute it and/or modify it
  2308. # under the terms of the GNU General Public License as published by the
  2309. # Free Software Foundation, either version 3 of the License, or (at your
  2310. # option) any later version.
  2311. #
  2312. # This program is distributed in the hope that it will be useful, but
  2313. # WITHOUT ANY WARRANTY; without even the implied warranty of
  2314. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  2315. # Public License for more details.
  2316. #
  2317. # You should have received a copy of the GNU General Public License along
  2318. # with this program. If not, see <http://www.gnu.org/licenses/>.
  2319. #
  2320. # As a special exception, the respective Autoconf Macro's copyright owner
  2321. # gives unlimited permission to copy, distribute and modify the configure
  2322. # scripts that are the output of Autoconf when processing the Macro. You
  2323. # need not follow the terms of the GNU General Public License when using
  2324. # or distributing such scripts, even though portions of the text of the
  2325. # Macro appear in them. The GNU General Public License (GPL) does govern
  2326. # all other use of the material that constitutes the Autoconf Macro.
  2327. #
  2328. # This special exception to the GPL applies to versions of the Autoconf
  2329. # Macro released by the Autoconf Archive. When you make and distribute a
  2330. # modified version of the Autoconf Macro, you may extend this special
  2331. # exception to the GPL to apply to your modified version as well.#
  2332. AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
  2333. [AC_MSG_CHECKING([whether the linker accepts $1])
  2334. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
  2335. AS_LITERAL_IF([$1],
  2336. [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
  2337. ax_save_FLAGS=$LDFLAGS
  2338. LDFLAGS="$1"
  2339. AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
  2340. AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  2341. AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  2342. LDFLAGS=$ax_save_FLAGS])],
  2343. [ax_save_FLAGS=$LDFLAGS
  2344. LDFLAGS="$1"
  2345. AC_LINK_IFELSE([AC_LANG_PROGRAM()],
  2346. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  2347. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  2348. LDFLAGS=$ax_save_FLAGS])
  2349. eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
  2350. AC_MSG_RESULT($xorg_check_linker_flags)
  2351. if test "x$xorg_check_linker_flags" = xyes; then
  2352. m4_default([$2], :)
  2353. else
  2354. m4_default([$3], :)
  2355. fi
  2356. ]) # XORG_CHECK_LINKER_FLAGS
  2357. # XORG_MEMORY_CHECK_FLAGS
  2358. # -----------------------
  2359. # Minimum version: 1.16.0
  2360. #
  2361. # This macro attempts to find appropriate memory checking functionality
  2362. # for various platforms which unit testing code may use to catch various
  2363. # forms of memory allocation and access errors in testing.
  2364. #
  2365. # Interface to module:
  2366. # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
  2367. # Usually added to TESTS_ENVIRONMENT in Makefile.am
  2368. #
  2369. # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
  2370. #
  2371. AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
  2372. AC_REQUIRE([AC_CANONICAL_HOST])
  2373. AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
  2374. [Environment variables to enable memory checking in tests])
  2375. # Check for different types of support on different platforms
  2376. case $host_os in
  2377. solaris*)
  2378. AC_CHECK_LIB([umem], [umem_alloc],
  2379. [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
  2380. ;;
  2381. *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
  2382. # both directly and inverted, so should not be 0 or 255.
  2383. malloc_debug_env='MALLOC_PERTURB_=15'
  2384. ;;
  2385. darwin*)
  2386. malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
  2387. ;;
  2388. *bsd*)
  2389. malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
  2390. ;;
  2391. esac
  2392. # User supplied flags override default flags
  2393. if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
  2394. malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
  2395. fi
  2396. AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
  2397. ]) # XORG_WITH_LINT
  2398. # XORG_CHECK_MALLOC_ZERO
  2399. # ----------------------
  2400. # Minimum version: 1.0.0
  2401. #
  2402. # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
  2403. # malloc(0) returns NULL. Packages should add one of these cflags to
  2404. # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
  2405. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
  2406. AC_ARG_ENABLE(malloc0returnsnull,
  2407. AS_HELP_STRING([--enable-malloc0returnsnull],
  2408. [malloc(0) returns NULL (default: auto)]),
  2409. [MALLOC_ZERO_RETURNS_NULL=$enableval],
  2410. [MALLOC_ZERO_RETURNS_NULL=auto])
  2411. AC_MSG_CHECKING([whether malloc(0) returns NULL])
  2412. if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
  2413. AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
  2414. [AC_RUN_IFELSE([AC_LANG_PROGRAM([
  2415. #include <stdlib.h>
  2416. ],[
  2417. char *m0, *r0, *c0, *p;
  2418. m0 = malloc(0);
  2419. p = malloc(10);
  2420. r0 = realloc(p,0);
  2421. c0 = calloc(0,10);
  2422. exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
  2423. ])],
  2424. [xorg_cv_malloc0_returns_null=yes],
  2425. [xorg_cv_malloc0_returns_null=no])])
  2426. MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
  2427. fi
  2428. AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
  2429. if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
  2430. MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
  2431. XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
  2432. XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
  2433. else
  2434. MALLOC_ZERO_CFLAGS=""
  2435. XMALLOC_ZERO_CFLAGS=""
  2436. XTMALLOC_ZERO_CFLAGS=""
  2437. fi
  2438. AC_SUBST([MALLOC_ZERO_CFLAGS])
  2439. AC_SUBST([XMALLOC_ZERO_CFLAGS])
  2440. AC_SUBST([XTMALLOC_ZERO_CFLAGS])
  2441. ]) # XORG_CHECK_MALLOC_ZERO
  2442. # XORG_WITH_LINT()
  2443. # ----------------
  2444. # Minimum version: 1.1.0
  2445. #
  2446. # This macro enables the use of a tool that flags some suspicious and
  2447. # non-portable constructs (likely to be bugs) in C language source code.
  2448. # It will attempt to locate the tool and use appropriate options.
  2449. # There are various lint type tools on different platforms.
  2450. #
  2451. # Interface to module:
  2452. # LINT: returns the path to the tool found on the platform
  2453. # or the value set to LINT on the configure cmd line
  2454. # also an Automake conditional
  2455. # LINT_FLAGS: an Automake variable with appropriate flags
  2456. #
  2457. # --with-lint: 'yes' user instructs the module to use lint
  2458. # 'no' user instructs the module not to use lint (default)
  2459. #
  2460. # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
  2461. # If the user sets the value of LINT_FLAGS, they are used verbatim.
  2462. #
  2463. AC_DEFUN([XORG_WITH_LINT],[
  2464. AC_ARG_VAR([LINT], [Path to a lint-style command])
  2465. AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
  2466. AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
  2467. [Use a lint-style source code checker (default: disabled)])],
  2468. [use_lint=$withval], [use_lint=no])
  2469. # Obtain platform specific info like program name and options
  2470. # The lint program on FreeBSD and NetBSD is different from the one on Solaris
  2471. case $host_os in
  2472. *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
  2473. lint_name=splint
  2474. lint_options="-badflag"
  2475. ;;
  2476. *freebsd* | *netbsd*)
  2477. lint_name=lint
  2478. lint_options="-u -b"
  2479. ;;
  2480. *solaris*)
  2481. lint_name=lint
  2482. lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
  2483. ;;
  2484. esac
  2485. # Test for the presence of the program (either guessed by the code or spelled out by the user)
  2486. if test "x$use_lint" = x"yes" ; then
  2487. AC_PATH_PROG([LINT], [$lint_name])
  2488. if test "x$LINT" = "x"; then
  2489. AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
  2490. fi
  2491. elif test "x$use_lint" = x"no" ; then
  2492. if test "x$LINT" != "x"; then
  2493. AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
  2494. fi
  2495. else
  2496. AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
  2497. fi
  2498. # User supplied flags override default flags
  2499. if test "x$LINT_FLAGS" != "x"; then
  2500. lint_options=$LINT_FLAGS
  2501. fi
  2502. AC_SUBST([LINT_FLAGS],[$lint_options])
  2503. AM_CONDITIONAL(LINT, [test "x$LINT" != x])
  2504. ]) # XORG_WITH_LINT
  2505. # XORG_LINT_LIBRARY(LIBNAME)
  2506. # --------------------------
  2507. # Minimum version: 1.1.0
  2508. #
  2509. # Sets up flags for building lint libraries for checking programs that call
  2510. # functions in the library.
  2511. #
  2512. # Interface to module:
  2513. # LINTLIB - Automake variable with the name of lint library file to make
  2514. # MAKE_LINT_LIB - Automake conditional
  2515. #
  2516. # --enable-lint-library: - 'yes' user instructs the module to created a lint library
  2517. # - 'no' user instructs the module not to create a lint library (default)
  2518. AC_DEFUN([XORG_LINT_LIBRARY],[
  2519. AC_REQUIRE([XORG_WITH_LINT])
  2520. AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
  2521. [Create lint library (default: disabled)])],
  2522. [make_lint_lib=$enableval], [make_lint_lib=no])
  2523. if test "x$make_lint_lib" = x"yes" ; then
  2524. LINTLIB=llib-l$1.ln
  2525. if test "x$LINT" = "x"; then
  2526. AC_MSG_ERROR([Cannot make lint library without --with-lint])
  2527. fi
  2528. elif test "x$make_lint_lib" != x"no" ; then
  2529. AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
  2530. fi
  2531. AC_SUBST(LINTLIB)
  2532. AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
  2533. ]) # XORG_LINT_LIBRARY
  2534. # XORG_COMPILER_BRAND
  2535. # -------------------
  2536. # Minimum version: 1.14.0
  2537. #
  2538. # Checks for various brands of compilers and sets flags as appropriate:
  2539. # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
  2540. # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
  2541. # clang compiler - sets CLANGCC to "yes"
  2542. # Intel compiler - sets INTELCC to "yes"
  2543. # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
  2544. #
  2545. AC_DEFUN([XORG_COMPILER_BRAND], [
  2546. AC_LANG_CASE(
  2547. [C], [
  2548. AC_REQUIRE([AC_PROG_CC_C99])
  2549. ],
  2550. [C++], [
  2551. AC_REQUIRE([AC_PROG_CXX])
  2552. ]
  2553. )
  2554. AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
  2555. AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
  2556. AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
  2557. ]) # XORG_COMPILER_BRAND
  2558. # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
  2559. # ---------------
  2560. # Minimum version: 1.16.0
  2561. #
  2562. # Test if the compiler works when passed the given flag as a command line argument.
  2563. # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
  2564. # next flag in the list until there are no more options.
  2565. #
  2566. # Note that this does not guarantee that the compiler supports the flag as some
  2567. # compilers will simply ignore arguments that they do not understand, but we do
  2568. # attempt to weed out false positives by using -Werror=unknown-warning-option and
  2569. # -Werror=unused-command-line-argument
  2570. #
  2571. AC_DEFUN([XORG_TESTSET_CFLAG], [
  2572. m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  2573. m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  2574. AC_LANG_COMPILER_REQUIRE
  2575. AC_LANG_CASE(
  2576. [C], [
  2577. AC_REQUIRE([AC_PROG_CC_C99])
  2578. define([PREFIX], [C])
  2579. define([CACHE_PREFIX], [cc])
  2580. define([COMPILER], [$CC])
  2581. ],
  2582. [C++], [
  2583. define([PREFIX], [CXX])
  2584. define([CACHE_PREFIX], [cxx])
  2585. define([COMPILER], [$CXX])
  2586. ]
  2587. )
  2588. [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
  2589. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
  2590. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2591. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
  2592. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
  2593. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  2594. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
  2595. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
  2596. [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
  2597. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2598. fi
  2599. if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
  2600. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
  2601. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2602. fi
  2603. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  2604. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
  2605. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
  2606. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  2607. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
  2608. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
  2609. [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
  2610. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2611. fi
  2612. found="no"
  2613. m4_foreach([flag], m4_cdr($@), [
  2614. if test $found = "no" ; then
  2615. if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
  2616. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2617. fi
  2618. if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
  2619. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  2620. fi
  2621. PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
  2622. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
  2623. AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
  2624. cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
  2625. AC_CACHE_VAL($cacheid,
  2626. [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
  2627. [eval $cacheid=yes],
  2628. [eval $cacheid=no])])
  2629. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2630. eval supported=\$$cacheid
  2631. AC_MSG_RESULT([$supported])
  2632. if test "$supported" = "yes" ; then
  2633. $1="$$1 ]flag["
  2634. found="yes"
  2635. fi
  2636. fi
  2637. ])
  2638. ]) # XORG_TESTSET_CFLAG
  2639. # XORG_COMPILER_FLAGS
  2640. # ---------------
  2641. # Minimum version: 1.16.0
  2642. #
  2643. # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
  2644. # arguments supported by the selected compiler which do NOT alter the generated
  2645. # code. These arguments will cause the compiler to print various warnings
  2646. # during compilation AND turn a conservative set of warnings into errors.
  2647. #
  2648. # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
  2649. # future versions of util-macros as options are added to new compilers.
  2650. #
  2651. AC_DEFUN([XORG_COMPILER_FLAGS], [
  2652. AC_REQUIRE([XORG_COMPILER_BRAND])
  2653. AC_ARG_ENABLE(selective-werror,
  2654. AS_HELP_STRING([--disable-selective-werror],
  2655. [Turn off selective compiler errors. (default: enabled)]),
  2656. [SELECTIVE_WERROR=$enableval],
  2657. [SELECTIVE_WERROR=yes])
  2658. AC_LANG_CASE(
  2659. [C], [
  2660. define([PREFIX], [C])
  2661. ],
  2662. [C++], [
  2663. define([PREFIX], [CXX])
  2664. ]
  2665. )
  2666. # -v is too short to test reliably with XORG_TESTSET_CFLAG
  2667. if test "x$SUNCC" = "xyes"; then
  2668. [BASE_]PREFIX[FLAGS]="-v"
  2669. else
  2670. [BASE_]PREFIX[FLAGS]=""
  2671. fi
  2672. # This chunk of warnings were those that existed in the legacy CWARNFLAGS
  2673. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
  2674. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
  2675. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
  2676. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
  2677. AC_LANG_CASE(
  2678. [C], [
  2679. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
  2680. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
  2681. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
  2682. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
  2683. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
  2684. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
  2685. ]
  2686. )
  2687. # This chunk adds additional warnings that could catch undesired effects.
  2688. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
  2689. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
  2690. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
  2691. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
  2692. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
  2693. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
  2694. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
  2695. # These are currently disabled because they are noisy. They will be enabled
  2696. # in the future once the codebase is sufficiently modernized to silence
  2697. # them. For now, I don't want them to drown out the other warnings.
  2698. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
  2699. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
  2700. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
  2701. # Turn some warnings into errors, so we don't accidently get successful builds
  2702. # when there are problems that should be fixed.
  2703. if test "x$SELECTIVE_WERROR" = "xyes" ; then
  2704. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
  2705. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
  2706. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
  2707. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
  2708. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
  2709. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
  2710. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
  2711. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
  2712. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
  2713. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
  2714. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
  2715. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
  2716. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
  2717. else
  2718. AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
  2719. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
  2720. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
  2721. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
  2722. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
  2723. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
  2724. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
  2725. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
  2726. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
  2727. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
  2728. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
  2729. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
  2730. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
  2731. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
  2732. fi
  2733. AC_SUBST([BASE_]PREFIX[FLAGS])
  2734. ]) # XORG_COMPILER_FLAGS
  2735. # XORG_CWARNFLAGS
  2736. # ---------------
  2737. # Minimum version: 1.2.0
  2738. # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
  2739. #
  2740. # Defines CWARNFLAGS to enable C compiler warnings.
  2741. #
  2742. # This function is deprecated because it defines -fno-strict-aliasing
  2743. # which alters the code generated by the compiler. If -fno-strict-aliasing
  2744. # is needed, then it should be added explicitly in the module when
  2745. # it is updated to use BASE_CFLAGS.
  2746. #
  2747. AC_DEFUN([XORG_CWARNFLAGS], [
  2748. AC_REQUIRE([XORG_COMPILER_FLAGS])
  2749. AC_REQUIRE([XORG_COMPILER_BRAND])
  2750. AC_LANG_CASE(
  2751. [C], [
  2752. CWARNFLAGS="$BASE_CFLAGS"
  2753. if test "x$GCC" = xyes ; then
  2754. CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
  2755. fi
  2756. AC_SUBST(CWARNFLAGS)
  2757. ]
  2758. )
  2759. ]) # XORG_CWARNFLAGS
  2760. # XORG_STRICT_OPTION
  2761. # -----------------------
  2762. # Minimum version: 1.3.0
  2763. #
  2764. # Add configure option to enable strict compilation flags, such as treating
  2765. # warnings as fatal errors.
  2766. # If --enable-strict-compilation is passed to configure, adds strict flags to
  2767. # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
  2768. #
  2769. # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
  2770. # when strict compilation is unconditionally desired.
  2771. AC_DEFUN([XORG_STRICT_OPTION], [
  2772. AC_REQUIRE([XORG_CWARNFLAGS])
  2773. AC_REQUIRE([XORG_COMPILER_FLAGS])
  2774. AC_ARG_ENABLE(strict-compilation,
  2775. AS_HELP_STRING([--enable-strict-compilation],
  2776. [Enable all warnings from compiler and make them errors (default: disabled)]),
  2777. [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
  2778. AC_LANG_CASE(
  2779. [C], [
  2780. define([PREFIX], [C])
  2781. ],
  2782. [C++], [
  2783. define([PREFIX], [CXX])
  2784. ]
  2785. )
  2786. [STRICT_]PREFIX[FLAGS]=""
  2787. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
  2788. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
  2789. # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
  2790. # activate it with -Werror, so we add it here explicitly.
  2791. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
  2792. if test "x$STRICT_COMPILE" = "xyes"; then
  2793. [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
  2794. AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
  2795. fi
  2796. AC_SUBST([STRICT_]PREFIX[FLAGS])
  2797. AC_SUBST([BASE_]PREFIX[FLAGS])
  2798. AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
  2799. ]) # XORG_STRICT_OPTION
  2800. # XORG_DEFAULT_OPTIONS
  2801. # --------------------
  2802. # Minimum version: 1.3.0
  2803. #
  2804. # Defines default options for X.Org modules.
  2805. #
  2806. AC_DEFUN([XORG_DEFAULT_OPTIONS], [
  2807. AC_REQUIRE([AC_PROG_INSTALL])
  2808. XORG_COMPILER_FLAGS
  2809. XORG_CWARNFLAGS
  2810. XORG_STRICT_OPTION
  2811. XORG_RELEASE_VERSION
  2812. XORG_CHANGELOG
  2813. XORG_INSTALL
  2814. XORG_MANPAGE_SECTIONS
  2815. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  2816. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  2817. ]) # XORG_DEFAULT_OPTIONS
  2818. # XORG_INSTALL()
  2819. # ----------------
  2820. # Minimum version: 1.4.0
  2821. #
  2822. # Defines the variable INSTALL_CMD as the command to copy
  2823. # INSTALL from $prefix/share/util-macros.
  2824. #
  2825. AC_DEFUN([XORG_INSTALL], [
  2826. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2827. macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
  2828. INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
  2829. mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
  2830. || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
  2831. echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
  2832. AC_SUBST([INSTALL_CMD])
  2833. ]) # XORG_INSTALL
  2834. dnl Copyright 2005 Red Hat, Inc
  2835. dnl
  2836. dnl Permission to use, copy, modify, distribute, and sell this software and its
  2837. dnl documentation for any purpose is hereby granted without fee, provided that
  2838. dnl the above copyright notice appear in all copies and that both that
  2839. dnl copyright notice and this permission notice appear in supporting
  2840. dnl documentation.
  2841. dnl
  2842. dnl The above copyright notice and this permission notice shall be included
  2843. dnl in all copies or substantial portions of the Software.
  2844. dnl
  2845. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2846. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2847. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2848. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  2849. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  2850. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  2851. dnl OTHER DEALINGS IN THE SOFTWARE.
  2852. dnl
  2853. dnl Except as contained in this notice, the name of the copyright holders shall
  2854. dnl not be used in advertising or otherwise to promote the sale, use or
  2855. dnl other dealings in this Software without prior written authorization
  2856. dnl from the copyright holders.
  2857. dnl
  2858. # XORG_RELEASE_VERSION
  2859. # --------------------
  2860. # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
  2861. AC_DEFUN([XORG_RELEASE_VERSION],[
  2862. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
  2863. [`echo $PACKAGE_VERSION | cut -d . -f 1`],
  2864. [Major version of this package])
  2865. PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
  2866. if test "x$PVM" = "x"; then
  2867. PVM="0"
  2868. fi
  2869. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
  2870. [$PVM],
  2871. [Minor version of this package])
  2872. PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
  2873. if test "x$PVP" = "x"; then
  2874. PVP="0"
  2875. fi
  2876. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
  2877. [$PVP],
  2878. [Patch version of this package])
  2879. ])
  2880. # XORG_CHANGELOG()
  2881. # ----------------
  2882. # Minimum version: 1.2.0
  2883. #
  2884. # Defines the variable CHANGELOG_CMD as the command to generate
  2885. # ChangeLog from git.
  2886. #
  2887. #
  2888. AC_DEFUN([XORG_CHANGELOG], [
  2889. CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
  2890. mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
  2891. || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
  2892. echo 'git directory not found: installing possibly empty changelog.' >&2)"
  2893. AC_SUBST([CHANGELOG_CMD])
  2894. ]) # XORG_CHANGELOG
  2895. dnl Copyright 2005 Red Hat, Inc
  2896. dnl
  2897. dnl Permission to use, copy, modify, distribute, and sell this software and its
  2898. dnl documentation for any purpose is hereby granted without fee, provided that
  2899. dnl the above copyright notice appear in all copies and that both that
  2900. dnl copyright notice and this permission notice appear in supporting
  2901. dnl documentation.
  2902. dnl
  2903. dnl The above copyright notice and this permission notice shall be included
  2904. dnl in all copies or substantial portions of the Software.
  2905. dnl
  2906. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2907. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2908. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2909. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  2910. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  2911. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  2912. dnl OTHER DEALINGS IN THE SOFTWARE.
  2913. dnl
  2914. dnl Except as contained in this notice, the name of the copyright holders shall
  2915. dnl not be used in advertising or otherwise to promote the sale, use or
  2916. dnl other dealings in this Software without prior written authorization
  2917. dnl from the copyright holders.
  2918. dnl
  2919. # XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
  2920. # --------------------------
  2921. # Checks for the MACRO define in xorg-server.h (from the sdk). If it
  2922. # is defined, then add the given PROTO to $REQUIRED_MODULES.
  2923. AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
  2924. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2925. SAVE_CFLAGS="$CFLAGS"
  2926. CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
  2927. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  2928. #include "xorg-server.h"
  2929. #if !defined $1
  2930. #error $1 not defined
  2931. #endif
  2932. ]])],
  2933. [_EXT_CHECK=yes],
  2934. [_EXT_CHECK=no])
  2935. CFLAGS="$SAVE_CFLAGS"
  2936. AC_MSG_CHECKING([if $1 is defined])
  2937. AC_MSG_RESULT([$_EXT_CHECK])
  2938. if test "$_EXT_CHECK" != no; then
  2939. REQUIRED_MODULES="$REQUIRED_MODULES $2"
  2940. fi
  2941. ])