You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

aclocal.m4 98KB

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