1
#***************************************************************************
3
# Project ___| | | | _ \| |
5
# | (__| |_| | _ <| |___
6
# \___|\___/|_| \_\_____|
8
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
10
# This software is licensed as described in the file COPYING, which
11
# you should have received as part of this distribution. The terms
12
# are also available at http://curl.haxx.se/docs/copyright.html.
14
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
15
# copies of the Software, and permit persons to whom the Software is
16
# furnished to do so, under the terms of the COPYING file.
18
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
# KIND, either express or implied.
21
# $Id: curl-system.m4,v 1.2 2008-11-19 01:57:27 yangtse Exp $
22
#***************************************************************************
24
# File version for 'aclocal' use. Keep it a single number.
28
dnl CURL_CHECK_PATH_SEPARATOR
29
dnl -------------------------------------------------
30
dnl Check and compute the path separator for us. This
31
dnl path separator is the symbol used to diferentiate
32
dnl or separate paths inside the PATH environment var.
34
AC_DEFUN([CURL_CHECK_PATH_SEPARATOR], [
35
if test -z "$curl_cv_PATH_SEPARATOR"; then
36
if test -z "$PATH"; then
37
AC_MSG_ERROR([PATH not set. Cannot continue without PATH being set.])
39
dnl Directory count in PATH when using a colon separator.
41
tst_save_IFS=$IFS; IFS=':'
42
for tst_dir in $PATH; do
44
test -d "$tst_dir" && tst_dirs_col=`expr $tst_dirs_col + 1`
47
dnl Directory count in PATH when using a semicolon separator.
49
tst_save_IFS=$IFS; IFS=';'
50
for tst_dir in $PATH; do
52
test -d "$tst_dir" && tst_dirs_sem=`expr $tst_dirs_sem + 1`
55
if test $tst_dirs_sem -eq $tst_dirs_col; then
56
dnl When both counting methods give the same result we do not want to
57
dnl chose one over the other, and consider auto-detection not possible.
58
if test -z "$PATH_SEPARATOR"; then
59
dnl Stop dead until user provides PATH_SEPARATOR definition.
60
AC_MSG_ERROR([PATH_SEPARATOR not set. Cannot continue without it.])
63
dnl Separator with the greater directory count is the auto-detected one.
64
if test $tst_dirs_sem -gt $tst_dirs_col; then
65
tst_auto_separator=';'
67
tst_auto_separator=':'
69
if test -z "$PATH_SEPARATOR"; then
70
dnl Simply use the auto-detected one when not already set.
71
PATH_SEPARATOR="$tst_auto_separator"
74
curl_cv_PATH_SEPARATOR="$PATH_SEPARATOR"
76
AC_SUBST([PATH_SEPARATOR])