aclocal.m4 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183
  1. # generated automatically by aclocal 1.9.6 -*- Autoconf -*-
  2. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  3. # 2005 Free Software Foundation, Inc.
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  9. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  10. # PARTICULAR PURPOSE.
  11. # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
  12. #
  13. # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  14. #
  15. # This program is free software; you can redistribute it and/or modify
  16. # it under the terms of the GNU General Public License as published by
  17. # the Free Software Foundation; either version 2 of the License, or
  18. # (at your option) any later version.
  19. #
  20. # This program is distributed in the hope that it will be useful, but
  21. # WITHOUT ANY WARRANTY; without even the implied warranty of
  22. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  23. # General Public License for more details.
  24. #
  25. # You should have received a copy of the GNU General Public License
  26. # along with this program; if not, write to the Free Software
  27. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  28. #
  29. # As a special exception to the GNU General Public License, if you
  30. # distribute this file as part of a program that contains a
  31. # configuration script generated by Autoconf, you may include it under
  32. # the same distribution terms that you use for the rest of that program.
  33. # PKG_PROG_PKG_CONFIG([MIN-VERSION])
  34. # ----------------------------------
  35. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  36. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  37. m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
  38. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
  39. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  40. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  41. fi
  42. if test -n "$PKG_CONFIG"; then
  43. _pkg_min_version=m4_default([$1], [0.9.0])
  44. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  45. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  46. AC_MSG_RESULT([yes])
  47. else
  48. AC_MSG_RESULT([no])
  49. PKG_CONFIG=""
  50. fi
  51. fi[]dnl
  52. ])# PKG_PROG_PKG_CONFIG
  53. # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  54. #
  55. # Check to see whether a particular set of modules exists. Similar
  56. # to PKG_CHECK_MODULES(), but does not set variables or print errors.
  57. #
  58. #
  59. # Similar to PKG_CHECK_MODULES, make sure that the first instance of
  60. # this or PKG_CHECK_MODULES is called, or make sure to call
  61. # PKG_CHECK_EXISTS manually
  62. # --------------------------------------------------------------
  63. AC_DEFUN([PKG_CHECK_EXISTS],
  64. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  65. if test -n "$PKG_CONFIG" && \
  66. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  67. m4_ifval([$2], [$2], [:])
  68. m4_ifvaln([$3], [else
  69. $3])dnl
  70. fi])
  71. # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  72. # ---------------------------------------------
  73. m4_define([_PKG_CONFIG],
  74. [if test -n "$PKG_CONFIG"; then
  75. if test -n "$$1"; then
  76. pkg_cv_[]$1="$$1"
  77. else
  78. PKG_CHECK_EXISTS([$3],
  79. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
  80. [pkg_failed=yes])
  81. fi
  82. else
  83. pkg_failed=untried
  84. fi[]dnl
  85. ])# _PKG_CONFIG
  86. # _PKG_SHORT_ERRORS_SUPPORTED
  87. # -----------------------------
  88. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  89. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  90. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  91. _pkg_short_errors_supported=yes
  92. else
  93. _pkg_short_errors_supported=no
  94. fi[]dnl
  95. ])# _PKG_SHORT_ERRORS_SUPPORTED
  96. # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  97. # [ACTION-IF-NOT-FOUND])
  98. #
  99. #
  100. # Note that if there is a possibility the first call to
  101. # PKG_CHECK_MODULES might not happen, you should be sure to include an
  102. # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  103. #
  104. #
  105. # --------------------------------------------------------------
  106. AC_DEFUN([PKG_CHECK_MODULES],
  107. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  108. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  109. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  110. pkg_failed=no
  111. AC_MSG_CHECKING([for $1])
  112. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  113. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  114. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  115. and $1[]_LIBS to avoid the need to call pkg-config.
  116. See the pkg-config man page for more details.])
  117. if test $pkg_failed = yes; then
  118. _PKG_SHORT_ERRORS_SUPPORTED
  119. if test $_pkg_short_errors_supported = yes; then
  120. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
  121. else
  122. $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
  123. fi
  124. # Put the nasty error message in config.log where it belongs
  125. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  126. ifelse([$4], , [AC_MSG_ERROR(dnl
  127. [Package requirements ($2) were not met:
  128. $$1_PKG_ERRORS
  129. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  130. installed software in a non-standard prefix.
  131. _PKG_TEXT
  132. ])],
  133. [AC_MSG_RESULT([no])
  134. $4])
  135. elif test $pkg_failed = untried; then
  136. ifelse([$4], , [AC_MSG_FAILURE(dnl
  137. [The pkg-config script could not be found or is too old. Make sure it
  138. is in your PATH or set the PKG_CONFIG environment variable to the full
  139. path to pkg-config.
  140. _PKG_TEXT
  141. To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
  142. [$4])
  143. else
  144. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  145. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  146. AC_MSG_RESULT([yes])
  147. ifelse([$3], , :, [$3])
  148. fi[]dnl
  149. ])# PKG_CHECK_MODULES
  150. # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
  151. #
  152. # This file is free software; the Free Software Foundation
  153. # gives unlimited permission to copy and/or distribute it,
  154. # with or without modifications, as long as this notice is preserved.
  155. # AM_AUTOMAKE_VERSION(VERSION)
  156. # ----------------------------
  157. # Automake X.Y traces this macro to ensure aclocal.m4 has been
  158. # generated from the m4 files accompanying Automake X.Y.
  159. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
  160. # AM_SET_CURRENT_AUTOMAKE_VERSION
  161. # -------------------------------
  162. # Call AM_AUTOMAKE_VERSION so it can be traced.
  163. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
  164. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  165. [AM_AUTOMAKE_VERSION([1.9.6])])
  166. # AM_AUX_DIR_EXPAND -*- Autoconf -*-
  167. # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
  168. #
  169. # This file is free software; the Free Software Foundation
  170. # gives unlimited permission to copy and/or distribute it,
  171. # with or without modifications, as long as this notice is preserved.
  172. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
  173. # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
  174. # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
  175. #
  176. # Of course, Automake must honor this variable whenever it calls a
  177. # tool from the auxiliary directory. The problem is that $srcdir (and
  178. # therefore $ac_aux_dir as well) can be either absolute or relative,
  179. # depending on how configure is run. This is pretty annoying, since
  180. # it makes $ac_aux_dir quite unusable in subdirectories: in the top
  181. # source directory, any form will work fine, but in subdirectories a
  182. # relative path needs to be adjusted first.
  183. #
  184. # $ac_aux_dir/missing
  185. # fails when called from a subdirectory if $ac_aux_dir is relative
  186. # $top_srcdir/$ac_aux_dir/missing
  187. # fails if $ac_aux_dir is absolute,
  188. # fails when called from a subdirectory in a VPATH build with
  189. # a relative $ac_aux_dir
  190. #
  191. # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
  192. # are both prefixed by $srcdir. In an in-source build this is usually
  193. # harmless because $srcdir is `.', but things will broke when you
  194. # start a VPATH build or use an absolute $srcdir.
  195. #
  196. # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
  197. # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
  198. # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
  199. # and then we would define $MISSING as
  200. # MISSING="\${SHELL} $am_aux_dir/missing"
  201. # This will work as long as MISSING is not called from configure, because
  202. # unfortunately $(top_srcdir) has no meaning in configure.
  203. # However there are other variables, like CC, which are often used in
  204. # configure, and could therefore not use this "fixed" $ac_aux_dir.
  205. #
  206. # Another solution, used here, is to always expand $ac_aux_dir to an
  207. # absolute PATH. The drawback is that using absolute paths prevent a
  208. # configured tree to be moved without reconfiguration.
  209. AC_DEFUN([AM_AUX_DIR_EXPAND],
  210. [dnl Rely on autoconf to set up CDPATH properly.
  211. AC_PREREQ([2.50])dnl
  212. # expand $ac_aux_dir to an absolute path
  213. am_aux_dir=`cd $ac_aux_dir && pwd`
  214. ])
  215. # AM_CONDITIONAL -*- Autoconf -*-
  216. # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
  217. # Free Software Foundation, Inc.
  218. #
  219. # This file is free software; the Free Software Foundation
  220. # gives unlimited permission to copy and/or distribute it,
  221. # with or without modifications, as long as this notice is preserved.
  222. # serial 7
  223. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  224. # -------------------------------------
  225. # Define a conditional.
  226. AC_DEFUN([AM_CONDITIONAL],
  227. [AC_PREREQ(2.52)dnl
  228. ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  229. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  230. AC_SUBST([$1_TRUE])
  231. AC_SUBST([$1_FALSE])
  232. if $2; then
  233. $1_TRUE=
  234. $1_FALSE='#'
  235. else
  236. $1_TRUE='#'
  237. $1_FALSE=
  238. fi
  239. AC_CONFIG_COMMANDS_PRE(
  240. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  241. AC_MSG_ERROR([[conditional "$1" was never defined.
  242. Usually this means the macro was only invoked conditionally.]])
  243. fi])])
  244. # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
  245. # Free Software Foundation, Inc.
  246. #
  247. # This file is free software; the Free Software Foundation
  248. # gives unlimited permission to copy and/or distribute it,
  249. # with or without modifications, as long as this notice is preserved.
  250. # serial 8
  251. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
  252. # written in clear, in which case automake, when reading aclocal.m4,
  253. # will think it sees a *use*, and therefore will trigger all it's
  254. # C support machinery. Also note that it means that autoscan, seeing
  255. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  256. # _AM_DEPENDENCIES(NAME)
  257. # ----------------------
  258. # See how the compiler implements dependency checking.
  259. # NAME is "CC", "CXX", "GCJ", or "OBJC".
  260. # We try a few techniques and use that to set a single cache variable.
  261. #
  262. # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  263. # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  264. # dependency, and given that the user is not expected to run this macro,
  265. # just rely on AC_PROG_CC.
  266. AC_DEFUN([_AM_DEPENDENCIES],
  267. [AC_REQUIRE([AM_SET_DEPDIR])dnl
  268. AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  269. AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  270. AC_REQUIRE([AM_DEP_TRACK])dnl
  271. ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
  272. [$1], CXX, [depcc="$CXX" am_compiler_list=],
  273. [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  274. [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
  275. [depcc="$$1" am_compiler_list=])
  276. AC_CACHE_CHECK([dependency style of $depcc],
  277. [am_cv_$1_dependencies_compiler_type],
  278. [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  279. # We make a subdir and do the tests there. Otherwise we can end up
  280. # making bogus files that we don't know about and never remove. For
  281. # instance it was reported that on HP-UX the gcc test will end up
  282. # making a dummy file named `D' -- because `-MD' means `put the output
  283. # in D'.
  284. mkdir conftest.dir
  285. # Copy depcomp to subdir because otherwise we won't find it if we're
  286. # using a relative directory.
  287. cp "$am_depcomp" conftest.dir
  288. cd conftest.dir
  289. # We will build objects and dependencies in a subdirectory because
  290. # it helps to detect inapplicable dependency modes. For instance
  291. # both Tru64's cc and ICC support -MD to output dependencies as a
  292. # side effect of compilation, but ICC will put the dependencies in
  293. # the current directory while Tru64 will put them in the object
  294. # directory.
  295. mkdir sub
  296. am_cv_$1_dependencies_compiler_type=none
  297. if test "$am_compiler_list" = ""; then
  298. am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  299. fi
  300. for depmode in $am_compiler_list; do
  301. # Setup a source with many dependencies, because some compilers
  302. # like to wrap large dependency lists on column 80 (with \), and
  303. # we should not choose a depcomp mode which is confused by this.
  304. #
  305. # We need to recreate these files for each test, as the compiler may
  306. # overwrite some of them when testing with obscure command lines.
  307. # This happens at least with the AIX C compiler.
  308. : > sub/conftest.c
  309. for i in 1 2 3 4 5 6; do
  310. echo '#include "conftst'$i'.h"' >> sub/conftest.c
  311. # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
  312. # Solaris 8's {/usr,}/bin/sh.
  313. touch sub/conftst$i.h
  314. done
  315. echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  316. case $depmode in
  317. nosideeffect)
  318. # after this tag, mechanisms are not by side-effect, so they'll
  319. # only be used when explicitly requested
  320. if test "x$enable_dependency_tracking" = xyes; then
  321. continue
  322. else
  323. break
  324. fi
  325. ;;
  326. none) break ;;
  327. esac
  328. # We check with `-c' and `-o' for the sake of the "dashmstdout"
  329. # mode. It turns out that the SunPro C++ compiler does not properly
  330. # handle `-M -o', and we need to detect this.
  331. if depmode=$depmode \
  332. source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
  333. depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  334. $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
  335. >/dev/null 2>conftest.err &&
  336. grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  337. grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
  338. ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  339. # icc doesn't choke on unknown options, it will just issue warnings
  340. # or remarks (even with -Werror). So we grep stderr for any message
  341. # that says an option was ignored or not supported.
  342. # When given -MP, icc 7.0 and 7.1 complain thusly:
  343. # icc: Command line warning: ignoring option '-M'; no argument required
  344. # The diagnosis changed in icc 8.0:
  345. # icc: Command line remark: option '-MP' not supported
  346. if (grep 'ignoring option' conftest.err ||
  347. grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
  348. am_cv_$1_dependencies_compiler_type=$depmode
  349. break
  350. fi
  351. fi
  352. done
  353. cd ..
  354. rm -rf conftest.dir
  355. else
  356. am_cv_$1_dependencies_compiler_type=none
  357. fi
  358. ])
  359. AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  360. AM_CONDITIONAL([am__fastdep$1], [
  361. test "x$enable_dependency_tracking" != xno \
  362. && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  363. ])
  364. # AM_SET_DEPDIR
  365. # -------------
  366. # Choose a directory name for dependency files.
  367. # This macro is AC_REQUIREd in _AM_DEPENDENCIES
  368. AC_DEFUN([AM_SET_DEPDIR],
  369. [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  370. AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  371. ])
  372. # AM_DEP_TRACK
  373. # ------------
  374. AC_DEFUN([AM_DEP_TRACK],
  375. [AC_ARG_ENABLE(dependency-tracking,
  376. [ --disable-dependency-tracking speeds up one-time build
  377. --enable-dependency-tracking do not reject slow dependency extractors])
  378. if test "x$enable_dependency_tracking" != xno; then
  379. am_depcomp="$ac_aux_dir/depcomp"
  380. AMDEPBACKSLASH='\'
  381. fi
  382. AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  383. AC_SUBST([AMDEPBACKSLASH])
  384. ])
  385. # Generate code to set up dependency tracking. -*- Autoconf -*-
  386. # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
  387. # Free Software Foundation, Inc.
  388. #
  389. # This file is free software; the Free Software Foundation
  390. # gives unlimited permission to copy and/or distribute it,
  391. # with or without modifications, as long as this notice is preserved.
  392. #serial 3
  393. # _AM_OUTPUT_DEPENDENCY_COMMANDS
  394. # ------------------------------
  395. AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  396. [for mf in $CONFIG_FILES; do
  397. # Strip MF so we end up with the name of the file.
  398. mf=`echo "$mf" | sed -e 's/:.*$//'`
  399. # Check whether this is an Automake generated Makefile or not.
  400. # We used to match only the files named `Makefile.in', but
  401. # some people rename them; so instead we look at the file content.
  402. # Grep'ing the first line is not enough: some people post-process
  403. # each Makefile.in and add a new line on top of each file to say so.
  404. # So let's grep whole file.
  405. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
  406. dirpart=`AS_DIRNAME("$mf")`
  407. else
  408. continue
  409. fi
  410. # Extract the definition of DEPDIR, am__include, and am__quote
  411. # from the Makefile without running `make'.
  412. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
  413. test -z "$DEPDIR" && continue
  414. am__include=`sed -n 's/^am__include = //p' < "$mf"`
  415. test -z "am__include" && continue
  416. am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
  417. # When using ansi2knr, U may be empty or an underscore; expand it
  418. U=`sed -n 's/^U = //p' < "$mf"`
  419. # Find all dependency output files, they are included files with
  420. # $(DEPDIR) in their names. We invoke sed twice because it is the
  421. # simplest approach to changing $(DEPDIR) to its actual value in the
  422. # expansion.
  423. for file in `sed -n "
  424. s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
  425. sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
  426. # Make sure the directory exists.
  427. test -f "$dirpart/$file" && continue
  428. fdir=`AS_DIRNAME(["$file"])`
  429. AS_MKDIR_P([$dirpart/$fdir])
  430. # echo "creating $dirpart/$file"
  431. echo '# dummy' > "$dirpart/$file"
  432. done
  433. done
  434. ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  435. # AM_OUTPUT_DEPENDENCY_COMMANDS
  436. # -----------------------------
  437. # This macro should only be invoked once -- use via AC_REQUIRE.
  438. #
  439. # This code is only required when automatic dependency tracking
  440. # is enabled. FIXME. This creates each `.P' file that we will
  441. # need in order to bootstrap the dependency handling code.
  442. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  443. [AC_CONFIG_COMMANDS([depfiles],
  444. [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  445. [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  446. ])
  447. # Do all the work for Automake. -*- Autoconf -*-
  448. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
  449. # Free Software Foundation, Inc.
  450. #
  451. # This file is free software; the Free Software Foundation
  452. # gives unlimited permission to copy and/or distribute it,
  453. # with or without modifications, as long as this notice is preserved.
  454. # serial 12
  455. # This macro actually does too much. Some checks are only needed if
  456. # your package does certain things. But this isn't really a big deal.
  457. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  458. # AM_INIT_AUTOMAKE([OPTIONS])
  459. # -----------------------------------------------
  460. # The call with PACKAGE and VERSION arguments is the old style
  461. # call (pre autoconf-2.50), which is being phased out. PACKAGE
  462. # and VERSION should now be passed to AC_INIT and removed from
  463. # the call to AM_INIT_AUTOMAKE.
  464. # We support both call styles for the transition. After
  465. # the next Automake release, Autoconf can make the AC_INIT
  466. # arguments mandatory, and then we can depend on a new Autoconf
  467. # release and drop the old call support.
  468. AC_DEFUN([AM_INIT_AUTOMAKE],
  469. [AC_PREREQ([2.58])dnl
  470. dnl Autoconf wants to disallow AM_ names. We explicitly allow
  471. dnl the ones we care about.
  472. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  473. AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  474. AC_REQUIRE([AC_PROG_INSTALL])dnl
  475. # test to see if srcdir already configured
  476. if test "`cd $srcdir && pwd`" != "`pwd`" &&
  477. test -f $srcdir/config.status; then
  478. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  479. fi
  480. # test whether we have cygpath
  481. if test -z "$CYGPATH_W"; then
  482. if (cygpath --version) >/dev/null 2>/dev/null; then
  483. CYGPATH_W='cygpath -w'
  484. else
  485. CYGPATH_W=echo
  486. fi
  487. fi
  488. AC_SUBST([CYGPATH_W])
  489. # Define the identity of the package.
  490. dnl Distinguish between old-style and new-style calls.
  491. m4_ifval([$2],
  492. [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  493. AC_SUBST([PACKAGE], [$1])dnl
  494. AC_SUBST([VERSION], [$2])],
  495. [_AM_SET_OPTIONS([$1])dnl
  496. AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  497. AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  498. _AM_IF_OPTION([no-define],,
  499. [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  500. AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
  501. # Some tools Automake needs.
  502. AC_REQUIRE([AM_SANITY_CHECK])dnl
  503. AC_REQUIRE([AC_ARG_PROGRAM])dnl
  504. AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
  505. AM_MISSING_PROG(AUTOCONF, autoconf)
  506. AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
  507. AM_MISSING_PROG(AUTOHEADER, autoheader)
  508. AM_MISSING_PROG(MAKEINFO, makeinfo)
  509. AM_PROG_INSTALL_SH
  510. AM_PROG_INSTALL_STRIP
  511. AC_REQUIRE([AM_PROG_MKDIR_P])dnl
  512. # We need awk for the "check" target. The system "awk" is bad on
  513. # some platforms.
  514. AC_REQUIRE([AC_PROG_AWK])dnl
  515. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  516. AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  517. _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  518. [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  519. [_AM_PROG_TAR([v7])])])
  520. _AM_IF_OPTION([no-dependencies],,
  521. [AC_PROVIDE_IFELSE([AC_PROG_CC],
  522. [_AM_DEPENDENCIES(CC)],
  523. [define([AC_PROG_CC],
  524. defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
  525. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  526. [_AM_DEPENDENCIES(CXX)],
  527. [define([AC_PROG_CXX],
  528. defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
  529. ])
  530. ])
  531. # When config.status generates a header, we must update the stamp-h file.
  532. # This file resides in the same directory as the config header
  533. # that is generated. The stamp files are numbered to have different names.
  534. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  535. # loop where config.status creates the headers, so we can generate
  536. # our stamp files there.
  537. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  538. [# Compute $1's index in $config_headers.
  539. _am_stamp_count=1
  540. for _am_header in $config_headers :; do
  541. case $_am_header in
  542. $1 | $1:* )
  543. break ;;
  544. * )
  545. _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  546. esac
  547. done
  548. echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
  549. # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
  550. #
  551. # This file is free software; the Free Software Foundation
  552. # gives unlimited permission to copy and/or distribute it,
  553. # with or without modifications, as long as this notice is preserved.
  554. # AM_PROG_INSTALL_SH
  555. # ------------------
  556. # Define $install_sh.
  557. AC_DEFUN([AM_PROG_INSTALL_SH],
  558. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  559. install_sh=${install_sh-"$am_aux_dir/install-sh"}
  560. AC_SUBST(install_sh)])
  561. # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
  562. #
  563. # This file is free software; the Free Software Foundation
  564. # gives unlimited permission to copy and/or distribute it,
  565. # with or without modifications, as long as this notice is preserved.
  566. # serial 2
  567. # Check whether the underlying file-system supports filenames
  568. # with a leading dot. For instance MS-DOS doesn't.
  569. AC_DEFUN([AM_SET_LEADING_DOT],
  570. [rm -rf .tst 2>/dev/null
  571. mkdir .tst 2>/dev/null
  572. if test -d .tst; then
  573. am__leading_dot=.
  574. else
  575. am__leading_dot=_
  576. fi
  577. rmdir .tst 2>/dev/null
  578. AC_SUBST([am__leading_dot])])
  579. # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
  580. # From Jim Meyering
  581. # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
  582. # Free Software Foundation, Inc.
  583. #
  584. # This file is free software; the Free Software Foundation
  585. # gives unlimited permission to copy and/or distribute it,
  586. # with or without modifications, as long as this notice is preserved.
  587. # serial 4
  588. AC_DEFUN([AM_MAINTAINER_MODE],
  589. [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  590. dnl maintainer-mode is disabled by default
  591. AC_ARG_ENABLE(maintainer-mode,
  592. [ --enable-maintainer-mode enable make rules and dependencies not useful
  593. (and sometimes confusing) to the casual installer],
  594. USE_MAINTAINER_MODE=$enableval,
  595. USE_MAINTAINER_MODE=no)
  596. AC_MSG_RESULT([$USE_MAINTAINER_MODE])
  597. AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
  598. MAINT=$MAINTAINER_MODE_TRUE
  599. AC_SUBST(MAINT)dnl
  600. ]
  601. )
  602. AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
  603. # Check to see how 'make' treats includes. -*- Autoconf -*-
  604. # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
  605. #
  606. # This file is free software; the Free Software Foundation
  607. # gives unlimited permission to copy and/or distribute it,
  608. # with or without modifications, as long as this notice is preserved.
  609. # serial 3
  610. # AM_MAKE_INCLUDE()
  611. # -----------------
  612. # Check to see how make treats includes.
  613. AC_DEFUN([AM_MAKE_INCLUDE],
  614. [am_make=${MAKE-make}
  615. cat > confinc << 'END'
  616. am__doit:
  617. @echo done
  618. .PHONY: am__doit
  619. END
  620. # If we don't find an include directive, just comment out the code.
  621. AC_MSG_CHECKING([for style of include used by $am_make])
  622. am__include="#"
  623. am__quote=
  624. _am_result=none
  625. # First try GNU make style include.
  626. echo "include confinc" > confmf
  627. # We grep out `Entering directory' and `Leaving directory'
  628. # messages which can occur if `w' ends up in MAKEFLAGS.
  629. # In particular we don't look at `^make:' because GNU make might
  630. # be invoked under some other name (usually "gmake"), in which
  631. # case it prints its new name instead of `make'.
  632. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
  633. am__include=include
  634. am__quote=
  635. _am_result=GNU
  636. fi
  637. # Now try BSD make style include.
  638. if test "$am__include" = "#"; then
  639. echo '.include "confinc"' > confmf
  640. if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
  641. am__include=.include
  642. am__quote="\""
  643. _am_result=BSD
  644. fi
  645. fi
  646. AC_SUBST([am__include])
  647. AC_SUBST([am__quote])
  648. AC_MSG_RESULT([$_am_result])
  649. rm -f confinc confmf
  650. ])
  651. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  652. # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
  653. # Free Software Foundation, Inc.
  654. #
  655. # This file is free software; the Free Software Foundation
  656. # gives unlimited permission to copy and/or distribute it,
  657. # with or without modifications, as long as this notice is preserved.
  658. # serial 4
  659. # AM_MISSING_PROG(NAME, PROGRAM)
  660. # ------------------------------
  661. AC_DEFUN([AM_MISSING_PROG],
  662. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  663. $1=${$1-"${am_missing_run}$2"}
  664. AC_SUBST($1)])
  665. # AM_MISSING_HAS_RUN
  666. # ------------------
  667. # Define MISSING if not defined so far and test if it supports --run.
  668. # If it does, set am_missing_run to use it, otherwise, to nothing.
  669. AC_DEFUN([AM_MISSING_HAS_RUN],
  670. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  671. test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
  672. # Use eval to expand $SHELL
  673. if eval "$MISSING --run true"; then
  674. am_missing_run="$MISSING --run "
  675. else
  676. am_missing_run=
  677. AC_MSG_WARN([`missing' script is too old or missing])
  678. fi
  679. ])
  680. # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
  681. #
  682. # This file is free software; the Free Software Foundation
  683. # gives unlimited permission to copy and/or distribute it,
  684. # with or without modifications, as long as this notice is preserved.
  685. # AM_PROG_MKDIR_P
  686. # ---------------
  687. # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
  688. #
  689. # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
  690. # created by `make install' are always world readable, even if the
  691. # installer happens to have an overly restrictive umask (e.g. 077).
  692. # This was a mistake. There are at least two reasons why we must not
  693. # use `-m 0755':
  694. # - it causes special bits like SGID to be ignored,
  695. # - it may be too restrictive (some setups expect 775 directories).
  696. #
  697. # Do not use -m 0755 and let people choose whatever they expect by
  698. # setting umask.
  699. #
  700. # We cannot accept any implementation of `mkdir' that recognizes `-p'.
  701. # Some implementations (such as Solaris 8's) are not thread-safe: if a
  702. # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
  703. # concurrently, both version can detect that a/ is missing, but only
  704. # one can create it and the other will error out. Consequently we
  705. # restrict ourselves to GNU make (using the --version option ensures
  706. # this.)
  707. AC_DEFUN([AM_PROG_MKDIR_P],
  708. [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
  709. # We used to keeping the `.' as first argument, in order to
  710. # allow $(mkdir_p) to be used without argument. As in
  711. # $(mkdir_p) $(somedir)
  712. # where $(somedir) is conditionally defined. However this is wrong
  713. # for two reasons:
  714. # 1. if the package is installed by a user who cannot write `.'
  715. # make install will fail,
  716. # 2. the above comment should most certainly read
  717. # $(mkdir_p) $(DESTDIR)$(somedir)
  718. # so it does not work when $(somedir) is undefined and
  719. # $(DESTDIR) is not.
  720. # To support the latter case, we have to write
  721. # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
  722. # so the `.' trick is pointless.
  723. mkdir_p='mkdir -p --'
  724. else
  725. # On NextStep and OpenStep, the `mkdir' command does not
  726. # recognize any option. It will interpret all options as
  727. # directories to create, and then abort because `.' already
  728. # exists.
  729. for d in ./-p ./--version;
  730. do
  731. test -d $d && rmdir $d
  732. done
  733. # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
  734. if test -f "$ac_aux_dir/mkinstalldirs"; then
  735. mkdir_p='$(mkinstalldirs)'
  736. else
  737. mkdir_p='$(SHELL) $(install_sh) -d'
  738. fi
  739. fi
  740. AC_SUBST([mkdir_p])])
  741. # Helper functions for option handling. -*- Autoconf -*-
  742. # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
  743. #
  744. # This file is free software; the Free Software Foundation
  745. # gives unlimited permission to copy and/or distribute it,
  746. # with or without modifications, as long as this notice is preserved.
  747. # serial 3
  748. # _AM_MANGLE_OPTION(NAME)
  749. # -----------------------
  750. AC_DEFUN([_AM_MANGLE_OPTION],
  751. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  752. # _AM_SET_OPTION(NAME)
  753. # ------------------------------
  754. # Set option NAME. Presently that only means defining a flag for this option.
  755. AC_DEFUN([_AM_SET_OPTION],
  756. [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
  757. # _AM_SET_OPTIONS(OPTIONS)
  758. # ----------------------------------
  759. # OPTIONS is a space-separated list of Automake options.
  760. AC_DEFUN([_AM_SET_OPTIONS],
  761. [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  762. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  763. # -------------------------------------------
  764. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  765. AC_DEFUN([_AM_IF_OPTION],
  766. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  767. # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
  768. #
  769. # This file is free software; the Free Software Foundation
  770. # gives unlimited permission to copy and/or distribute it,
  771. # with or without modifications, as long as this notice is preserved.
  772. # AM_PROG_INSTALL_STRIP
  773. # ---------------------
  774. # One issue with vendor `install' (even GNU) is that you can't
  775. # specify the program used to strip binaries. This is especially
  776. # annoying in cross-compiling environments, where the build's strip
  777. # is unlikely to handle the host's binaries.
  778. # Fortunately install-sh will honor a STRIPPROG variable, so we
  779. # always use install-sh in `make install-strip', and initialize
  780. # STRIPPROG with the value of the STRIP variable (set by the user).
  781. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  782. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  783. # Installed binaries are usually stripped using `strip' when the user
  784. # run `make install-strip'. However `strip' might not be the right
  785. # tool to use in cross-compilation environments, therefore Automake
  786. # will honor the `STRIP' environment variable to overrule this program.
  787. dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
  788. if test "$cross_compiling" != no; then
  789. AC_CHECK_TOOL([STRIP], [strip], :)
  790. fi
  791. INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
  792. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  793. # Check how to create a tarball. -*- Autoconf -*-
  794. # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
  795. #
  796. # This file is free software; the Free Software Foundation
  797. # gives unlimited permission to copy and/or distribute it,
  798. # with or without modifications, as long as this notice is preserved.
  799. # serial 2
  800. # _AM_PROG_TAR(FORMAT)
  801. # --------------------
  802. # Check how to create a tarball in format FORMAT.
  803. # FORMAT should be one of `v7', `ustar', or `pax'.
  804. #
  805. # Substitute a variable $(am__tar) that is a command
  806. # writing to stdout a FORMAT-tarball containing the directory
  807. # $tardir.
  808. # tardir=directory && $(am__tar) > result.tar
  809. #
  810. # Substitute a variable $(am__untar) that extract such
  811. # a tarball read from stdin.
  812. # $(am__untar) < result.tar
  813. AC_DEFUN([_AM_PROG_TAR],
  814. [# Always define AMTAR for backward compatibility.
  815. AM_MISSING_PROG([AMTAR], [tar])
  816. m4_if([$1], [v7],
  817. [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
  818. [m4_case([$1], [ustar],, [pax],,
  819. [m4_fatal([Unknown tar format])])
  820. AC_MSG_CHECKING([how to create a $1 tar archive])
  821. # Loop over all known methods to create a tar archive until one works.
  822. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  823. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  824. # Do not fold the above two line into one, because Tru64 sh and
  825. # Solaris sh will not grok spaces in the rhs of `-'.
  826. for _am_tool in $_am_tools
  827. do
  828. case $_am_tool in
  829. gnutar)
  830. for _am_tar in tar gnutar gtar;
  831. do
  832. AM_RUN_LOG([$_am_tar --version]) && break
  833. done
  834. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  835. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  836. am__untar="$_am_tar -xf -"
  837. ;;
  838. plaintar)
  839. # Must skip GNU tar: if it does not support --format= it doesn't create
  840. # ustar tarball either.
  841. (tar --version) >/dev/null 2>&1 && continue
  842. am__tar='tar chf - "$$tardir"'
  843. am__tar_='tar chf - "$tardir"'
  844. am__untar='tar xf -'
  845. ;;
  846. pax)
  847. am__tar='pax -L -x $1 -w "$$tardir"'
  848. am__tar_='pax -L -x $1 -w "$tardir"'
  849. am__untar='pax -r'
  850. ;;
  851. cpio)
  852. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  853. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  854. am__untar='cpio -i -H $1 -d'
  855. ;;
  856. none)
  857. am__tar=false
  858. am__tar_=false
  859. am__untar=false
  860. ;;
  861. esac
  862. # If the value was cached, stop now. We just wanted to have am__tar
  863. # and am__untar set.
  864. test -n "${am_cv_prog_tar_$1}" && break
  865. # tar/untar a dummy directory, and stop if the command works
  866. rm -rf conftest.dir
  867. mkdir conftest.dir
  868. echo GrepMe > conftest.dir/file
  869. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  870. rm -rf conftest.dir
  871. if test -s conftest.tar; then
  872. AM_RUN_LOG([$am__untar <conftest.tar])
  873. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  874. fi
  875. done
  876. rm -rf conftest.dir
  877. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  878. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  879. AC_SUBST([am__tar])
  880. AC_SUBST([am__untar])
  881. ]) # _AM_PROG_TAR
  882. dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
  883. dnl
  884. dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
  885. dnl
  886. dnl Permission is hereby granted, free of charge, to any person obtaining a
  887. dnl copy of this software and associated documentation files (the "Software"),
  888. dnl to deal in the Software without restriction, including without limitation
  889. dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
  890. dnl and/or sell copies of the Software, and to permit persons to whom the
  891. dnl Software is furnished to do so, subject to the following conditions:
  892. dnl
  893. dnl The above copyright notice and this permission notice (including the next
  894. dnl paragraph) shall be included in all copies or substantial portions of the
  895. dnl Software.
  896. dnl
  897. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  898. dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  899. dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  900. dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  901. dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  902. dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  903. dnl DEALINGS IN THE SOFTWARE.
  904. # XORG_MACROS_VERSION(required-version)
  905. # -------------------------------------
  906. # Minimum version: 1.1.0
  907. #
  908. # If you're using a macro added in Version 1.1 or newer, include this in
  909. # your configure.ac with the minimum required version, such as:
  910. # XORG_MACROS_VERSION(1.1)
  911. #
  912. # To ensure that this macro is defined, also add:
  913. # m4_ifndef([XORG_MACROS_VERSION],
  914. # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
  915. #
  916. #
  917. # See the "minimum version" comment for each macro you use to see what
  918. # version you require.
  919. m4_defun([XORG_MACROS_VERSION],[
  920. m4_define([vers_have], [1.11.0])
  921. m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
  922. m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
  923. m4_if(m4_cmp(maj_have, maj_needed), 0,,
  924. [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
  925. m4_if(m4_version_compare(vers_have, [$1]), -1,
  926. [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
  927. m4_undefine([vers_have])
  928. m4_undefine([maj_have])
  929. m4_undefine([maj_needed])
  930. ]) # XORG_MACROS_VERSION
  931. # XORG_PROG_RAWCPP()
  932. # ------------------
  933. # Minimum version: 1.0.0
  934. #
  935. # Find cpp program and necessary flags for use in pre-processing text files
  936. # such as man pages and config files
  937. AC_DEFUN([XORG_PROG_RAWCPP],[
  938. AC_REQUIRE([AC_PROG_CPP])
  939. AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
  940. [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
  941. # Check for flag to avoid builtin definitions - assumes unix is predefined,
  942. # which is not the best choice for supporting other OS'es, but covers most
  943. # of the ones we need for now.
  944. AC_MSG_CHECKING([if $RAWCPP requires -undef])
  945. AC_LANG_CONFTEST([Does cpp redefine unix ?])
  946. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  947. AC_MSG_RESULT([no])
  948. else
  949. if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  950. RAWCPPFLAGS=-undef
  951. AC_MSG_RESULT([yes])
  952. # under Cygwin unix is still defined even with -undef
  953. elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  954. RAWCPPFLAGS="-undef -ansi"
  955. AC_MSG_RESULT([yes, with -ansi])
  956. else
  957. AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
  958. fi
  959. fi
  960. rm -f conftest.$ac_ext
  961. AC_MSG_CHECKING([if $RAWCPP requires -traditional])
  962. AC_LANG_CONFTEST([Does cpp preserve "whitespace"?])
  963. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  964. AC_MSG_RESULT([no])
  965. else
  966. if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  967. RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
  968. AC_MSG_RESULT([yes])
  969. else
  970. AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
  971. fi
  972. fi
  973. rm -f conftest.$ac_ext
  974. AC_SUBST(RAWCPPFLAGS)
  975. ]) # XORG_PROG_RAWCPP
  976. # XORG_MANPAGE_SECTIONS()
  977. # -----------------------
  978. # Minimum version: 1.0.0
  979. #
  980. # Determine which sections man pages go in for the different man page types
  981. # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
  982. # Not sure if there's any better way than just hardcoding by OS name.
  983. # Override default settings by setting environment variables
  984. # Added MAN_SUBSTS in version 1.8
  985. # Added AC_PROG_SED in version 1.8
  986. AC_DEFUN([XORG_MANPAGE_SECTIONS],[
  987. AC_REQUIRE([AC_CANONICAL_HOST])
  988. AC_REQUIRE([AC_PROG_SED])
  989. if test x$APP_MAN_SUFFIX = x ; then
  990. APP_MAN_SUFFIX=1
  991. fi
  992. if test x$APP_MAN_DIR = x ; then
  993. APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
  994. fi
  995. if test x$LIB_MAN_SUFFIX = x ; then
  996. LIB_MAN_SUFFIX=3
  997. fi
  998. if test x$LIB_MAN_DIR = x ; then
  999. LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
  1000. fi
  1001. if test x$FILE_MAN_SUFFIX = x ; then
  1002. case $host_os in
  1003. solaris*) FILE_MAN_SUFFIX=4 ;;
  1004. *) FILE_MAN_SUFFIX=5 ;;
  1005. esac
  1006. fi
  1007. if test x$FILE_MAN_DIR = x ; then
  1008. FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
  1009. fi
  1010. if test x$MISC_MAN_SUFFIX = x ; then
  1011. case $host_os in
  1012. solaris*) MISC_MAN_SUFFIX=5 ;;
  1013. *) MISC_MAN_SUFFIX=7 ;;
  1014. esac
  1015. fi
  1016. if test x$MISC_MAN_DIR = x ; then
  1017. MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
  1018. fi
  1019. if test x$DRIVER_MAN_SUFFIX = x ; then
  1020. case $host_os in
  1021. solaris*) DRIVER_MAN_SUFFIX=7 ;;
  1022. *) DRIVER_MAN_SUFFIX=4 ;;
  1023. esac
  1024. fi
  1025. if test x$DRIVER_MAN_DIR = x ; then
  1026. DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
  1027. fi
  1028. if test x$ADMIN_MAN_SUFFIX = x ; then
  1029. case $host_os in
  1030. solaris*) ADMIN_MAN_SUFFIX=1m ;;
  1031. *) ADMIN_MAN_SUFFIX=8 ;;
  1032. esac
  1033. fi
  1034. if test x$ADMIN_MAN_DIR = x ; then
  1035. ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
  1036. fi
  1037. AC_SUBST([APP_MAN_SUFFIX])
  1038. AC_SUBST([LIB_MAN_SUFFIX])
  1039. AC_SUBST([FILE_MAN_SUFFIX])
  1040. AC_SUBST([MISC_MAN_SUFFIX])
  1041. AC_SUBST([DRIVER_MAN_SUFFIX])
  1042. AC_SUBST([ADMIN_MAN_SUFFIX])
  1043. AC_SUBST([APP_MAN_DIR])
  1044. AC_SUBST([LIB_MAN_DIR])
  1045. AC_SUBST([FILE_MAN_DIR])
  1046. AC_SUBST([MISC_MAN_DIR])
  1047. AC_SUBST([DRIVER_MAN_DIR])
  1048. AC_SUBST([ADMIN_MAN_DIR])
  1049. XORG_MAN_PAGE="X Version 11"
  1050. AC_SUBST([XORG_MAN_PAGE])
  1051. MAN_SUBSTS="\
  1052. -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1053. -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1054. -e 's|__xservername__|Xorg|g' \
  1055. -e 's|__xconfigfile__|xorg.conf|g' \
  1056. -e 's|__projectroot__|\$(prefix)|g' \
  1057. -e 's|__apploaddir__|\$(appdefaultdir)|g' \
  1058. -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
  1059. -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
  1060. -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
  1061. -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
  1062. -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
  1063. -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
  1064. AC_SUBST([MAN_SUBSTS])
  1065. ]) # XORG_MANPAGE_SECTIONS
  1066. # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
  1067. # ------------------------
  1068. # Minimum version: 1.7.0
  1069. #
  1070. # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
  1071. # provided by xorg-sgml-doctools, if installed.
  1072. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
  1073. AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
  1074. XORG_SGML_PATH=
  1075. PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
  1076. [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
  1077. [m4_ifval([$1],[:],
  1078. [if test x"$cross_compiling" != x"yes" ; then
  1079. AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
  1080. [XORG_SGML_PATH=$prefix/share/sgml])
  1081. fi])
  1082. ])
  1083. # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
  1084. # the path and the name of the doc stylesheet
  1085. if test "x$XORG_SGML_PATH" != "x" ; then
  1086. AC_MSG_RESULT([$XORG_SGML_PATH])
  1087. STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
  1088. XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
  1089. else
  1090. AC_MSG_RESULT([no])
  1091. fi
  1092. AC_SUBST(XORG_SGML_PATH)
  1093. AC_SUBST(STYLESHEET_SRCDIR)
  1094. AC_SUBST(XSL_STYLESHEET)
  1095. AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
  1096. ]) # XORG_CHECK_SGML_DOCTOOLS
  1097. # XORG_CHECK_LINUXDOC
  1098. # -------------------
  1099. # Minimum version: 1.0.0
  1100. #
  1101. # Defines the variable MAKE_TEXT if the necessary tools and
  1102. # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
  1103. # Whether or not the necessary tools and files are found can be checked
  1104. # with the AM_CONDITIONAL "BUILD_LINUXDOC"
  1105. AC_DEFUN([XORG_CHECK_LINUXDOC],[
  1106. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1107. AC_REQUIRE([XORG_WITH_PS2PDF])
  1108. AC_PATH_PROG(LINUXDOC, linuxdoc)
  1109. AC_MSG_CHECKING([whether to build documentation])
  1110. if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
  1111. BUILDDOC=yes
  1112. else
  1113. BUILDDOC=no
  1114. fi
  1115. AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
  1116. AC_MSG_RESULT([$BUILDDOC])
  1117. AC_MSG_CHECKING([whether to build pdf documentation])
  1118. if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
  1119. BUILDPDFDOC=yes
  1120. else
  1121. BUILDPDFDOC=no
  1122. fi
  1123. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1124. AC_MSG_RESULT([$BUILDPDFDOC])
  1125. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
  1126. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
  1127. MAKE_PDF="$PS2PDF"
  1128. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
  1129. AC_SUBST(MAKE_TEXT)
  1130. AC_SUBST(MAKE_PS)
  1131. AC_SUBST(MAKE_PDF)
  1132. AC_SUBST(MAKE_HTML)
  1133. ]) # XORG_CHECK_LINUXDOC
  1134. # XORG_CHECK_DOCBOOK
  1135. # -------------------
  1136. # Minimum version: 1.0.0
  1137. #
  1138. # Checks for the ability to build output formats from SGML DocBook source.
  1139. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
  1140. # indicates whether the necessary tools and files are found and, if set,
  1141. # $(MAKE_XXX) blah.sgml will produce blah.xxx.
  1142. AC_DEFUN([XORG_CHECK_DOCBOOK],[
  1143. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1144. BUILDTXTDOC=no
  1145. BUILDPDFDOC=no
  1146. BUILDPSDOC=no
  1147. BUILDHTMLDOC=no
  1148. AC_PATH_PROG(DOCBOOKPS, docbook2ps)
  1149. AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
  1150. AC_PATH_PROG(DOCBOOKHTML, docbook2html)
  1151. AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
  1152. AC_MSG_CHECKING([whether to build text documentation])
  1153. if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
  1154. test x$BUILD_TXTDOC != xno; then
  1155. BUILDTXTDOC=yes
  1156. fi
  1157. AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
  1158. AC_MSG_RESULT([$BUILDTXTDOC])
  1159. AC_MSG_CHECKING([whether to build PDF documentation])
  1160. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
  1161. test x$BUILD_PDFDOC != xno; then
  1162. BUILDPDFDOC=yes
  1163. fi
  1164. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1165. AC_MSG_RESULT([$BUILDPDFDOC])
  1166. AC_MSG_CHECKING([whether to build PostScript documentation])
  1167. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
  1168. test x$BUILD_PSDOC != xno; then
  1169. BUILDPSDOC=yes
  1170. fi
  1171. AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
  1172. AC_MSG_RESULT([$BUILDPSDOC])
  1173. AC_MSG_CHECKING([whether to build HTML documentation])
  1174. if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
  1175. test x$BUILD_HTMLDOC != xno; then
  1176. BUILDHTMLDOC=yes
  1177. fi
  1178. AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
  1179. AC_MSG_RESULT([$BUILDHTMLDOC])
  1180. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
  1181. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
  1182. MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
  1183. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
  1184. AC_SUBST(MAKE_TEXT)
  1185. AC_SUBST(MAKE_PS)
  1186. AC_SUBST(MAKE_PDF)
  1187. AC_SUBST(MAKE_HTML)
  1188. ]) # XORG_CHECK_DOCBOOK
  1189. # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
  1190. # ----------------
  1191. # Minimum version: 1.5.0
  1192. # Minimum version for optional DEFAULT argument: 1.11.0
  1193. #
  1194. # Documentation tools are not always available on all platforms and sometimes
  1195. # not at the appropriate level. This macro enables a module to test for the
  1196. # presence of the tool and obtain it's path in separate variables. Coupled with
  1197. # the --with-xmlto option, it allows maximum flexibilty in making decisions
  1198. # as whether or not to use the xmlto package. When DEFAULT is not specified,
  1199. # --with-xmlto assumes 'auto'.
  1200. #
  1201. # Interface to module:
  1202. # HAVE_XMLTO: used in makefiles to conditionally generate documentation
  1203. # XMLTO: returns the path of the xmlto program found
  1204. # returns the path set by the user in the environment
  1205. # --with-xmlto: 'yes' user instructs the module to use xmlto
  1206. # 'no' user instructs the module not to use xmlto
  1207. #
  1208. # Added in version 1.10.0
  1209. # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
  1210. # xmlto for text output requires either lynx, links, or w3m browsers
  1211. #
  1212. # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
  1213. #
  1214. AC_DEFUN([XORG_WITH_XMLTO],[
  1215. AC_ARG_VAR([XMLTO], [Path to xmlto command])
  1216. m4_define([_defopt], m4_default([$2], [auto]))
  1217. AC_ARG_WITH(xmlto,
  1218. AS_HELP_STRING([--with-xmlto],
  1219. [Use xmlto to regenerate documentation (default: ]_defopt[)]),
  1220. [use_xmlto=$withval], [use_xmlto=]_defopt)
  1221. m4_undefine([_defopt])
  1222. if test "x$use_xmlto" = x"auto"; then
  1223. AC_PATH_PROG([XMLTO], [xmlto])
  1224. if test "x$XMLTO" = "x"; then
  1225. AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
  1226. have_xmlto=no
  1227. else
  1228. have_xmlto=yes
  1229. fi
  1230. elif test "x$use_xmlto" = x"yes" ; then
  1231. AC_PATH_PROG([XMLTO], [xmlto])
  1232. if test "x$XMLTO" = "x"; then
  1233. AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
  1234. fi
  1235. have_xmlto=yes
  1236. elif test "x$use_xmlto" = x"no" ; then
  1237. if test "x$XMLTO" != "x"; then
  1238. AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
  1239. fi
  1240. have_xmlto=no
  1241. else
  1242. AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
  1243. fi
  1244. # Test for a minimum version of xmlto, if provided.
  1245. m4_ifval([$1],
  1246. [if test "$have_xmlto" = yes; then
  1247. # scrape the xmlto version
  1248. AC_MSG_CHECKING([the xmlto version])
  1249. xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
  1250. AC_MSG_RESULT([$xmlto_version])
  1251. AS_VERSION_COMPARE([$xmlto_version], [$1],
  1252. [if test "x$use_xmlto" = xauto; then
  1253. AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
  1254. have_xmlto=no
  1255. else
  1256. AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
  1257. fi])
  1258. fi])
  1259. # Test for the ability of xmlto to generate a text target
  1260. have_xmlto_text=no
  1261. cat > conftest.xml << "EOF"
  1262. EOF
  1263. AS_IF([test "$have_xmlto" = yes],
  1264. [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
  1265. [have_xmlto_text=yes],
  1266. [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
  1267. rm -f conftest.xml
  1268. AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
  1269. AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
  1270. ]) # XORG_WITH_XMLTO
  1271. # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
  1272. # ----------------
  1273. # Minimum version: 1.5.0
  1274. # Minimum version for optional DEFAULT argument: 1.11.0
  1275. #
  1276. # Documentation tools are not always available on all platforms and sometimes
  1277. # not at the appropriate level. This macro enables a module to test for the
  1278. # presence of the tool and obtain it's path in separate variables. Coupled with
  1279. # the --with-asciidoc option, it allows maximum flexibilty in making decisions
  1280. # as whether or not to use the asciidoc package. When DEFAULT is not specified,
  1281. # --with-asciidoc assumes 'auto'.
  1282. #
  1283. # Interface to module:
  1284. # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
  1285. # ASCIIDOC: returns the path of the asciidoc program found
  1286. # returns the path set by the user in the environment
  1287. # --with-asciidoc: 'yes' user instructs the module to use asciidoc
  1288. # 'no' user instructs the module not to use asciidoc
  1289. #
  1290. # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
  1291. #
  1292. AC_DEFUN([XORG_WITH_ASCIIDOC],[
  1293. AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
  1294. m4_define([_defopt], m4_default([$2], [auto]))
  1295. AC_ARG_WITH(asciidoc,
  1296. AS_HELP_STRING([--with-asciidoc],
  1297. [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
  1298. [use_asciidoc=$withval], [use_asciidoc=]_defopt)
  1299. m4_undefine([_defopt])
  1300. if test "x$use_asciidoc" = x"auto"; then
  1301. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1302. if test "x$ASCIIDOC" = "x"; then
  1303. AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
  1304. have_asciidoc=no
  1305. else
  1306. have_asciidoc=yes
  1307. fi
  1308. elif test "x$use_asciidoc" = x"yes" ; then
  1309. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1310. if test "x$ASCIIDOC" = "x"; then
  1311. AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
  1312. fi
  1313. have_asciidoc=yes
  1314. elif test "x$use_asciidoc" = x"no" ; then
  1315. if test "x$ASCIIDOC" != "x"; then
  1316. AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
  1317. fi
  1318. have_asciidoc=no
  1319. else
  1320. AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
  1321. fi
  1322. m4_ifval([$1],
  1323. [if test "$have_asciidoc" = yes; then
  1324. # scrape the asciidoc version
  1325. AC_MSG_CHECKING([the asciidoc version])
  1326. asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
  1327. AC_MSG_RESULT([$asciidoc_version])
  1328. AS_VERSION_COMPARE([$asciidoc_version], [$1],
  1329. [if test "x$use_asciidoc" = xauto; then
  1330. AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
  1331. have_asciidoc=no
  1332. else
  1333. AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
  1334. fi])
  1335. fi])
  1336. AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
  1337. ]) # XORG_WITH_ASCIIDOC
  1338. # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
  1339. # --------------------------------
  1340. # Minimum version: 1.5.0
  1341. # Minimum version for optional DEFAULT argument: 1.11.0
  1342. #
  1343. # Documentation tools are not always available on all platforms and sometimes
  1344. # not at the appropriate level. This macro enables a module to test for the
  1345. # presence of the tool and obtain it's path in separate variables. Coupled with
  1346. # the --with-doxygen option, it allows maximum flexibilty in making decisions
  1347. # as whether or not to use the doxygen package. When DEFAULT is not specified,
  1348. # --with-doxygen assumes 'auto'.
  1349. #
  1350. # Interface to module:
  1351. # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
  1352. # DOXYGEN: returns the path of the doxygen program found
  1353. # returns the path set by the user in the environment
  1354. # --with-doxygen: 'yes' user instructs the module to use doxygen
  1355. # 'no' user instructs the module not to use doxygen
  1356. #
  1357. # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
  1358. #
  1359. AC_DEFUN([XORG_WITH_DOXYGEN],[
  1360. AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
  1361. m4_define([_defopt], m4_default([$2], [auto]))
  1362. AC_ARG_WITH(doxygen,
  1363. AS_HELP_STRING([--with-doxygen],
  1364. [Use doxygen to regenerate documentation (default: ]_defopt[)]),
  1365. [use_doxygen=$withval], [use_doxygen=]_defopt)
  1366. m4_undefine([_defopt])
  1367. if test "x$use_doxygen" = x"auto"; then
  1368. AC_PATH_PROG([DOXYGEN], [doxygen])
  1369. if test "x$DOXYGEN" = "x"; then
  1370. AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
  1371. have_doxygen=no
  1372. else
  1373. have_doxygen=yes
  1374. fi
  1375. elif test "x$use_doxygen" = x"yes" ; then
  1376. AC_PATH_PROG([DOXYGEN], [doxygen])
  1377. if test "x$DOXYGEN" = "x"; then
  1378. AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
  1379. fi
  1380. have_doxygen=yes
  1381. elif test "x$use_doxygen" = x"no" ; then
  1382. if test "x$DOXYGEN" != "x"; then
  1383. AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
  1384. fi
  1385. have_doxygen=no
  1386. else
  1387. AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
  1388. fi
  1389. m4_ifval([$1],
  1390. [if test "$have_doxygen" = yes; then
  1391. # scrape the doxygen version
  1392. AC_MSG_CHECKING([the doxygen version])
  1393. doxygen_version=`$DOXYGEN --version 2>/dev/null`
  1394. AC_MSG_RESULT([$doxygen_version])
  1395. AS_VERSION_COMPARE([$doxygen_version], [$1],
  1396. [if test "x$use_doxygen" = xauto; then
  1397. AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
  1398. have_doxygen=no
  1399. else
  1400. AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
  1401. fi])
  1402. fi])
  1403. AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
  1404. ]) # XORG_WITH_DOXYGEN
  1405. # XORG_WITH_GROFF([DEFAULT])
  1406. # ----------------
  1407. # Minimum version: 1.6.0
  1408. # Minimum version for optional DEFAULT argument: 1.11.0
  1409. #
  1410. # Documentation tools are not always available on all platforms and sometimes
  1411. # not at the appropriate level. This macro enables a module to test for the
  1412. # presence of the tool and obtain it's path in separate variables. Coupled with
  1413. # the --with-groff option, it allows maximum flexibilty in making decisions
  1414. # as whether or not to use the groff package. When DEFAULT is not specified,
  1415. # --with-groff assumes 'auto'.
  1416. #
  1417. # Interface to module:
  1418. # HAVE_GROFF: used in makefiles to conditionally generate documentation
  1419. # HAVE_GROFF_MM: the memorandum macros (-mm) package
  1420. # HAVE_GROFF_MS: the -ms macros package
  1421. # GROFF: returns the path of the groff program found
  1422. # returns the path set by the user in the environment
  1423. # --with-groff: 'yes' user instructs the module to use groff
  1424. # 'no' user instructs the module not to use groff
  1425. #
  1426. # Added in version 1.9.0:
  1427. # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
  1428. # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
  1429. # psselect from the psutils package.
  1430. # the ghostcript package. Refer to the grohtml man pages
  1431. #
  1432. # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
  1433. #
  1434. # OS and distros often splits groff in a basic and full package, the former
  1435. # having the groff program and the later having devices, fonts and macros
  1436. # Checking for the groff executable is not enough.
  1437. #
  1438. # If macros are missing, we cannot assume that groff is useless, so we don't
  1439. # unset HAVE_GROFF or GROFF env variables.
  1440. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
  1441. #
  1442. AC_DEFUN([XORG_WITH_GROFF],[
  1443. AC_ARG_VAR([GROFF], [Path to groff command])
  1444. m4_define([_defopt], m4_default([$1], [auto]))
  1445. AC_ARG_WITH(groff,
  1446. AS_HELP_STRING([--with-groff],
  1447. [Use groff to regenerate documentation (default: ]_defopt[)]),
  1448. [use_groff=$withval], [use_groff=]_defopt)
  1449. m4_undefine([_defopt])
  1450. if test "x$use_groff" = x"auto"; then
  1451. AC_PATH_PROG([GROFF], [groff])
  1452. if test "x$GROFF" = "x"; then
  1453. AC_MSG_WARN([groff not found - documentation targets will be skipped])
  1454. have_groff=no
  1455. else
  1456. have_groff=yes
  1457. fi
  1458. elif test "x$use_groff" = x"yes" ; then
  1459. AC_PATH_PROG([GROFF], [groff])
  1460. if test "x$GROFF" = "x"; then
  1461. AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
  1462. fi
  1463. have_groff=yes
  1464. elif test "x$use_groff" = x"no" ; then
  1465. if test "x$GROFF" != "x"; then
  1466. AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
  1467. fi
  1468. have_groff=no
  1469. else
  1470. AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
  1471. fi
  1472. # We have groff, test for the presence of the macro packages
  1473. if test "x$have_groff" = x"yes"; then
  1474. AC_MSG_CHECKING([for ${GROFF} -ms macros])
  1475. if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
  1476. groff_ms_works=yes
  1477. else
  1478. groff_ms_works=no
  1479. fi
  1480. AC_MSG_RESULT([$groff_ms_works])
  1481. AC_MSG_CHECKING([for ${GROFF} -mm macros])
  1482. if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
  1483. groff_mm_works=yes
  1484. else
  1485. groff_mm_works=no
  1486. fi
  1487. AC_MSG_RESULT([$groff_mm_works])
  1488. fi
  1489. # We have groff, test for HTML dependencies, one command per package
  1490. if test "x$have_groff" = x"yes"; then
  1491. AC_PATH_PROGS(GS_PATH, [gs gswin32c])
  1492. AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
  1493. AC_PATH_PROG(PSSELECT_PATH, [psselect])
  1494. if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
  1495. have_groff_html=yes
  1496. else
  1497. have_groff_html=no
  1498. AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
  1499. fi
  1500. fi
  1501. # Set Automake conditionals for Makefiles
  1502. AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
  1503. AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
  1504. AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
  1505. AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
  1506. ]) # XORG_WITH_GROFF
  1507. # XORG_WITH_FOP([DEFAULT])
  1508. # ----------------
  1509. # Minimum version: 1.6.0
  1510. # Minimum version for optional DEFAULT argument: 1.11.0
  1511. #
  1512. # Documentation tools are not always available on all platforms and sometimes
  1513. # not at the appropriate level. This macro enables a module to test for the
  1514. # presence of the tool and obtain it's path in separate variables. Coupled with
  1515. # the --with-fop option, it allows maximum flexibilty in making decisions
  1516. # as whether or not to use the fop package. When DEFAULT is not specified,
  1517. # --with-fop assumes 'auto'.
  1518. #
  1519. # Interface to module:
  1520. # HAVE_FOP: used in makefiles to conditionally generate documentation
  1521. # FOP: returns the path of the fop program found
  1522. # returns the path set by the user in the environment
  1523. # --with-fop: 'yes' user instructs the module to use fop
  1524. # 'no' user instructs the module not to use fop
  1525. #
  1526. # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
  1527. #
  1528. AC_DEFUN([XORG_WITH_FOP],[
  1529. AC_ARG_VAR([FOP], [Path to fop command])
  1530. m4_define([_defopt], m4_default([$1], [auto]))
  1531. AC_ARG_WITH(fop,
  1532. AS_HELP_STRING([--with-fop],
  1533. [Use fop to regenerate documentation (default: ]_defopt[)]),
  1534. [use_fop=$withval], [use_fop=]_defopt)
  1535. m4_undefine([_defopt])
  1536. if test "x$use_fop" = x"auto"; then
  1537. AC_PATH_PROG([FOP], [fop])
  1538. if test "x$FOP" = "x"; then
  1539. AC_MSG_WARN([fop not found - documentation targets will be skipped])
  1540. have_fop=no
  1541. else
  1542. have_fop=yes
  1543. fi
  1544. elif test "x$use_fop" = x"yes" ; then
  1545. AC_PATH_PROG([FOP], [fop])
  1546. if test "x$FOP" = "x"; then
  1547. AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
  1548. fi
  1549. have_fop=yes
  1550. elif test "x$use_fop" = x"no" ; then
  1551. if test "x$FOP" != "x"; then
  1552. AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
  1553. fi
  1554. have_fop=no
  1555. else
  1556. AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
  1557. fi
  1558. AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
  1559. ]) # XORG_WITH_FOP
  1560. # XORG_WITH_PS2PDF([DEFAULT])
  1561. # ----------------
  1562. # Minimum version: 1.6.0
  1563. # Minimum version for optional DEFAULT argument: 1.11.0
  1564. #
  1565. # Documentation tools are not always available on all platforms and sometimes
  1566. # not at the appropriate level. This macro enables a module to test for the
  1567. # presence of the tool and obtain it's path in separate variables. Coupled with
  1568. # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
  1569. # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
  1570. # --with-ps2pdf assumes 'auto'.
  1571. #
  1572. # Interface to module:
  1573. # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
  1574. # PS2PDF: returns the path of the ps2pdf program found
  1575. # returns the path set by the user in the environment
  1576. # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
  1577. # 'no' user instructs the module not to use ps2pdf
  1578. #
  1579. # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
  1580. #
  1581. AC_DEFUN([XORG_WITH_PS2PDF],[
  1582. AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
  1583. m4_define([_defopt], m4_default([$1], [auto]))
  1584. AC_ARG_WITH(ps2pdf,
  1585. AS_HELP_STRING([--with-ps2pdf],
  1586. [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
  1587. [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
  1588. m4_undefine([_defopt])
  1589. if test "x$use_ps2pdf" = x"auto"; then
  1590. AC_PATH_PROG([PS2PDF], [ps2pdf])
  1591. if test "x$PS2PDF" = "x"; then
  1592. AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
  1593. have_ps2pdf=no
  1594. else
  1595. have_ps2pdf=yes
  1596. fi
  1597. elif test "x$use_ps2pdf" = x"yes" ; then
  1598. AC_PATH_PROG([PS2PDF], [ps2pdf])
  1599. if test "x$PS2PDF" = "x"; then
  1600. AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
  1601. fi
  1602. have_ps2pdf=yes
  1603. elif test "x$use_ps2pdf" = x"no" ; then
  1604. if test "x$PS2PDF" != "x"; then
  1605. AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
  1606. fi
  1607. have_ps2pdf=no
  1608. else
  1609. AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
  1610. fi
  1611. AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
  1612. ]) # XORG_WITH_PS2PDF
  1613. # XORG_ENABLE_DOCS (enable_docs=yes)
  1614. # ----------------
  1615. # Minimum version: 1.6.0
  1616. #
  1617. # Documentation tools are not always available on all platforms and sometimes
  1618. # not at the appropriate level. This macro enables a builder to skip all
  1619. # documentation targets except traditional man pages.
  1620. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  1621. # maximum flexibilty in controlling documentation building.
  1622. # Refer to:
  1623. # XORG_WITH_XMLTO --with-xmlto
  1624. # XORG_WITH_ASCIIDOC --with-asciidoc
  1625. # XORG_WITH_DOXYGEN --with-doxygen
  1626. # XORG_WITH_FOP --with-fop
  1627. # XORG_WITH_GROFF --with-groff
  1628. # XORG_WITH_PS2PDF --with-ps2pdf
  1629. #
  1630. # Interface to module:
  1631. # ENABLE_DOCS: used in makefiles to conditionally generate documentation
  1632. # --enable-docs: 'yes' user instructs the module to generate docs
  1633. # 'no' user instructs the module not to generate docs
  1634. # parm1: specify the default value, yes or no.
  1635. #
  1636. AC_DEFUN([XORG_ENABLE_DOCS],[
  1637. m4_define([default], m4_default([$1], [yes]))
  1638. AC_ARG_ENABLE(docs,
  1639. AS_HELP_STRING([--enable-docs],
  1640. [Enable building the documentation (default: ]default[)]),
  1641. [build_docs=$enableval], [build_docs=]default)
  1642. m4_undefine([default])
  1643. AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
  1644. AC_MSG_CHECKING([whether to build documentation])
  1645. AC_MSG_RESULT([$build_docs])
  1646. ]) # XORG_ENABLE_DOCS
  1647. # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
  1648. # ----------------
  1649. # Minimum version: 1.6.0
  1650. #
  1651. # This macro enables a builder to skip all developer documentation.
  1652. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  1653. # maximum flexibilty in controlling documentation building.
  1654. # Refer to:
  1655. # XORG_WITH_XMLTO --with-xmlto
  1656. # XORG_WITH_ASCIIDOC --with-asciidoc
  1657. # XORG_WITH_DOXYGEN --with-doxygen
  1658. # XORG_WITH_FOP --with-fop
  1659. # XORG_WITH_GROFF --with-groff
  1660. # XORG_WITH_PS2PDF --with-ps2pdf
  1661. #
  1662. # Interface to module:
  1663. # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
  1664. # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
  1665. # 'no' user instructs the module not to generate developer docs
  1666. # parm1: specify the default value, yes or no.
  1667. #
  1668. AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
  1669. m4_define([devel_default], m4_default([$1], [yes]))
  1670. AC_ARG_ENABLE(devel-docs,
  1671. AS_HELP_STRING([--enable-devel-docs],
  1672. [Enable building the developer documentation (default: ]devel_default[)]),
  1673. [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
  1674. m4_undefine([devel_default])
  1675. AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
  1676. AC_MSG_CHECKING([whether to build developer documentation])
  1677. AC_MSG_RESULT([$build_devel_docs])
  1678. ]) # XORG_ENABLE_DEVEL_DOCS
  1679. # XORG_ENABLE_SPECS (enable_specs=yes)
  1680. # ----------------
  1681. # Minimum version: 1.6.0
  1682. #
  1683. # This macro enables a builder to skip all functional specification targets.
  1684. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  1685. # maximum flexibilty in controlling documentation building.
  1686. # Refer to:
  1687. # XORG_WITH_XMLTO --with-xmlto
  1688. # XORG_WITH_ASCIIDOC --with-asciidoc
  1689. # XORG_WITH_DOXYGEN --with-doxygen
  1690. # XORG_WITH_FOP --with-fop
  1691. # XORG_WITH_GROFF --with-groff
  1692. # XORG_WITH_PS2PDF --with-ps2pdf
  1693. #
  1694. # Interface to module:
  1695. # ENABLE_SPECS: used in makefiles to conditionally generate specs
  1696. # --enable-specs: 'yes' user instructs the module to generate specs
  1697. # 'no' user instructs the module not to generate specs
  1698. # parm1: specify the default value, yes or no.
  1699. #
  1700. AC_DEFUN([XORG_ENABLE_SPECS],[
  1701. m4_define([spec_default], m4_default([$1], [yes]))
  1702. AC_ARG_ENABLE(specs,
  1703. AS_HELP_STRING([--enable-specs],
  1704. [Enable building the specs (default: ]spec_default[)]),
  1705. [build_specs=$enableval], [build_specs=]spec_default)
  1706. m4_undefine([spec_default])
  1707. AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
  1708. AC_MSG_CHECKING([whether to build functional specifications])
  1709. AC_MSG_RESULT([$build_specs])
  1710. ]) # XORG_ENABLE_SPECS
  1711. # XORG_CHECK_MALLOC_ZERO
  1712. # ----------------------
  1713. # Minimum version: 1.0.0
  1714. #
  1715. # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
  1716. # malloc(0) returns NULL. Packages should add one of these cflags to
  1717. # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
  1718. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
  1719. AC_ARG_ENABLE(malloc0returnsnull,
  1720. AS_HELP_STRING([--enable-malloc0returnsnull],
  1721. [malloc(0) returns NULL (default: auto)]),
  1722. [MALLOC_ZERO_RETURNS_NULL=$enableval],
  1723. [MALLOC_ZERO_RETURNS_NULL=auto])
  1724. AC_MSG_CHECKING([whether malloc(0) returns NULL])
  1725. if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
  1726. AC_RUN_IFELSE([
  1727. char *malloc();
  1728. char *realloc();
  1729. char *calloc();
  1730. main() {
  1731. char *m0, *r0, *c0, *p;
  1732. m0 = malloc(0);
  1733. p = malloc(10);
  1734. r0 = realloc(p,0);
  1735. c0 = calloc(0);
  1736. exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
  1737. }],
  1738. [MALLOC_ZERO_RETURNS_NULL=yes],
  1739. [MALLOC_ZERO_RETURNS_NULL=no],
  1740. [MALLOC_ZERO_RETURNS_NULL=yes])
  1741. fi
  1742. AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
  1743. if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
  1744. MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
  1745. XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
  1746. XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
  1747. else
  1748. MALLOC_ZERO_CFLAGS=""
  1749. XMALLOC_ZERO_CFLAGS=""
  1750. XTMALLOC_ZERO_CFLAGS=""
  1751. fi
  1752. AC_SUBST([MALLOC_ZERO_CFLAGS])
  1753. AC_SUBST([XMALLOC_ZERO_CFLAGS])
  1754. AC_SUBST([XTMALLOC_ZERO_CFLAGS])
  1755. ]) # XORG_CHECK_MALLOC_ZERO
  1756. # XORG_WITH_LINT()
  1757. # ----------------
  1758. # Minimum version: 1.1.0
  1759. #
  1760. # This macro enables the use of a tool that flags some suspicious and
  1761. # non-portable constructs (likely to be bugs) in C language source code.
  1762. # It will attempt to locate the tool and use appropriate options.
  1763. # There are various lint type tools on different platforms.
  1764. #
  1765. # Interface to module:
  1766. # LINT: returns the path to the tool found on the platform
  1767. # or the value set to LINT on the configure cmd line
  1768. # also an Automake conditional
  1769. # LINT_FLAGS: an Automake variable with appropriate flags
  1770. #
  1771. # --with-lint: 'yes' user instructs the module to use lint
  1772. # 'no' user instructs the module not to use lint (default)
  1773. #
  1774. # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
  1775. # If the user sets the value of LINT_FLAGS, they are used verbatim.
  1776. #
  1777. AC_DEFUN([XORG_WITH_LINT],[
  1778. AC_ARG_VAR([LINT], [Path to a lint-style command])
  1779. AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
  1780. AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
  1781. [Use a lint-style source code checker (default: disabled)])],
  1782. [use_lint=$withval], [use_lint=no])
  1783. # Obtain platform specific info like program name and options
  1784. # The lint program on FreeBSD and NetBSD is different from the one on Solaris
  1785. case $host_os in
  1786. *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
  1787. lint_name=splint
  1788. lint_options="-badflag"
  1789. ;;
  1790. *freebsd* | *netbsd*)
  1791. lint_name=lint
  1792. lint_options="-u -b"
  1793. ;;
  1794. *solaris*)
  1795. lint_name=lint
  1796. lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
  1797. ;;
  1798. esac
  1799. # Test for the presence of the program (either guessed by the code or spelled out by the user)
  1800. if test "x$use_lint" = x"yes" ; then
  1801. AC_PATH_PROG([LINT], [$lint_name])
  1802. if test "x$LINT" = "x"; then
  1803. AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
  1804. fi
  1805. elif test "x$use_lint" = x"no" ; then
  1806. if test "x$LINT" != "x"; then
  1807. AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
  1808. fi
  1809. else
  1810. AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
  1811. fi
  1812. # User supplied flags override default flags
  1813. if test "x$LINT_FLAGS" != "x"; then
  1814. lint_options=$LINT_FLAGS
  1815. fi
  1816. AC_SUBST([LINT_FLAGS],[$lint_options])
  1817. AM_CONDITIONAL(LINT, [test "x$LINT" != x])
  1818. ]) # XORG_WITH_LINT
  1819. # XORG_LINT_LIBRARY(LIBNAME)
  1820. # --------------------------
  1821. # Minimum version: 1.1.0
  1822. #
  1823. # Sets up flags for building lint libraries for checking programs that call
  1824. # functions in the library.
  1825. #
  1826. # Interface to module:
  1827. # LINTLIB - Automake variable with the name of lint library file to make
  1828. # MAKE_LINT_LIB - Automake conditional
  1829. #
  1830. # --enable-lint-library: - 'yes' user instructs the module to created a lint library
  1831. # - 'no' user instructs the module not to create a lint library (default)
  1832. AC_DEFUN([XORG_LINT_LIBRARY],[
  1833. AC_REQUIRE([XORG_WITH_LINT])
  1834. AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
  1835. [Create lint library (default: disabled)])],
  1836. [make_lint_lib=$enableval], [make_lint_lib=no])
  1837. if test "x$make_lint_lib" = x"yes" ; then
  1838. LINTLIB=llib-l$1.ln
  1839. if test "x$LINT" = "x"; then
  1840. AC_MSG_ERROR([Cannot make lint library without --with-lint])
  1841. fi
  1842. elif test "x$make_lint_lib" != x"no" ; then
  1843. AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
  1844. fi
  1845. AC_SUBST(LINTLIB)
  1846. AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
  1847. ]) # XORG_LINT_LIBRARY
  1848. # XORG_CWARNFLAGS
  1849. # ---------------
  1850. # Minimum version: 1.2.0
  1851. #
  1852. # Defines CWARNFLAGS to enable C compiler warnings.
  1853. #
  1854. AC_DEFUN([XORG_CWARNFLAGS], [
  1855. AC_REQUIRE([AC_PROG_CC_C99])
  1856. if test "x$GCC" = xyes ; then
  1857. CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
  1858. -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
  1859. -Wbad-function-cast -Wformat=2"
  1860. case `$CC -dumpversion` in
  1861. 3.4.* | 4.*)
  1862. CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
  1863. ;;
  1864. esac
  1865. else
  1866. AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
  1867. if test "x$SUNCC" = "xyes"; then
  1868. CWARNFLAGS="-v"
  1869. fi
  1870. fi
  1871. AC_SUBST(CWARNFLAGS)
  1872. ]) # XORG_CWARNFLAGS
  1873. # XORG_STRICT_OPTION
  1874. # -----------------------
  1875. # Minimum version: 1.3.0
  1876. #
  1877. # Add configure option to enable strict compilation
  1878. AC_DEFUN([XORG_STRICT_OPTION], [
  1879. # If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
  1880. AC_REQUIRE([AC_PROG_CC_C99])
  1881. AC_REQUIRE([XORG_CWARNFLAGS])
  1882. AC_ARG_ENABLE(strict-compilation,
  1883. AS_HELP_STRING([--enable-strict-compilation],
  1884. [Enable all warnings from compiler and make them errors (default: disabled)]),
  1885. [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
  1886. if test "x$STRICT_COMPILE" = "xyes"; then
  1887. AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
  1888. AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
  1889. if test "x$GCC" = xyes ; then
  1890. STRICT_CFLAGS="-pedantic -Werror"
  1891. elif test "x$SUNCC" = "xyes"; then
  1892. STRICT_CFLAGS="-errwarn"
  1893. elif test "x$INTELCC" = "xyes"; then
  1894. STRICT_CFLAGS="-Werror"
  1895. fi
  1896. fi
  1897. CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
  1898. AC_SUBST([CWARNFLAGS])
  1899. ]) # XORG_STRICT_OPTION
  1900. # XORG_DEFAULT_OPTIONS
  1901. # --------------------
  1902. # Minimum version: 1.3.0
  1903. #
  1904. # Defines default options for X.Org modules.
  1905. #
  1906. AC_DEFUN([XORG_DEFAULT_OPTIONS], [
  1907. AC_REQUIRE([AC_PROG_INSTALL])
  1908. XORG_CWARNFLAGS
  1909. XORG_STRICT_OPTION
  1910. XORG_RELEASE_VERSION
  1911. XORG_CHANGELOG
  1912. XORG_INSTALL
  1913. XORG_MANPAGE_SECTIONS
  1914. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  1915. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  1916. ]) # XORG_DEFAULT_OPTIONS
  1917. # XORG_INSTALL()
  1918. # ----------------
  1919. # Minimum version: 1.4.0
  1920. #
  1921. # Defines the variable INSTALL_CMD as the command to copy
  1922. # INSTALL from $prefix/share/util-macros.
  1923. #
  1924. AC_DEFUN([XORG_INSTALL], [
  1925. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  1926. macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
  1927. INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
  1928. mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
  1929. || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
  1930. echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
  1931. AC_SUBST([INSTALL_CMD])
  1932. ]) # XORG_INSTALL
  1933. dnl Copyright 2005 Red Hat, Inc
  1934. dnl
  1935. dnl Permission to use, copy, modify, distribute, and sell this software and its
  1936. dnl documentation for any purpose is hereby granted without fee, provided that
  1937. dnl the above copyright notice appear in all copies and that both that
  1938. dnl copyright notice and this permission notice appear in supporting
  1939. dnl documentation.
  1940. dnl
  1941. dnl The above copyright notice and this permission notice shall be included
  1942. dnl in all copies or substantial portions of the Software.
  1943. dnl
  1944. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  1945. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  1946. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  1947. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  1948. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  1949. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  1950. dnl OTHER DEALINGS IN THE SOFTWARE.
  1951. dnl
  1952. dnl Except as contained in this notice, the name of the copyright holders shall
  1953. dnl not be used in advertising or otherwise to promote the sale, use or
  1954. dnl other dealings in this Software without prior written authorization
  1955. dnl from the copyright holders.
  1956. dnl
  1957. # XORG_RELEASE_VERSION
  1958. # --------------------
  1959. # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
  1960. AC_DEFUN([XORG_RELEASE_VERSION],[
  1961. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
  1962. [`echo $PACKAGE_VERSION | cut -d . -f 1`],
  1963. [Major version of this package])
  1964. PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
  1965. if test "x$PVM" = "x"; then
  1966. PVM="0"
  1967. fi
  1968. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
  1969. [$PVM],
  1970. [Minor version of this package])
  1971. PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
  1972. if test "x$PVP" = "x"; then
  1973. PVP="0"
  1974. fi
  1975. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
  1976. [$PVP],
  1977. [Patch version of this package])
  1978. ])
  1979. # XORG_CHANGELOG()
  1980. # ----------------
  1981. # Minimum version: 1.2.0
  1982. #
  1983. # Defines the variable CHANGELOG_CMD as the command to generate
  1984. # ChangeLog from git.
  1985. #
  1986. #
  1987. AC_DEFUN([XORG_CHANGELOG], [
  1988. CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
  1989. mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
  1990. || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
  1991. echo 'git directory not found: installing possibly empty changelog.' >&2)"
  1992. AC_SUBST([CHANGELOG_CMD])
  1993. ]) # XORG_CHANGELOG