Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 217 lines (196 sloc) 5.305 kB
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
1 #! /bin/sh
6ca627a @bagder curl-config got a --checkfor option
authored
2 #***************************************************************************
3 # _ _ ____ _
4 # Project ___| | | | _ \| |
5 # / __| | | | |_) | |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
8 #
c5e7d83 @dfandrich Don't bother adding a library path of /usr/lib in curl-config --libs
dfandrich authored
9 # Copyright (C) 2001 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
6ca627a @bagder curl-config got a --checkfor option
authored
10 #
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.
14 #
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.
18 #
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
21 #
22 # $Id$
6ca627a @bagder curl-config got a --checkfor option
authored
23 ###########################################################################
24 #
25 # The idea to this kind of setup info script was stolen from numerous
26 # other packages, such as neon, libxml and gnome.
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
27 #
28 prefix=@prefix@
29 exec_prefix=@exec_prefix@
30 includedir=@includedir@
31
32 usage()
33 {
34 cat <<EOF
35 Usage: curl-config [OPTION]
36
1ee7f92 @bagder configure sets variables that curl-config uses to display what features
authored
37 Available values for OPTION include:
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
38
98e1605 @bagder --ca shows ca bundle path
authored
39 --ca ca bundle install path
6e9d161 @bagder added support for --cc to output the compiler name. This makes it pos…
authored
40 --cc compiler
1ee7f92 @bagder configure sets variables that curl-config uses to display what features
authored
41 --cflags pre-processor and compiler flags
6ca627a @bagder curl-config got a --checkfor option
authored
42 --checkfor [version] check for (lib)curl of the specified version
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
43 --features newline separated list of enabled features
1ee7f92 @bagder configure sets variables that curl-config uses to display what features
authored
44 --help display this help and exit
45 --libs library linking information
46 --prefix curl install prefix
faaaf62 @dfandrich Added the --static-libs option to curl-config
dfandrich authored
47 --protocols newline separated list of enabled protocols
48 --static-libs static libcurl library linking information
1ee7f92 @bagder configure sets variables that curl-config uses to display what features
authored
49 --version output version information
2688673 Add documentation for the --vernum attribute
Sterling Hughes authored
50 --vernum output the version information as a number (hexadecimal)
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
51 EOF
52
53 exit $1
54 }
55
56 if test $# -eq 0; then
57 usage 1
58 fi
59
60 while test $# -gt 0; do
61 case "$1" in
28a9108 @bagder more intial fixes
authored
62 # this deals with options in the style
63 # --option=value and extracts the value part
64 # [not currently used]
65 -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
66 *) value= ;;
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
67 esac
68
69 case "$1" in
98e1605 @bagder --ca shows ca bundle path
authored
70 --ca)
df3ca59 @bagder Dan Fandrich:
authored
71 echo "@CURL_CA_BUNDLE@"
98e1605 @bagder --ca shows ca bundle path
authored
72 ;;
73
6e9d161 @bagder added support for --cc to output the compiler name. This makes it pos…
authored
74 --cc)
df3ca59 @bagder Dan Fandrich:
authored
75 echo "@CC@"
6e9d161 @bagder added support for --cc to output the compiler name. This makes it pos…
authored
76 ;;
77
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
78 --prefix)
df3ca59 @bagder Dan Fandrich:
authored
79 echo "$prefix"
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
80 ;;
81
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
82 --feature|--features)
df3ca59 @bagder Dan Fandrich:
authored
83 if test "@USE_SSLEAY@" = "1"; then
1ee7f92 @bagder configure sets variables that curl-config uses to display what features
authored
84 echo "SSL"
8f219af @bagder When curl is built with GnuTLS, curl-config didn't include "SSL" when
authored
85 NTLM=1 # OpenSSL implies NTLM
86 elif test -n "@USE_GNUTLS@"; then
87 echo "SSL"
1ee7f92 @bagder configure sets variables that curl-config uses to display what features
authored
88 fi
89 if test "@KRB4_ENABLED@" = "1"; then
90 echo "KRB4"
91 fi
92 if test "@IPV6_ENABLED@" = "1"; then
93 echo "IPv6"
94 fi
f8e0b18 @bagder AC_SUBST HAVE_LIBZ for curl-config.in
authored
95 if test "@HAVE_LIBZ@" = "1"; then
96 echo "libz"
97 fi
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
98 if test "@HAVE_ARES@" = "1"; then
99 echo "AsynchDNS"
fd3881e @bagder added --disable-[protocol] support
authored
100 fi
d6460af @bagder added missing features to curl-config
authored
101 if test "@IDN_ENABLED@" = "1"; then
102 echo "IDN"
103 fi
104 if test "@USE_WINDOWS_SSPI@" = "1"; then
105 echo "SSPI"
106 NTLM=1
107 fi
108 if test "$NTLM" = "1"; then
109 echo "NTLM"
110 fi
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
111 ;;
112
113 --protocols)
114 if test "@CURL_DISABLE_HTTP@" != "1"; then
115 echo "HTTP"
116 if test "@USE_SSLEAY@" = "1"; then
117 echo "HTTPS"
118 fi
fd3881e @bagder added --disable-[protocol] support
authored
119 fi
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
120 if test "@CURL_DISABLE_FTP@" != "1"; then
121 echo "FTP"
122 if test "@USE_SSLEAY@" = "1"; then
123 echo "FTPS"
124 fi
fd3881e @bagder added --disable-[protocol] support
authored
125 fi
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
126 if test "@CURL_DISABLE_FILE@" != "1"; then
127 echo "FILE"
fd3881e @bagder added --disable-[protocol] support
authored
128 fi
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
129 if test "@CURL_DISABLE_TELNET@" != "1"; then
130 echo "TELNET"
fd3881e @bagder added --disable-[protocol] support
authored
131 fi
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
132 if test "@CURL_DISABLE_LDAP@" != "1"; then
133 echo "LDAP"
fd3881e @bagder added --disable-[protocol] support
authored
134 fi
9b23b31 @dfandrich Added LDAPS, SCP and SFTP to curl-config --protocols.
dfandrich authored
135 if test "@CURL_DISABLE_LDAPS@" != "1"; then
136 echo "LDAPS"
137 fi
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
138 if test "@CURL_DISABLE_DICT@" != "1"; then
139 echo "DICT"
437afe0 @bagder curl-config now shows asyncdns if built with ares enabled
authored
140 fi
e55f502 @bagder --protocols now supports TFTP
authored
141 if test "@CURL_DISABLE_TFTP@" != "1"; then
142 echo "TFTP"
143 fi
9b23b31 @dfandrich Added LDAPS, SCP and SFTP to curl-config --protocols.
dfandrich authored
144 if test "@USE_LIBSSH2@" = "1"; then
145 echo "SCP"
146 echo "SFTP"
147 fi
1ee7f92 @bagder configure sets variables that curl-config uses to display what features
authored
148 ;;
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
149 --version)
cc7fc20 @bagder libcurl version, not curl version
authored
150 echo libcurl @VERSION@
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
151 exit 0
152 ;;
153
6ca627a @bagder curl-config got a --checkfor option
authored
154 --checkfor)
155 checkfor=$2
156 cmajor=`echo $checkfor | cut -d. -f1`
157 cminor=`echo $checkfor | cut -d. -f2`
158 # when extracting the patch part we strip off everything after a
159 # dash as that's used for things like version 1.2.3-CVS
160 cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1`
161 checknum=`echo "$cmajor*256*256 + $cminor*256 + ${cpatch:-0}" | bc`
162 numuppercase=`echo @VERSIONNUM@ | tr 'a-f' 'A-F'`
163 nownum=`echo "obase=10; ibase=16; $numuppercase" | bc`
164
165 if test "$nownum" -ge "$checknum"; then
166 # silent success
167 exit 0
168 else
169 echo "requested version $checkfor is newer than existing @VERSION@"
170 exit 1
171 fi
172 ;;
173
1e5e0f9 @bagder added 'curl-config --vernum' for hardcore hex version output
authored
174 --vernum)
175 echo @VERSIONNUM@
176 exit 0
177 ;;
178
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
179 --help)
180 usage 0
181 ;;
182
183 --cflags)
b0fbb98 @bagder Markus Oberhumer fixed the -cflags option
authored
184 if test "X@includedir@" = "X/usr/include"; then
185 echo ""
186 else
187 echo "-I@includedir@"
188 fi
d9e54a3 @bagder Added --include to set the compiler include flag for libcurl
authored
189 ;;
190
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
191 --libs)
c5e7d83 @dfandrich Don't bother adding a library path of /usr/lib in curl-config --libs
dfandrich authored
192 if test "X@libdir@" != "X/usr/lib"; then
193 CURLLIBDIR="-L@libdir@ "
194 else
195 CURLLIBDIR=""
196 fi
9de4e5e @dfandrich Fixed the problem of curl-config --libs specifying unneeded libraries
dfandrich authored
197 if test "X@REQUIRE_LIB_DEPS@" = "Xyes"; then
2691f1e @dfandrich Use configure's new LIBCURL_LIBS variable
dfandrich authored
198 echo ${CURLLIBDIR}-lcurl @LDFLAGS@ @LIBCURL_LIBS@ @LIBS@
9de4e5e @dfandrich Fixed the problem of curl-config --libs specifying unneeded libraries
dfandrich authored
199 else
2691f1e @dfandrich Use configure's new LIBCURL_LIBS variable
dfandrich authored
200 echo ${CURLLIBDIR}-lcurl @LDFLAGS@ @LIBS@
9de4e5e @dfandrich Fixed the problem of curl-config --libs specifying unneeded libraries
dfandrich authored
201 fi
202 ;;
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
203
faaaf62 @dfandrich Added the --static-libs option to curl-config
dfandrich authored
204 --static-libs)
205 echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ @LIBS@
206 ;;
207
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
208 *)
861ca06 @bagder removed --include again and stuffed the libcurl's include path in --c…
authored
209 echo "unknown option: $1"
2a6ea6d @bagder David Shaw added --protocols, and thus the --feature no longer mentio…
authored
210 usage 1
fb1ce5f @bagder tiny tool for outputting curl config variables
authored
211 ;;
212 esac
213 shift
214 done
215
216 exit 0
Something went wrong with that request. Please try again.