GitMe: inline 7z's install script
[msysgit.git] / mingw / bin / curl-config
blob9145d929cd5943277f57a1f0eeee7ef5ebf536c0
1 #! /bin/sh
2 #***************************************************************************
3 # _ _ ____ _
4 # Project ___| | | | _ \| |
5 # / __| | | | |_) | |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
9 # Copyright (C) 2001 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
11 # This software is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at http://curl.haxx.se/docs/copyright.html.
15 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
16 # copies of the Software, and permit persons to whom the Software is
17 # furnished to do so, under the terms of the COPYING file.
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
22 # $Id: curl-config.in,v 1.28 2007-02-17 17:55:19 danf Exp $
23 ###########################################################################
25 # The idea to this kind of setup info script was stolen from numerous
26 # other packages, such as neon, libxml and gnome.
28 prefix=/mingw
29 exec_prefix=${prefix}
30 includedir=${prefix}/include
32 usage()
34 cat <<EOF
35 Usage: curl-config [OPTION]
37 Available values for OPTION include:
39 --ca ca bundle install path
40 --cc compiler
41 --cflags pre-processor and compiler flags
42 --checkfor [version] check for (lib)curl of the specified version
43 --features newline separated list of enabled features
44 --protocols newline separated list of enabled protocols
45 --help display this help and exit
46 --libs library linking information
47 --prefix curl install prefix
48 --version output version information
49 --vernum output the version information as a number (hexadecimal)
50 EOF
52 exit $1
55 if test $# -eq 0; then
56 usage 1
59 while test $# -gt 0; do
60 case "$1" in
61 # this deals with options in the style
62 # --option=value and extracts the value part
63 # [not currently used]
64 -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
65 *) value= ;;
66 esac
68 case "$1" in
69 --ca)
70 echo ""
73 --cc)
74 echo "gcc"
77 --prefix)
78 echo "$prefix"
81 --feature|--features)
82 if test "" = "1"; then
83 echo "SSL"
84 NTLM=1 # OpenSSL implies NTLM
85 elif test -n ""; then
86 echo "SSL"
88 if test "" = "1"; then
89 echo "KRB4"
91 if test "" = "1"; then
92 echo "IPv6"
94 if test "1" = "1"; then
95 echo "libz"
97 if test "" = "1"; then
98 echo "AsynchDNS"
100 if test "" = "1"; then
101 echo "IDN"
103 if test "" = "1"; then
104 echo "SSPI"
105 NTLM=1
107 if test "$NTLM" = "1"; then
108 echo "NTLM"
112 --protocols)
113 if test "" != "1"; then
114 echo "HTTP"
115 if test "" = "1"; then
116 echo "HTTPS"
119 if test "" != "1"; then
120 echo "FTP"
121 if test "" = "1"; then
122 echo "FTPS"
125 if test "" != "1"; then
126 echo "FILE"
128 if test "" != "1"; then
129 echo "TELNET"
131 if test "" != "1"; then
132 echo "LDAP"
134 if test "" != "1"; then
135 echo "DICT"
137 if test "" != "1"; then
138 echo "TFTP"
141 --version)
142 echo libcurl 7.16.4
143 exit 0
146 --checkfor)
147 checkfor=$2
148 cmajor=`echo $checkfor | cut -d. -f1`
149 cminor=`echo $checkfor | cut -d. -f2`
150 # when extracting the patch part we strip off everything after a
151 # dash as that's used for things like version 1.2.3-CVS
152 cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1`
153 checknum=`echo "$cmajor*256*256 + $cminor*256 + ${cpatch:-0}" | bc`
154 numuppercase=`echo 071004 | tr 'a-f' 'A-F'`
155 nownum=`echo "obase=10; ibase=16; $numuppercase" | bc`
157 if test "$nownum" -ge "$checknum"; then
158 # silent success
159 exit 0
160 else
161 echo "requested version $checkfor is newer than existing 7.16.4"
162 exit 1
166 --vernum)
167 echo 071004
168 exit 0
171 --help)
172 usage 0
175 --cflags)
176 if test "X${prefix}/include" = "X/usr/include"; then
177 echo ""
178 else
179 echo "-I${prefix}/include"
183 --libs)
184 if test "X${exec_prefix}/lib" != "X/usr/lib"; then
185 CURLLIBDIR="-L${exec_prefix}/lib "
186 else
187 CURLLIBDIR=""
189 if test "Xyes" = "Xyes"; then
190 echo ${CURLLIBDIR}-lcurl -lwinmm -lws2_32 -lz -lws2_32
191 else
192 echo ${CURLLIBDIR}-lcurl
197 echo "unknown option: $1"
198 usage 1
200 esac
201 shift
202 done
204 exit 0