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