zz40-xc-ovr.m4 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. #---------------------------------------------------------------------------
  2. #
  3. # zz40-xc-ovr.m4
  4. #
  5. # Copyright (c) 2013 - 2018 Daniel Stenberg <daniel@haxx.se>
  6. #
  7. # Permission to use, copy, modify, and distribute this software for any
  8. # purpose with or without fee is hereby granted, provided that the above
  9. # copyright notice and this permission notice appear in all copies.
  10. #
  11. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  12. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  13. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  14. # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  15. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  16. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  17. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  18. #
  19. #---------------------------------------------------------------------------
  20. dnl The funny name of this file is intentional in order to make it
  21. dnl sort alphabetically after any libtool, autoconf or automake
  22. dnl provided .m4 macro file that might get copied into this same
  23. dnl subdirectory. This allows that macro (re)definitions from this
  24. dnl file may override those provided in other files.
  25. dnl Version macros
  26. dnl -------------------------------------------------
  27. dnl Public macros.
  28. m4_define([XC_CONFIGURE_PREAMBLE_VER_MAJOR],[1])dnl
  29. m4_define([XC_CONFIGURE_PREAMBLE_VER_MINOR],[0])dnl
  30. dnl _XC_CFG_PRE_PREAMBLE
  31. dnl -------------------------------------------------
  32. dnl Private macro.
  33. AC_DEFUN([_XC_CFG_PRE_PREAMBLE],
  34. [
  35. ## -------------------------------- ##
  36. @%:@@%:@ [XC_CONFIGURE_PREAMBLE] ver: []dnl
  37. XC_CONFIGURE_PREAMBLE_VER_MAJOR.[]dnl
  38. XC_CONFIGURE_PREAMBLE_VER_MINOR ##
  39. ## -------------------------------- ##
  40. xc_configure_preamble_ver_major='XC_CONFIGURE_PREAMBLE_VER_MAJOR'
  41. xc_configure_preamble_ver_minor='XC_CONFIGURE_PREAMBLE_VER_MINOR'
  42. #
  43. # Set IFS to space, tab and newline.
  44. #
  45. xc_space=' '
  46. xc_tab=' '
  47. xc_newline='
  48. '
  49. IFS="$xc_space$xc_tab$xc_newline"
  50. #
  51. # Set internationalization behavior variables.
  52. #
  53. LANG='C'
  54. LC_ALL='C'
  55. LANGUAGE='C'
  56. export LANG
  57. export LC_ALL
  58. export LANGUAGE
  59. #
  60. # Some useful variables.
  61. #
  62. xc_msg_warn='configure: WARNING:'
  63. xc_msg_abrt='Can not continue.'
  64. xc_msg_err='configure: error:'
  65. ])
  66. dnl _XC_CFG_PRE_BASIC_CHK_CMD_ECHO
  67. dnl -------------------------------------------------
  68. dnl Private macro.
  69. dnl
  70. dnl Emits shell code that verifies that 'echo' command
  71. dnl is available, otherwise aborts execution.
  72. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO],
  73. [dnl
  74. AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl
  75. #
  76. # Verify that 'echo' command is available, otherwise abort.
  77. #
  78. xc_tst_str='unknown'
  79. (`echo "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success'
  80. case "x$xc_tst_str" in @%:@ ((
  81. xsuccess)
  82. :
  83. ;;
  84. *)
  85. # Try built-in echo, and fail.
  86. echo "$xc_msg_err 'echo' command not found. $xc_msg_abrt" >&2
  87. exit 1
  88. ;;
  89. esac
  90. ])
  91. dnl _XC_CFG_PRE_BASIC_CHK_CMD_TEST
  92. dnl -------------------------------------------------
  93. dnl Private macro.
  94. dnl
  95. dnl Emits shell code that verifies that 'test' command
  96. dnl is available, otherwise aborts execution.
  97. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_TEST],
  98. [dnl
  99. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl
  100. #
  101. # Verify that 'test' command is available, otherwise abort.
  102. #
  103. xc_tst_str='unknown'
  104. (`test -n "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success'
  105. case "x$xc_tst_str" in @%:@ ((
  106. xsuccess)
  107. :
  108. ;;
  109. *)
  110. echo "$xc_msg_err 'test' command not found. $xc_msg_abrt" >&2
  111. exit 1
  112. ;;
  113. esac
  114. ])
  115. dnl _XC_CFG_PRE_BASIC_CHK_VAR_PATH
  116. dnl -------------------------------------------------
  117. dnl Private macro.
  118. dnl
  119. dnl Emits shell code that verifies that 'PATH' variable
  120. dnl is set, otherwise aborts execution.
  121. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_VAR_PATH],
  122. [dnl
  123. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl
  124. #
  125. # Verify that 'PATH' variable is set, otherwise abort.
  126. #
  127. xc_tst_str='unknown'
  128. (`test -n "$PATH" >/dev/null 2>&1`) && xc_tst_str='success'
  129. case "x$xc_tst_str" in @%:@ ((
  130. xsuccess)
  131. :
  132. ;;
  133. *)
  134. echo "$xc_msg_err 'PATH' variable not set. $xc_msg_abrt" >&2
  135. exit 1
  136. ;;
  137. esac
  138. ])
  139. dnl _XC_CFG_PRE_BASIC_CHK_CMD_EXPR
  140. dnl -------------------------------------------------
  141. dnl Private macro.
  142. dnl
  143. dnl Emits shell code that verifies that 'expr' command
  144. dnl is available, otherwise aborts execution.
  145. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR],
  146. [dnl
  147. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  148. #
  149. # Verify that 'expr' command is available, otherwise abort.
  150. #
  151. xc_tst_str='unknown'
  152. xc_tst_str=`expr "$xc_tst_str" : '.*' 2>/dev/null`
  153. case "x$xc_tst_str" in @%:@ ((
  154. x7)
  155. :
  156. ;;
  157. *)
  158. echo "$xc_msg_err 'expr' command not found. $xc_msg_abrt" >&2
  159. exit 1
  160. ;;
  161. esac
  162. ])
  163. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_SED
  164. dnl -------------------------------------------------
  165. dnl Private macro.
  166. dnl
  167. dnl Emits shell code that verifies that 'sed' utility
  168. dnl is found within 'PATH', otherwise aborts execution.
  169. dnl
  170. dnl This 'sed' is required in order to allow configure
  171. dnl script bootstrapping itself. No fancy testing for a
  172. dnl proper 'sed' this early, that should be done later.
  173. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_SED],
  174. [dnl
  175. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  176. #
  177. # Verify that 'sed' utility is found within 'PATH', otherwise abort.
  178. #
  179. xc_tst_str='unknown'
  180. xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
  181. | sed -e 's:unknown:success:' 2>/dev/null`
  182. case "x$xc_tst_str" in @%:@ ((
  183. xsuccess)
  184. :
  185. ;;
  186. *)
  187. echo "$xc_msg_err 'sed' utility not found in 'PATH'. $xc_msg_abrt" >&2
  188. exit 1
  189. ;;
  190. esac
  191. ])
  192. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_GREP
  193. dnl -------------------------------------------------
  194. dnl Private macro.
  195. dnl
  196. dnl Emits shell code that verifies that 'grep' utility
  197. dnl is found within 'PATH', otherwise aborts execution.
  198. dnl
  199. dnl This 'grep' is required in order to allow configure
  200. dnl script bootstrapping itself. No fancy testing for a
  201. dnl proper 'grep' this early, that should be done later.
  202. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP],
  203. [dnl
  204. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  205. #
  206. # Verify that 'grep' utility is found within 'PATH', otherwise abort.
  207. #
  208. xc_tst_str='unknown'
  209. (`echo "$xc_tst_str" 2>/dev/null \
  210. | grep 'unknown' >/dev/null 2>&1`) && xc_tst_str='success'
  211. case "x$xc_tst_str" in @%:@ ((
  212. xsuccess)
  213. :
  214. ;;
  215. *)
  216. echo "$xc_msg_err 'grep' utility not found in 'PATH'. $xc_msg_abrt" >&2
  217. exit 1
  218. ;;
  219. esac
  220. ])
  221. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_TR
  222. dnl -------------------------------------------------
  223. dnl Private macro.
  224. dnl
  225. dnl Emits shell code that verifies that 'tr' utility
  226. dnl is found within 'PATH', otherwise aborts execution.
  227. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_TR],
  228. [dnl
  229. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  230. #
  231. # Verify that 'tr' utility is found within 'PATH', otherwise abort.
  232. #
  233. xc_tst_str="${xc_tab}98s7u6c5c4e3s2s10"
  234. xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
  235. | tr -d "0123456789$xc_tab" 2>/dev/null`
  236. case "x$xc_tst_str" in @%:@ ((
  237. xsuccess)
  238. :
  239. ;;
  240. *)
  241. echo "$xc_msg_err 'tr' utility not found in 'PATH'. $xc_msg_abrt" >&2
  242. exit 1
  243. ;;
  244. esac
  245. ])
  246. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_WC
  247. dnl -------------------------------------------------
  248. dnl Private macro.
  249. dnl
  250. dnl Emits shell code that verifies that 'wc' utility
  251. dnl is found within 'PATH', otherwise aborts execution.
  252. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_WC],
  253. [dnl
  254. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
  255. #
  256. # Verify that 'wc' utility is found within 'PATH', otherwise abort.
  257. #
  258. xc_tst_str='unknown unknown unknown unknown'
  259. xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
  260. | wc -w 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null`
  261. case "x$xc_tst_str" in @%:@ ((
  262. x4)
  263. :
  264. ;;
  265. *)
  266. echo "$xc_msg_err 'wc' utility not found in 'PATH'. $xc_msg_abrt" >&2
  267. exit 1
  268. ;;
  269. esac
  270. ])
  271. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_CAT
  272. dnl -------------------------------------------------
  273. dnl Private macro.
  274. dnl
  275. dnl Emits shell code that verifies that 'cat' utility
  276. dnl is found within 'PATH', otherwise aborts execution.
  277. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT],
  278. [dnl
  279. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
  280. #
  281. # Verify that 'cat' utility is found within 'PATH', otherwise abort.
  282. #
  283. xc_tst_str='unknown'
  284. xc_tst_str=`cat <<_EOT 2>/dev/null \
  285. | wc -l 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null
  286. unknown
  287. unknown
  288. unknown
  289. _EOT`
  290. case "x$xc_tst_str" in @%:@ ((
  291. x3)
  292. :
  293. ;;
  294. *)
  295. echo "$xc_msg_err 'cat' utility not found in 'PATH'. $xc_msg_abrt" >&2
  296. exit 1
  297. ;;
  298. esac
  299. ])
  300. dnl _XC_CFG_PRE_CHECK_PATH_SEPARATOR
  301. dnl -------------------------------------------------
  302. dnl Private macro.
  303. dnl
  304. dnl Emits shell code that computes the path separator
  305. dnl and stores the result in 'PATH_SEPARATOR', unless
  306. dnl the user has already set it with a non-empty value.
  307. dnl
  308. dnl This path separator is the symbol used to separate
  309. dnl or diferentiate paths inside the 'PATH' environment
  310. dnl variable.
  311. dnl
  312. dnl Non-empty user provided 'PATH_SEPARATOR' always
  313. dnl overrides the auto-detected one.
  314. AC_DEFUN([_XC_CFG_PRE_CHECK_PATH_SEPARATOR],
  315. [dnl
  316. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
  317. #
  318. # Auto-detect and set 'PATH_SEPARATOR', unless it is already non-empty set.
  319. #
  320. # Directory count in 'PATH' when using a colon separator.
  321. xc_tst_dirs_col='x'
  322. xc_tst_prev_IFS=$IFS; IFS=':'
  323. for xc_tst_dir in $PATH; do
  324. IFS=$xc_tst_prev_IFS
  325. xc_tst_dirs_col="x$xc_tst_dirs_col"
  326. done
  327. IFS=$xc_tst_prev_IFS
  328. xc_tst_dirs_col=`expr "$xc_tst_dirs_col" : '.*'`
  329. # Directory count in 'PATH' when using a semicolon separator.
  330. xc_tst_dirs_sem='x'
  331. xc_tst_prev_IFS=$IFS; IFS=';'
  332. for xc_tst_dir in $PATH; do
  333. IFS=$xc_tst_prev_IFS
  334. xc_tst_dirs_sem="x$xc_tst_dirs_sem"
  335. done
  336. IFS=$xc_tst_prev_IFS
  337. xc_tst_dirs_sem=`expr "$xc_tst_dirs_sem" : '.*'`
  338. if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then
  339. # When both counting methods give the same result we do not want to
  340. # chose one over the other, and consider auto-detection not possible.
  341. if test -z "$PATH_SEPARATOR"; then
  342. # User should provide the correct 'PATH_SEPARATOR' definition.
  343. # Until then, guess that it is colon!
  344. echo "$xc_msg_warn path separator not determined, guessing colon" >&2
  345. PATH_SEPARATOR=':'
  346. fi
  347. else
  348. # Separator with the greater directory count is the auto-detected one.
  349. if test $xc_tst_dirs_sem -gt $xc_tst_dirs_col; then
  350. xc_tst_auto_separator=';'
  351. else
  352. xc_tst_auto_separator=':'
  353. fi
  354. if test -z "$PATH_SEPARATOR"; then
  355. # Simply use the auto-detected one when not already set.
  356. PATH_SEPARATOR=$xc_tst_auto_separator
  357. elif test "x$PATH_SEPARATOR" != "x$xc_tst_auto_separator"; then
  358. echo "$xc_msg_warn 'PATH_SEPARATOR' does not match auto-detected one." >&2
  359. fi
  360. fi
  361. xc_PATH_SEPARATOR=$PATH_SEPARATOR
  362. AC_SUBST([PATH_SEPARATOR])dnl
  363. ])
  364. dnl _XC_CFG_PRE_POSTLUDE
  365. dnl -------------------------------------------------
  366. dnl Private macro.
  367. AC_DEFUN([_XC_CFG_PRE_POSTLUDE],
  368. [dnl
  369. AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl
  370. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl
  371. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl
  372. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  373. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
  374. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl
  375. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl
  376. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
  377. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
  378. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl
  379. AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl
  380. dnl
  381. xc_configure_preamble_result='yes'
  382. ])
  383. dnl XC_CONFIGURE_PREAMBLE
  384. dnl -------------------------------------------------
  385. dnl Public macro.
  386. dnl
  387. dnl This macro emits shell code which does some
  388. dnl very basic checks related with the availability
  389. dnl of some commands and utilities needed to allow
  390. dnl configure script bootstrapping itself when using
  391. dnl these to figure out other settings. Also emits
  392. dnl code that performs PATH_SEPARATOR auto-detection
  393. dnl and sets its value unless it is already set with
  394. dnl a non-empty value.
  395. dnl
  396. dnl These basic checks are intended to be placed and
  397. dnl executed as early as possible in the resulting
  398. dnl configure script, and as such these must be pure
  399. dnl and portable shell code.
  400. dnl
  401. dnl This macro may be used directly, or indirectly
  402. dnl when using other macros that AC_REQUIRE it such
  403. dnl as XC_CHECK_PATH_SEPARATOR.
  404. dnl
  405. dnl Currently the mechanism used to ensure that this
  406. dnl macro expands early enough in generated configure
  407. dnl script is making it override autoconf and libtool
  408. dnl PATH_SEPARATOR check.
  409. AC_DEFUN([XC_CONFIGURE_PREAMBLE],
  410. [dnl
  411. AC_PREREQ([2.50])dnl
  412. dnl
  413. AC_BEFORE([$0],[_XC_CFG_PRE_PREAMBLE])dnl
  414. AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl
  415. AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl
  416. AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  417. AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
  418. AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl
  419. AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl
  420. AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
  421. AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
  422. AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl
  423. AC_BEFORE([$0],[_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl
  424. AC_BEFORE([$0],[_XC_CFG_PRE_POSTLUDE])dnl
  425. dnl
  426. AC_BEFORE([$0],[AC_CHECK_TOOL])dnl
  427. AC_BEFORE([$0],[AC_CHECK_PROG])dnl
  428. AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl
  429. AC_BEFORE([$0],[AC_CHECK_PROGS])dnl
  430. dnl
  431. AC_BEFORE([$0],[AC_PATH_TOOL])dnl
  432. AC_BEFORE([$0],[AC_PATH_PROG])dnl
  433. AC_BEFORE([$0],[AC_PATH_PROGS])dnl
  434. dnl
  435. AC_BEFORE([$0],[AC_PROG_SED])dnl
  436. AC_BEFORE([$0],[AC_PROG_GREP])dnl
  437. AC_BEFORE([$0],[AC_PROG_LN_S])dnl
  438. AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl
  439. AC_BEFORE([$0],[AC_PROG_INSTALL])dnl
  440. AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl
  441. AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl
  442. dnl
  443. AC_BEFORE([$0],[LT_INIT])dnl
  444. AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
  445. AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl
  446. dnl
  447. AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl
  448. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl
  449. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl
  450. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  451. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
  452. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl
  453. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl
  454. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
  455. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
  456. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl
  457. AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl
  458. AC_REQUIRE([_XC_CFG_PRE_POSTLUDE])dnl
  459. dnl
  460. m4_pattern_forbid([^_*XC])dnl
  461. m4_define([$0],[])dnl
  462. ])
  463. dnl Override autoconf and libtool PATH_SEPARATOR check
  464. dnl -------------------------------------------------
  465. dnl Macros overriding.
  466. dnl
  467. dnl This is done to ensure that the same check is
  468. dnl used across different autoconf versions and to
  469. dnl allow expansion of XC_CONFIGURE_PREAMBLE macro
  470. dnl early enough in the generated configure script.
  471. dnl
  472. dnl Override when using autoconf 2.53 and newer.
  473. dnl
  474. m4_ifdef([_AS_PATH_SEPARATOR_PREPARE],
  475. [dnl
  476. m4_undefine([_AS_PATH_SEPARATOR_PREPARE])dnl
  477. m4_defun([_AS_PATH_SEPARATOR_PREPARE],
  478. [dnl
  479. AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl
  480. m4_define([$0],[])dnl
  481. ])dnl
  482. ])
  483. dnl
  484. dnl Override when using autoconf 2.50 to 2.52
  485. dnl
  486. m4_ifdef([_AC_INIT_PREPARE_FS_SEPARATORS],
  487. [dnl
  488. m4_undefine([_AC_INIT_PREPARE_FS_SEPARATORS])dnl
  489. m4_defun([_AC_INIT_PREPARE_FS_SEPARATORS],
  490. [dnl
  491. AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl
  492. ac_path_separator=$PATH_SEPARATOR
  493. m4_define([$0],[])dnl
  494. ])dnl
  495. ])
  496. dnl
  497. dnl Override when using libtool 1.4.2
  498. dnl
  499. m4_ifdef([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
  500. [dnl
  501. m4_undefine([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
  502. m4_defun([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
  503. [dnl
  504. AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl
  505. lt_cv_sys_path_separator=$PATH_SEPARATOR
  506. m4_define([$0],[])dnl
  507. ])dnl
  508. ])
  509. dnl XC_CHECK_PATH_SEPARATOR
  510. dnl -------------------------------------------------
  511. dnl Public macro.
  512. dnl
  513. dnl Usage of this macro ensures that generated configure
  514. dnl script uses the same PATH_SEPARATOR check irrespective
  515. dnl of autoconf or libtool version being used to generate
  516. dnl configure script.
  517. dnl
  518. dnl Emits shell code that computes the path separator
  519. dnl and stores the result in 'PATH_SEPARATOR', unless
  520. dnl the user has already set it with a non-empty value.
  521. dnl
  522. dnl This path separator is the symbol used to separate
  523. dnl or diferentiate paths inside the 'PATH' environment
  524. dnl variable.
  525. dnl
  526. dnl Non-empty user provided 'PATH_SEPARATOR' always
  527. dnl overrides the auto-detected one.
  528. dnl
  529. dnl Strictly speaking the check is done in two steps. The
  530. dnl first, which does the actual check, takes place in
  531. dnl XC_CONFIGURE_PREAMBLE macro and happens very early in
  532. dnl generated configure script. The second one shows and
  533. dnl logs the result of the check into config.log at a later
  534. dnl configure stage. Placement of this second stage in
  535. dnl generated configure script will be done where first
  536. dnl direct or indirect usage of this macro happens.
  537. AC_DEFUN([XC_CHECK_PATH_SEPARATOR],
  538. [dnl
  539. AC_PREREQ([2.50])dnl
  540. dnl
  541. AC_BEFORE([$0],[AC_CHECK_TOOL])dnl
  542. AC_BEFORE([$0],[AC_CHECK_PROG])dnl
  543. AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl
  544. AC_BEFORE([$0],[AC_CHECK_PROGS])dnl
  545. dnl
  546. AC_BEFORE([$0],[AC_PATH_TOOL])dnl
  547. AC_BEFORE([$0],[AC_PATH_PROG])dnl
  548. AC_BEFORE([$0],[AC_PATH_PROGS])dnl
  549. dnl
  550. AC_BEFORE([$0],[AC_PROG_SED])dnl
  551. AC_BEFORE([$0],[AC_PROG_GREP])dnl
  552. AC_BEFORE([$0],[AC_PROG_LN_S])dnl
  553. AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl
  554. AC_BEFORE([$0],[AC_PROG_INSTALL])dnl
  555. AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl
  556. AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl
  557. dnl
  558. AC_BEFORE([$0],[LT_INIT])dnl
  559. AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
  560. AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl
  561. dnl
  562. AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl
  563. dnl
  564. #
  565. # Check that 'XC_CONFIGURE_PREAMBLE' has already run.
  566. #
  567. if test -z "$xc_configure_preamble_result"; then
  568. AC_MSG_ERROR([xc_configure_preamble_result not set (internal problem)])
  569. fi
  570. #
  571. # Check that 'PATH_SEPARATOR' has already been set.
  572. #
  573. if test -z "$xc_PATH_SEPARATOR"; then
  574. AC_MSG_ERROR([xc_PATH_SEPARATOR not set (internal problem)])
  575. fi
  576. if test -z "$PATH_SEPARATOR"; then
  577. AC_MSG_ERROR([PATH_SEPARATOR not set (internal or config.site problem)])
  578. fi
  579. AC_MSG_CHECKING([for path separator])
  580. AC_MSG_RESULT([$PATH_SEPARATOR])
  581. if test "x$PATH_SEPARATOR" != "x$xc_PATH_SEPARATOR"; then
  582. AC_MSG_CHECKING([for initial path separator])
  583. AC_MSG_RESULT([$xc_PATH_SEPARATOR])
  584. AC_MSG_ERROR([path separator mismatch (internal or config.site problem)])
  585. fi
  586. dnl
  587. m4_pattern_forbid([^_*XC])dnl
  588. m4_define([$0],[])dnl
  589. ])