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.

zz40-xc-ovr.m4 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. #---------------------------------------------------------------------------
  2. #
  3. # zz40-xc-ovr.m4
  4. #
  5. # Copyright (c) 2013 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. # serial 1
  23. dnl The funny name of this file is intentional in order to make it
  24. dnl sort alphabetically after any libtool, autoconf or automake
  25. dnl provided .m4 macro file that might get copied into this same
  26. dnl subdirectory. This allows that macro (re)definitions from this
  27. dnl file may override those provided in other files.
  28. dnl Version macros
  29. dnl -------------------------------------------------
  30. dnl Public macros.
  31. m4_define([XC_CONFIGURE_PREAMBLE_VER_MAJOR],[1])dnl
  32. m4_define([XC_CONFIGURE_PREAMBLE_VER_MINOR],[0])dnl
  33. dnl _XC_CFG_PRE_PREAMBLE
  34. dnl -------------------------------------------------
  35. dnl Private macro.
  36. AC_DEFUN([_XC_CFG_PRE_PREAMBLE],
  37. [
  38. ## -------------------------------- ##
  39. @%:@@%:@ [XC_CONFIGURE_PREAMBLE] ver: []dnl
  40. XC_CONFIGURE_PREAMBLE_VER_MAJOR.[]dnl
  41. XC_CONFIGURE_PREAMBLE_VER_MINOR ##
  42. ## -------------------------------- ##
  43. xc_configure_preamble_ver_major='XC_CONFIGURE_PREAMBLE_VER_MAJOR'
  44. xc_configure_preamble_ver_minor='XC_CONFIGURE_PREAMBLE_VER_MINOR'
  45. #
  46. # Set IFS to space, tab and newline.
  47. #
  48. xc_space=' '
  49. xc_tab=' '
  50. xc_newline='
  51. '
  52. IFS="$xc_space$xc_tab$xc_newline"
  53. #
  54. # Set internationalization behavior variables.
  55. #
  56. LANG='C'
  57. LC_ALL='C'
  58. LANGUAGE='C'
  59. export LANG
  60. export LC_ALL
  61. export LANGUAGE
  62. #
  63. # Some useful variables.
  64. #
  65. xc_msg_warn='configure: WARNING:'
  66. xc_msg_abrt='Can not continue.'
  67. xc_msg_err='configure: error:'
  68. ])
  69. dnl _XC_CFG_PRE_BASIC_CHK_CMD_ECHO
  70. dnl -------------------------------------------------
  71. dnl Private macro.
  72. dnl
  73. dnl Emits shell code that verifies that 'echo' command
  74. dnl is available, otherwise aborts execution.
  75. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO],
  76. [dnl
  77. AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl
  78. #
  79. # Verify that 'echo' command is available, otherwise abort.
  80. #
  81. xc_tst_str='unknown'
  82. (`echo "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success'
  83. case "x$xc_tst_str" in @%:@ ((
  84. xsuccess)
  85. :
  86. ;;
  87. *)
  88. # Try built-in echo, and fail.
  89. echo "$xc_msg_err 'echo' command not found. $xc_msg_abrt" >&2
  90. exit 1
  91. ;;
  92. esac
  93. ])
  94. dnl _XC_CFG_PRE_BASIC_CHK_CMD_TEST
  95. dnl -------------------------------------------------
  96. dnl Private macro.
  97. dnl
  98. dnl Emits shell code that verifies that 'test' command
  99. dnl is available, otherwise aborts execution.
  100. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_TEST],
  101. [dnl
  102. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl
  103. #
  104. # Verify that 'test' command is available, otherwise abort.
  105. #
  106. xc_tst_str='unknown'
  107. (`test -n "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success'
  108. case "x$xc_tst_str" in @%:@ ((
  109. xsuccess)
  110. :
  111. ;;
  112. *)
  113. echo "$xc_msg_err 'test' command not found. $xc_msg_abrt" >&2
  114. exit 1
  115. ;;
  116. esac
  117. ])
  118. dnl _XC_CFG_PRE_BASIC_CHK_VAR_PATH
  119. dnl -------------------------------------------------
  120. dnl Private macro.
  121. dnl
  122. dnl Emits shell code that verifies that 'PATH' variable
  123. dnl is set, otherwise aborts execution.
  124. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_VAR_PATH],
  125. [dnl
  126. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl
  127. #
  128. # Verify that 'PATH' variable is set, otherwise abort.
  129. #
  130. xc_tst_str='unknown'
  131. (`test -n "$PATH" >/dev/null 2>&1`) && xc_tst_str='success'
  132. case "x$xc_tst_str" in @%:@ ((
  133. xsuccess)
  134. :
  135. ;;
  136. *)
  137. echo "$xc_msg_err 'PATH' variable not set. $xc_msg_abrt" >&2
  138. exit 1
  139. ;;
  140. esac
  141. ])
  142. dnl _XC_CFG_PRE_BASIC_CHK_CMD_EXPR
  143. dnl -------------------------------------------------
  144. dnl Private macro.
  145. dnl
  146. dnl Emits shell code that verifies that 'expr' command
  147. dnl is available, otherwise aborts execution.
  148. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR],
  149. [dnl
  150. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  151. #
  152. # Verify that 'expr' command is available, otherwise abort.
  153. #
  154. xc_tst_str='unknown'
  155. xc_tst_str=`expr "$xc_tst_str" : '.*' 2>/dev/null`
  156. case "x$xc_tst_str" in @%:@ ((
  157. x7)
  158. :
  159. ;;
  160. *)
  161. echo "$xc_msg_err 'expr' command not found. $xc_msg_abrt" >&2
  162. exit 1
  163. ;;
  164. esac
  165. ])
  166. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_SED
  167. dnl -------------------------------------------------
  168. dnl Private macro.
  169. dnl
  170. dnl Emits shell code that verifies that 'sed' utility
  171. dnl is found within 'PATH', otherwise aborts execution.
  172. dnl
  173. dnl This 'sed' is required in order to allow configure
  174. dnl script bootstrapping itself. No fancy testing for a
  175. dnl proper 'sed' this early, that should be done later.
  176. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_SED],
  177. [dnl
  178. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  179. #
  180. # Verify that 'sed' utility is found within 'PATH', otherwise abort.
  181. #
  182. xc_tst_str='unknown'
  183. xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
  184. | sed -e 's:unknown:success:' 2>/dev/null`
  185. case "x$xc_tst_str" in @%:@ ((
  186. xsuccess)
  187. :
  188. ;;
  189. *)
  190. echo "$xc_msg_err 'sed' utility not found in 'PATH'. $xc_msg_abrt" >&2
  191. exit 1
  192. ;;
  193. esac
  194. ])
  195. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_GREP
  196. dnl -------------------------------------------------
  197. dnl Private macro.
  198. dnl
  199. dnl Emits shell code that verifies that 'grep' utility
  200. dnl is found within 'PATH', otherwise aborts execution.
  201. dnl
  202. dnl This 'grep' is required in order to allow configure
  203. dnl script bootstrapping itself. No fancy testing for a
  204. dnl proper 'grep' this early, that should be done later.
  205. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP],
  206. [dnl
  207. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  208. #
  209. # Verify that 'grep' utility is found within 'PATH', otherwise abort.
  210. #
  211. xc_tst_str='unknown'
  212. (`echo "$xc_tst_str" 2>/dev/null \
  213. | grep 'unknown' >/dev/null 2>&1`) && xc_tst_str='success'
  214. case "x$xc_tst_str" in @%:@ ((
  215. xsuccess)
  216. :
  217. ;;
  218. *)
  219. echo "$xc_msg_err 'grep' utility not found in 'PATH'. $xc_msg_abrt" >&2
  220. exit 1
  221. ;;
  222. esac
  223. ])
  224. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_TR
  225. dnl -------------------------------------------------
  226. dnl Private macro.
  227. dnl
  228. dnl Emits shell code that verifies that 'tr' utility
  229. dnl is found within 'PATH', otherwise aborts execution.
  230. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_TR],
  231. [dnl
  232. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
  233. #
  234. # Verify that 'tr' utility is found within 'PATH', otherwise abort.
  235. #
  236. xc_tst_str="${xc_tab}98s7u6c5c4e3s2s10"
  237. xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
  238. | tr -d "0123456789$xc_tab" 2>/dev/null`
  239. case "x$xc_tst_str" in @%:@ ((
  240. xsuccess)
  241. :
  242. ;;
  243. *)
  244. echo "$xc_msg_err 'tr' utility not found in 'PATH'. $xc_msg_abrt" >&2
  245. exit 1
  246. ;;
  247. esac
  248. ])
  249. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_WC
  250. dnl -------------------------------------------------
  251. dnl Private macro.
  252. dnl
  253. dnl Emits shell code that verifies that 'wc' utility
  254. dnl is found within 'PATH', otherwise aborts execution.
  255. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_WC],
  256. [dnl
  257. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
  258. #
  259. # Verify that 'wc' utility is found within 'PATH', otherwise abort.
  260. #
  261. xc_tst_str='unknown unknown unknown unknown'
  262. xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
  263. | wc -w 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null`
  264. case "x$xc_tst_str" in @%:@ ((
  265. x4)
  266. :
  267. ;;
  268. *)
  269. echo "$xc_msg_err 'wc' utility not found in 'PATH'. $xc_msg_abrt" >&2
  270. exit 1
  271. ;;
  272. esac
  273. ])
  274. dnl _XC_CFG_PRE_BASIC_CHK_UTIL_CAT
  275. dnl -------------------------------------------------
  276. dnl Private macro.
  277. dnl
  278. dnl Emits shell code that verifies that 'cat' utility
  279. dnl is found within 'PATH', otherwise aborts execution.
  280. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT],
  281. [dnl
  282. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
  283. #
  284. # Verify that 'cat' utility is found within 'PATH', otherwise abort.
  285. #
  286. xc_tst_str='unknown'
  287. xc_tst_str=`cat <<_EOT 2>/dev/null \
  288. | wc -l 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null
  289. unknown
  290. unknown
  291. unknown
  292. _EOT`
  293. case "x$xc_tst_str" in @%:@ ((
  294. x3)
  295. :
  296. ;;
  297. *)
  298. echo "$xc_msg_err 'cat' utility not found in 'PATH'. $xc_msg_abrt" >&2
  299. exit 1
  300. ;;
  301. esac
  302. ])
  303. dnl _XC_CFG_PRE_CHECK_PATH_SEPARATOR
  304. dnl -------------------------------------------------
  305. dnl Private macro.
  306. dnl
  307. dnl Emits shell code that computes the path separator
  308. dnl and stores the result in 'PATH_SEPARATOR', unless
  309. dnl the user has already set it with a non-empty value.
  310. dnl
  311. dnl This path separator is the symbol used to separate
  312. dnl or diferentiate paths inside the 'PATH' environment
  313. dnl variable.
  314. dnl
  315. dnl Non-empty user provided 'PATH_SEPARATOR' always
  316. dnl overrides the auto-detected one.
  317. AC_DEFUN([_XC_CFG_PRE_CHECK_PATH_SEPARATOR],
  318. [dnl
  319. AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
  320. #
  321. # Auto-detect and set 'PATH_SEPARATOR', unless it is already non-empty set.
  322. #
  323. # Directory count in 'PATH' when using a colon separator.
  324. xc_tst_dirs_col='x'
  325. xc_tst_prev_IFS=$IFS; IFS=':'
  326. for xc_tst_dir in $PATH; do
  327. IFS=$xc_tst_prev_IFS
  328. xc_tst_dirs_col="x$xc_tst_dirs_col"
  329. done
  330. IFS=$xc_tst_prev_IFS
  331. xc_tst_dirs_col=`expr "$xc_tst_dirs_col" : '.*'`
  332. # Directory count in 'PATH' when using a semicolon separator.
  333. xc_tst_dirs_sem='x'
  334. xc_tst_prev_IFS=$IFS; IFS=';'
  335. for xc_tst_dir in $PATH; do
  336. IFS=$xc_tst_prev_IFS
  337. xc_tst_dirs_sem="x$xc_tst_dirs_sem"
  338. done
  339. IFS=$xc_tst_prev_IFS
  340. xc_tst_dirs_sem=`expr "$xc_tst_dirs_sem" : '.*'`
  341. if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then
  342. # When both counting methods give the same result we do not want to
  343. # chose one over the other, and consider auto-detection not possible.
  344. if test -z "$PATH_SEPARATOR"; then
  345. # Stop dead until user provides 'PATH_SEPARATOR' definition.
  346. echo "$xc_msg_err 'PATH_SEPARATOR' variable not set. $xc_msg_abrt" >&2
  347. exit 1
  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 diferentiate 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. ])