aclocal.m4 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091
  1. # generated automatically by aclocal 1.8.5 -*- Autoconf -*-
  2. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
  3. # 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. # gettext.m4 serial 34 (gettext-0.14.2)
  12. dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
  13. dnl This file is free software; the Free Software Foundation
  14. dnl gives unlimited permission to copy and/or distribute it,
  15. dnl with or without modifications, as long as this notice is preserved.
  16. dnl
  17. dnl This file can can be used in projects which are not available under
  18. dnl the GNU General Public License or the GNU Library General Public
  19. dnl License but which still want to provide support for the GNU gettext
  20. dnl functionality.
  21. dnl Please note that the actual code of the GNU gettext library is covered
  22. dnl by the GNU Library General Public License, and the rest of the GNU
  23. dnl gettext package package is covered by the GNU General Public License.
  24. dnl They are *not* in the public domain.
  25. dnl Authors:
  26. dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
  27. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
  28. dnl Macro to add for using GNU gettext.
  29. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
  30. dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
  31. dnl default (if it is not specified or empty) is 'no-libtool'.
  32. dnl INTLSYMBOL should be 'external' for packages with no intl directory,
  33. dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
  34. dnl If INTLSYMBOL is 'use-libtool', then a libtool library
  35. dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
  36. dnl depending on --{enable,disable}-{shared,static} and on the presence of
  37. dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
  38. dnl $(top_builddir)/intl/libintl.a will be created.
  39. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
  40. dnl implementations (in libc or libintl) without the ngettext() function
  41. dnl will be ignored. If NEEDSYMBOL is specified and is
  42. dnl 'need-formatstring-macros', then GNU gettext implementations that don't
  43. dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
  44. dnl INTLDIR is used to find the intl libraries. If empty,
  45. dnl the value `$(top_builddir)/intl/' is used.
  46. dnl
  47. dnl The result of the configuration is one of three cases:
  48. dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
  49. dnl and used.
  50. dnl Catalog format: GNU --> install in $(datadir)
  51. dnl Catalog extension: .mo after installation, .gmo in source tree
  52. dnl 2) GNU gettext has been found in the system's C library.
  53. dnl Catalog format: GNU --> install in $(datadir)
  54. dnl Catalog extension: .mo after installation, .gmo in source tree
  55. dnl 3) No internationalization, always use English msgid.
  56. dnl Catalog format: none
  57. dnl Catalog extension: none
  58. dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
  59. dnl The use of .gmo is historical (it was needed to avoid overwriting the
  60. dnl GNU format catalogs when building on a platform with an X/Open gettext),
  61. dnl but we keep it in order not to force irrelevant filename changes on the
  62. dnl maintainers.
  63. dnl
  64. AC_DEFUN([AM_GNU_GETTEXT],
  65. [
  66. dnl Argument checking.
  67. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
  68. [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
  69. ])])])])])
  70. ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
  71. [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
  72. ])])])])
  73. define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
  74. define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
  75. AC_REQUIRE([AM_PO_SUBDIRS])dnl
  76. ifelse(gt_included_intl, yes, [
  77. AC_REQUIRE([AM_INTL_SUBDIR])dnl
  78. ])
  79. dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
  80. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  81. AC_REQUIRE([AC_LIB_RPATH])
  82. dnl Sometimes libintl requires libiconv, so first search for libiconv.
  83. dnl Ideally we would do this search only after the
  84. dnl if test "$USE_NLS" = "yes"; then
  85. dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
  86. dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
  87. dnl the configure script would need to contain the same shell code
  88. dnl again, outside any 'if'. There are two solutions:
  89. dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
  90. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
  91. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
  92. dnl documented, we avoid it.
  93. ifelse(gt_included_intl, yes, , [
  94. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
  95. ])
  96. dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
  97. gt_INTL_MACOSX
  98. dnl Set USE_NLS.
  99. AM_NLS
  100. ifelse(gt_included_intl, yes, [
  101. BUILD_INCLUDED_LIBINTL=no
  102. USE_INCLUDED_LIBINTL=no
  103. ])
  104. LIBINTL=
  105. LTLIBINTL=
  106. POSUB=
  107. dnl If we use NLS figure out what method
  108. if test "$USE_NLS" = "yes"; then
  109. gt_use_preinstalled_gnugettext=no
  110. ifelse(gt_included_intl, yes, [
  111. AC_MSG_CHECKING([whether included gettext is requested])
  112. AC_ARG_WITH(included-gettext,
  113. [ --with-included-gettext use the GNU gettext library included here],
  114. nls_cv_force_use_gnu_gettext=$withval,
  115. nls_cv_force_use_gnu_gettext=no)
  116. AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
  117. nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
  118. if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
  119. ])
  120. dnl User does not insist on using GNU NLS library. Figure out what
  121. dnl to use. If GNU gettext is available we use this. Else we have
  122. dnl to fall back to GNU NLS library.
  123. dnl Add a version number to the cache macros.
  124. define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
  125. define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
  126. define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
  127. AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
  128. [AC_TRY_LINK([#include <libintl.h>
  129. ]ifelse([$2], [need-formatstring-macros],
  130. [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
  131. #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
  132. #endif
  133. changequote(,)dnl
  134. typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
  135. changequote([,])dnl
  136. ], [])[extern int _nl_msg_cat_cntr;
  137. extern int *_nl_domain_bindings;],
  138. [bindtextdomain ("", "");
  139. return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
  140. gt_cv_func_gnugettext_libc=yes,
  141. gt_cv_func_gnugettext_libc=no)])
  142. if test "$gt_cv_func_gnugettext_libc" != "yes"; then
  143. dnl Sometimes libintl requires libiconv, so first search for libiconv.
  144. ifelse(gt_included_intl, yes, , [
  145. AM_ICONV_LINK
  146. ])
  147. dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
  148. dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
  149. dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
  150. dnl even if libiconv doesn't exist.
  151. AC_LIB_LINKFLAGS_BODY([intl])
  152. AC_CACHE_CHECK([for GNU gettext in libintl],
  153. gt_cv_func_gnugettext_libintl,
  154. [gt_save_CPPFLAGS="$CPPFLAGS"
  155. CPPFLAGS="$CPPFLAGS $INCINTL"
  156. gt_save_LIBS="$LIBS"
  157. LIBS="$LIBS $LIBINTL"
  158. dnl Now see whether libintl exists and does not depend on libiconv.
  159. AC_TRY_LINK([#include <libintl.h>
  160. ]ifelse([$2], [need-formatstring-macros],
  161. [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
  162. #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
  163. #endif
  164. changequote(,)dnl
  165. typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
  166. changequote([,])dnl
  167. ], [])[extern int _nl_msg_cat_cntr;
  168. extern
  169. #ifdef __cplusplus
  170. "C"
  171. #endif
  172. const char *_nl_expand_alias (const char *);],
  173. [bindtextdomain ("", "");
  174. return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
  175. gt_cv_func_gnugettext_libintl=yes,
  176. gt_cv_func_gnugettext_libintl=no)
  177. dnl Now see whether libintl exists and depends on libiconv.
  178. if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
  179. LIBS="$LIBS $LIBICONV"
  180. AC_TRY_LINK([#include <libintl.h>
  181. ]ifelse([$2], [need-formatstring-macros],
  182. [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
  183. #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
  184. #endif
  185. changequote(,)dnl
  186. typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
  187. changequote([,])dnl
  188. ], [])[extern int _nl_msg_cat_cntr;
  189. extern
  190. #ifdef __cplusplus
  191. "C"
  192. #endif
  193. const char *_nl_expand_alias (const char *);],
  194. [bindtextdomain ("", "");
  195. return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
  196. [LIBINTL="$LIBINTL $LIBICONV"
  197. LTLIBINTL="$LTLIBINTL $LTLIBICONV"
  198. gt_cv_func_gnugettext_libintl=yes
  199. ])
  200. fi
  201. CPPFLAGS="$gt_save_CPPFLAGS"
  202. LIBS="$gt_save_LIBS"])
  203. fi
  204. dnl If an already present or preinstalled GNU gettext() is found,
  205. dnl use it. But if this macro is used in GNU gettext, and GNU
  206. dnl gettext is already preinstalled in libintl, we update this
  207. dnl libintl. (Cf. the install rule in intl/Makefile.in.)
  208. if test "$gt_cv_func_gnugettext_libc" = "yes" \
  209. || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
  210. && test "$PACKAGE" != gettext-runtime \
  211. && test "$PACKAGE" != gettext-tools; }; then
  212. gt_use_preinstalled_gnugettext=yes
  213. else
  214. dnl Reset the values set by searching for libintl.
  215. LIBINTL=
  216. LTLIBINTL=
  217. INCINTL=
  218. fi
  219. ifelse(gt_included_intl, yes, [
  220. if test "$gt_use_preinstalled_gnugettext" != "yes"; then
  221. dnl GNU gettext is not found in the C library.
  222. dnl Fall back on included GNU gettext library.
  223. nls_cv_use_gnu_gettext=yes
  224. fi
  225. fi
  226. if test "$nls_cv_use_gnu_gettext" = "yes"; then
  227. dnl Mark actions used to generate GNU NLS library.
  228. BUILD_INCLUDED_LIBINTL=yes
  229. USE_INCLUDED_LIBINTL=yes
  230. LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
  231. LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
  232. LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
  233. fi
  234. if test "$gt_use_preinstalled_gnugettext" = "yes" \
  235. || test "$nls_cv_use_gnu_gettext" = "yes"; then
  236. dnl Mark actions to use GNU gettext tools.
  237. CATOBJEXT=.gmo
  238. fi
  239. ])
  240. if test -n "$INTL_MACOSX_LIBS"; then
  241. if test "$gt_use_preinstalled_gnugettext" = "yes" \
  242. || test "$nls_cv_use_gnu_gettext" = "yes"; then
  243. dnl Some extra flags are needed during linking.
  244. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
  245. LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
  246. fi
  247. fi
  248. if test "$gt_use_preinstalled_gnugettext" = "yes" \
  249. || test "$nls_cv_use_gnu_gettext" = "yes"; then
  250. AC_DEFINE(ENABLE_NLS, 1,
  251. [Define to 1 if translation of program messages to the user's native language
  252. is requested.])
  253. else
  254. USE_NLS=no
  255. fi
  256. fi
  257. AC_MSG_CHECKING([whether to use NLS])
  258. AC_MSG_RESULT([$USE_NLS])
  259. if test "$USE_NLS" = "yes"; then
  260. AC_MSG_CHECKING([where the gettext function comes from])
  261. if test "$gt_use_preinstalled_gnugettext" = "yes"; then
  262. if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
  263. gt_source="external libintl"
  264. else
  265. gt_source="libc"
  266. fi
  267. else
  268. gt_source="included intl directory"
  269. fi
  270. AC_MSG_RESULT([$gt_source])
  271. fi
  272. if test "$USE_NLS" = "yes"; then
  273. if test "$gt_use_preinstalled_gnugettext" = "yes"; then
  274. if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
  275. AC_MSG_CHECKING([how to link with libintl])
  276. AC_MSG_RESULT([$LIBINTL])
  277. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
  278. fi
  279. dnl For backward compatibility. Some packages may be using this.
  280. AC_DEFINE(HAVE_GETTEXT, 1,
  281. [Define if the GNU gettext() function is already present or preinstalled.])
  282. AC_DEFINE(HAVE_DCGETTEXT, 1,
  283. [Define if the GNU dcgettext() function is already present or preinstalled.])
  284. fi
  285. dnl We need to process the po/ directory.
  286. POSUB=po
  287. fi
  288. ifelse(gt_included_intl, yes, [
  289. dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
  290. dnl to 'yes' because some of the testsuite requires it.
  291. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
  292. BUILD_INCLUDED_LIBINTL=yes
  293. fi
  294. dnl Make all variables we use known to autoconf.
  295. AC_SUBST(BUILD_INCLUDED_LIBINTL)
  296. AC_SUBST(USE_INCLUDED_LIBINTL)
  297. AC_SUBST(CATOBJEXT)
  298. dnl For backward compatibility. Some configure.ins may be using this.
  299. nls_cv_header_intl=
  300. nls_cv_header_libgt=
  301. dnl For backward compatibility. Some Makefiles may be using this.
  302. DATADIRNAME=share
  303. AC_SUBST(DATADIRNAME)
  304. dnl For backward compatibility. Some Makefiles may be using this.
  305. INSTOBJEXT=.mo
  306. AC_SUBST(INSTOBJEXT)
  307. dnl For backward compatibility. Some Makefiles may be using this.
  308. GENCAT=gencat
  309. AC_SUBST(GENCAT)
  310. dnl For backward compatibility. Some Makefiles may be using this.
  311. if test "$USE_INCLUDED_LIBINTL" = yes; then
  312. INTLOBJS="\$(GETTOBJS)"
  313. fi
  314. AC_SUBST(INTLOBJS)
  315. dnl Enable libtool support if the surrounding package wishes it.
  316. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
  317. AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
  318. ])
  319. dnl For backward compatibility. Some Makefiles may be using this.
  320. INTLLIBS="$LIBINTL"
  321. AC_SUBST(INTLLIBS)
  322. dnl Make all documented variables known to autoconf.
  323. AC_SUBST(LIBINTL)
  324. AC_SUBST(LTLIBINTL)
  325. AC_SUBST(POSUB)
  326. ])
  327. dnl Checks for all prerequisites of the intl subdirectory,
  328. dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
  329. dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
  330. AC_DEFUN([AM_INTL_SUBDIR],
  331. [
  332. AC_REQUIRE([AC_PROG_INSTALL])dnl
  333. AC_REQUIRE([AM_MKINSTALLDIRS])dnl
  334. AC_REQUIRE([AC_PROG_CC])dnl
  335. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  336. AC_REQUIRE([gt_GLIBC2])dnl
  337. AC_REQUIRE([AC_PROG_RANLIB])dnl
  338. AC_REQUIRE([AC_ISC_POSIX])dnl
  339. AC_REQUIRE([AC_HEADER_STDC])dnl
  340. AC_REQUIRE([AC_C_CONST])dnl
  341. AC_REQUIRE([bh_C_SIGNED])dnl
  342. AC_REQUIRE([AC_C_INLINE])dnl
  343. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  344. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  345. AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
  346. AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
  347. AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
  348. AC_REQUIRE([gt_TYPE_WINT_T])dnl
  349. AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
  350. AC_REQUIRE([gl_AC_HEADER_STDINT_H])
  351. AC_REQUIRE([gt_TYPE_INTMAX_T])
  352. AC_REQUIRE([gt_PRINTF_POSIX])
  353. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  354. AC_REQUIRE([AC_FUNC_MMAP])dnl
  355. AC_REQUIRE([gl_GLIBC21])dnl
  356. AC_REQUIRE([gt_INTDIV0])dnl
  357. AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
  358. AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
  359. AC_REQUIRE([gt_INTTYPES_PRI])dnl
  360. AC_REQUIRE([gl_XSIZE])dnl
  361. AC_REQUIRE([gt_INTL_MACOSX])dnl
  362. AC_CHECK_TYPE([ptrdiff_t], ,
  363. [AC_DEFINE([ptrdiff_t], [long],
  364. [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
  365. ])
  366. AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
  367. stdlib.h string.h unistd.h sys/param.h])
  368. AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
  369. mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
  370. strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
  371. __fsetlocking])
  372. dnl Use the _snprintf function only if it is declared (because on NetBSD it
  373. dnl is defined as a weak alias of snprintf; we prefer to use the latter).
  374. gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
  375. gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
  376. dnl Use the *_unlocked functions only if they are declared.
  377. dnl (because some of them were defined without being declared in Solaris
  378. dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
  379. dnl on Solaris 2.5.1 to run on Solaris 2.6).
  380. dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
  381. gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
  382. gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
  383. gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
  384. case $gt_cv_func_printf_posix in
  385. *yes) HAVE_POSIX_PRINTF=1 ;;
  386. *) HAVE_POSIX_PRINTF=0 ;;
  387. esac
  388. AC_SUBST([HAVE_POSIX_PRINTF])
  389. if test "$ac_cv_func_asprintf" = yes; then
  390. HAVE_ASPRINTF=1
  391. else
  392. HAVE_ASPRINTF=0
  393. fi
  394. AC_SUBST([HAVE_ASPRINTF])
  395. if test "$ac_cv_func_snprintf" = yes; then
  396. HAVE_SNPRINTF=1
  397. else
  398. HAVE_SNPRINTF=0
  399. fi
  400. AC_SUBST([HAVE_SNPRINTF])
  401. if test "$ac_cv_func_wprintf" = yes; then
  402. HAVE_WPRINTF=1
  403. else
  404. HAVE_WPRINTF=0
  405. fi
  406. AC_SUBST([HAVE_WPRINTF])
  407. AM_ICONV
  408. AM_LANGINFO_CODESET
  409. if test $ac_cv_header_locale_h = yes; then
  410. gt_LC_MESSAGES
  411. fi
  412. if test -n "$INTL_MACOSX_LIBS"; then
  413. CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
  414. fi
  415. dnl intl/plural.c is generated from intl/plural.y. It requires bison,
  416. dnl because plural.y uses bison specific features. It requires at least
  417. dnl bison-1.26 because earlier versions generate a plural.c that doesn't
  418. dnl compile.
  419. dnl bison is only needed for the maintainer (who touches plural.y). But in
  420. dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
  421. dnl the rule in general Makefile. Now, some people carelessly touch the
  422. dnl files or have a broken "make" program, hence the plural.c rule will
  423. dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
  424. dnl present or too old.
  425. AC_CHECK_PROGS([INTLBISON], [bison])
  426. if test -z "$INTLBISON"; then
  427. ac_verc_fail=yes
  428. else
  429. dnl Found it, now check the version.
  430. AC_MSG_CHECKING([version of bison])
  431. changequote(<<,>>)dnl
  432. ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  433. case $ac_prog_version in
  434. '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  435. 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
  436. changequote([,])dnl
  437. ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
  438. *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
  439. esac
  440. AC_MSG_RESULT([$ac_prog_version])
  441. fi
  442. if test $ac_verc_fail = yes; then
  443. INTLBISON=:
  444. fi
  445. ])
  446. dnl Checks for special options needed on MacOS X.
  447. dnl Defines INTL_MACOSX_LIBS.
  448. AC_DEFUN([gt_INTL_MACOSX],
  449. [
  450. dnl Check for API introduced in MacOS X 10.2.
  451. AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
  452. gt_cv_func_CFPreferencesCopyAppValue,
  453. [gt_save_CPPFLAGS="$CPPFLAGS"
  454. CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
  455. gt_save_LIBS="$LIBS"
  456. LIBS="$LIBS -framework CoreFoundation"
  457. AC_TRY_LINK([#include <CFPreferences.h>],
  458. [CFPreferencesCopyAppValue(NULL, NULL)],
  459. [gt_cv_func_CFPreferencesCopyAppValue=yes],
  460. [gt_cv_func_CFPreferencesCopyAppValue=no])
  461. CPPFLAGS="$gt_save_CPPFLAGS"
  462. LIBS="$gt_save_LIBS"])
  463. if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
  464. AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
  465. [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
  466. fi
  467. dnl Check for API introduced in MacOS X 10.3.
  468. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
  469. [gt_save_CPPFLAGS="$CPPFLAGS"
  470. CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
  471. gt_save_LIBS="$LIBS"
  472. LIBS="$LIBS -framework CoreFoundation"
  473. AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();],
  474. [gt_cv_func_CFLocaleCopyCurrent=yes],
  475. [gt_cv_func_CFLocaleCopyCurrent=no])
  476. CPPFLAGS="$gt_save_CPPFLAGS"
  477. LIBS="$gt_save_LIBS"])
  478. if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
  479. AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
  480. [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
  481. fi
  482. INTL_MACOSX_LIBS=
  483. if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
  484. INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
  485. fi
  486. AC_SUBST([INTL_MACOSX_LIBS])
  487. ])
  488. dnl gt_CHECK_DECL(FUNC, INCLUDES)
  489. dnl Check whether a function is declared.
  490. AC_DEFUN([gt_CHECK_DECL],
  491. [
  492. AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
  493. [AC_TRY_COMPILE([$2], [
  494. #ifndef $1
  495. char *p = (char *) $1;
  496. #endif
  497. ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
  498. if test $ac_cv_have_decl_$1 = yes; then
  499. gt_value=1
  500. else
  501. gt_value=0
  502. fi
  503. AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
  504. [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
  505. ])
  506. dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
  507. AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
  508. # iconv.m4 serial AM4 (gettext-0.11.3)
  509. dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
  510. dnl This file is free software; the Free Software Foundation
  511. dnl gives unlimited permission to copy and/or distribute it,
  512. dnl with or without modifications, as long as this notice is preserved.
  513. dnl From Bruno Haible.
  514. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
  515. [
  516. dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
  517. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  518. AC_REQUIRE([AC_LIB_RPATH])
  519. dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  520. dnl accordingly.
  521. AC_LIB_LINKFLAGS_BODY([iconv])
  522. ])
  523. AC_DEFUN([AM_ICONV_LINK],
  524. [
  525. dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
  526. dnl those with the standalone portable GNU libiconv installed).
  527. dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  528. dnl accordingly.
  529. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
  530. dnl Add $INCICONV to CPPFLAGS before performing the following checks,
  531. dnl because if the user has installed libiconv and not disabled its use
  532. dnl via --without-libiconv-prefix, he wants to use it. The first
  533. dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
  534. am_save_CPPFLAGS="$CPPFLAGS"
  535. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
  536. AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
  537. am_cv_func_iconv="no, consider installing GNU libiconv"
  538. am_cv_lib_iconv=no
  539. AC_TRY_LINK([#include <stdlib.h>
  540. #include <iconv.h>],
  541. [iconv_t cd = iconv_open("","");
  542. iconv(cd,NULL,NULL,NULL,NULL);
  543. iconv_close(cd);],
  544. am_cv_func_iconv=yes)
  545. if test "$am_cv_func_iconv" != yes; then
  546. am_save_LIBS="$LIBS"
  547. LIBS="$LIBS $LIBICONV"
  548. AC_TRY_LINK([#include <stdlib.h>
  549. #include <iconv.h>],
  550. [iconv_t cd = iconv_open("","");
  551. iconv(cd,NULL,NULL,NULL,NULL);
  552. iconv_close(cd);],
  553. am_cv_lib_iconv=yes
  554. am_cv_func_iconv=yes)
  555. LIBS="$am_save_LIBS"
  556. fi
  557. ])
  558. if test "$am_cv_func_iconv" = yes; then
  559. AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
  560. fi
  561. if test "$am_cv_lib_iconv" = yes; then
  562. AC_MSG_CHECKING([how to link with libiconv])
  563. AC_MSG_RESULT([$LIBICONV])
  564. else
  565. dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
  566. dnl either.
  567. CPPFLAGS="$am_save_CPPFLAGS"
  568. LIBICONV=
  569. LTLIBICONV=
  570. fi
  571. AC_SUBST(LIBICONV)
  572. AC_SUBST(LTLIBICONV)
  573. ])
  574. AC_DEFUN([AM_ICONV],
  575. [
  576. AM_ICONV_LINK
  577. if test "$am_cv_func_iconv" = yes; then
  578. AC_MSG_CHECKING([for iconv declaration])
  579. AC_CACHE_VAL(am_cv_proto_iconv, [
  580. AC_TRY_COMPILE([
  581. #include <stdlib.h>
  582. #include <iconv.h>
  583. extern
  584. #ifdef __cplusplus
  585. "C"
  586. #endif
  587. #if defined(__STDC__) || defined(__cplusplus)
  588. size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
  589. #else
  590. size_t iconv();
  591. #endif
  592. ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
  593. am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
  594. am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
  595. AC_MSG_RESULT([$]{ac_t:-
  596. }[$]am_cv_proto_iconv)
  597. AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
  598. [Define as const if the declaration of iconv() needs const.])
  599. fi
  600. ])
  601. # lib-ld.m4 serial 3 (gettext-0.13)
  602. dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
  603. dnl This file is free software; the Free Software Foundation
  604. dnl gives unlimited permission to copy and/or distribute it,
  605. dnl with or without modifications, as long as this notice is preserved.
  606. dnl Subroutines of libtool.m4,
  607. dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
  608. dnl with libtool.m4.
  609. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
  610. AC_DEFUN([AC_LIB_PROG_LD_GNU],
  611. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
  612. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  613. case `$LD -v 2>&1 </dev/null` in
  614. *GNU* | *'with BFD'*)
  615. acl_cv_prog_gnu_ld=yes ;;
  616. *)
  617. acl_cv_prog_gnu_ld=no ;;
  618. esac])
  619. with_gnu_ld=$acl_cv_prog_gnu_ld
  620. ])
  621. dnl From libtool-1.4. Sets the variable LD.
  622. AC_DEFUN([AC_LIB_PROG_LD],
  623. [AC_ARG_WITH(gnu-ld,
  624. [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
  625. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  626. AC_REQUIRE([AC_PROG_CC])dnl
  627. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  628. # Prepare PATH_SEPARATOR.
  629. # The user is always right.
  630. if test "${PATH_SEPARATOR+set}" != set; then
  631. echo "#! /bin/sh" >conf$$.sh
  632. echo "exit 0" >>conf$$.sh
  633. chmod +x conf$$.sh
  634. if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
  635. PATH_SEPARATOR=';'
  636. else
  637. PATH_SEPARATOR=:
  638. fi
  639. rm -f conf$$.sh
  640. fi
  641. ac_prog=ld
  642. if test "$GCC" = yes; then
  643. # Check if gcc -print-prog-name=ld gives a path.
  644. AC_MSG_CHECKING([for ld used by GCC])
  645. case $host in
  646. *-*-mingw*)
  647. # gcc leaves a trailing carriage return which upsets mingw
  648. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  649. *)
  650. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  651. esac
  652. case $ac_prog in
  653. # Accept absolute paths.
  654. [[\\/]* | [A-Za-z]:[\\/]*)]
  655. [re_direlt='/[^/][^/]*/\.\./']
  656. # Canonicalize the path of ld
  657. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  658. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  659. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  660. done
  661. test -z "$LD" && LD="$ac_prog"
  662. ;;
  663. "")
  664. # If it fails, then pretend we aren't using GCC.
  665. ac_prog=ld
  666. ;;
  667. *)
  668. # If it is relative, then search for the first ld in PATH.
  669. with_gnu_ld=unknown
  670. ;;
  671. esac
  672. elif test "$with_gnu_ld" = yes; then
  673. AC_MSG_CHECKING([for GNU ld])
  674. else
  675. AC_MSG_CHECKING([for non-GNU ld])
  676. fi
  677. AC_CACHE_VAL(acl_cv_path_LD,
  678. [if test -z "$LD"; then
  679. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  680. for ac_dir in $PATH; do
  681. test -z "$ac_dir" && ac_dir=.
  682. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  683. acl_cv_path_LD="$ac_dir/$ac_prog"
  684. # Check to see if the program is GNU ld. I'd rather use --version,
  685. # but apparently some GNU ld's only accept -v.
  686. # Break only if it was the GNU/non-GNU ld that we prefer.
  687. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
  688. *GNU* | *'with BFD'*)
  689. test "$with_gnu_ld" != no && break ;;
  690. *)
  691. test "$with_gnu_ld" != yes && break ;;
  692. esac
  693. fi
  694. done
  695. IFS="$ac_save_ifs"
  696. else
  697. acl_cv_path_LD="$LD" # Let the user override the test with a path.
  698. fi])
  699. LD="$acl_cv_path_LD"
  700. if test -n "$LD"; then
  701. AC_MSG_RESULT($LD)
  702. else
  703. AC_MSG_RESULT(no)
  704. fi
  705. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  706. AC_LIB_PROG_LD_GNU
  707. ])
  708. # lib-link.m4 serial 5 (gettext-0.14.2)
  709. dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
  710. dnl This file is free software; the Free Software Foundation
  711. dnl gives unlimited permission to copy and/or distribute it,
  712. dnl with or without modifications, as long as this notice is preserved.
  713. dnl From Bruno Haible.
  714. dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
  715. dnl the libraries corresponding to explicit and implicit dependencies.
  716. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
  717. dnl augments the CPPFLAGS variable.
  718. AC_DEFUN([AC_LIB_LINKFLAGS],
  719. [
  720. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  721. AC_REQUIRE([AC_LIB_RPATH])
  722. define([Name],[translit([$1],[./-], [___])])
  723. define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
  724. [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
  725. AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
  726. AC_LIB_LINKFLAGS_BODY([$1], [$2])
  727. ac_cv_lib[]Name[]_libs="$LIB[]NAME"
  728. ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
  729. ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
  730. ])
  731. LIB[]NAME="$ac_cv_lib[]Name[]_libs"
  732. LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
  733. INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
  734. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  735. AC_SUBST([LIB]NAME)
  736. AC_SUBST([LTLIB]NAME)
  737. dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
  738. dnl results of this search when this library appears as a dependency.
  739. HAVE_LIB[]NAME=yes
  740. undefine([Name])
  741. undefine([NAME])
  742. ])
  743. dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
  744. dnl searches for libname and the libraries corresponding to explicit and
  745. dnl implicit dependencies, together with the specified include files and
  746. dnl the ability to compile and link the specified testcode. If found, it
  747. dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
  748. dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
  749. dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
  750. dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
  751. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
  752. [
  753. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  754. AC_REQUIRE([AC_LIB_RPATH])
  755. define([Name],[translit([$1],[./-], [___])])
  756. define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
  757. [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
  758. dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
  759. dnl accordingly.
  760. AC_LIB_LINKFLAGS_BODY([$1], [$2])
  761. dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
  762. dnl because if the user has installed lib[]Name and not disabled its use
  763. dnl via --without-lib[]Name-prefix, he wants to use it.
  764. ac_save_CPPFLAGS="$CPPFLAGS"
  765. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  766. AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
  767. ac_save_LIBS="$LIBS"
  768. LIBS="$LIBS $LIB[]NAME"
  769. AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
  770. LIBS="$ac_save_LIBS"
  771. ])
  772. if test "$ac_cv_lib[]Name" = yes; then
  773. HAVE_LIB[]NAME=yes
  774. AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
  775. AC_MSG_CHECKING([how to link with lib[]$1])
  776. AC_MSG_RESULT([$LIB[]NAME])
  777. else
  778. HAVE_LIB[]NAME=no
  779. dnl If $LIB[]NAME didn't lead to a usable library, we don't need
  780. dnl $INC[]NAME either.
  781. CPPFLAGS="$ac_save_CPPFLAGS"
  782. LIB[]NAME=
  783. LTLIB[]NAME=
  784. fi
  785. AC_SUBST([HAVE_LIB]NAME)
  786. AC_SUBST([LIB]NAME)
  787. AC_SUBST([LTLIB]NAME)
  788. undefine([Name])
  789. undefine([NAME])
  790. ])
  791. dnl Determine the platform dependent parameters needed to use rpath:
  792. dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
  793. dnl hardcode_direct, hardcode_minus_L.
  794. AC_DEFUN([AC_LIB_RPATH],
  795. [
  796. AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
  797. AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
  798. AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
  799. AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
  800. AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
  801. CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
  802. ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
  803. . ./conftest.sh
  804. rm -f ./conftest.sh
  805. acl_cv_rpath=done
  806. ])
  807. wl="$acl_cv_wl"
  808. libext="$acl_cv_libext"
  809. shlibext="$acl_cv_shlibext"
  810. hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
  811. hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
  812. hardcode_direct="$acl_cv_hardcode_direct"
  813. hardcode_minus_L="$acl_cv_hardcode_minus_L"
  814. dnl Determine whether the user wants rpath handling at all.
  815. AC_ARG_ENABLE(rpath,
  816. [ --disable-rpath do not hardcode runtime library paths],
  817. :, enable_rpath=yes)
  818. ])
  819. dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
  820. dnl the libraries corresponding to explicit and implicit dependencies.
  821. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
  822. AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
  823. [
  824. define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
  825. [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
  826. dnl By default, look in $includedir and $libdir.
  827. use_additional=yes
  828. AC_LIB_WITH_FINAL_PREFIX([
  829. eval additional_includedir=\"$includedir\"
  830. eval additional_libdir=\"$libdir\"
  831. ])
  832. AC_LIB_ARG_WITH([lib$1-prefix],
  833. [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
  834. --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
  835. [
  836. if test "X$withval" = "Xno"; then
  837. use_additional=no
  838. else
  839. if test "X$withval" = "X"; then
  840. AC_LIB_WITH_FINAL_PREFIX([
  841. eval additional_includedir=\"$includedir\"
  842. eval additional_libdir=\"$libdir\"
  843. ])
  844. else
  845. additional_includedir="$withval/include"
  846. additional_libdir="$withval/lib"
  847. fi
  848. fi
  849. ])
  850. dnl Search the library and its dependencies in $additional_libdir and
  851. dnl $LDFLAGS. Using breadth-first-seach.
  852. LIB[]NAME=
  853. LTLIB[]NAME=
  854. INC[]NAME=
  855. rpathdirs=
  856. ltrpathdirs=
  857. names_already_handled=
  858. names_next_round='$1 $2'
  859. while test -n "$names_next_round"; do
  860. names_this_round="$names_next_round"
  861. names_next_round=
  862. for name in $names_this_round; do
  863. already_handled=
  864. for n in $names_already_handled; do
  865. if test "$n" = "$name"; then
  866. already_handled=yes
  867. break
  868. fi
  869. done
  870. if test -z "$already_handled"; then
  871. names_already_handled="$names_already_handled $name"
  872. dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
  873. dnl or AC_LIB_HAVE_LINKFLAGS call.
  874. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
  875. eval value=\"\$HAVE_LIB$uppername\"
  876. if test -n "$value"; then
  877. if test "$value" = yes; then
  878. eval value=\"\$LIB$uppername\"
  879. test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
  880. eval value=\"\$LTLIB$uppername\"
  881. test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
  882. else
  883. dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
  884. dnl that this library doesn't exist. So just drop it.
  885. :
  886. fi
  887. else
  888. dnl Search the library lib$name in $additional_libdir and $LDFLAGS
  889. dnl and the already constructed $LIBNAME/$LTLIBNAME.
  890. found_dir=
  891. found_la=
  892. found_so=
  893. found_a=
  894. if test $use_additional = yes; then
  895. if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
  896. found_dir="$additional_libdir"
  897. found_so="$additional_libdir/lib$name.$shlibext"
  898. if test -f "$additional_libdir/lib$name.la"; then
  899. found_la="$additional_libdir/lib$name.la"
  900. fi
  901. else
  902. if test -f "$additional_libdir/lib$name.$libext"; then
  903. found_dir="$additional_libdir"
  904. found_a="$additional_libdir/lib$name.$libext"
  905. if test -f "$additional_libdir/lib$name.la"; then
  906. found_la="$additional_libdir/lib$name.la"
  907. fi
  908. fi
  909. fi
  910. fi
  911. if test "X$found_dir" = "X"; then
  912. for x in $LDFLAGS $LTLIB[]NAME; do
  913. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  914. case "$x" in
  915. -L*)
  916. dir=`echo "X$x" | sed -e 's/^X-L//'`
  917. if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
  918. found_dir="$dir"
  919. found_so="$dir/lib$name.$shlibext"
  920. if test -f "$dir/lib$name.la"; then
  921. found_la="$dir/lib$name.la"
  922. fi
  923. else
  924. if test -f "$dir/lib$name.$libext"; then
  925. found_dir="$dir"
  926. found_a="$dir/lib$name.$libext"
  927. if test -f "$dir/lib$name.la"; then
  928. found_la="$dir/lib$name.la"
  929. fi
  930. fi
  931. fi
  932. ;;
  933. esac
  934. if test "X$found_dir" != "X"; then
  935. break
  936. fi
  937. done
  938. fi
  939. if test "X$found_dir" != "X"; then
  940. dnl Found the library.
  941. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
  942. if test "X$found_so" != "X"; then
  943. dnl Linking with a shared library. We attempt to hardcode its
  944. dnl directory into the executable's runpath, unless it's the
  945. dnl standard /usr/lib.
  946. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
  947. dnl No hardcoding is needed.
  948. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  949. else
  950. dnl Use an explicit option to hardcode DIR into the resulting
  951. dnl binary.
  952. dnl Potentially add DIR to ltrpathdirs.
  953. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  954. haveit=
  955. for x in $ltrpathdirs; do
  956. if test "X$x" = "X$found_dir"; then
  957. haveit=yes
  958. break
  959. fi
  960. done
  961. if test -z "$haveit"; then
  962. ltrpathdirs="$ltrpathdirs $found_dir"
  963. fi
  964. dnl The hardcoding into $LIBNAME is system dependent.
  965. if test "$hardcode_direct" = yes; then
  966. dnl Using DIR/libNAME.so during linking hardcodes DIR into the
  967. dnl resulting binary.
  968. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  969. else
  970. if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
  971. dnl Use an explicit option to hardcode DIR into the resulting
  972. dnl binary.
  973. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  974. dnl Potentially add DIR to rpathdirs.
  975. dnl The rpathdirs will be appended to $LIBNAME at the end.
  976. haveit=
  977. for x in $rpathdirs; do
  978. if test "X$x" = "X$found_dir"; then
  979. haveit=yes
  980. break
  981. fi
  982. done
  983. if test -z "$haveit"; then
  984. rpathdirs="$rpathdirs $found_dir"
  985. fi
  986. else
  987. dnl Rely on "-L$found_dir".
  988. dnl But don't add it if it's already contained in the LDFLAGS
  989. dnl or the already constructed $LIBNAME
  990. haveit=
  991. for x in $LDFLAGS $LIB[]NAME; do
  992. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  993. if test "X$x" = "X-L$found_dir"; then
  994. haveit=yes
  995. break
  996. fi
  997. done
  998. if test -z "$haveit"; then
  999. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
  1000. fi
  1001. if test "$hardcode_minus_L" != no; then
  1002. dnl FIXME: Not sure whether we should use
  1003. dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  1004. dnl here.
  1005. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  1006. else
  1007. dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
  1008. dnl here, because this doesn't fit in flags passed to the
  1009. dnl compiler. So give up. No hardcoding. This affects only
  1010. dnl very old systems.
  1011. dnl FIXME: Not sure whether we should use
  1012. dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  1013. dnl here.
  1014. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  1015. fi
  1016. fi
  1017. fi
  1018. fi
  1019. else
  1020. if test "X$found_a" != "X"; then
  1021. dnl Linking with a static library.
  1022. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
  1023. else
  1024. dnl We shouldn't come here, but anyway it's good to have a
  1025. dnl fallback.
  1026. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
  1027. fi
  1028. fi
  1029. dnl Assume the include files are nearby.
  1030. additional_includedir=
  1031. case "$found_dir" in
  1032. */lib | */lib/)
  1033. basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
  1034. additional_includedir="$basedir/include"
  1035. ;;
  1036. esac
  1037. if test "X$additional_includedir" != "X"; then
  1038. dnl Potentially add $additional_includedir to $INCNAME.
  1039. dnl But don't add it
  1040. dnl 1. if it's the standard /usr/include,
  1041. dnl 2. if it's /usr/local/include and we are using GCC on Linux,
  1042. dnl 3. if it's already present in $CPPFLAGS or the already
  1043. dnl constructed $INCNAME,
  1044. dnl 4. if it doesn't exist as a directory.
  1045. if test "X$additional_includedir" != "X/usr/include"; then
  1046. haveit=
  1047. if test "X$additional_includedir" = "X/usr/local/include"; then
  1048. if test -n "$GCC"; then
  1049. case $host_os in
  1050. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  1051. esac
  1052. fi
  1053. fi
  1054. if test -z "$haveit"; then
  1055. for x in $CPPFLAGS $INC[]NAME; do
  1056. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  1057. if test "X$x" = "X-I$additional_includedir"; then
  1058. haveit=yes
  1059. break
  1060. fi
  1061. done
  1062. if test -z "$haveit"; then
  1063. if test -d "$additional_includedir"; then
  1064. dnl Really add $additional_includedir to $INCNAME.
  1065. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
  1066. fi
  1067. fi
  1068. fi
  1069. fi
  1070. fi
  1071. dnl Look for dependencies.
  1072. if test -n "$found_la"; then
  1073. dnl Read the .la file. It defines the variables
  1074. dnl dlname, library_names, old_library, dependency_libs, current,
  1075. dnl age, revision, installed, dlopen, dlpreopen, libdir.
  1076. save_libdir="$libdir"
  1077. case "$found_la" in
  1078. */* | *\\*) . "$found_la" ;;
  1079. *) . "./$found_la" ;;
  1080. esac
  1081. libdir="$save_libdir"
  1082. dnl We use only dependency_libs.
  1083. for dep in $dependency_libs; do
  1084. case "$dep" in
  1085. -L*)
  1086. additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
  1087. dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
  1088. dnl But don't add it
  1089. dnl 1. if it's the standard /usr/lib,
  1090. dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
  1091. dnl 3. if it's already present in $LDFLAGS or the already
  1092. dnl constructed $LIBNAME,
  1093. dnl 4. if it doesn't exist as a directory.
  1094. if test "X$additional_libdir" != "X/usr/lib"; then
  1095. haveit=
  1096. if test "X$additional_libdir" = "X/usr/local/lib"; then
  1097. if test -n "$GCC"; then
  1098. case $host_os in
  1099. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  1100. esac
  1101. fi
  1102. fi
  1103. if test -z "$haveit"; then
  1104. haveit=
  1105. for x in $LDFLAGS $LIB[]NAME; do
  1106. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  1107. if test "X$x" = "X-L$additional_libdir"; then
  1108. haveit=yes
  1109. break
  1110. fi
  1111. done
  1112. if test -z "$haveit"; then
  1113. if test -d "$additional_libdir"; then
  1114. dnl Really add $additional_libdir to $LIBNAME.
  1115. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
  1116. fi
  1117. fi
  1118. haveit=
  1119. for x in $LDFLAGS $LTLIB[]NAME; do
  1120. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  1121. if test "X$x" = "X-L$additional_libdir"; then
  1122. haveit=yes
  1123. break
  1124. fi
  1125. done
  1126. if test -z "$haveit"; then
  1127. if test -d "$additional_libdir"; then
  1128. dnl Really add $additional_libdir to $LTLIBNAME.
  1129. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
  1130. fi
  1131. fi
  1132. fi
  1133. fi
  1134. ;;
  1135. -R*)
  1136. dir=`echo "X$dep" | sed -e 's/^X-R//'`
  1137. if test "$enable_rpath" != no; then
  1138. dnl Potentially add DIR to rpathdirs.
  1139. dnl The rpathdirs will be appended to $LIBNAME at the end.
  1140. haveit=
  1141. for x in $rpathdirs; do
  1142. if test "X$x" = "X$dir"; then
  1143. haveit=yes
  1144. break
  1145. fi
  1146. done
  1147. if test -z "$haveit"; then
  1148. rpathdirs="$rpathdirs $dir"
  1149. fi
  1150. dnl Potentially add DIR to ltrpathdirs.
  1151. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  1152. haveit=
  1153. for x in $ltrpathdirs; do
  1154. if test "X$x" = "X$dir"; then
  1155. haveit=yes
  1156. break
  1157. fi
  1158. done
  1159. if test -z "$haveit"; then
  1160. ltrpathdirs="$ltrpathdirs $dir"
  1161. fi
  1162. fi
  1163. ;;
  1164. -l*)
  1165. dnl Handle this in the next round.
  1166. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
  1167. ;;
  1168. *.la)
  1169. dnl Handle this in the next round. Throw away the .la's
  1170. dnl directory; it is already contained in a preceding -L
  1171. dnl option.
  1172. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
  1173. ;;
  1174. *)
  1175. dnl Most likely an immediate library name.
  1176. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
  1177. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
  1178. ;;
  1179. esac
  1180. done
  1181. fi
  1182. else
  1183. dnl Didn't find the library; assume it is in the system directories
  1184. dnl known to the linker and runtime loader. (All the system
  1185. dnl directories known to the linker should also be known to the
  1186. dnl runtime loader, otherwise the system is severely misconfigured.)
  1187. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  1188. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
  1189. fi
  1190. fi
  1191. fi
  1192. done
  1193. done
  1194. if test "X$rpathdirs" != "X"; then
  1195. if test -n "$hardcode_libdir_separator"; then
  1196. dnl Weird platform: only the last -rpath option counts, the user must
  1197. dnl pass all path elements in one option. We can arrange that for a
  1198. dnl single library, but not when more than one $LIBNAMEs are used.
  1199. alldirs=
  1200. for found_dir in $rpathdirs; do
  1201. alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
  1202. done
  1203. dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
  1204. acl_save_libdir="$libdir"
  1205. libdir="$alldirs"
  1206. eval flag=\"$hardcode_libdir_flag_spec\"
  1207. libdir="$acl_save_libdir"
  1208. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  1209. else
  1210. dnl The -rpath options are cumulative.
  1211. for found_dir in $rpathdirs; do
  1212. acl_save_libdir="$libdir"
  1213. libdir="$found_dir"
  1214. eval flag=\"$hardcode_libdir_flag_spec\"
  1215. libdir="$acl_save_libdir"
  1216. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  1217. done
  1218. fi
  1219. fi
  1220. if test "X$ltrpathdirs" != "X"; then
  1221. dnl When using libtool, the option that works for both libraries and
  1222. dnl executables is -R. The -R options are cumulative.
  1223. for found_dir in $ltrpathdirs; do
  1224. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
  1225. done
  1226. fi
  1227. ])
  1228. dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
  1229. dnl unless already present in VAR.
  1230. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
  1231. dnl contains two or three consecutive elements that belong together.
  1232. AC_DEFUN([AC_LIB_APPENDTOVAR],
  1233. [
  1234. for element in [$2]; do
  1235. haveit=
  1236. for x in $[$1]; do
  1237. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  1238. if test "X$x" = "X$element"; then
  1239. haveit=yes
  1240. break
  1241. fi
  1242. done
  1243. if test -z "$haveit"; then
  1244. [$1]="${[$1]}${[$1]:+ }$element"
  1245. fi
  1246. done
  1247. ])
  1248. # lib-prefix.m4 serial 4 (gettext-0.14.2)
  1249. dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
  1250. dnl This file is free software; the Free Software Foundation
  1251. dnl gives unlimited permission to copy and/or distribute it,
  1252. dnl with or without modifications, as long as this notice is preserved.
  1253. dnl From Bruno Haible.
  1254. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
  1255. dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
  1256. dnl require excessive bracketing.
  1257. ifdef([AC_HELP_STRING],
  1258. [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
  1259. [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
  1260. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
  1261. dnl to access previously installed libraries. The basic assumption is that
  1262. dnl a user will want packages to use other packages he previously installed
  1263. dnl with the same --prefix option.
  1264. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
  1265. dnl libraries, but is otherwise very convenient.
  1266. AC_DEFUN([AC_LIB_PREFIX],
  1267. [
  1268. AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
  1269. AC_REQUIRE([AC_PROG_CC])
  1270. AC_REQUIRE([AC_CANONICAL_HOST])
  1271. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  1272. dnl By default, look in $includedir and $libdir.
  1273. use_additional=yes
  1274. AC_LIB_WITH_FINAL_PREFIX([
  1275. eval additional_includedir=\"$includedir\"
  1276. eval additional_libdir=\"$libdir\"
  1277. ])
  1278. AC_LIB_ARG_WITH([lib-prefix],
  1279. [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
  1280. --without-lib-prefix don't search for libraries in includedir and libdir],
  1281. [
  1282. if test "X$withval" = "Xno"; then
  1283. use_additional=no
  1284. else
  1285. if test "X$withval" = "X"; then
  1286. AC_LIB_WITH_FINAL_PREFIX([
  1287. eval additional_includedir=\"$includedir\"
  1288. eval additional_libdir=\"$libdir\"
  1289. ])
  1290. else
  1291. additional_includedir="$withval/include"
  1292. additional_libdir="$withval/lib"
  1293. fi
  1294. fi
  1295. ])
  1296. if test $use_additional = yes; then
  1297. dnl Potentially add $additional_includedir to $CPPFLAGS.
  1298. dnl But don't add it
  1299. dnl 1. if it's the standard /usr/include,
  1300. dnl 2. if it's already present in $CPPFLAGS,
  1301. dnl 3. if it's /usr/local/include and we are using GCC on Linux,
  1302. dnl 4. if it doesn't exist as a directory.
  1303. if test "X$additional_includedir" != "X/usr/include"; then
  1304. haveit=
  1305. for x in $CPPFLAGS; do
  1306. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  1307. if test "X$x" = "X-I$additional_includedir"; then
  1308. haveit=yes
  1309. break
  1310. fi
  1311. done
  1312. if test -z "$haveit"; then
  1313. if test "X$additional_includedir" = "X/usr/local/include"; then
  1314. if test -n "$GCC"; then
  1315. case $host_os in
  1316. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  1317. esac
  1318. fi
  1319. fi
  1320. if test -z "$haveit"; then
  1321. if test -d "$additional_includedir"; then
  1322. dnl Really add $additional_includedir to $CPPFLAGS.
  1323. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
  1324. fi
  1325. fi
  1326. fi
  1327. fi
  1328. dnl Potentially add $additional_libdir to $LDFLAGS.
  1329. dnl But don't add it
  1330. dnl 1. if it's the standard /usr/lib,
  1331. dnl 2. if it's already present in $LDFLAGS,
  1332. dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
  1333. dnl 4. if it doesn't exist as a directory.
  1334. if test "X$additional_libdir" != "X/usr/lib"; then
  1335. haveit=
  1336. for x in $LDFLAGS; do
  1337. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  1338. if test "X$x" = "X-L$additional_libdir"; then
  1339. haveit=yes
  1340. break
  1341. fi
  1342. done
  1343. if test -z "$haveit"; then
  1344. if test "X$additional_libdir" = "X/usr/local/lib"; then
  1345. if test -n "$GCC"; then
  1346. case $host_os in
  1347. linux*) haveit=yes;;
  1348. esac
  1349. fi
  1350. fi
  1351. if test -z "$haveit"; then
  1352. if test -d "$additional_libdir"; then
  1353. dnl Really add $additional_libdir to $LDFLAGS.
  1354. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
  1355. fi
  1356. fi
  1357. fi
  1358. fi
  1359. fi
  1360. ])
  1361. dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
  1362. dnl acl_final_exec_prefix, containing the values to which $prefix and
  1363. dnl $exec_prefix will expand at the end of the configure script.
  1364. AC_DEFUN([AC_LIB_PREPARE_PREFIX],
  1365. [
  1366. dnl Unfortunately, prefix and exec_prefix get only finally determined
  1367. dnl at the end of configure.
  1368. if test "X$prefix" = "XNONE"; then
  1369. acl_final_prefix="$ac_default_prefix"
  1370. else
  1371. acl_final_prefix="$prefix"
  1372. fi
  1373. if test "X$exec_prefix" = "XNONE"; then
  1374. acl_final_exec_prefix='${prefix}'
  1375. else
  1376. acl_final_exec_prefix="$exec_prefix"
  1377. fi
  1378. acl_save_prefix="$prefix"
  1379. prefix="$acl_final_prefix"
  1380. eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  1381. prefix="$acl_save_prefix"
  1382. ])
  1383. dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
  1384. dnl variables prefix and exec_prefix bound to the values they will have
  1385. dnl at the end of the configure script.
  1386. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
  1387. [
  1388. acl_save_prefix="$prefix"
  1389. prefix="$acl_final_prefix"
  1390. acl_save_exec_prefix="$exec_prefix"
  1391. exec_prefix="$acl_final_exec_prefix"
  1392. $1
  1393. exec_prefix="$acl_save_exec_prefix"
  1394. prefix="$acl_save_prefix"
  1395. ])
  1396. # nls.m4 serial 1 (gettext-0.12)
  1397. dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
  1398. dnl This file is free software; the Free Software Foundation
  1399. dnl gives unlimited permission to copy and/or distribute it,
  1400. dnl with or without modifications, as long as this notice is preserved.
  1401. dnl
  1402. dnl This file can can be used in projects which are not available under
  1403. dnl the GNU General Public License or the GNU Library General Public
  1404. dnl License but which still want to provide support for the GNU gettext
  1405. dnl functionality.
  1406. dnl Please note that the actual code of the GNU gettext library is covered
  1407. dnl by the GNU Library General Public License, and the rest of the GNU
  1408. dnl gettext package package is covered by the GNU General Public License.
  1409. dnl They are *not* in the public domain.
  1410. dnl Authors:
  1411. dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
  1412. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
  1413. AC_DEFUN([AM_NLS],
  1414. [
  1415. AC_MSG_CHECKING([whether NLS is requested])
  1416. dnl Default is enabled NLS
  1417. AC_ARG_ENABLE(nls,
  1418. [ --disable-nls do not use Native Language Support],
  1419. USE_NLS=$enableval, USE_NLS=yes)
  1420. AC_MSG_RESULT($USE_NLS)
  1421. AC_SUBST(USE_NLS)
  1422. ])
  1423. AC_DEFUN([AM_MKINSTALLDIRS],
  1424. [
  1425. dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
  1426. dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
  1427. dnl Try to locate it.
  1428. MKINSTALLDIRS=
  1429. if test -n "$ac_aux_dir"; then
  1430. case "$ac_aux_dir" in
  1431. /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
  1432. *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
  1433. esac
  1434. fi
  1435. if test -z "$MKINSTALLDIRS"; then
  1436. MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
  1437. fi
  1438. AC_SUBST(MKINSTALLDIRS)
  1439. ])
  1440. # po.m4 serial 5 (gettext-0.14.2)
  1441. dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
  1442. dnl This file is free software; the Free Software Foundation
  1443. dnl gives unlimited permission to copy and/or distribute it,
  1444. dnl with or without modifications, as long as this notice is preserved.
  1445. dnl
  1446. dnl This file can can be used in projects which are not available under
  1447. dnl the GNU General Public License or the GNU Library General Public
  1448. dnl License but which still want to provide support for the GNU gettext
  1449. dnl functionality.
  1450. dnl Please note that the actual code of the GNU gettext library is covered
  1451. dnl by the GNU Library General Public License, and the rest of the GNU
  1452. dnl gettext package package is covered by the GNU General Public License.
  1453. dnl They are *not* in the public domain.
  1454. dnl Authors:
  1455. dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
  1456. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
  1457. AC_PREREQ(2.50)
  1458. dnl Checks for all prerequisites of the po subdirectory.
  1459. AC_DEFUN([AM_PO_SUBDIRS],
  1460. [
  1461. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  1462. AC_REQUIRE([AC_PROG_INSTALL])dnl
  1463. AC_REQUIRE([AM_MKINSTALLDIRS])dnl
  1464. AC_REQUIRE([AM_NLS])dnl
  1465. dnl Perform the following tests also if --disable-nls has been given,
  1466. dnl because they are needed for "make dist" to work.
  1467. dnl Search for GNU msgfmt in the PATH.
  1468. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
  1469. dnl The second test excludes FreeBSD msgfmt.
  1470. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  1471. [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
  1472. (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
  1473. :)
  1474. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  1475. dnl Search for GNU xgettext 0.12 or newer in the PATH.
  1476. dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
  1477. dnl The second test excludes FreeBSD xgettext.
  1478. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  1479. [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
  1480. (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
  1481. :)
  1482. dnl Remove leftover from FreeBSD xgettext call.
  1483. rm -f messages.po
  1484. dnl Search for GNU msgmerge 0.11 or newer in the PATH.
  1485. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
  1486. [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
  1487. dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
  1488. dnl Test whether we really found GNU msgfmt.
  1489. if test "$GMSGFMT" != ":"; then
  1490. dnl If it is no GNU msgfmt we define it as : so that the
  1491. dnl Makefiles still can work.
  1492. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
  1493. (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
  1494. : ;
  1495. else
  1496. GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
  1497. AC_MSG_RESULT(
  1498. [found $GMSGFMT program is not GNU msgfmt; ignore it])
  1499. GMSGFMT=":"
  1500. fi
  1501. fi
  1502. dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
  1503. dnl Test whether we really found GNU xgettext.
  1504. if test "$XGETTEXT" != ":"; then
  1505. dnl If it is no GNU xgettext we define it as : so that the
  1506. dnl Makefiles still can work.
  1507. if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
  1508. (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
  1509. : ;
  1510. else
  1511. AC_MSG_RESULT(
  1512. [found xgettext program is not GNU xgettext; ignore it])
  1513. XGETTEXT=":"
  1514. fi
  1515. dnl Remove leftover from FreeBSD xgettext call.
  1516. rm -f messages.po
  1517. fi
  1518. AC_OUTPUT_COMMANDS([
  1519. for ac_file in $CONFIG_FILES; do
  1520. # Support "outfile[:infile[:infile...]]"
  1521. case "$ac_file" in
  1522. *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  1523. esac
  1524. # PO directories have a Makefile.in generated from Makefile.in.in.
  1525. case "$ac_file" in */Makefile.in)
  1526. # Adjust a relative srcdir.
  1527. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
  1528. ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
  1529. ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
  1530. # In autoconf-2.13 it is called $ac_given_srcdir.
  1531. # In autoconf-2.50 it is called $srcdir.
  1532. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
  1533. case "$ac_given_srcdir" in
  1534. .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
  1535. /*) top_srcdir="$ac_given_srcdir" ;;
  1536. *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
  1537. esac
  1538. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
  1539. rm -f "$ac_dir/POTFILES"
  1540. test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
  1541. cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
  1542. POMAKEFILEDEPS="POTFILES.in"
  1543. # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
  1544. # on $ac_dir but don't depend on user-specified configuration
  1545. # parameters.
  1546. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
  1547. # The LINGUAS file contains the set of available languages.
  1548. if test -n "$OBSOLETE_ALL_LINGUAS"; then
  1549. test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
  1550. fi
  1551. ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
  1552. # Hide the ALL_LINGUAS assigment from automake.
  1553. eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
  1554. POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
  1555. else
  1556. # The set of available languages was given in configure.in.
  1557. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
  1558. fi
  1559. # Compute POFILES
  1560. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
  1561. # Compute UPDATEPOFILES
  1562. # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
  1563. # Compute DUMMYPOFILES
  1564. # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
  1565. # Compute GMOFILES
  1566. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
  1567. case "$ac_given_srcdir" in
  1568. .) srcdirpre= ;;
  1569. *) srcdirpre='$(srcdir)/' ;;
  1570. esac
  1571. POFILES=
  1572. UPDATEPOFILES=
  1573. DUMMYPOFILES=
  1574. GMOFILES=
  1575. for lang in $ALL_LINGUAS; do
  1576. POFILES="$POFILES $srcdirpre$lang.po"
  1577. UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
  1578. DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
  1579. GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
  1580. done
  1581. # CATALOGS depends on both $ac_dir and the user's LINGUAS
  1582. # environment variable.
  1583. INST_LINGUAS=
  1584. if test -n "$ALL_LINGUAS"; then
  1585. for presentlang in $ALL_LINGUAS; do
  1586. useit=no
  1587. if test "%UNSET%" != "$LINGUAS"; then
  1588. desiredlanguages="$LINGUAS"
  1589. else
  1590. desiredlanguages="$ALL_LINGUAS"
  1591. fi
  1592. for desiredlang in $desiredlanguages; do
  1593. # Use the presentlang catalog if desiredlang is
  1594. # a. equal to presentlang, or
  1595. # b. a variant of presentlang (because in this case,
  1596. # presentlang can be used as a fallback for messages
  1597. # which are not translated in the desiredlang catalog).
  1598. case "$desiredlang" in
  1599. "$presentlang"*) useit=yes;;
  1600. esac
  1601. done
  1602. if test $useit = yes; then
  1603. INST_LINGUAS="$INST_LINGUAS $presentlang"
  1604. fi
  1605. done
  1606. fi
  1607. CATALOGS=
  1608. if test -n "$INST_LINGUAS"; then
  1609. for lang in $INST_LINGUAS; do
  1610. CATALOGS="$CATALOGS $lang.gmo"
  1611. done
  1612. fi
  1613. test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
  1614. sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
  1615. for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
  1616. if test -f "$f"; then
  1617. case "$f" in
  1618. *.orig | *.bak | *~) ;;
  1619. *) cat "$f" >> "$ac_dir/Makefile" ;;
  1620. esac
  1621. fi
  1622. done
  1623. fi
  1624. ;;
  1625. esac
  1626. done],
  1627. [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
  1628. # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
  1629. # from automake.
  1630. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
  1631. # Capture the value of LINGUAS because we need it to compute CATALOGS.
  1632. LINGUAS="${LINGUAS-%UNSET%}"
  1633. ])
  1634. ])
  1635. dnl Postprocesses a Makefile in a directory containing PO files.
  1636. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
  1637. [
  1638. # When this code is run, in config.status, two variables have already been
  1639. # set:
  1640. # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
  1641. # - LINGUAS is the value of the environment variable LINGUAS at configure
  1642. # time.
  1643. changequote(,)dnl
  1644. # Adjust a relative srcdir.
  1645. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
  1646. ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
  1647. ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
  1648. # In autoconf-2.13 it is called $ac_given_srcdir.
  1649. # In autoconf-2.50 it is called $srcdir.
  1650. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
  1651. case "$ac_given_srcdir" in
  1652. .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
  1653. /*) top_srcdir="$ac_given_srcdir" ;;
  1654. *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
  1655. esac
  1656. # Find a way to echo strings without interpreting backslash.
  1657. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
  1658. gt_echo='echo'
  1659. else
  1660. if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
  1661. gt_echo='printf %s\n'
  1662. else
  1663. echo_func () {
  1664. cat <<EOT
  1665. $*
  1666. EOT
  1667. }
  1668. gt_echo='echo_func'
  1669. fi
  1670. fi
  1671. # A sed script that extracts the value of VARIABLE from a Makefile.
  1672. sed_x_variable='
  1673. # Test if the hold space is empty.
  1674. x
  1675. s/P/P/
  1676. x
  1677. ta
  1678. # Yes it was empty. Look if we have the expected variable definition.
  1679. /^[ ]*VARIABLE[ ]*=/{
  1680. # Seen the first line of the variable definition.
  1681. s/^[ ]*VARIABLE[ ]*=//
  1682. ba
  1683. }
  1684. bd
  1685. :a
  1686. # Here we are processing a line from the variable definition.
  1687. # Remove comment, more precisely replace it with a space.
  1688. s/#.*$/ /
  1689. # See if the line ends in a backslash.
  1690. tb
  1691. :b
  1692. s/\\$//
  1693. # Print the line, without the trailing backslash.
  1694. p
  1695. tc
  1696. # There was no trailing backslash. The end of the variable definition is
  1697. # reached. Clear the hold space.
  1698. s/^.*$//
  1699. x
  1700. bd
  1701. :c
  1702. # A trailing backslash means that the variable definition continues in the
  1703. # next line. Put a nonempty string into the hold space to indicate this.
  1704. s/^.*$/P/
  1705. x
  1706. :d
  1707. '
  1708. changequote([,])dnl
  1709. # Set POTFILES to the value of the Makefile variable POTFILES.
  1710. sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
  1711. POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
  1712. # Compute POTFILES_DEPS as
  1713. # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
  1714. POTFILES_DEPS=
  1715. for file in $POTFILES; do
  1716. POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
  1717. done
  1718. POMAKEFILEDEPS=""
  1719. if test -n "$OBSOLETE_ALL_LINGUAS"; then
  1720. test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
  1721. fi
  1722. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
  1723. # The LINGUAS file contains the set of available languages.
  1724. ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
  1725. POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
  1726. else
  1727. # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
  1728. sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
  1729. ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
  1730. fi
  1731. # Hide the ALL_LINGUAS assigment from automake.
  1732. eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
  1733. # Compute POFILES
  1734. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
  1735. # Compute UPDATEPOFILES
  1736. # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
  1737. # Compute DUMMYPOFILES
  1738. # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
  1739. # Compute GMOFILES
  1740. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
  1741. # Compute PROPERTIESFILES
  1742. # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
  1743. # Compute CLASSFILES
  1744. # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
  1745. # Compute QMFILES
  1746. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
  1747. # Compute MSGFILES
  1748. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
  1749. # Compute RESOURCESDLLFILES
  1750. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
  1751. case "$ac_given_srcdir" in
  1752. .) srcdirpre= ;;
  1753. *) srcdirpre='$(srcdir)/' ;;
  1754. esac
  1755. POFILES=
  1756. UPDATEPOFILES=
  1757. DUMMYPOFILES=
  1758. GMOFILES=
  1759. PROPERTIESFILES=
  1760. CLASSFILES=
  1761. QMFILES=
  1762. MSGFILES=
  1763. RESOURCESDLLFILES=
  1764. for lang in $ALL_LINGUAS; do
  1765. POFILES="$POFILES $srcdirpre$lang.po"
  1766. UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
  1767. DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
  1768. GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
  1769. PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
  1770. CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
  1771. QMFILES="$QMFILES $srcdirpre$lang.qm"
  1772. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  1773. MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
  1774. frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
  1775. RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
  1776. done
  1777. # CATALOGS depends on both $ac_dir and the user's LINGUAS
  1778. # environment variable.
  1779. INST_LINGUAS=
  1780. if test -n "$ALL_LINGUAS"; then
  1781. for presentlang in $ALL_LINGUAS; do
  1782. useit=no
  1783. if test "%UNSET%" != "$LINGUAS"; then
  1784. desiredlanguages="$LINGUAS"
  1785. else
  1786. desiredlanguages="$ALL_LINGUAS"
  1787. fi
  1788. for desiredlang in $desiredlanguages; do
  1789. # Use the presentlang catalog if desiredlang is
  1790. # a. equal to presentlang, or
  1791. # b. a variant of presentlang (because in this case,
  1792. # presentlang can be used as a fallback for messages
  1793. # which are not translated in the desiredlang catalog).
  1794. case "$desiredlang" in
  1795. "$presentlang"*) useit=yes;;
  1796. esac
  1797. done
  1798. if test $useit = yes; then
  1799. INST_LINGUAS="$INST_LINGUAS $presentlang"
  1800. fi
  1801. done
  1802. fi
  1803. CATALOGS=
  1804. JAVACATALOGS=
  1805. QTCATALOGS=
  1806. TCLCATALOGS=
  1807. CSHARPCATALOGS=
  1808. if test -n "$INST_LINGUAS"; then
  1809. for lang in $INST_LINGUAS; do
  1810. CATALOGS="$CATALOGS $lang.gmo"
  1811. JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
  1812. QTCATALOGS="$QTCATALOGS $lang.qm"
  1813. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  1814. TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
  1815. frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
  1816. CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
  1817. done
  1818. fi
  1819. sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
  1820. if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
  1821. # Add dependencies that cannot be formulated as a simple suffix rule.
  1822. for lang in $ALL_LINGUAS; do
  1823. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  1824. cat >> "$ac_file.tmp" <<EOF
  1825. $frobbedlang.msg: $lang.po
  1826. @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
  1827. \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
  1828. EOF
  1829. done
  1830. fi
  1831. if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
  1832. # Add dependencies that cannot be formulated as a simple suffix rule.
  1833. for lang in $ALL_LINGUAS; do
  1834. frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
  1835. cat >> "$ac_file.tmp" <<EOF
  1836. $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
  1837. @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
  1838. \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
  1839. EOF
  1840. done
  1841. fi
  1842. if test -n "$POMAKEFILEDEPS"; then
  1843. cat >> "$ac_file.tmp" <<EOF
  1844. Makefile: $POMAKEFILEDEPS
  1845. EOF
  1846. fi
  1847. mv "$ac_file.tmp" "$ac_file"
  1848. ])
  1849. # progtest.m4 serial 4 (gettext-0.14.2)
  1850. dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
  1851. dnl This file is free software; the Free Software Foundation
  1852. dnl gives unlimited permission to copy and/or distribute it,
  1853. dnl with or without modifications, as long as this notice is preserved.
  1854. dnl
  1855. dnl This file can can be used in projects which are not available under
  1856. dnl the GNU General Public License or the GNU Library General Public
  1857. dnl License but which still want to provide support for the GNU gettext
  1858. dnl functionality.
  1859. dnl Please note that the actual code of the GNU gettext library is covered
  1860. dnl by the GNU Library General Public License, and the rest of the GNU
  1861. dnl gettext package package is covered by the GNU General Public License.
  1862. dnl They are *not* in the public domain.
  1863. dnl Authors:
  1864. dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
  1865. AC_PREREQ(2.50)
  1866. # Search path for a program which passes the given test.
  1867. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
  1868. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  1869. AC_DEFUN([AM_PATH_PROG_WITH_TEST],
  1870. [
  1871. # Prepare PATH_SEPARATOR.
  1872. # The user is always right.
  1873. if test "${PATH_SEPARATOR+set}" != set; then
  1874. echo "#! /bin/sh" >conf$$.sh
  1875. echo "exit 0" >>conf$$.sh
  1876. chmod +x conf$$.sh
  1877. if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
  1878. PATH_SEPARATOR=';'
  1879. else
  1880. PATH_SEPARATOR=:
  1881. fi
  1882. rm -f conf$$.sh
  1883. fi
  1884. # Find out how to test for executable files. Don't use a zero-byte file,
  1885. # as systems may use methods other than mode bits to determine executability.
  1886. cat >conf$$.file <<_ASEOF
  1887. #! /bin/sh
  1888. exit 0
  1889. _ASEOF
  1890. chmod +x conf$$.file
  1891. if test -x conf$$.file >/dev/null 2>&1; then
  1892. ac_executable_p="test -x"
  1893. else
  1894. ac_executable_p="test -f"
  1895. fi
  1896. rm -f conf$$.file
  1897. # Extract the first word of "$2", so it can be a program name with args.
  1898. set dummy $2; ac_word=[$]2
  1899. AC_MSG_CHECKING([for $ac_word])
  1900. AC_CACHE_VAL(ac_cv_path_$1,
  1901. [case "[$]$1" in
  1902. [[\\/]]* | ?:[[\\/]]*)
  1903. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  1904. ;;
  1905. *)
  1906. ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
  1907. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  1908. IFS="$ac_save_IFS"
  1909. test -z "$ac_dir" && ac_dir=.
  1910. for ac_exec_ext in '' $ac_executable_extensions; do
  1911. if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
  1912. echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
  1913. if [$3]; then
  1914. ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
  1915. break 2
  1916. fi
  1917. fi
  1918. done
  1919. done
  1920. IFS="$ac_save_IFS"
  1921. dnl If no 4th arg is given, leave the cache variable unset,
  1922. dnl so AC_PATH_PROGS will keep looking.
  1923. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  1924. ])dnl
  1925. ;;
  1926. esac])dnl
  1927. $1="$ac_cv_path_$1"
  1928. if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
  1929. AC_MSG_RESULT([$]$1)
  1930. else
  1931. AC_MSG_RESULT(no)
  1932. fi
  1933. AC_SUBST($1)dnl
  1934. ])
  1935. # AM_CONDITIONAL -*- Autoconf -*-
  1936. # Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
  1937. # This program is free software; you can redistribute it and/or modify
  1938. # it under the terms of the GNU General Public License as published by
  1939. # the Free Software Foundation; either version 2, or (at your option)
  1940. # any later version.
  1941. # This program is distributed in the hope that it will be useful,
  1942. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  1943. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1944. # GNU General Public License for more details.
  1945. # You should have received a copy of the GNU General Public License
  1946. # along with this program; if not, write to the Free Software
  1947. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  1948. # 02111-1307, USA.
  1949. # serial 6
  1950. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  1951. # -------------------------------------
  1952. # Define a conditional.
  1953. AC_DEFUN([AM_CONDITIONAL],
  1954. [AC_PREREQ(2.52)dnl
  1955. ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  1956. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  1957. AC_SUBST([$1_TRUE])
  1958. AC_SUBST([$1_FALSE])
  1959. if $2; then
  1960. $1_TRUE=
  1961. $1_FALSE='#'
  1962. else
  1963. $1_TRUE='#'
  1964. $1_FALSE=
  1965. fi
  1966. AC_CONFIG_COMMANDS_PRE(
  1967. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  1968. AC_MSG_ERROR([conditional "$1" was never defined.
  1969. Usually this means the macro was only invoked conditionally.])
  1970. fi])])
  1971. m4_include([./automake/dpkg.m4])