2
0

zz40-xc-ovr.m4 18 KB

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