zz40-xc-ovr.m4 18 KB

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