gnulib-common.m4 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. # gnulib-common.m4 serial 38
  2. dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. # gl_COMMON
  7. # is expanded unconditionally through gnulib-tool magic.
  8. AC_DEFUN([gl_COMMON], [
  9. dnl Use AC_REQUIRE here, so that the code is expanded once only.
  10. AC_REQUIRE([gl_00GNULIB])
  11. AC_REQUIRE([gl_COMMON_BODY])
  12. ])
  13. AC_DEFUN([gl_COMMON_BODY], [
  14. AH_VERBATIM([_Noreturn],
  15. [/* The _Noreturn keyword of C11. */
  16. #if ! (defined _Noreturn \
  17. || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
  18. # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
  19. || 0x5110 <= __SUNPRO_C)
  20. # define _Noreturn __attribute__ ((__noreturn__))
  21. # elif defined _MSC_VER && 1200 <= _MSC_VER
  22. # define _Noreturn __declspec (noreturn)
  23. # else
  24. # define _Noreturn
  25. # endif
  26. #endif
  27. ])
  28. AH_VERBATIM([isoc99_inline],
  29. [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
  30. the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
  31. earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
  32. __APPLE__ && __MACH__ test for Mac OS X.
  33. __APPLE_CC__ tests for the Apple compiler and its version.
  34. __STDC_VERSION__ tests for the C99 mode. */
  35. #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
  36. # define __GNUC_STDC_INLINE__ 1
  37. #endif])
  38. AH_VERBATIM([unused_parameter],
  39. [/* Define as a marker that can be attached to declarations that might not
  40. be used. This helps to reduce warnings, such as from
  41. GCC -Wunused-parameter. */
  42. #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
  43. # define _GL_UNUSED __attribute__ ((__unused__))
  44. #else
  45. # define _GL_UNUSED
  46. #endif
  47. /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
  48. is a misnomer outside of parameter lists. */
  49. #define _UNUSED_PARAMETER_ _GL_UNUSED
  50. /* gcc supports the "unused" attribute on possibly unused labels, and
  51. g++ has since version 4.5. Note to support C++ as well as C,
  52. _GL_UNUSED_LABEL should be used with a trailing ; */
  53. #if !defined __cplusplus || __GNUC__ > 4 \
  54. || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
  55. # define _GL_UNUSED_LABEL _GL_UNUSED
  56. #else
  57. # define _GL_UNUSED_LABEL
  58. #endif
  59. /* The __pure__ attribute was added in gcc 2.96. */
  60. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
  61. # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
  62. #else
  63. # define _GL_ATTRIBUTE_PURE /* empty */
  64. #endif
  65. /* The __const__ attribute was added in gcc 2.95. */
  66. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
  67. # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
  68. #else
  69. # define _GL_ATTRIBUTE_CONST /* empty */
  70. #endif
  71. ])
  72. dnl Preparation for running test programs:
  73. dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
  74. dnl to /dev/tty, so they can be redirected to log files. Such diagnostics
  75. dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
  76. LIBC_FATAL_STDERR_=1
  77. export LIBC_FATAL_STDERR_
  78. ])
  79. # gl_MODULE_INDICATOR_CONDITION
  80. # expands to a C preprocessor expression that evaluates to 1 or 0, depending
  81. # whether a gnulib module that has been requested shall be considered present
  82. # or not.
  83. m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
  84. # gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
  85. # sets the shell variable that indicates the presence of the given module to
  86. # a C preprocessor expression that will evaluate to 1.
  87. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
  88. [
  89. gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
  90. [GNULIB_[]m4_translit([[$1]],
  91. [abcdefghijklmnopqrstuvwxyz./-],
  92. [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
  93. [gl_MODULE_INDICATOR_CONDITION])
  94. ])
  95. # gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
  96. # modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
  97. # The shell variable's value is a C preprocessor expression that evaluates
  98. # to 0 or 1.
  99. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
  100. [
  101. m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
  102. [
  103. dnl Simplify the expression VALUE || 1 to 1.
  104. $1=1
  105. ],
  106. [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
  107. [gl_MODULE_INDICATOR_CONDITION])])
  108. ])
  109. # gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
  110. # modifies the shell variable to include the given condition. The shell
  111. # variable's value is a C preprocessor expression that evaluates to 0 or 1.
  112. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
  113. [
  114. dnl Simplify the expression 1 || CONDITION to 1.
  115. if test "$[]$1" != 1; then
  116. dnl Simplify the expression 0 || CONDITION to CONDITION.
  117. if test "$[]$1" = 0; then
  118. $1=$2
  119. else
  120. $1="($[]$1 || $2)"
  121. fi
  122. fi
  123. ])
  124. # gl_MODULE_INDICATOR([modulename])
  125. # defines a C macro indicating the presence of the given module
  126. # in a location where it can be used.
  127. # | Value | Value |
  128. # | in lib/ | in tests/ |
  129. # --------------------------------------------+---------+-----------+
  130. # Module present among main modules: | 1 | 1 |
  131. # --------------------------------------------+---------+-----------+
  132. # Module present among tests-related modules: | 0 | 1 |
  133. # --------------------------------------------+---------+-----------+
  134. # Module not present at all: | 0 | 0 |
  135. # --------------------------------------------+---------+-----------+
  136. AC_DEFUN([gl_MODULE_INDICATOR],
  137. [
  138. AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]],
  139. [abcdefghijklmnopqrstuvwxyz./-],
  140. [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
  141. [gl_MODULE_INDICATOR_CONDITION],
  142. [Define to a C preprocessor expression that evaluates to 1 or 0,
  143. depending whether the gnulib module $1 shall be considered present.])
  144. ])
  145. # gl_MODULE_INDICATOR_FOR_TESTS([modulename])
  146. # defines a C macro indicating the presence of the given module
  147. # in lib or tests. This is useful to determine whether the module
  148. # should be tested.
  149. # | Value | Value |
  150. # | in lib/ | in tests/ |
  151. # --------------------------------------------+---------+-----------+
  152. # Module present among main modules: | 1 | 1 |
  153. # --------------------------------------------+---------+-----------+
  154. # Module present among tests-related modules: | 1 | 1 |
  155. # --------------------------------------------+---------+-----------+
  156. # Module not present at all: | 0 | 0 |
  157. # --------------------------------------------+---------+-----------+
  158. AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
  159. [
  160. AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]],
  161. [abcdefghijklmnopqrstuvwxyz./-],
  162. [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
  163. [Define to 1 when the gnulib module $1 should be tested.])
  164. ])
  165. # gl_ASSERT_NO_GNULIB_POSIXCHECK
  166. # asserts that there will never be a need to #define GNULIB_POSIXCHECK.
  167. # and thereby enables an optimization of configure and config.h.
  168. # Used by Emacs.
  169. AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
  170. [
  171. dnl Override gl_WARN_ON_USE_PREPARE.
  172. dnl But hide this definition from 'aclocal'.
  173. AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], [])
  174. ])
  175. # gl_ASSERT_NO_GNULIB_TESTS
  176. # asserts that there will be no gnulib tests in the scope of the configure.ac
  177. # and thereby enables an optimization of config.h.
  178. # Used by Emacs.
  179. AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
  180. [
  181. dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
  182. AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
  183. ])
  184. # Test whether <features.h> exists.
  185. # Set HAVE_FEATURES_H.
  186. AC_DEFUN([gl_FEATURES_H],
  187. [
  188. AC_CHECK_HEADERS_ONCE([features.h])
  189. if test $ac_cv_header_features_h = yes; then
  190. HAVE_FEATURES_H=1
  191. else
  192. HAVE_FEATURES_H=0
  193. fi
  194. AC_SUBST([HAVE_FEATURES_H])
  195. ])
  196. # m4_foreach_w
  197. # is a backport of autoconf-2.59c's m4_foreach_w.
  198. # Remove this macro when we can assume autoconf >= 2.60.
  199. m4_ifndef([m4_foreach_w],
  200. [m4_define([m4_foreach_w],
  201. [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
  202. # AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
  203. # ----------------------------------------------------
  204. # Backport of autoconf-2.63b's macro.
  205. # Remove this macro when we can assume autoconf >= 2.64.
  206. m4_ifndef([AS_VAR_IF],
  207. [m4_define([AS_VAR_IF],
  208. [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
  209. # gl_PROG_CC_C99
  210. # Modifies the value of the shell variable CC in an attempt to make $CC
  211. # understand ISO C99 source code.
  212. # This is like AC_PROG_CC_C99, except that
  213. # - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
  214. # - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
  215. # <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>,
  216. # but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
  217. # <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>.
  218. # Remaining problems:
  219. # - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
  220. # to CC twice
  221. # <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
  222. # - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
  223. AC_DEFUN([gl_PROG_CC_C99],
  224. [
  225. dnl Change that version number to the minimum Autoconf version that supports
  226. dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
  227. m4_version_prereq([9.0],
  228. [AC_REQUIRE([AC_PROG_CC_C99])],
  229. [AC_REQUIRE([AC_PROG_CC_STDC])])
  230. ])
  231. # gl_PROG_AR_RANLIB
  232. # Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
  233. # The user can set the variables AR, ARFLAGS, RANLIB if he wants to override
  234. # the values.
  235. AC_DEFUN([gl_PROG_AR_RANLIB],
  236. [
  237. dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
  238. dnl as "cc", and GCC as "gcc". They have different object file formats and
  239. dnl library formats. In particular, the GNU binutils programs ar and ranlib
  240. dnl produce libraries that work only with gcc, not with cc.
  241. AC_REQUIRE([AC_PROG_CC])
  242. dnl The '][' hides this use from 'aclocal'.
  243. AC_BEFORE([$0], [A][M_PROG_AR])
  244. AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
  245. [
  246. AC_EGREP_CPP([Amsterdam],
  247. [
  248. #ifdef __ACK__
  249. Amsterdam
  250. #endif
  251. ],
  252. [gl_cv_c_amsterdam_compiler=yes],
  253. [gl_cv_c_amsterdam_compiler=no])
  254. ])
  255. dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not
  256. dnl building with __ACK__.
  257. if test $gl_cv_c_amsterdam_compiler = yes; then
  258. if test -z "$AR"; then
  259. AR='cc -c.a'
  260. fi
  261. if test -z "$ARFLAGS"; then
  262. ARFLAGS='-o'
  263. fi
  264. else
  265. dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST
  266. dnl ARFLAGS variable (it is filed into Makefile.in directly by automake
  267. dnl script on-demand, if not specified by ./configure of course).
  268. dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above
  269. dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block
  270. dnl because AM_PROG_AR is written so it could re-set AR variable even for
  271. dnl __ACK__. It may seem like its easier to avoid calling the macro here,
  272. dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
  273. dnl default value and automake should usually know them).
  274. dnl
  275. dnl The '][' hides this use from 'aclocal'.
  276. m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:])
  277. fi
  278. dnl In case the code above has not helped with setting AR/ARFLAGS, use
  279. dnl Automake-documented default values for AR and ARFLAGS, but prefer
  280. dnl ${host}-ar over ar (useful for cross-compiling).
  281. AC_CHECK_TOOL([AR], [ar], [ar])
  282. if test -z "$ARFLAGS"; then
  283. ARFLAGS='cr'
  284. fi
  285. AC_SUBST([AR])
  286. AC_SUBST([ARFLAGS])
  287. if test -z "$RANLIB"; then
  288. if test $gl_cv_c_amsterdam_compiler = yes; then
  289. RANLIB=':'
  290. else
  291. dnl Use the ranlib program if it is available.
  292. AC_PROG_RANLIB
  293. fi
  294. fi
  295. AC_SUBST([RANLIB])
  296. ])
  297. # AC_PROG_MKDIR_P
  298. # is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
  299. # for interoperability with automake-1.9.6 from autoconf-2.62.
  300. # Remove this macro when we can assume autoconf >= 2.62 or
  301. # autoconf >= 2.60 && automake >= 1.10.
  302. # AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
  303. m4_ifndef([AC_AUTOCONF_VERSION],[
  304. m4_ifdef([AC_PROG_MKDIR_P], [
  305. dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
  306. m4_define([AC_PROG_MKDIR_P],
  307. m4_defn([AC_PROG_MKDIR_P])[
  308. AC_SUBST([MKDIR_P])])], [
  309. dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
  310. AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
  311. [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
  312. MKDIR_P='$(mkdir_p)'
  313. AC_SUBST([MKDIR_P])])])
  314. ])
  315. # AC_C_RESTRICT
  316. # This definition is copied from post-2.69 Autoconf and overrides the
  317. # AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed
  318. # once autoconf >= 2.70 can be assumed. It's painful to check version
  319. # numbers, and in practice this macro is more up-to-date than Autoconf
  320. # is, so override Autoconf unconditionally.
  321. AC_DEFUN([AC_C_RESTRICT],
  322. [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
  323. [ac_cv_c_restrict=no
  324. # The order here caters to the fact that C++ does not require restrict.
  325. for ac_kw in __restrict __restrict__ _Restrict restrict; do
  326. AC_COMPILE_IFELSE(
  327. [AC_LANG_PROGRAM(
  328. [[typedef int *int_ptr;
  329. int foo (int_ptr $ac_kw ip) { return ip[0]; }
  330. int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
  331. int bar (int ip[$ac_kw]) { return ip[0]; }
  332. ]],
  333. [[int s[1];
  334. int *$ac_kw t = s;
  335. t[0] = 0;
  336. return foo (t) + bar (t);
  337. ]])],
  338. [ac_cv_c_restrict=$ac_kw])
  339. test "$ac_cv_c_restrict" != no && break
  340. done
  341. ])
  342. AH_VERBATIM([restrict],
  343. [/* Define to the equivalent of the C99 'restrict' keyword, or to
  344. nothing if this is not supported. Do not define if restrict is
  345. supported directly. */
  346. #undef restrict
  347. /* Work around a bug in Sun C++: it does not support _Restrict or
  348. __restrict__, even though the corresponding Sun C compiler ends up with
  349. "#define restrict _Restrict" or "#define restrict __restrict__" in the
  350. previous line. Perhaps some future version of Sun C++ will work with
  351. restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
  352. #if defined __SUNPRO_CC && !defined __RESTRICT
  353. # define _Restrict
  354. # define __restrict__
  355. #endif])
  356. case $ac_cv_c_restrict in
  357. restrict) ;;
  358. no) AC_DEFINE([restrict], []) ;;
  359. *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
  360. esac
  361. ])# AC_C_RESTRICT
  362. # gl_BIGENDIAN
  363. # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
  364. # Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some
  365. # macros invoke AC_C_BIGENDIAN with arguments.
  366. AC_DEFUN([gl_BIGENDIAN],
  367. [
  368. AC_C_BIGENDIAN
  369. ])
  370. # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
  371. # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
  372. # output a spurious "(cached)" mark in the midst of other configure output.
  373. # This macro should be used instead of AC_CACHE_VAL when it is not surrounded
  374. # by an AC_MSG_CHECKING/AC_MSG_RESULT pair.
  375. AC_DEFUN([gl_CACHE_VAL_SILENT],
  376. [
  377. saved_as_echo_n="$as_echo_n"
  378. as_echo_n=':'
  379. AC_CACHE_VAL([$1], [$2])
  380. as_echo_n="$saved_as_echo_n"
  381. ])
  382. # AS_VAR_COPY was added in autoconf 2.63b
  383. m4_define_default([AS_VAR_COPY],
  384. [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
  385. # AC_PROG_SED was added in autoconf 2.59b
  386. m4_ifndef([AC_PROG_SED],
  387. [AC_DEFUN([AC_PROG_SED],
  388. [AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
  389. [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
  390. dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
  391. ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
  392. for ac_i in 1 2 3 4 5 6 7; do
  393. ac_script="$ac_script$as_nl$ac_script"
  394. done
  395. echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
  396. AS_UNSET([ac_script])
  397. if test -z "$SED"; then
  398. ac_path_SED_found=false
  399. _AS_PATH_WALK([], [
  400. for ac_prog in sed gsed; do
  401. for ac_exec_ext in '' $ac_executable_extensions; do
  402. ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
  403. AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
  404. case `"$ac_path_SED" --version 2>&1` in
  405. *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
  406. *)
  407. ac_count=0
  408. _AS_ECHO_N([0123456789]) >conftest.in
  409. while :
  410. do
  411. cat conftest.in conftest.in >conftest.tmp
  412. mv conftest.tmp conftest.in
  413. cp conftest.in conftest.nl
  414. echo >> conftest.nl
  415. "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
  416. diff conftest.out conftest.nl >/dev/null 2>&1 || break
  417. ac_count=`expr $ac_count + 1`
  418. if test $ac_count -gt ${ac_path_SED_max-0}; then
  419. # Best so far, but keep looking for better
  420. ac_cv_path_SED=$ac_path_SED
  421. ac_path_SED_max=$ac_count
  422. fi
  423. test $ac_count -gt 10 && break
  424. done
  425. rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
  426. esac
  427. $ac_path_SED_found && break 3
  428. done
  429. done])
  430. if test -z "$ac_cv_path_SED"; then
  431. AC_ERROR([no acceptable sed could be found in \$PATH])
  432. fi
  433. else
  434. ac_cv_path_SED=$SED
  435. fi
  436. ])
  437. SED="$ac_cv_path_SED"
  438. AC_SUBST([SED])dnl
  439. rm -f conftest.sed
  440. ])
  441. ])