Install curl-7.19.5.tar.bz2
[msysgit/bosko.git] / mingw / bin / curl-config
blob50e538461e231f1de394cbb682603128cbfd04e2
1 #! /bin/sh
2 #***************************************************************************
3 # _ _ ____ _
4 # Project ___| | | | _ \| |
5 # / __| | | | |_) | |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
9 # Copyright (C) 2001 - 2009, 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.36 2009-03-20 12:42:29 bagder Exp $
23 ###########################################################################
25 prefix=/mingw
26 exec_prefix=${prefix}
27 includedir=${prefix}/include
29 usage()
31 cat <<EOF
32 Usage: curl-config [OPTION]
34 Available values for OPTION include:
36 --ca ca bundle install path
37 --cc compiler
38 --cflags pre-processor and compiler flags
39 --checkfor [version] check for (lib)curl of the specified version
40 --features newline separated list of enabled features
41 --help display this help and exit
42 --libs library linking information
43 --prefix curl install prefix
44 --protocols newline separated list of enabled protocols
45 --static-libs static libcurl library linking information
46 --version output version information
47 --vernum output the version information as a number (hexadecimal)
48 EOF
50 exit $1
53 if test $# -eq 0; then
54 usage 1
57 while test $# -gt 0; do
58 case "$1" in
59 # this deals with options in the style
60 # --option=value and extracts the value part
61 # [not currently used]
62 -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
63 *) value= ;;
64 esac
66 case "$1" in
67 --ca)
68 echo ""
71 --cc)
72 echo "gcc"
75 --prefix)
76 echo "$prefix"
79 --feature|--features)
80 for feature in SSL libz NTLM ""; do
81 test -n "$feature" && echo "$feature"
82 done
85 --protocols)
86 for protocol in HTTP HTTPS FTP FTPS FILE TELNET LDAP DICT TFTP; do
87 echo "$protocol"
88 done
90 --version)
91 echo libcurl 7.19.5
92 exit 0
95 --checkfor)
96 checkfor=$2
97 cmajor=`echo $checkfor | cut -d. -f1`
98 cminor=`echo $checkfor | cut -d. -f2`
99 # when extracting the patch part we strip off everything after a
100 # dash as that's used for things like version 1.2.3-CVS
101 cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1`
102 checknum=`echo "$cmajor*256*256 + $cminor*256 + ${cpatch:-0}" | bc`
103 numuppercase=`echo 071305 | tr 'a-f' 'A-F'`
104 nownum=`echo "obase=10; ibase=16; $numuppercase" | bc`
106 if test "$nownum" -ge "$checknum"; then
107 # silent success
108 exit 0
109 else
110 echo "requested version $checkfor is newer than existing 7.19.5"
111 exit 1
115 --vernum)
116 echo 071305
117 exit 0
120 --help)
121 usage 0
124 --cflags)
125 if test "X${prefix}/include" = "X/usr/include"; then
126 echo ""
127 else
128 echo "-I${prefix}/include"
132 --libs)
133 if test "X${exec_prefix}/lib" != "X/usr/lib" -a "X${exec_prefix}/lib" != "X/usr/lib64"; then
134 CURLLIBDIR="-L${exec_prefix}/lib "
135 else
136 CURLLIBDIR=""
138 if test "Xyes" = "Xyes"; then
139 echo ${CURLLIBDIR}-lcurl -L/mingw/lib -lssl -lcrypto -lgdi32 -lwldap32 -lws2_32 -lz -lws2_32
140 else
141 echo ${CURLLIBDIR}-lcurl -L/mingw/lib
145 --static-libs)
146 echo ${exec_prefix}/lib/libcurl.a -L/mingw/lib -lssl -lcrypto -lgdi32 -lwldap32 -lws2_32 -lz -lws2_32
150 echo "unknown option: $1"
151 usage 1
153 esac
154 shift
155 done
157 exit 0