Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 174 lines (149 sloc) 4.378 kb
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
1 #! /bin/sh
6ca627ae »
2006-05-02 curl-config got a --checkfor option
2 #***************************************************************************
3 # _ _ ____ _
4 # Project ___| | | | _ \| |
5 # / __| | | | |_) | |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
8 #
a379a4c1 »
2012-05-25 Fix libcurl.pc and curl-config generation for static MingW* cross builds
9 # Copyright (C) 2001 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
6ca627ae »
2006-05-02 curl-config got a --checkfor option
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.
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
21 #
6ca627ae »
2006-05-02 curl-config got a --checkfor option
22 ###########################################################################
1b6d18fc »
2009-03-20 removed useless comment
23
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
24 prefix=@prefix@
25 exec_prefix=@exec_prefix@
26 includedir=@includedir@
a379a4c1 »
2012-05-25 Fix libcurl.pc and curl-config generation for static MingW* cross builds
27 cppflag_curl_staticlib=@CPPFLAG_CURL_STATICLIB@
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
28
29 usage()
30 {
31 cat <<EOF
32 Usage: curl-config [OPTION]
33
1ee7f92c »
2001-04-18 configure sets variables that curl-config uses to display what features
34 Available values for OPTION include:
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
35
a1312859 »
2010-07-25 curl-config: --built-shared returns shared info
36 --built-shared says 'yes' if libcurl was built shared
98e1605b »
2002-08-30 --ca shows ca bundle path
37 --ca ca bundle install path
6e9d1617 »
2002-01-16 added support for --cc to output the compiler name. This makes it pos…
38 --cc compiler
1ee7f92c »
2001-04-18 configure sets variables that curl-config uses to display what features
39 --cflags pre-processor and compiler flags
6ca627ae »
2006-05-02 curl-config got a --checkfor option
40 --checkfor [version] check for (lib)curl of the specified version
f7f76e17 »
2009-11-14 Added '--configure' option to curl-config to display original configu…
41 --configure the arguments given to configure when building curl
2a6ea6d7 »
2004-12-24 David Shaw added --protocols, and thus the --feature no longer mentio…
42 --features newline separated list of enabled features
1ee7f92c »
2001-04-18 configure sets variables that curl-config uses to display what features
43 --help display this help and exit
44 --libs library linking information
45 --prefix curl install prefix
faaaf626 »
2007-10-25 Added the --static-libs option to curl-config
46 --protocols newline separated list of enabled protocols
47 --static-libs static libcurl library linking information
1ee7f92c »
2001-04-18 configure sets variables that curl-config uses to display what features
48 --version output version information
26886731 »
2001-06-01 Add documentation for the --vernum attribute
49 --vernum output the version information as a number (hexadecimal)
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
50 EOF
51
52 exit $1
53 }
54
55 if test $# -eq 0; then
56 usage 1
57 fi
58
59 while test $# -gt 0; do
60 case "$1" in
28a91082 »
2001-04-17 more intial fixes
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= ;;
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
66 esac
67
68 case "$1" in
a1312859 »
2010-07-25 curl-config: --built-shared returns shared info
69 --built-shared)
70 echo @ENABLE_SHARED@
71 ;;
72
98e1605b »
2002-08-30 --ca shows ca bundle path
73 --ca)
df3ca591 »
2004-12-11 Dan Fandrich:
74 echo "@CURL_CA_BUNDLE@"
98e1605b »
2002-08-30 --ca shows ca bundle path
75 ;;
76
6e9d1617 »
2002-01-16 added support for --cc to output the compiler name. This makes it pos…
77 --cc)
df3ca591 »
2004-12-11 Dan Fandrich:
78 echo "@CC@"
6e9d1617 »
2002-01-16 added support for --cc to output the compiler name. This makes it pos…
79 ;;
80
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
81 --prefix)
df3ca591 »
2004-12-11 Dan Fandrich:
82 echo "$prefix"
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
83 ;;
84
2a6ea6d7 »
2004-12-24 David Shaw added --protocols, and thus the --feature no longer mentio…
85 --feature|--features)
9813cea1 »
2008-09-03 Fixed curl-config when no features are enabled.
86 for feature in @SUPPORT_FEATURES@ ""; do
87 test -n "$feature" && echo "$feature"
bbc002a5 »
2008-09-02 - Keith Mok added supported_protocols and supported_features to the p…
88 done
2a6ea6d7 »
2004-12-24 David Shaw added --protocols, and thus the --feature no longer mentio…
89 ;;
90
91 --protocols)
bbc002a5 »
2008-09-02 - Keith Mok added supported_protocols and supported_features to the p…
92 for protocol in @SUPPORT_PROTOCOLS@; do
cc0054a4 »
2008-09-03 remove extra semicolon from curl-config.in
93 echo "$protocol"
bbc002a5 »
2008-09-02 - Keith Mok added supported_protocols and supported_features to the p…
94 done
1ee7f92c »
2001-04-18 configure sets variables that curl-config uses to display what features
95 ;;
a1312859 »
2010-07-25 curl-config: --built-shared returns shared info
96
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
97 --version)
82ecc85d »
2011-04-18 curl-config: fix --version
98 echo libcurl @CURLVERSION@
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
99 exit 0
100 ;;
101
6ca627ae »
2006-05-02 curl-config got a --checkfor option
102 --checkfor)
103 checkfor=$2
104 cmajor=`echo $checkfor | cut -d. -f1`
105 cminor=`echo $checkfor | cut -d. -f2`
106 # when extracting the patch part we strip off everything after a
107 # dash as that's used for things like version 1.2.3-CVS
108 cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1`
109 checknum=`echo "$cmajor*256*256 + $cminor*256 + ${cpatch:-0}" | bc`
110 numuppercase=`echo @VERSIONNUM@ | tr 'a-f' 'A-F'`
111 nownum=`echo "obase=10; ibase=16; $numuppercase" | bc`
112
113 if test "$nownum" -ge "$checknum"; then
114 # silent success
115 exit 0
116 else
2d1b6242 »
2011-04-19 curl-config: fix version output
117 echo "requested version $checkfor is newer than existing @CURLVERSION@"
6ca627ae »
2006-05-02 curl-config got a --checkfor option
118 exit 1
119 fi
120 ;;
121
1e5e0f9a »
2001-05-28 added 'curl-config --vernum' for hardcore hex version output
122 --vernum)
123 echo @VERSIONNUM@
124 exit 0
125 ;;
126
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
127 --help)
128 usage 0
129 ;;
130
131 --cflags)
a379a4c1 »
2012-05-25 Fix libcurl.pc and curl-config generation for static MingW* cross builds
132 if test "X$cppflag_curl_staticlib" = "X-DCURL_STATICLIB"; then
133 CPPFLAG_CURL_STATICLIB="-DCURL_STATICLIB "
134 else
135 CPPFLAG_CURL_STATICLIB=""
136 fi
b0fbb98f »
2003-01-16 Markus Oberhumer fixed the -cflags option
137 if test "X@includedir@" = "X/usr/include"; then
382429e7 »
2012-08-07 curl-config: parentheses fix
138 echo "$CPPFLAG_CURL_STATICLIB"
b0fbb98f »
2003-01-16 Markus Oberhumer fixed the -cflags option
139 else
382429e7 »
2012-08-07 curl-config: parentheses fix
140 echo "${CPPFLAG_CURL_STATICLIB}-I@includedir@"
b0fbb98f »
2003-01-16 Markus Oberhumer fixed the -cflags option
141 fi
d9e54a3c »
2001-08-16 Added --include to set the compiler include flag for libcurl
142 ;;
143
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
144 --libs)
8df7e0bd »
2008-01-10 Michal Marek made curl-config --libs not include /usr/lib64 in the ou…
145 if test "X@libdir@" != "X/usr/lib" -a "X@libdir@" != "X/usr/lib64"; then
c5e7d839 »
2007-02-14 Don't bother adding a library path of /usr/lib in curl-config --libs
146 CURLLIBDIR="-L@libdir@ "
147 else
148 CURLLIBDIR=""
149 fi
9de4e5eb »
2007-02-14 Fixed the problem of curl-config --libs specifying unneeded libraries
150 if test "X@REQUIRE_LIB_DEPS@" = "Xyes"; then
4ee2df4b »
2012-02-27 curl-config: only provide libraries with --libs
151 echo ${CURLLIBDIR}-lcurl @LIBCURL_LIBS@ @LIBS@
9de4e5eb »
2007-02-14 Fixed the problem of curl-config --libs specifying unneeded libraries
152 else
4ee2df4b »
2012-02-27 curl-config: only provide libraries with --libs
153 echo ${CURLLIBDIR}-lcurl @LIBS@
9de4e5eb »
2007-02-14 Fixed the problem of curl-config --libs specifying unneeded libraries
154 fi
155 ;;
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
156
faaaf626 »
2007-10-25 Added the --static-libs option to curl-config
157 --static-libs)
158 echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ @LIBS@
159 ;;
160
f7f76e17 »
2009-11-14 Added '--configure' option to curl-config to display original configu…
161 --configure)
162 echo @CONFIGURE_OPTIONS@
163 ;;
164
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
165 *)
861ca06f »
2001-08-16 removed --include again and stuffed the libcurl's include path in --c…
166 echo "unknown option: $1"
2a6ea6d7 »
2004-12-24 David Shaw added --protocols, and thus the --feature no longer mentio…
167 usage 1
fb1ce5fd »
2001-04-17 tiny tool for outputting curl config variables
168 ;;
169 esac
170 shift
171 done
172
173 exit 0
Something went wrong with that request. Please try again.