aclocal.m4 112 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100
  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. # Check to see how 'make' treats includes. -*- Autoconf -*-
  728. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  729. #
  730. # This file is free software; the Free Software Foundation
  731. # gives unlimited permission to copy and/or distribute it,
  732. # with or without modifications, as long as this notice is preserved.
  733. # AM_MAKE_INCLUDE()
  734. # -----------------
  735. # Check to see how make treats includes.
  736. AC_DEFUN([AM_MAKE_INCLUDE],
  737. [am_make=${MAKE-make}
  738. cat > confinc << 'END'
  739. am__doit:
  740. @echo this is the am__doit target
  741. .PHONY: am__doit
  742. END
  743. # If we don't find an include directive, just comment out the code.
  744. AC_MSG_CHECKING([for style of include used by $am_make])
  745. am__include="#"
  746. am__quote=
  747. _am_result=none
  748. # First try GNU make style include.
  749. echo "include confinc" > confmf
  750. # Ignore all kinds of additional output from 'make'.
  751. case `$am_make -s -f confmf 2> /dev/null` in #(
  752. *the\ am__doit\ target*)
  753. am__include=include
  754. am__quote=
  755. _am_result=GNU
  756. ;;
  757. esac
  758. # Now try BSD make style include.
  759. if test "$am__include" = "#"; then
  760. echo '.include "confinc"' > confmf
  761. case `$am_make -s -f confmf 2> /dev/null` in #(
  762. *the\ am__doit\ target*)
  763. am__include=.include
  764. am__quote="\""
  765. _am_result=BSD
  766. ;;
  767. esac
  768. fi
  769. AC_SUBST([am__include])
  770. AC_SUBST([am__quote])
  771. AC_MSG_RESULT([$_am_result])
  772. rm -f confinc confmf
  773. ])
  774. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  775. # Copyright (C) 1997-2012 Free Software Foundation, Inc.
  776. #
  777. # This file is free software; the Free Software Foundation
  778. # gives unlimited permission to copy and/or distribute it,
  779. # with or without modifications, as long as this notice is preserved.
  780. # AM_MISSING_PROG(NAME, PROGRAM)
  781. # ------------------------------
  782. AC_DEFUN([AM_MISSING_PROG],
  783. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  784. $1=${$1-"${am_missing_run}$2"}
  785. AC_SUBST($1)])
  786. # AM_MISSING_HAS_RUN
  787. # ------------------
  788. # Define MISSING if not defined so far and test if it supports --run.
  789. # If it does, set am_missing_run to use it, otherwise, to nothing.
  790. AC_DEFUN([AM_MISSING_HAS_RUN],
  791. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  792. AC_REQUIRE_AUX_FILE([missing])dnl
  793. if test x"${MISSING+set}" != xset; then
  794. case $am_aux_dir in
  795. *\ * | *\ *)
  796. MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  797. *)
  798. MISSING="\${SHELL} $am_aux_dir/missing" ;;
  799. esac
  800. fi
  801. # Use eval to expand $SHELL
  802. if eval "$MISSING --run true"; then
  803. am_missing_run="$MISSING --run "
  804. else
  805. am_missing_run=
  806. AC_MSG_WARN(['missing' script is too old or missing])
  807. fi
  808. ])
  809. # Helper functions for option handling. -*- Autoconf -*-
  810. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  811. #
  812. # This file is free software; the Free Software Foundation
  813. # gives unlimited permission to copy and/or distribute it,
  814. # with or without modifications, as long as this notice is preserved.
  815. # _AM_MANGLE_OPTION(NAME)
  816. # -----------------------
  817. AC_DEFUN([_AM_MANGLE_OPTION],
  818. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  819. # _AM_SET_OPTION(NAME)
  820. # --------------------
  821. # Set option NAME. Presently that only means defining a flag for this option.
  822. AC_DEFUN([_AM_SET_OPTION],
  823. [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
  824. # _AM_SET_OPTIONS(OPTIONS)
  825. # ------------------------
  826. # OPTIONS is a space-separated list of Automake options.
  827. AC_DEFUN([_AM_SET_OPTIONS],
  828. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  829. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  830. # -------------------------------------------
  831. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  832. AC_DEFUN([_AM_IF_OPTION],
  833. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  834. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  835. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  836. #
  837. # This file is free software; the Free Software Foundation
  838. # gives unlimited permission to copy and/or distribute it,
  839. # with or without modifications, as long as this notice is preserved.
  840. # AM_SANITY_CHECK
  841. # ---------------
  842. AC_DEFUN([AM_SANITY_CHECK],
  843. [AC_MSG_CHECKING([whether build environment is sane])
  844. # Reject unsafe characters in $srcdir or the absolute working directory
  845. # name. Accept space and tab only in the latter.
  846. am_lf='
  847. '
  848. case `pwd` in
  849. *[[\\\"\#\$\&\'\`$am_lf]]*)
  850. AC_MSG_ERROR([unsafe absolute working directory name]);;
  851. esac
  852. case $srcdir in
  853. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  854. AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
  855. esac
  856. # Do 'set' in a subshell so we don't clobber the current shell's
  857. # arguments. Must try -L first in case configure is actually a
  858. # symlink; some systems play weird games with the mod time of symlinks
  859. # (eg FreeBSD returns the mod time of the symlink's containing
  860. # directory).
  861. if (
  862. am_has_slept=no
  863. for am_try in 1 2; do
  864. echo "timestamp, slept: $am_has_slept" > conftest.file
  865. set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
  866. if test "$[*]" = "X"; then
  867. # -L didn't work.
  868. set X `ls -t "$srcdir/configure" conftest.file`
  869. fi
  870. if test "$[*]" != "X $srcdir/configure conftest.file" \
  871. && test "$[*]" != "X conftest.file $srcdir/configure"; then
  872. # If neither matched, then we have a broken ls. This can happen
  873. # if, for instance, CONFIG_SHELL is bash and it inherits a
  874. # broken ls alias from the environment. This has actually
  875. # happened. Such a system could not be considered "sane".
  876. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  877. alias in your environment])
  878. fi
  879. if test "$[2]" = conftest.file || test $am_try -eq 2; then
  880. break
  881. fi
  882. # Just in case.
  883. sleep 1
  884. am_has_slept=yes
  885. done
  886. test "$[2]" = conftest.file
  887. )
  888. then
  889. # Ok.
  890. :
  891. else
  892. AC_MSG_ERROR([newly created file is older than distributed files!
  893. Check your system clock])
  894. fi
  895. AC_MSG_RESULT([yes])
  896. # If we didn't sleep, we still need to ensure time stamps of config.status and
  897. # generated files are strictly newer.
  898. am_sleep_pid=
  899. if grep 'slept: no' conftest.file >/dev/null 2>&1; then
  900. ( sleep 1 ) &
  901. am_sleep_pid=$!
  902. fi
  903. AC_CONFIG_COMMANDS_PRE(
  904. [AC_MSG_CHECKING([that generated files are newer than configure])
  905. if test -n "$am_sleep_pid"; then
  906. # Hide warnings about reused PIDs.
  907. wait $am_sleep_pid 2>/dev/null
  908. fi
  909. AC_MSG_RESULT([done])])
  910. rm -f conftest.file
  911. ])
  912. # Copyright (C) 2009-2012 Free Software Foundation, Inc.
  913. #
  914. # This file is free software; the Free Software Foundation
  915. # gives unlimited permission to copy and/or distribute it,
  916. # with or without modifications, as long as this notice is preserved.
  917. # AM_SILENT_RULES([DEFAULT])
  918. # --------------------------
  919. # Enable less verbose build rules; with the default set to DEFAULT
  920. # ("yes" being less verbose, "no" or empty being verbose).
  921. AC_DEFUN([AM_SILENT_RULES],
  922. [AC_ARG_ENABLE([silent-rules], [dnl
  923. AS_HELP_STRING(
  924. [--enable-silent-rules],
  925. [less verbose build output (undo: "make V=1")])
  926. AS_HELP_STRING(
  927. [--disable-silent-rules],
  928. [verbose build output (undo: "make V=0")])dnl
  929. ])
  930. case $enable_silent_rules in @%:@ (((
  931. yes) AM_DEFAULT_VERBOSITY=0;;
  932. no) AM_DEFAULT_VERBOSITY=1;;
  933. *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
  934. esac
  935. dnl
  936. dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
  937. dnl do not support nested variable expansions.
  938. dnl See automake bug#9928 and bug#10237.
  939. am_make=${MAKE-make}
  940. AC_CACHE_CHECK([whether $am_make supports nested variables],
  941. [am_cv_make_support_nested_variables],
  942. [if AS_ECHO([['TRUE=$(BAR$(V))
  943. BAR0=false
  944. BAR1=true
  945. V=1
  946. am__doit:
  947. @$(TRUE)
  948. .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
  949. am_cv_make_support_nested_variables=yes
  950. else
  951. am_cv_make_support_nested_variables=no
  952. fi])
  953. if test $am_cv_make_support_nested_variables = yes; then
  954. dnl Using '$V' instead of '$(V)' breaks IRIX make.
  955. AM_V='$(V)'
  956. AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
  957. else
  958. AM_V=$AM_DEFAULT_VERBOSITY
  959. AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
  960. fi
  961. AC_SUBST([AM_V])dnl
  962. AM_SUBST_NOTMAKE([AM_V])dnl
  963. AC_SUBST([AM_DEFAULT_V])dnl
  964. AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
  965. AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
  966. AM_BACKSLASH='\'
  967. AC_SUBST([AM_BACKSLASH])dnl
  968. _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
  969. ])
  970. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  971. #
  972. # This file is free software; the Free Software Foundation
  973. # gives unlimited permission to copy and/or distribute it,
  974. # with or without modifications, as long as this notice is preserved.
  975. # AM_PROG_INSTALL_STRIP
  976. # ---------------------
  977. # One issue with vendor 'install' (even GNU) is that you can't
  978. # specify the program used to strip binaries. This is especially
  979. # annoying in cross-compiling environments, where the build's strip
  980. # is unlikely to handle the host's binaries.
  981. # Fortunately install-sh will honor a STRIPPROG variable, so we
  982. # always use install-sh in "make install-strip", and initialize
  983. # STRIPPROG with the value of the STRIP variable (set by the user).
  984. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  985. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  986. # Installed binaries are usually stripped using 'strip' when the user
  987. # run "make install-strip". However 'strip' might not be the right
  988. # tool to use in cross-compilation environments, therefore Automake
  989. # will honor the 'STRIP' environment variable to overrule this program.
  990. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
  991. if test "$cross_compiling" != no; then
  992. AC_CHECK_TOOL([STRIP], [strip], :)
  993. fi
  994. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  995. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  996. # Copyright (C) 2006-2012 Free Software Foundation, Inc.
  997. #
  998. # This file is free software; the Free Software Foundation
  999. # gives unlimited permission to copy and/or distribute it,
  1000. # with or without modifications, as long as this notice is preserved.
  1001. # _AM_SUBST_NOTMAKE(VARIABLE)
  1002. # ---------------------------
  1003. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  1004. # This macro is traced by Automake.
  1005. AC_DEFUN([_AM_SUBST_NOTMAKE])
  1006. # AM_SUBST_NOTMAKE(VARIABLE)
  1007. # --------------------------
  1008. # Public sister of _AM_SUBST_NOTMAKE.
  1009. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  1010. # Check how to create a tarball. -*- Autoconf -*-
  1011. # Copyright (C) 2004-2012 Free Software Foundation, Inc.
  1012. #
  1013. # This file is free software; the Free Software Foundation
  1014. # gives unlimited permission to copy and/or distribute it,
  1015. # with or without modifications, as long as this notice is preserved.
  1016. # _AM_PROG_TAR(FORMAT)
  1017. # --------------------
  1018. # Check how to create a tarball in format FORMAT.
  1019. # FORMAT should be one of 'v7', 'ustar', or 'pax'.
  1020. #
  1021. # Substitute a variable $(am__tar) that is a command
  1022. # writing to stdout a FORMAT-tarball containing the directory
  1023. # $tardir.
  1024. # tardir=directory && $(am__tar) > result.tar
  1025. #
  1026. # Substitute a variable $(am__untar) that extract such
  1027. # a tarball read from stdin.
  1028. # $(am__untar) < result.tar
  1029. AC_DEFUN([_AM_PROG_TAR],
  1030. [# Always define AMTAR for backward compatibility. Yes, it's still used
  1031. # in the wild :-( We should find a proper way to deprecate it ...
  1032. AC_SUBST([AMTAR], ['$${TAR-tar}'])
  1033. m4_if([$1], [v7],
  1034. [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
  1035. [m4_case([$1], [ustar],, [pax],,
  1036. [m4_fatal([Unknown tar format])])
  1037. AC_MSG_CHECKING([how to create a $1 tar archive])
  1038. # Loop over all known methods to create a tar archive until one works.
  1039. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  1040. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  1041. # Do not fold the above two line into one, because Tru64 sh and
  1042. # Solaris sh will not grok spaces in the rhs of '-'.
  1043. for _am_tool in $_am_tools
  1044. do
  1045. case $_am_tool in
  1046. gnutar)
  1047. for _am_tar in tar gnutar gtar;
  1048. do
  1049. AM_RUN_LOG([$_am_tar --version]) && break
  1050. done
  1051. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  1052. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  1053. am__untar="$_am_tar -xf -"
  1054. ;;
  1055. plaintar)
  1056. # Must skip GNU tar: if it does not support --format= it doesn't create
  1057. # ustar tarball either.
  1058. (tar --version) >/dev/null 2>&1 && continue
  1059. am__tar='tar chf - "$$tardir"'
  1060. am__tar_='tar chf - "$tardir"'
  1061. am__untar='tar xf -'
  1062. ;;
  1063. pax)
  1064. am__tar='pax -L -x $1 -w "$$tardir"'
  1065. am__tar_='pax -L -x $1 -w "$tardir"'
  1066. am__untar='pax -r'
  1067. ;;
  1068. cpio)
  1069. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  1070. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  1071. am__untar='cpio -i -H $1 -d'
  1072. ;;
  1073. none)
  1074. am__tar=false
  1075. am__tar_=false
  1076. am__untar=false
  1077. ;;
  1078. esac
  1079. # If the value was cached, stop now. We just wanted to have am__tar
  1080. # and am__untar set.
  1081. test -n "${am_cv_prog_tar_$1}" && break
  1082. # tar/untar a dummy directory, and stop if the command works
  1083. rm -rf conftest.dir
  1084. mkdir conftest.dir
  1085. echo GrepMe > conftest.dir/file
  1086. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  1087. rm -rf conftest.dir
  1088. if test -s conftest.tar; then
  1089. AM_RUN_LOG([$am__untar <conftest.tar])
  1090. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  1091. fi
  1092. done
  1093. rm -rf conftest.dir
  1094. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  1095. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  1096. AC_SUBST([am__tar])
  1097. AC_SUBST([am__untar])
  1098. ]) # _AM_PROG_TAR
  1099. dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
  1100. dnl
  1101. dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
  1102. dnl
  1103. dnl Permission is hereby granted, free of charge, to any person obtaining a
  1104. dnl copy of this software and associated documentation files (the "Software"),
  1105. dnl to deal in the Software without restriction, including without limitation
  1106. dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
  1107. dnl and/or sell copies of the Software, and to permit persons to whom the
  1108. dnl Software is furnished to do so, subject to the following conditions:
  1109. dnl
  1110. dnl The above copyright notice and this permission notice (including the next
  1111. dnl paragraph) shall be included in all copies or substantial portions of the
  1112. dnl Software.
  1113. dnl
  1114. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1115. dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1116. dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  1117. dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1118. dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  1119. dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  1120. dnl DEALINGS IN THE SOFTWARE.
  1121. # XORG_MACROS_VERSION(required-version)
  1122. # -------------------------------------
  1123. # Minimum version: 1.1.0
  1124. #
  1125. # If you're using a macro added in Version 1.1 or newer, include this in
  1126. # your configure.ac with the minimum required version, such as:
  1127. # XORG_MACROS_VERSION(1.1)
  1128. #
  1129. # To ensure that this macro is defined, also add:
  1130. # m4_ifndef([XORG_MACROS_VERSION],
  1131. # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
  1132. #
  1133. #
  1134. # See the "minimum version" comment for each macro you use to see what
  1135. # version you require.
  1136. m4_defun([XORG_MACROS_VERSION],[
  1137. m4_define([vers_have], [1.19.0])
  1138. m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
  1139. m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
  1140. m4_if(m4_cmp(maj_have, maj_needed), 0,,
  1141. [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
  1142. m4_if(m4_version_compare(vers_have, [$1]), -1,
  1143. [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
  1144. m4_undefine([vers_have])
  1145. m4_undefine([maj_have])
  1146. m4_undefine([maj_needed])
  1147. ]) # XORG_MACROS_VERSION
  1148. # XORG_PROG_RAWCPP()
  1149. # ------------------
  1150. # Minimum version: 1.0.0
  1151. #
  1152. # Find cpp program and necessary flags for use in pre-processing text files
  1153. # such as man pages and config files
  1154. AC_DEFUN([XORG_PROG_RAWCPP],[
  1155. AC_REQUIRE([AC_PROG_CPP])
  1156. AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
  1157. [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
  1158. # Check for flag to avoid builtin definitions - assumes unix is predefined,
  1159. # which is not the best choice for supporting other OS'es, but covers most
  1160. # of the ones we need for now.
  1161. AC_MSG_CHECKING([if $RAWCPP requires -undef])
  1162. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
  1163. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1164. AC_MSG_RESULT([no])
  1165. else
  1166. if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1167. RAWCPPFLAGS=-undef
  1168. AC_MSG_RESULT([yes])
  1169. # under Cygwin unix is still defined even with -undef
  1170. elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1171. RAWCPPFLAGS="-undef -ansi"
  1172. AC_MSG_RESULT([yes, with -ansi])
  1173. else
  1174. AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
  1175. fi
  1176. fi
  1177. rm -f conftest.$ac_ext
  1178. AC_MSG_CHECKING([if $RAWCPP requires -traditional])
  1179. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
  1180. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  1181. AC_MSG_RESULT([no])
  1182. else
  1183. if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  1184. TRADITIONALCPPFLAGS="-traditional"
  1185. RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
  1186. AC_MSG_RESULT([yes])
  1187. else
  1188. AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
  1189. fi
  1190. fi
  1191. rm -f conftest.$ac_ext
  1192. AC_SUBST(RAWCPPFLAGS)
  1193. AC_SUBST(TRADITIONALCPPFLAGS)
  1194. ]) # XORG_PROG_RAWCPP
  1195. # XORG_MANPAGE_SECTIONS()
  1196. # -----------------------
  1197. # Minimum version: 1.0.0
  1198. #
  1199. # Determine which sections man pages go in for the different man page types
  1200. # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
  1201. # Not sure if there's any better way than just hardcoding by OS name.
  1202. # Override default settings by setting environment variables
  1203. # Added MAN_SUBSTS in version 1.8
  1204. # Added AC_PROG_SED in version 1.8
  1205. AC_DEFUN([XORG_MANPAGE_SECTIONS],[
  1206. AC_REQUIRE([AC_CANONICAL_HOST])
  1207. AC_REQUIRE([AC_PROG_SED])
  1208. if test x$APP_MAN_SUFFIX = x ; then
  1209. APP_MAN_SUFFIX=1
  1210. fi
  1211. if test x$APP_MAN_DIR = x ; then
  1212. APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
  1213. fi
  1214. if test x$LIB_MAN_SUFFIX = x ; then
  1215. LIB_MAN_SUFFIX=3
  1216. fi
  1217. if test x$LIB_MAN_DIR = x ; then
  1218. LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
  1219. fi
  1220. if test x$FILE_MAN_SUFFIX = x ; then
  1221. case $host_os in
  1222. solaris*) FILE_MAN_SUFFIX=4 ;;
  1223. *) FILE_MAN_SUFFIX=5 ;;
  1224. esac
  1225. fi
  1226. if test x$FILE_MAN_DIR = x ; then
  1227. FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
  1228. fi
  1229. if test x$MISC_MAN_SUFFIX = x ; then
  1230. case $host_os in
  1231. solaris*) MISC_MAN_SUFFIX=5 ;;
  1232. *) MISC_MAN_SUFFIX=7 ;;
  1233. esac
  1234. fi
  1235. if test x$MISC_MAN_DIR = x ; then
  1236. MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
  1237. fi
  1238. if test x$DRIVER_MAN_SUFFIX = x ; then
  1239. case $host_os in
  1240. solaris*) DRIVER_MAN_SUFFIX=7 ;;
  1241. *) DRIVER_MAN_SUFFIX=4 ;;
  1242. esac
  1243. fi
  1244. if test x$DRIVER_MAN_DIR = x ; then
  1245. DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
  1246. fi
  1247. if test x$ADMIN_MAN_SUFFIX = x ; then
  1248. case $host_os in
  1249. solaris*) ADMIN_MAN_SUFFIX=1m ;;
  1250. *) ADMIN_MAN_SUFFIX=8 ;;
  1251. esac
  1252. fi
  1253. if test x$ADMIN_MAN_DIR = x ; then
  1254. ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
  1255. fi
  1256. AC_SUBST([APP_MAN_SUFFIX])
  1257. AC_SUBST([LIB_MAN_SUFFIX])
  1258. AC_SUBST([FILE_MAN_SUFFIX])
  1259. AC_SUBST([MISC_MAN_SUFFIX])
  1260. AC_SUBST([DRIVER_MAN_SUFFIX])
  1261. AC_SUBST([ADMIN_MAN_SUFFIX])
  1262. AC_SUBST([APP_MAN_DIR])
  1263. AC_SUBST([LIB_MAN_DIR])
  1264. AC_SUBST([FILE_MAN_DIR])
  1265. AC_SUBST([MISC_MAN_DIR])
  1266. AC_SUBST([DRIVER_MAN_DIR])
  1267. AC_SUBST([ADMIN_MAN_DIR])
  1268. XORG_MAN_PAGE="X Version 11"
  1269. AC_SUBST([XORG_MAN_PAGE])
  1270. MAN_SUBSTS="\
  1271. -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1272. -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1273. -e 's|__xservername__|Xorg|g' \
  1274. -e 's|__xconfigfile__|xorg.conf|g' \
  1275. -e 's|__projectroot__|\$(prefix)|g' \
  1276. -e 's|__apploaddir__|\$(appdefaultdir)|g' \
  1277. -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
  1278. -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
  1279. -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
  1280. -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
  1281. -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
  1282. -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
  1283. AC_SUBST([MAN_SUBSTS])
  1284. ]) # XORG_MANPAGE_SECTIONS
  1285. # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
  1286. # ------------------------
  1287. # Minimum version: 1.7.0
  1288. #
  1289. # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
  1290. # provided by xorg-sgml-doctools, if installed.
  1291. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
  1292. AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
  1293. XORG_SGML_PATH=
  1294. PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
  1295. [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
  1296. [m4_ifval([$1],[:],
  1297. [if test x"$cross_compiling" != x"yes" ; then
  1298. AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
  1299. [XORG_SGML_PATH=$prefix/share/sgml])
  1300. fi])
  1301. ])
  1302. # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
  1303. # the path and the name of the doc stylesheet
  1304. if test "x$XORG_SGML_PATH" != "x" ; then
  1305. AC_MSG_RESULT([$XORG_SGML_PATH])
  1306. STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
  1307. XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
  1308. else
  1309. AC_MSG_RESULT([no])
  1310. fi
  1311. AC_SUBST(XORG_SGML_PATH)
  1312. AC_SUBST(STYLESHEET_SRCDIR)
  1313. AC_SUBST(XSL_STYLESHEET)
  1314. AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
  1315. ]) # XORG_CHECK_SGML_DOCTOOLS
  1316. # XORG_CHECK_LINUXDOC
  1317. # -------------------
  1318. # Minimum version: 1.0.0
  1319. #
  1320. # Defines the variable MAKE_TEXT if the necessary tools and
  1321. # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
  1322. # Whether or not the necessary tools and files are found can be checked
  1323. # with the AM_CONDITIONAL "BUILD_LINUXDOC"
  1324. AC_DEFUN([XORG_CHECK_LINUXDOC],[
  1325. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1326. AC_REQUIRE([XORG_WITH_PS2PDF])
  1327. AC_PATH_PROG(LINUXDOC, linuxdoc)
  1328. AC_MSG_CHECKING([whether to build documentation])
  1329. if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
  1330. BUILDDOC=yes
  1331. else
  1332. BUILDDOC=no
  1333. fi
  1334. AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
  1335. AC_MSG_RESULT([$BUILDDOC])
  1336. AC_MSG_CHECKING([whether to build pdf documentation])
  1337. if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
  1338. BUILDPDFDOC=yes
  1339. else
  1340. BUILDPDFDOC=no
  1341. fi
  1342. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1343. AC_MSG_RESULT([$BUILDPDFDOC])
  1344. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
  1345. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
  1346. MAKE_PDF="$PS2PDF"
  1347. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
  1348. AC_SUBST(MAKE_TEXT)
  1349. AC_SUBST(MAKE_PS)
  1350. AC_SUBST(MAKE_PDF)
  1351. AC_SUBST(MAKE_HTML)
  1352. ]) # XORG_CHECK_LINUXDOC
  1353. # XORG_CHECK_DOCBOOK
  1354. # -------------------
  1355. # Minimum version: 1.0.0
  1356. #
  1357. # Checks for the ability to build output formats from SGML DocBook source.
  1358. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
  1359. # indicates whether the necessary tools and files are found and, if set,
  1360. # $(MAKE_XXX) blah.sgml will produce blah.xxx.
  1361. AC_DEFUN([XORG_CHECK_DOCBOOK],[
  1362. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1363. BUILDTXTDOC=no
  1364. BUILDPDFDOC=no
  1365. BUILDPSDOC=no
  1366. BUILDHTMLDOC=no
  1367. AC_PATH_PROG(DOCBOOKPS, docbook2ps)
  1368. AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
  1369. AC_PATH_PROG(DOCBOOKHTML, docbook2html)
  1370. AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
  1371. AC_MSG_CHECKING([whether to build text documentation])
  1372. if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
  1373. test x$BUILD_TXTDOC != xno; then
  1374. BUILDTXTDOC=yes
  1375. fi
  1376. AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
  1377. AC_MSG_RESULT([$BUILDTXTDOC])
  1378. AC_MSG_CHECKING([whether to build PDF documentation])
  1379. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
  1380. test x$BUILD_PDFDOC != xno; then
  1381. BUILDPDFDOC=yes
  1382. fi
  1383. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1384. AC_MSG_RESULT([$BUILDPDFDOC])
  1385. AC_MSG_CHECKING([whether to build PostScript documentation])
  1386. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
  1387. test x$BUILD_PSDOC != xno; then
  1388. BUILDPSDOC=yes
  1389. fi
  1390. AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
  1391. AC_MSG_RESULT([$BUILDPSDOC])
  1392. AC_MSG_CHECKING([whether to build HTML documentation])
  1393. if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
  1394. test x$BUILD_HTMLDOC != xno; then
  1395. BUILDHTMLDOC=yes
  1396. fi
  1397. AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
  1398. AC_MSG_RESULT([$BUILDHTMLDOC])
  1399. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
  1400. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
  1401. MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
  1402. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
  1403. AC_SUBST(MAKE_TEXT)
  1404. AC_SUBST(MAKE_PS)
  1405. AC_SUBST(MAKE_PDF)
  1406. AC_SUBST(MAKE_HTML)
  1407. ]) # XORG_CHECK_DOCBOOK
  1408. # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
  1409. # ----------------
  1410. # Minimum version: 1.5.0
  1411. # Minimum version for optional DEFAULT argument: 1.11.0
  1412. #
  1413. # Documentation tools are not always available on all platforms and sometimes
  1414. # not at the appropriate level. This macro enables a module to test for the
  1415. # presence of the tool and obtain it's path in separate variables. Coupled with
  1416. # the --with-xmlto option, it allows maximum flexibilty in making decisions
  1417. # as whether or not to use the xmlto package. When DEFAULT is not specified,
  1418. # --with-xmlto assumes 'auto'.
  1419. #
  1420. # Interface to module:
  1421. # HAVE_XMLTO: used in makefiles to conditionally generate documentation
  1422. # XMLTO: returns the path of the xmlto program found
  1423. # returns the path set by the user in the environment
  1424. # --with-xmlto: 'yes' user instructs the module to use xmlto
  1425. # 'no' user instructs the module not to use xmlto
  1426. #
  1427. # Added in version 1.10.0
  1428. # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
  1429. # xmlto for text output requires either lynx, links, or w3m browsers
  1430. #
  1431. # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
  1432. #
  1433. AC_DEFUN([XORG_WITH_XMLTO],[
  1434. AC_ARG_VAR([XMLTO], [Path to xmlto command])
  1435. m4_define([_defopt], m4_default([$2], [auto]))
  1436. AC_ARG_WITH(xmlto,
  1437. AS_HELP_STRING([--with-xmlto],
  1438. [Use xmlto to regenerate documentation (default: ]_defopt[)]),
  1439. [use_xmlto=$withval], [use_xmlto=]_defopt)
  1440. m4_undefine([_defopt])
  1441. if test "x$use_xmlto" = x"auto"; then
  1442. AC_PATH_PROG([XMLTO], [xmlto])
  1443. if test "x$XMLTO" = "x"; then
  1444. AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
  1445. have_xmlto=no
  1446. else
  1447. have_xmlto=yes
  1448. fi
  1449. elif test "x$use_xmlto" = x"yes" ; then
  1450. AC_PATH_PROG([XMLTO], [xmlto])
  1451. if test "x$XMLTO" = "x"; then
  1452. AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
  1453. fi
  1454. have_xmlto=yes
  1455. elif test "x$use_xmlto" = x"no" ; then
  1456. if test "x$XMLTO" != "x"; then
  1457. AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
  1458. fi
  1459. have_xmlto=no
  1460. else
  1461. AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
  1462. fi
  1463. # Test for a minimum version of xmlto, if provided.
  1464. m4_ifval([$1],
  1465. [if test "$have_xmlto" = yes; then
  1466. # scrape the xmlto version
  1467. AC_MSG_CHECKING([the xmlto version])
  1468. xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
  1469. AC_MSG_RESULT([$xmlto_version])
  1470. AS_VERSION_COMPARE([$xmlto_version], [$1],
  1471. [if test "x$use_xmlto" = xauto; then
  1472. AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
  1473. have_xmlto=no
  1474. else
  1475. AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
  1476. fi])
  1477. fi])
  1478. # Test for the ability of xmlto to generate a text target
  1479. have_xmlto_text=no
  1480. cat > conftest.xml << "EOF"
  1481. EOF
  1482. AS_IF([test "$have_xmlto" = yes],
  1483. [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
  1484. [have_xmlto_text=yes],
  1485. [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
  1486. rm -f conftest.xml
  1487. AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
  1488. AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
  1489. ]) # XORG_WITH_XMLTO
  1490. # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
  1491. # --------------------------------------------
  1492. # Minimum version: 1.12.0
  1493. # Minimum version for optional DEFAULT argument: 1.12.0
  1494. #
  1495. # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
  1496. # XML-based language used for the transformation of XML documents.
  1497. # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
  1498. # It is used under the cover by xmlto to generate html files from DocBook/XML.
  1499. # The XSLT processor is often used as a standalone tool for transformations.
  1500. # It should not be assumed that this tool is used only to work with documnetation.
  1501. # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
  1502. #
  1503. # Interface to module:
  1504. # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
  1505. # XSLTPROC: returns the path of the xsltproc program found
  1506. # returns the path set by the user in the environment
  1507. # --with-xsltproc: 'yes' user instructs the module to use xsltproc
  1508. # 'no' user instructs the module not to use xsltproc
  1509. # have_xsltproc: returns yes if xsltproc found in PATH or no
  1510. #
  1511. # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
  1512. #
  1513. AC_DEFUN([XORG_WITH_XSLTPROC],[
  1514. AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
  1515. # Preserves the interface, should it be implemented later
  1516. m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
  1517. m4_define([_defopt], m4_default([$2], [auto]))
  1518. AC_ARG_WITH(xsltproc,
  1519. AS_HELP_STRING([--with-xsltproc],
  1520. [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
  1521. [use_xsltproc=$withval], [use_xsltproc=]_defopt)
  1522. m4_undefine([_defopt])
  1523. if test "x$use_xsltproc" = x"auto"; then
  1524. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1525. if test "x$XSLTPROC" = "x"; then
  1526. AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
  1527. have_xsltproc=no
  1528. else
  1529. have_xsltproc=yes
  1530. fi
  1531. elif test "x$use_xsltproc" = x"yes" ; then
  1532. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1533. if test "x$XSLTPROC" = "x"; then
  1534. AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
  1535. fi
  1536. have_xsltproc=yes
  1537. elif test "x$use_xsltproc" = x"no" ; then
  1538. if test "x$XSLTPROC" != "x"; then
  1539. AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
  1540. fi
  1541. have_xsltproc=no
  1542. else
  1543. AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
  1544. fi
  1545. AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
  1546. ]) # XORG_WITH_XSLTPROC
  1547. # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
  1548. # ----------------------------------------
  1549. # Minimum version: 1.15.0
  1550. #
  1551. # PERL (Practical Extraction and Report Language) is a language optimized for
  1552. # scanning arbitrary text files, extracting information from those text files,
  1553. # and printing reports based on that information.
  1554. #
  1555. # When DEFAULT is not specified, --with-perl assumes 'auto'.
  1556. #
  1557. # Interface to module:
  1558. # HAVE_PERL: used in makefiles to conditionally scan text files
  1559. # PERL: returns the path of the perl program found
  1560. # returns the path set by the user in the environment
  1561. # --with-perl: 'yes' user instructs the module to use perl
  1562. # 'no' user instructs the module not to use perl
  1563. # have_perl: returns yes if perl found in PATH or no
  1564. #
  1565. # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
  1566. #
  1567. AC_DEFUN([XORG_WITH_PERL],[
  1568. AC_ARG_VAR([PERL], [Path to perl command])
  1569. # Preserves the interface, should it be implemented later
  1570. m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
  1571. m4_define([_defopt], m4_default([$2], [auto]))
  1572. AC_ARG_WITH(perl,
  1573. AS_HELP_STRING([--with-perl],
  1574. [Use perl for extracting information from files (default: ]_defopt[)]),
  1575. [use_perl=$withval], [use_perl=]_defopt)
  1576. m4_undefine([_defopt])
  1577. if test "x$use_perl" = x"auto"; then
  1578. AC_PATH_PROG([PERL], [perl])
  1579. if test "x$PERL" = "x"; then
  1580. AC_MSG_WARN([perl not found - cannot extract information and report])
  1581. have_perl=no
  1582. else
  1583. have_perl=yes
  1584. fi
  1585. elif test "x$use_perl" = x"yes" ; then
  1586. AC_PATH_PROG([PERL], [perl])
  1587. if test "x$PERL" = "x"; then
  1588. AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
  1589. fi
  1590. have_perl=yes
  1591. elif test "x$use_perl" = x"no" ; then
  1592. if test "x$PERL" != "x"; then
  1593. AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
  1594. fi
  1595. have_perl=no
  1596. else
  1597. AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
  1598. fi
  1599. AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
  1600. ]) # XORG_WITH_PERL
  1601. # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
  1602. # ----------------
  1603. # Minimum version: 1.5.0
  1604. # Minimum version for optional DEFAULT argument: 1.11.0
  1605. #
  1606. # Documentation tools are not always available on all platforms and sometimes
  1607. # not at the appropriate level. This macro enables a module to test for the
  1608. # presence of the tool and obtain it's path in separate variables. Coupled with
  1609. # the --with-asciidoc option, it allows maximum flexibilty in making decisions
  1610. # as whether or not to use the asciidoc package. When DEFAULT is not specified,
  1611. # --with-asciidoc assumes 'auto'.
  1612. #
  1613. # Interface to module:
  1614. # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
  1615. # ASCIIDOC: returns the path of the asciidoc program found
  1616. # returns the path set by the user in the environment
  1617. # --with-asciidoc: 'yes' user instructs the module to use asciidoc
  1618. # 'no' user instructs the module not to use asciidoc
  1619. #
  1620. # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
  1621. #
  1622. AC_DEFUN([XORG_WITH_ASCIIDOC],[
  1623. AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
  1624. m4_define([_defopt], m4_default([$2], [auto]))
  1625. AC_ARG_WITH(asciidoc,
  1626. AS_HELP_STRING([--with-asciidoc],
  1627. [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
  1628. [use_asciidoc=$withval], [use_asciidoc=]_defopt)
  1629. m4_undefine([_defopt])
  1630. if test "x$use_asciidoc" = x"auto"; then
  1631. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1632. if test "x$ASCIIDOC" = "x"; then
  1633. AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
  1634. have_asciidoc=no
  1635. else
  1636. have_asciidoc=yes
  1637. fi
  1638. elif test "x$use_asciidoc" = x"yes" ; then
  1639. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1640. if test "x$ASCIIDOC" = "x"; then
  1641. AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
  1642. fi
  1643. have_asciidoc=yes
  1644. elif test "x$use_asciidoc" = x"no" ; then
  1645. if test "x$ASCIIDOC" != "x"; then
  1646. AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
  1647. fi
  1648. have_asciidoc=no
  1649. else
  1650. AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
  1651. fi
  1652. m4_ifval([$1],
  1653. [if test "$have_asciidoc" = yes; then
  1654. # scrape the asciidoc version
  1655. AC_MSG_CHECKING([the asciidoc version])
  1656. asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
  1657. AC_MSG_RESULT([$asciidoc_version])
  1658. AS_VERSION_COMPARE([$asciidoc_version], [$1],
  1659. [if test "x$use_asciidoc" = xauto; then
  1660. AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
  1661. have_asciidoc=no
  1662. else
  1663. AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
  1664. fi])
  1665. fi])
  1666. AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
  1667. ]) # XORG_WITH_ASCIIDOC
  1668. # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
  1669. # -------------------------------------------
  1670. # Minimum version: 1.5.0
  1671. # Minimum version for optional DEFAULT argument: 1.11.0
  1672. # Minimum version for optional DOT checking: 1.18.0
  1673. #
  1674. # Documentation tools are not always available on all platforms and sometimes
  1675. # not at the appropriate level. This macro enables a module to test for the
  1676. # presence of the tool and obtain it's path in separate variables. Coupled with
  1677. # the --with-doxygen option, it allows maximum flexibilty in making decisions
  1678. # as whether or not to use the doxygen package. When DEFAULT is not specified,
  1679. # --with-doxygen assumes 'auto'.
  1680. #
  1681. # Interface to module:
  1682. # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
  1683. # DOXYGEN: returns the path of the doxygen program found
  1684. # returns the path set by the user in the environment
  1685. # --with-doxygen: 'yes' user instructs the module to use doxygen
  1686. # 'no' user instructs the module not to use doxygen
  1687. #
  1688. # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
  1689. #
  1690. AC_DEFUN([XORG_WITH_DOXYGEN],[
  1691. AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
  1692. AC_ARG_VAR([DOT], [Path to the dot graphics utility])
  1693. m4_define([_defopt], m4_default([$2], [auto]))
  1694. AC_ARG_WITH(doxygen,
  1695. AS_HELP_STRING([--with-doxygen],
  1696. [Use doxygen to regenerate documentation (default: ]_defopt[)]),
  1697. [use_doxygen=$withval], [use_doxygen=]_defopt)
  1698. m4_undefine([_defopt])
  1699. if test "x$use_doxygen" = x"auto"; then
  1700. AC_PATH_PROG([DOXYGEN], [doxygen])
  1701. if test "x$DOXYGEN" = "x"; then
  1702. AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
  1703. have_doxygen=no
  1704. else
  1705. have_doxygen=yes
  1706. fi
  1707. elif test "x$use_doxygen" = x"yes" ; then
  1708. AC_PATH_PROG([DOXYGEN], [doxygen])
  1709. if test "x$DOXYGEN" = "x"; then
  1710. AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
  1711. fi
  1712. have_doxygen=yes
  1713. elif test "x$use_doxygen" = x"no" ; then
  1714. if test "x$DOXYGEN" != "x"; then
  1715. AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
  1716. fi
  1717. have_doxygen=no
  1718. else
  1719. AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
  1720. fi
  1721. m4_ifval([$1],
  1722. [if test "$have_doxygen" = yes; then
  1723. # scrape the doxygen version
  1724. AC_MSG_CHECKING([the doxygen version])
  1725. doxygen_version=`$DOXYGEN --version 2>/dev/null`
  1726. AC_MSG_RESULT([$doxygen_version])
  1727. AS_VERSION_COMPARE([$doxygen_version], [$1],
  1728. [if test "x$use_doxygen" = xauto; then
  1729. AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
  1730. have_doxygen=no
  1731. else
  1732. AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
  1733. fi])
  1734. fi])
  1735. dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
  1736. dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
  1737. dnl HAVE_DOT = @HAVE_DOT@
  1738. HAVE_DOT=no
  1739. if test "x$have_doxygen" = "xyes"; then
  1740. AC_PATH_PROG([DOT], [dot])
  1741. if test "x$DOT" != "x"; then
  1742. HAVE_DOT=yes
  1743. fi
  1744. fi
  1745. AC_SUBST([HAVE_DOT])
  1746. AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
  1747. AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
  1748. ]) # XORG_WITH_DOXYGEN
  1749. # XORG_WITH_GROFF([DEFAULT])
  1750. # ----------------
  1751. # Minimum version: 1.6.0
  1752. # Minimum version for optional DEFAULT argument: 1.11.0
  1753. #
  1754. # Documentation tools are not always available on all platforms and sometimes
  1755. # not at the appropriate level. This macro enables a module to test for the
  1756. # presence of the tool and obtain it's path in separate variables. Coupled with
  1757. # the --with-groff option, it allows maximum flexibilty in making decisions
  1758. # as whether or not to use the groff package. When DEFAULT is not specified,
  1759. # --with-groff assumes 'auto'.
  1760. #
  1761. # Interface to module:
  1762. # HAVE_GROFF: used in makefiles to conditionally generate documentation
  1763. # HAVE_GROFF_MM: the memorandum macros (-mm) package
  1764. # HAVE_GROFF_MS: the -ms macros package
  1765. # GROFF: returns the path of the groff program found
  1766. # returns the path set by the user in the environment
  1767. # --with-groff: 'yes' user instructs the module to use groff
  1768. # 'no' user instructs the module not to use groff
  1769. #
  1770. # Added in version 1.9.0:
  1771. # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
  1772. # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
  1773. # psselect from the psutils package.
  1774. # the ghostcript package. Refer to the grohtml man pages
  1775. #
  1776. # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
  1777. #
  1778. # OS and distros often splits groff in a basic and full package, the former
  1779. # having the groff program and the later having devices, fonts and macros
  1780. # Checking for the groff executable is not enough.
  1781. #
  1782. # If macros are missing, we cannot assume that groff is useless, so we don't
  1783. # unset HAVE_GROFF or GROFF env variables.
  1784. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
  1785. #
  1786. AC_DEFUN([XORG_WITH_GROFF],[
  1787. AC_ARG_VAR([GROFF], [Path to groff command])
  1788. m4_define([_defopt], m4_default([$1], [auto]))
  1789. AC_ARG_WITH(groff,
  1790. AS_HELP_STRING([--with-groff],
  1791. [Use groff to regenerate documentation (default: ]_defopt[)]),
  1792. [use_groff=$withval], [use_groff=]_defopt)
  1793. m4_undefine([_defopt])
  1794. if test "x$use_groff" = x"auto"; then
  1795. AC_PATH_PROG([GROFF], [groff])
  1796. if test "x$GROFF" = "x"; then
  1797. AC_MSG_WARN([groff not found - documentation targets will be skipped])
  1798. have_groff=no
  1799. else
  1800. have_groff=yes
  1801. fi
  1802. elif test "x$use_groff" = x"yes" ; then
  1803. AC_PATH_PROG([GROFF], [groff])
  1804. if test "x$GROFF" = "x"; then
  1805. AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
  1806. fi
  1807. have_groff=yes
  1808. elif test "x$use_groff" = x"no" ; then
  1809. if test "x$GROFF" != "x"; then
  1810. AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
  1811. fi
  1812. have_groff=no
  1813. else
  1814. AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
  1815. fi
  1816. # We have groff, test for the presence of the macro packages
  1817. if test "x$have_groff" = x"yes"; then
  1818. AC_MSG_CHECKING([for ${GROFF} -ms macros])
  1819. if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
  1820. groff_ms_works=yes
  1821. else
  1822. groff_ms_works=no
  1823. fi
  1824. AC_MSG_RESULT([$groff_ms_works])
  1825. AC_MSG_CHECKING([for ${GROFF} -mm macros])
  1826. if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
  1827. groff_mm_works=yes
  1828. else
  1829. groff_mm_works=no
  1830. fi
  1831. AC_MSG_RESULT([$groff_mm_works])
  1832. fi
  1833. # We have groff, test for HTML dependencies, one command per package
  1834. if test "x$have_groff" = x"yes"; then
  1835. AC_PATH_PROGS(GS_PATH, [gs gswin32c])
  1836. AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
  1837. AC_PATH_PROG(PSSELECT_PATH, [psselect])
  1838. if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
  1839. have_groff_html=yes
  1840. else
  1841. have_groff_html=no
  1842. AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
  1843. fi
  1844. fi
  1845. # Set Automake conditionals for Makefiles
  1846. AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
  1847. AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
  1848. AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
  1849. AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
  1850. ]) # XORG_WITH_GROFF
  1851. # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
  1852. # ---------------------------------------
  1853. # Minimum version: 1.6.0
  1854. # Minimum version for optional DEFAULT argument: 1.11.0
  1855. # Minimum version for optional MIN-VERSION argument: 1.15.0
  1856. #
  1857. # Documentation tools are not always available on all platforms and sometimes
  1858. # not at the appropriate level. This macro enables a module to test for the
  1859. # presence of the tool and obtain it's path in separate variables. Coupled with
  1860. # the --with-fop option, it allows maximum flexibilty in making decisions
  1861. # as whether or not to use the fop package. When DEFAULT is not specified,
  1862. # --with-fop assumes 'auto'.
  1863. #
  1864. # Interface to module:
  1865. # HAVE_FOP: used in makefiles to conditionally generate documentation
  1866. # FOP: returns the path of the fop program found
  1867. # returns the path set by the user in the environment
  1868. # --with-fop: 'yes' user instructs the module to use fop
  1869. # 'no' user instructs the module not to use fop
  1870. #
  1871. # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
  1872. #
  1873. AC_DEFUN([XORG_WITH_FOP],[
  1874. AC_ARG_VAR([FOP], [Path to fop command])
  1875. m4_define([_defopt], m4_default([$2], [auto]))
  1876. AC_ARG_WITH(fop,
  1877. AS_HELP_STRING([--with-fop],
  1878. [Use fop to regenerate documentation (default: ]_defopt[)]),
  1879. [use_fop=$withval], [use_fop=]_defopt)
  1880. m4_undefine([_defopt])
  1881. if test "x$use_fop" = x"auto"; then
  1882. AC_PATH_PROG([FOP], [fop])
  1883. if test "x$FOP" = "x"; then
  1884. AC_MSG_WARN([fop not found - documentation targets will be skipped])
  1885. have_fop=no
  1886. else
  1887. have_fop=yes
  1888. fi
  1889. elif test "x$use_fop" = x"yes" ; then
  1890. AC_PATH_PROG([FOP], [fop])
  1891. if test "x$FOP" = "x"; then
  1892. AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
  1893. fi
  1894. have_fop=yes
  1895. elif test "x$use_fop" = x"no" ; then
  1896. if test "x$FOP" != "x"; then
  1897. AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
  1898. fi
  1899. have_fop=no
  1900. else
  1901. AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
  1902. fi
  1903. # Test for a minimum version of fop, if provided.
  1904. m4_ifval([$1],
  1905. [if test "$have_fop" = yes; then
  1906. # scrape the fop version
  1907. AC_MSG_CHECKING([for fop minimum version])
  1908. fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
  1909. AC_MSG_RESULT([$fop_version])
  1910. AS_VERSION_COMPARE([$fop_version], [$1],
  1911. [if test "x$use_fop" = xauto; then
  1912. AC_MSG_WARN([fop version $fop_version found, but $1 needed])
  1913. have_fop=no
  1914. else
  1915. AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
  1916. fi])
  1917. fi])
  1918. AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
  1919. ]) # XORG_WITH_FOP
  1920. # XORG_WITH_M4([MIN-VERSION])
  1921. # ---------------------------
  1922. # Minimum version: 1.19.0
  1923. #
  1924. # This macro attempts to locate an m4 macro processor which supports
  1925. # -I option and is only useful for modules relying on M4 in order to
  1926. # expand macros in source code files.
  1927. #
  1928. # Interface to module:
  1929. # M4: returns the path of the m4 program found
  1930. # returns the path set by the user in the environment
  1931. #
  1932. AC_DEFUN([XORG_WITH_M4], [
  1933. AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
  1934. [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
  1935. [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
  1936. ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
  1937. [AC_MSG_ERROR([could not find m4 that supports -I option])],
  1938. [$PATH:/usr/gnu/bin])])
  1939. AC_SUBST([M4], [$ac_cv_path_M4])
  1940. ]) # XORG_WITH_M4
  1941. # XORG_WITH_PS2PDF([DEFAULT])
  1942. # ----------------
  1943. # Minimum version: 1.6.0
  1944. # Minimum version for optional DEFAULT argument: 1.11.0
  1945. #
  1946. # Documentation tools are not always available on all platforms and sometimes
  1947. # not at the appropriate level. This macro enables a module to test for the
  1948. # presence of the tool and obtain it's path in separate variables. Coupled with
  1949. # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
  1950. # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
  1951. # --with-ps2pdf assumes 'auto'.
  1952. #
  1953. # Interface to module:
  1954. # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
  1955. # PS2PDF: returns the path of the ps2pdf program found
  1956. # returns the path set by the user in the environment
  1957. # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
  1958. # 'no' user instructs the module not to use ps2pdf
  1959. #
  1960. # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
  1961. #
  1962. AC_DEFUN([XORG_WITH_PS2PDF],[
  1963. AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
  1964. m4_define([_defopt], m4_default([$1], [auto]))
  1965. AC_ARG_WITH(ps2pdf,
  1966. AS_HELP_STRING([--with-ps2pdf],
  1967. [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
  1968. [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
  1969. m4_undefine([_defopt])
  1970. if test "x$use_ps2pdf" = x"auto"; then
  1971. AC_PATH_PROG([PS2PDF], [ps2pdf])
  1972. if test "x$PS2PDF" = "x"; then
  1973. AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
  1974. have_ps2pdf=no
  1975. else
  1976. have_ps2pdf=yes
  1977. fi
  1978. elif test "x$use_ps2pdf" = x"yes" ; then
  1979. AC_PATH_PROG([PS2PDF], [ps2pdf])
  1980. if test "x$PS2PDF" = "x"; then
  1981. AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
  1982. fi
  1983. have_ps2pdf=yes
  1984. elif test "x$use_ps2pdf" = x"no" ; then
  1985. if test "x$PS2PDF" != "x"; then
  1986. AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
  1987. fi
  1988. have_ps2pdf=no
  1989. else
  1990. AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
  1991. fi
  1992. AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
  1993. ]) # XORG_WITH_PS2PDF
  1994. # XORG_ENABLE_DOCS (enable_docs=yes)
  1995. # ----------------
  1996. # Minimum version: 1.6.0
  1997. #
  1998. # Documentation tools are not always available on all platforms and sometimes
  1999. # not at the appropriate level. This macro enables a builder to skip all
  2000. # documentation targets except traditional man pages.
  2001. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2002. # maximum flexibilty in controlling documentation building.
  2003. # Refer to:
  2004. # XORG_WITH_XMLTO --with-xmlto
  2005. # XORG_WITH_ASCIIDOC --with-asciidoc
  2006. # XORG_WITH_DOXYGEN --with-doxygen
  2007. # XORG_WITH_FOP --with-fop
  2008. # XORG_WITH_GROFF --with-groff
  2009. # XORG_WITH_PS2PDF --with-ps2pdf
  2010. #
  2011. # Interface to module:
  2012. # ENABLE_DOCS: used in makefiles to conditionally generate documentation
  2013. # --enable-docs: 'yes' user instructs the module to generate docs
  2014. # 'no' user instructs the module not to generate docs
  2015. # parm1: specify the default value, yes or no.
  2016. #
  2017. AC_DEFUN([XORG_ENABLE_DOCS],[
  2018. m4_define([docs_default], m4_default([$1], [yes]))
  2019. AC_ARG_ENABLE(docs,
  2020. AS_HELP_STRING([--enable-docs],
  2021. [Enable building the documentation (default: ]docs_default[)]),
  2022. [build_docs=$enableval], [build_docs=]docs_default)
  2023. m4_undefine([docs_default])
  2024. AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
  2025. AC_MSG_CHECKING([whether to build documentation])
  2026. AC_MSG_RESULT([$build_docs])
  2027. ]) # XORG_ENABLE_DOCS
  2028. # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
  2029. # ----------------
  2030. # Minimum version: 1.6.0
  2031. #
  2032. # This macro enables a builder to skip all developer documentation.
  2033. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2034. # maximum flexibilty in controlling documentation building.
  2035. # Refer to:
  2036. # XORG_WITH_XMLTO --with-xmlto
  2037. # XORG_WITH_ASCIIDOC --with-asciidoc
  2038. # XORG_WITH_DOXYGEN --with-doxygen
  2039. # XORG_WITH_FOP --with-fop
  2040. # XORG_WITH_GROFF --with-groff
  2041. # XORG_WITH_PS2PDF --with-ps2pdf
  2042. #
  2043. # Interface to module:
  2044. # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
  2045. # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
  2046. # 'no' user instructs the module not to generate developer docs
  2047. # parm1: specify the default value, yes or no.
  2048. #
  2049. AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
  2050. m4_define([devel_default], m4_default([$1], [yes]))
  2051. AC_ARG_ENABLE(devel-docs,
  2052. AS_HELP_STRING([--enable-devel-docs],
  2053. [Enable building the developer documentation (default: ]devel_default[)]),
  2054. [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
  2055. m4_undefine([devel_default])
  2056. AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
  2057. AC_MSG_CHECKING([whether to build developer documentation])
  2058. AC_MSG_RESULT([$build_devel_docs])
  2059. ]) # XORG_ENABLE_DEVEL_DOCS
  2060. # XORG_ENABLE_SPECS (enable_specs=yes)
  2061. # ----------------
  2062. # Minimum version: 1.6.0
  2063. #
  2064. # This macro enables a builder to skip all functional specification targets.
  2065. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2066. # maximum flexibilty in controlling documentation building.
  2067. # Refer to:
  2068. # XORG_WITH_XMLTO --with-xmlto
  2069. # XORG_WITH_ASCIIDOC --with-asciidoc
  2070. # XORG_WITH_DOXYGEN --with-doxygen
  2071. # XORG_WITH_FOP --with-fop
  2072. # XORG_WITH_GROFF --with-groff
  2073. # XORG_WITH_PS2PDF --with-ps2pdf
  2074. #
  2075. # Interface to module:
  2076. # ENABLE_SPECS: used in makefiles to conditionally generate specs
  2077. # --enable-specs: 'yes' user instructs the module to generate specs
  2078. # 'no' user instructs the module not to generate specs
  2079. # parm1: specify the default value, yes or no.
  2080. #
  2081. AC_DEFUN([XORG_ENABLE_SPECS],[
  2082. m4_define([spec_default], m4_default([$1], [yes]))
  2083. AC_ARG_ENABLE(specs,
  2084. AS_HELP_STRING([--enable-specs],
  2085. [Enable building the specs (default: ]spec_default[)]),
  2086. [build_specs=$enableval], [build_specs=]spec_default)
  2087. m4_undefine([spec_default])
  2088. AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
  2089. AC_MSG_CHECKING([whether to build functional specifications])
  2090. AC_MSG_RESULT([$build_specs])
  2091. ]) # XORG_ENABLE_SPECS
  2092. # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
  2093. # ----------------------------------------------
  2094. # Minimum version: 1.13.0
  2095. #
  2096. # This macro enables a builder to enable/disable unit testing
  2097. # It makes no assumption about the test cases implementation
  2098. # Test cases may or may not use Automake "Support for test suites"
  2099. # They may or may not use the software utility library GLib
  2100. #
  2101. # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
  2102. # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
  2103. # The variable enable_unit_tests is used by other macros in this file.
  2104. #
  2105. # Interface to module:
  2106. # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
  2107. # enable_unit_tests: used in configure.ac for additional configuration
  2108. # --enable-unit-tests: 'yes' user instructs the module to build tests
  2109. # 'no' user instructs the module not to build tests
  2110. # parm1: specify the default value, yes or no.
  2111. #
  2112. AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
  2113. AC_BEFORE([$0], [XORG_WITH_GLIB])
  2114. AC_BEFORE([$0], [XORG_LD_WRAP])
  2115. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  2116. m4_define([_defopt], m4_default([$1], [auto]))
  2117. AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
  2118. [Enable building unit test cases (default: ]_defopt[)]),
  2119. [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
  2120. m4_undefine([_defopt])
  2121. AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
  2122. AC_MSG_CHECKING([whether to build unit test cases])
  2123. AC_MSG_RESULT([$enable_unit_tests])
  2124. ]) # XORG_ENABLE_UNIT_TESTS
  2125. # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
  2126. # ------------------------------------------------------
  2127. # Minimum version: 1.17.0
  2128. #
  2129. # This macro enables a builder to enable/disable integration testing
  2130. # It makes no assumption about the test cases' implementation
  2131. # Test cases may or may not use Automake "Support for test suites"
  2132. #
  2133. # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
  2134. # usually requires less dependencies and may be built and run under less
  2135. # stringent environments than integration tests.
  2136. #
  2137. # Interface to module:
  2138. # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
  2139. # enable_integration_tests: used in configure.ac for additional configuration
  2140. # --enable-integration-tests: 'yes' user instructs the module to build tests
  2141. # 'no' user instructs the module not to build tests
  2142. # parm1: specify the default value, yes or no.
  2143. #
  2144. AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
  2145. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  2146. m4_define([_defopt], m4_default([$1], [auto]))
  2147. AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
  2148. [Enable building integration test cases (default: ]_defopt[)]),
  2149. [enable_integration_tests=$enableval],
  2150. [enable_integration_tests=]_defopt)
  2151. m4_undefine([_defopt])
  2152. AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
  2153. [test "x$enable_integration_tests" != xno])
  2154. AC_MSG_CHECKING([whether to build unit test cases])
  2155. AC_MSG_RESULT([$enable_integration_tests])
  2156. ]) # XORG_ENABLE_INTEGRATION_TESTS
  2157. # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
  2158. # ----------------------------------------
  2159. # Minimum version: 1.13.0
  2160. #
  2161. # GLib is a library which provides advanced data structures and functions.
  2162. # This macro enables a module to test for the presence of Glib.
  2163. #
  2164. # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
  2165. # Otherwise the value of $enable_unit_tests is blank.
  2166. #
  2167. # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
  2168. # test support usually requires less dependencies and may be built and run under
  2169. # less stringent environments than integration tests.
  2170. #
  2171. # Interface to module:
  2172. # HAVE_GLIB: used in makefiles to conditionally build targets
  2173. # with_glib: used in configure.ac to know if GLib has been found
  2174. # --with-glib: 'yes' user instructs the module to use glib
  2175. # 'no' user instructs the module not to use glib
  2176. #
  2177. AC_DEFUN([XORG_WITH_GLIB],[
  2178. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2179. m4_define([_defopt], m4_default([$2], [auto]))
  2180. AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
  2181. [Use GLib library for unit testing (default: ]_defopt[)]),
  2182. [with_glib=$withval], [with_glib=]_defopt)
  2183. m4_undefine([_defopt])
  2184. have_glib=no
  2185. # Do not probe GLib if user explicitly disabled unit testing
  2186. if test "x$enable_unit_tests" != x"no"; then
  2187. # Do not probe GLib if user explicitly disabled it
  2188. if test "x$with_glib" != x"no"; then
  2189. m4_ifval(
  2190. [$1],
  2191. [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
  2192. [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
  2193. )
  2194. fi
  2195. fi
  2196. # Not having GLib when unit testing has been explicitly requested is an error
  2197. if test "x$enable_unit_tests" = x"yes"; then
  2198. if test "x$have_glib" = x"no"; then
  2199. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  2200. fi
  2201. fi
  2202. # Having unit testing disabled when GLib has been explicitly requested is an error
  2203. if test "x$enable_unit_tests" = x"no"; then
  2204. if test "x$with_glib" = x"yes"; then
  2205. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  2206. fi
  2207. fi
  2208. # Not having GLib when it has been explicitly requested is an error
  2209. if test "x$with_glib" = x"yes"; then
  2210. if test "x$have_glib" = x"no"; then
  2211. AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
  2212. fi
  2213. fi
  2214. AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
  2215. ]) # XORG_WITH_GLIB
  2216. # XORG_LD_WRAP([required|optional])
  2217. # ---------------------------------
  2218. # Minimum version: 1.13.0
  2219. #
  2220. # Check if linker supports -wrap, passed via compiler flags
  2221. #
  2222. # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
  2223. # Otherwise the value of $enable_unit_tests is blank.
  2224. #
  2225. # Argument added in 1.16.0 - default is "required", to match existing behavior
  2226. # of returning an error if enable_unit_tests is yes, and ld -wrap is not
  2227. # available, an argument of "optional" allows use when some unit tests require
  2228. # ld -wrap and others do not.
  2229. #
  2230. AC_DEFUN([XORG_LD_WRAP],[
  2231. XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
  2232. [AC_LANG_PROGRAM([#include <stdlib.h>
  2233. void __wrap_exit(int status) { return; }],
  2234. [exit(0);])])
  2235. # Not having ld wrap when unit testing has been explicitly requested is an error
  2236. if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
  2237. if test "x$have_ld_wrap" = x"no"; then
  2238. AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
  2239. fi
  2240. fi
  2241. AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
  2242. #
  2243. ]) # XORG_LD_WRAP
  2244. # XORG_CHECK_LINKER_FLAGS
  2245. # -----------------------
  2246. # SYNOPSIS
  2247. #
  2248. # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
  2249. #
  2250. # DESCRIPTION
  2251. #
  2252. # Check whether the given linker FLAGS work with the current language's
  2253. # linker, or whether they give an error.
  2254. #
  2255. # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
  2256. # success/failure.
  2257. #
  2258. # PROGRAM-SOURCE is the program source to link with, if needed
  2259. #
  2260. # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
  2261. #
  2262. # LICENSE
  2263. #
  2264. # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
  2265. # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
  2266. # Copyright (c) 2009 Matteo Frigo
  2267. #
  2268. # This program is free software: you can redistribute it and/or modify it
  2269. # under the terms of the GNU General Public License as published by the
  2270. # Free Software Foundation, either version 3 of the License, or (at your
  2271. # option) any later version.
  2272. #
  2273. # This program is distributed in the hope that it will be useful, but
  2274. # WITHOUT ANY WARRANTY; without even the implied warranty of
  2275. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  2276. # Public License for more details.
  2277. #
  2278. # You should have received a copy of the GNU General Public License along
  2279. # with this program. If not, see <http://www.gnu.org/licenses/>.
  2280. #
  2281. # As a special exception, the respective Autoconf Macro's copyright owner
  2282. # gives unlimited permission to copy, distribute and modify the configure
  2283. # scripts that are the output of Autoconf when processing the Macro. You
  2284. # need not follow the terms of the GNU General Public License when using
  2285. # or distributing such scripts, even though portions of the text of the
  2286. # Macro appear in them. The GNU General Public License (GPL) does govern
  2287. # all other use of the material that constitutes the Autoconf Macro.
  2288. #
  2289. # This special exception to the GPL applies to versions of the Autoconf
  2290. # Macro released by the Autoconf Archive. When you make and distribute a
  2291. # modified version of the Autoconf Macro, you may extend this special
  2292. # exception to the GPL to apply to your modified version as well.#
  2293. AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
  2294. [AC_MSG_CHECKING([whether the linker accepts $1])
  2295. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
  2296. AS_LITERAL_IF([$1],
  2297. [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
  2298. ax_save_FLAGS=$LDFLAGS
  2299. LDFLAGS="$1"
  2300. AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
  2301. AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  2302. AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  2303. LDFLAGS=$ax_save_FLAGS])],
  2304. [ax_save_FLAGS=$LDFLAGS
  2305. LDFLAGS="$1"
  2306. AC_LINK_IFELSE([AC_LANG_PROGRAM()],
  2307. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  2308. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  2309. LDFLAGS=$ax_save_FLAGS])
  2310. eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
  2311. AC_MSG_RESULT($xorg_check_linker_flags)
  2312. if test "x$xorg_check_linker_flags" = xyes; then
  2313. m4_default([$2], :)
  2314. else
  2315. m4_default([$3], :)
  2316. fi
  2317. ]) # XORG_CHECK_LINKER_FLAGS
  2318. # XORG_MEMORY_CHECK_FLAGS
  2319. # -----------------------
  2320. # Minimum version: 1.16.0
  2321. #
  2322. # This macro attempts to find appropriate memory checking functionality
  2323. # for various platforms which unit testing code may use to catch various
  2324. # forms of memory allocation and access errors in testing.
  2325. #
  2326. # Interface to module:
  2327. # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
  2328. # Usually added to TESTS_ENVIRONMENT in Makefile.am
  2329. #
  2330. # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
  2331. #
  2332. AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
  2333. AC_REQUIRE([AC_CANONICAL_HOST])
  2334. AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
  2335. [Environment variables to enable memory checking in tests])
  2336. # Check for different types of support on different platforms
  2337. case $host_os in
  2338. solaris*)
  2339. AC_CHECK_LIB([umem], [umem_alloc],
  2340. [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
  2341. ;;
  2342. *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
  2343. # both directly and inverted, so should not be 0 or 255.
  2344. malloc_debug_env='MALLOC_PERTURB_=15'
  2345. ;;
  2346. darwin*)
  2347. malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
  2348. ;;
  2349. *bsd*)
  2350. malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
  2351. ;;
  2352. esac
  2353. # User supplied flags override default flags
  2354. if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
  2355. malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
  2356. fi
  2357. AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
  2358. ]) # XORG_WITH_LINT
  2359. # XORG_CHECK_MALLOC_ZERO
  2360. # ----------------------
  2361. # Minimum version: 1.0.0
  2362. #
  2363. # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
  2364. # malloc(0) returns NULL. Packages should add one of these cflags to
  2365. # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
  2366. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
  2367. AC_ARG_ENABLE(malloc0returnsnull,
  2368. AS_HELP_STRING([--enable-malloc0returnsnull],
  2369. [malloc(0) returns NULL (default: auto)]),
  2370. [MALLOC_ZERO_RETURNS_NULL=$enableval],
  2371. [MALLOC_ZERO_RETURNS_NULL=auto])
  2372. AC_MSG_CHECKING([whether malloc(0) returns NULL])
  2373. if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
  2374. AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
  2375. [AC_RUN_IFELSE([AC_LANG_PROGRAM([
  2376. #include <stdlib.h>
  2377. ],[
  2378. char *m0, *r0, *c0, *p;
  2379. m0 = malloc(0);
  2380. p = malloc(10);
  2381. r0 = realloc(p,0);
  2382. c0 = calloc(0,10);
  2383. exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
  2384. ])],
  2385. [xorg_cv_malloc0_returns_null=yes],
  2386. [xorg_cv_malloc0_returns_null=no])])
  2387. MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
  2388. fi
  2389. AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
  2390. if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
  2391. MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
  2392. XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
  2393. XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
  2394. else
  2395. MALLOC_ZERO_CFLAGS=""
  2396. XMALLOC_ZERO_CFLAGS=""
  2397. XTMALLOC_ZERO_CFLAGS=""
  2398. fi
  2399. AC_SUBST([MALLOC_ZERO_CFLAGS])
  2400. AC_SUBST([XMALLOC_ZERO_CFLAGS])
  2401. AC_SUBST([XTMALLOC_ZERO_CFLAGS])
  2402. ]) # XORG_CHECK_MALLOC_ZERO
  2403. # XORG_WITH_LINT()
  2404. # ----------------
  2405. # Minimum version: 1.1.0
  2406. #
  2407. # This macro enables the use of a tool that flags some suspicious and
  2408. # non-portable constructs (likely to be bugs) in C language source code.
  2409. # It will attempt to locate the tool and use appropriate options.
  2410. # There are various lint type tools on different platforms.
  2411. #
  2412. # Interface to module:
  2413. # LINT: returns the path to the tool found on the platform
  2414. # or the value set to LINT on the configure cmd line
  2415. # also an Automake conditional
  2416. # LINT_FLAGS: an Automake variable with appropriate flags
  2417. #
  2418. # --with-lint: 'yes' user instructs the module to use lint
  2419. # 'no' user instructs the module not to use lint (default)
  2420. #
  2421. # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
  2422. # If the user sets the value of LINT_FLAGS, they are used verbatim.
  2423. #
  2424. AC_DEFUN([XORG_WITH_LINT],[
  2425. AC_ARG_VAR([LINT], [Path to a lint-style command])
  2426. AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
  2427. AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
  2428. [Use a lint-style source code checker (default: disabled)])],
  2429. [use_lint=$withval], [use_lint=no])
  2430. # Obtain platform specific info like program name and options
  2431. # The lint program on FreeBSD and NetBSD is different from the one on Solaris
  2432. case $host_os in
  2433. *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
  2434. lint_name=splint
  2435. lint_options="-badflag"
  2436. ;;
  2437. *freebsd* | *netbsd*)
  2438. lint_name=lint
  2439. lint_options="-u -b"
  2440. ;;
  2441. *solaris*)
  2442. lint_name=lint
  2443. lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
  2444. ;;
  2445. esac
  2446. # Test for the presence of the program (either guessed by the code or spelled out by the user)
  2447. if test "x$use_lint" = x"yes" ; then
  2448. AC_PATH_PROG([LINT], [$lint_name])
  2449. if test "x$LINT" = "x"; then
  2450. AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
  2451. fi
  2452. elif test "x$use_lint" = x"no" ; then
  2453. if test "x$LINT" != "x"; then
  2454. AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
  2455. fi
  2456. else
  2457. AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
  2458. fi
  2459. # User supplied flags override default flags
  2460. if test "x$LINT_FLAGS" != "x"; then
  2461. lint_options=$LINT_FLAGS
  2462. fi
  2463. AC_SUBST([LINT_FLAGS],[$lint_options])
  2464. AM_CONDITIONAL(LINT, [test "x$LINT" != x])
  2465. ]) # XORG_WITH_LINT
  2466. # XORG_LINT_LIBRARY(LIBNAME)
  2467. # --------------------------
  2468. # Minimum version: 1.1.0
  2469. #
  2470. # Sets up flags for building lint libraries for checking programs that call
  2471. # functions in the library.
  2472. #
  2473. # Interface to module:
  2474. # LINTLIB - Automake variable with the name of lint library file to make
  2475. # MAKE_LINT_LIB - Automake conditional
  2476. #
  2477. # --enable-lint-library: - 'yes' user instructs the module to created a lint library
  2478. # - 'no' user instructs the module not to create a lint library (default)
  2479. AC_DEFUN([XORG_LINT_LIBRARY],[
  2480. AC_REQUIRE([XORG_WITH_LINT])
  2481. AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
  2482. [Create lint library (default: disabled)])],
  2483. [make_lint_lib=$enableval], [make_lint_lib=no])
  2484. if test "x$make_lint_lib" = x"yes" ; then
  2485. LINTLIB=llib-l$1.ln
  2486. if test "x$LINT" = "x"; then
  2487. AC_MSG_ERROR([Cannot make lint library without --with-lint])
  2488. fi
  2489. elif test "x$make_lint_lib" != x"no" ; then
  2490. AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
  2491. fi
  2492. AC_SUBST(LINTLIB)
  2493. AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
  2494. ]) # XORG_LINT_LIBRARY
  2495. # XORG_COMPILER_BRAND
  2496. # -------------------
  2497. # Minimum version: 1.14.0
  2498. #
  2499. # Checks for various brands of compilers and sets flags as appropriate:
  2500. # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
  2501. # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
  2502. # clang compiler - sets CLANGCC to "yes"
  2503. # Intel compiler - sets INTELCC to "yes"
  2504. # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
  2505. #
  2506. AC_DEFUN([XORG_COMPILER_BRAND], [
  2507. AC_LANG_CASE(
  2508. [C], [
  2509. AC_REQUIRE([AC_PROG_CC_C99])
  2510. ],
  2511. [C++], [
  2512. AC_REQUIRE([AC_PROG_CXX])
  2513. ]
  2514. )
  2515. AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
  2516. AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
  2517. AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
  2518. ]) # XORG_COMPILER_BRAND
  2519. # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
  2520. # ---------------
  2521. # Minimum version: 1.16.0
  2522. #
  2523. # Test if the compiler works when passed the given flag as a command line argument.
  2524. # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
  2525. # next flag in the list until there are no more options.
  2526. #
  2527. # Note that this does not guarantee that the compiler supports the flag as some
  2528. # compilers will simply ignore arguments that they do not understand, but we do
  2529. # attempt to weed out false positives by using -Werror=unknown-warning-option and
  2530. # -Werror=unused-command-line-argument
  2531. #
  2532. AC_DEFUN([XORG_TESTSET_CFLAG], [
  2533. m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  2534. m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  2535. AC_LANG_COMPILER_REQUIRE
  2536. AC_LANG_CASE(
  2537. [C], [
  2538. AC_REQUIRE([AC_PROG_CC_C99])
  2539. define([PREFIX], [C])
  2540. define([CACHE_PREFIX], [cc])
  2541. define([COMPILER], [$CC])
  2542. ],
  2543. [C++], [
  2544. define([PREFIX], [CXX])
  2545. define([CACHE_PREFIX], [cxx])
  2546. define([COMPILER], [$CXX])
  2547. ]
  2548. )
  2549. [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
  2550. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
  2551. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2552. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
  2553. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
  2554. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  2555. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
  2556. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
  2557. [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
  2558. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2559. fi
  2560. if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
  2561. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
  2562. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2563. fi
  2564. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  2565. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
  2566. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
  2567. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  2568. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
  2569. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
  2570. [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
  2571. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2572. fi
  2573. found="no"
  2574. m4_foreach([flag], m4_cdr($@), [
  2575. if test $found = "no" ; then
  2576. if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
  2577. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2578. fi
  2579. if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
  2580. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  2581. fi
  2582. PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
  2583. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
  2584. AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
  2585. cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
  2586. AC_CACHE_VAL($cacheid,
  2587. [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
  2588. [eval $cacheid=yes],
  2589. [eval $cacheid=no])])
  2590. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2591. eval supported=\$$cacheid
  2592. AC_MSG_RESULT([$supported])
  2593. if test "$supported" = "yes" ; then
  2594. $1="$$1 ]flag["
  2595. found="yes"
  2596. fi
  2597. fi
  2598. ])
  2599. ]) # XORG_TESTSET_CFLAG
  2600. # XORG_COMPILER_FLAGS
  2601. # ---------------
  2602. # Minimum version: 1.16.0
  2603. #
  2604. # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
  2605. # arguments supported by the selected compiler which do NOT alter the generated
  2606. # code. These arguments will cause the compiler to print various warnings
  2607. # during compilation AND turn a conservative set of warnings into errors.
  2608. #
  2609. # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
  2610. # future versions of util-macros as options are added to new compilers.
  2611. #
  2612. AC_DEFUN([XORG_COMPILER_FLAGS], [
  2613. AC_REQUIRE([XORG_COMPILER_BRAND])
  2614. AC_ARG_ENABLE(selective-werror,
  2615. AS_HELP_STRING([--disable-selective-werror],
  2616. [Turn off selective compiler errors. (default: enabled)]),
  2617. [SELECTIVE_WERROR=$enableval],
  2618. [SELECTIVE_WERROR=yes])
  2619. AC_LANG_CASE(
  2620. [C], [
  2621. define([PREFIX], [C])
  2622. ],
  2623. [C++], [
  2624. define([PREFIX], [CXX])
  2625. ]
  2626. )
  2627. # -v is too short to test reliably with XORG_TESTSET_CFLAG
  2628. if test "x$SUNCC" = "xyes"; then
  2629. [BASE_]PREFIX[FLAGS]="-v"
  2630. else
  2631. [BASE_]PREFIX[FLAGS]=""
  2632. fi
  2633. # This chunk of warnings were those that existed in the legacy CWARNFLAGS
  2634. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
  2635. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
  2636. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
  2637. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
  2638. AC_LANG_CASE(
  2639. [C], [
  2640. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
  2641. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
  2642. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
  2643. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
  2644. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
  2645. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
  2646. ]
  2647. )
  2648. # This chunk adds additional warnings that could catch undesired effects.
  2649. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
  2650. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
  2651. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
  2652. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
  2653. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
  2654. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
  2655. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
  2656. # These are currently disabled because they are noisy. They will be enabled
  2657. # in the future once the codebase is sufficiently modernized to silence
  2658. # them. For now, I don't want them to drown out the other warnings.
  2659. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
  2660. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
  2661. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
  2662. # Turn some warnings into errors, so we don't accidently get successful builds
  2663. # when there are problems that should be fixed.
  2664. if test "x$SELECTIVE_WERROR" = "xyes" ; then
  2665. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
  2666. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
  2667. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
  2668. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
  2669. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
  2670. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
  2671. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
  2672. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
  2673. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
  2674. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
  2675. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
  2676. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
  2677. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
  2678. else
  2679. 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])
  2680. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
  2681. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
  2682. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
  2683. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
  2684. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
  2685. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
  2686. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
  2687. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
  2688. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
  2689. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
  2690. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
  2691. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
  2692. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
  2693. fi
  2694. AC_SUBST([BASE_]PREFIX[FLAGS])
  2695. ]) # XORG_COMPILER_FLAGS
  2696. # XORG_CWARNFLAGS
  2697. # ---------------
  2698. # Minimum version: 1.2.0
  2699. # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
  2700. #
  2701. # Defines CWARNFLAGS to enable C compiler warnings.
  2702. #
  2703. # This function is deprecated because it defines -fno-strict-aliasing
  2704. # which alters the code generated by the compiler. If -fno-strict-aliasing
  2705. # is needed, then it should be added explicitly in the module when
  2706. # it is updated to use BASE_CFLAGS.
  2707. #
  2708. AC_DEFUN([XORG_CWARNFLAGS], [
  2709. AC_REQUIRE([XORG_COMPILER_FLAGS])
  2710. AC_REQUIRE([XORG_COMPILER_BRAND])
  2711. AC_LANG_CASE(
  2712. [C], [
  2713. CWARNFLAGS="$BASE_CFLAGS"
  2714. if test "x$GCC" = xyes ; then
  2715. CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
  2716. fi
  2717. AC_SUBST(CWARNFLAGS)
  2718. ]
  2719. )
  2720. ]) # XORG_CWARNFLAGS
  2721. # XORG_STRICT_OPTION
  2722. # -----------------------
  2723. # Minimum version: 1.3.0
  2724. #
  2725. # Add configure option to enable strict compilation flags, such as treating
  2726. # warnings as fatal errors.
  2727. # If --enable-strict-compilation is passed to configure, adds strict flags to
  2728. # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
  2729. #
  2730. # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
  2731. # when strict compilation is unconditionally desired.
  2732. AC_DEFUN([XORG_STRICT_OPTION], [
  2733. AC_REQUIRE([XORG_CWARNFLAGS])
  2734. AC_REQUIRE([XORG_COMPILER_FLAGS])
  2735. AC_ARG_ENABLE(strict-compilation,
  2736. AS_HELP_STRING([--enable-strict-compilation],
  2737. [Enable all warnings from compiler and make them errors (default: disabled)]),
  2738. [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
  2739. AC_LANG_CASE(
  2740. [C], [
  2741. define([PREFIX], [C])
  2742. ],
  2743. [C++], [
  2744. define([PREFIX], [CXX])
  2745. ]
  2746. )
  2747. [STRICT_]PREFIX[FLAGS]=""
  2748. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
  2749. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
  2750. # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
  2751. # activate it with -Werror, so we add it here explicitly.
  2752. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
  2753. if test "x$STRICT_COMPILE" = "xyes"; then
  2754. [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
  2755. AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
  2756. fi
  2757. AC_SUBST([STRICT_]PREFIX[FLAGS])
  2758. AC_SUBST([BASE_]PREFIX[FLAGS])
  2759. AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
  2760. ]) # XORG_STRICT_OPTION
  2761. # XORG_DEFAULT_OPTIONS
  2762. # --------------------
  2763. # Minimum version: 1.3.0
  2764. #
  2765. # Defines default options for X.Org modules.
  2766. #
  2767. AC_DEFUN([XORG_DEFAULT_OPTIONS], [
  2768. AC_REQUIRE([AC_PROG_INSTALL])
  2769. XORG_COMPILER_FLAGS
  2770. XORG_CWARNFLAGS
  2771. XORG_STRICT_OPTION
  2772. XORG_RELEASE_VERSION
  2773. XORG_CHANGELOG
  2774. XORG_INSTALL
  2775. XORG_MANPAGE_SECTIONS
  2776. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  2777. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  2778. ]) # XORG_DEFAULT_OPTIONS
  2779. # XORG_INSTALL()
  2780. # ----------------
  2781. # Minimum version: 1.4.0
  2782. #
  2783. # Defines the variable INSTALL_CMD as the command to copy
  2784. # INSTALL from $prefix/share/util-macros.
  2785. #
  2786. AC_DEFUN([XORG_INSTALL], [
  2787. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2788. macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
  2789. INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
  2790. mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
  2791. || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
  2792. echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
  2793. AC_SUBST([INSTALL_CMD])
  2794. ]) # XORG_INSTALL
  2795. dnl Copyright 2005 Red Hat, Inc
  2796. dnl
  2797. dnl Permission to use, copy, modify, distribute, and sell this software and its
  2798. dnl documentation for any purpose is hereby granted without fee, provided that
  2799. dnl the above copyright notice appear in all copies and that both that
  2800. dnl copyright notice and this permission notice appear in supporting
  2801. dnl documentation.
  2802. dnl
  2803. dnl The above copyright notice and this permission notice shall be included
  2804. dnl in all copies or substantial portions of the Software.
  2805. dnl
  2806. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2807. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2808. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2809. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  2810. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  2811. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  2812. dnl OTHER DEALINGS IN THE SOFTWARE.
  2813. dnl
  2814. dnl Except as contained in this notice, the name of the copyright holders shall
  2815. dnl not be used in advertising or otherwise to promote the sale, use or
  2816. dnl other dealings in this Software without prior written authorization
  2817. dnl from the copyright holders.
  2818. dnl
  2819. # XORG_RELEASE_VERSION
  2820. # --------------------
  2821. # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
  2822. AC_DEFUN([XORG_RELEASE_VERSION],[
  2823. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
  2824. [`echo $PACKAGE_VERSION | cut -d . -f 1`],
  2825. [Major version of this package])
  2826. PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
  2827. if test "x$PVM" = "x"; then
  2828. PVM="0"
  2829. fi
  2830. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
  2831. [$PVM],
  2832. [Minor version of this package])
  2833. PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
  2834. if test "x$PVP" = "x"; then
  2835. PVP="0"
  2836. fi
  2837. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
  2838. [$PVP],
  2839. [Patch version of this package])
  2840. ])
  2841. # XORG_CHANGELOG()
  2842. # ----------------
  2843. # Minimum version: 1.2.0
  2844. #
  2845. # Defines the variable CHANGELOG_CMD as the command to generate
  2846. # ChangeLog from git.
  2847. #
  2848. #
  2849. AC_DEFUN([XORG_CHANGELOG], [
  2850. CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
  2851. mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
  2852. || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
  2853. echo 'git directory not found: installing possibly empty changelog.' >&2)"
  2854. AC_SUBST([CHANGELOG_CMD])
  2855. ]) # XORG_CHANGELOG