~ubuntu-branches/ubuntu/natty/curl/natty-proposed

« back to all changes in this revision

Viewing changes to m4/curl-system.m4

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-05-24 21:12:19 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (3.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20090524211219-7jgcwuhl04ixuqsm
Tags: upstream-7.19.5
ImportĀ upstreamĀ versionĀ 7.19.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#***************************************************************************
 
2
#                                  _   _ ____  _
 
3
#  Project                     ___| | | |  _ \| |
 
4
#                             / __| | | | |_) | |
 
5
#                            | (__| |_| |  _ <| |___
 
6
#                             \___|\___/|_| \_\_____|
 
7
#
 
8
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 
9
#
 
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.
 
13
#
 
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.
 
17
#
 
18
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 
19
# KIND, either express or implied.
 
20
#
 
21
# $Id: curl-system.m4,v 1.2 2008-11-19 01:57:27 yangtse Exp $
 
22
#***************************************************************************
 
23
 
 
24
# File version for 'aclocal' use. Keep it a single number.
 
25
# serial 2
 
26
 
 
27
 
 
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.
 
33
 
 
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.])
 
38
    fi
 
39
    dnl Directory count in PATH when using a colon separator.
 
40
    tst_dirs_col=0
 
41
    tst_save_IFS=$IFS; IFS=':'
 
42
    for tst_dir in $PATH; do
 
43
      IFS=$tst_save_IFS
 
44
      test -d "$tst_dir" && tst_dirs_col=`expr $tst_dirs_col + 1`
 
45
    done
 
46
    IFS=$tst_save_IFS
 
47
    dnl Directory count in PATH when using a semicolon separator.
 
48
    tst_dirs_sem=0
 
49
    tst_save_IFS=$IFS; IFS=';'
 
50
    for tst_dir in $PATH; do
 
51
      IFS=$tst_save_IFS
 
52
      test -d "$tst_dir" && tst_dirs_sem=`expr $tst_dirs_sem + 1`
 
53
    done
 
54
    IFS=$tst_save_IFS
 
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.])
 
61
      fi
 
62
    else
 
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=';'
 
66
      else
 
67
        tst_auto_separator=':'
 
68
      fi
 
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"
 
72
      fi
 
73
    fi
 
74
    curl_cv_PATH_SEPARATOR="$PATH_SEPARATOR"
 
75
  fi
 
76
  AC_SUBST([PATH_SEPARATOR])
 
77
  AC_SUBST([PATH])
 
78
])
 
79