1 | #! /bin/sh |
---|
2 | #*************************************************************************** |
---|
3 | # _ _ ____ _ |
---|
4 | # Project ___| | | | _ \| | |
---|
5 | # / __| | | | |_) | | |
---|
6 | # | (__| |_| | _ <| |___ |
---|
7 | # \___|\___/|_| \_\_____| |
---|
8 | # |
---|
9 | # Copyright (C) 2001 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. |
---|
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 https://curl.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. |
---|
21 | # |
---|
22 | ########################################################################### |
---|
23 | |
---|
24 | prefix=/opt/local |
---|
25 | exec_prefix=${prefix} |
---|
26 | includedir=${prefix}/include |
---|
27 | cppflag_curl_staticlib= |
---|
28 | |
---|
29 | usage() |
---|
30 | { |
---|
31 | cat <<EOF |
---|
32 | Usage: curl-config [OPTION] |
---|
33 | |
---|
34 | Available values for OPTION include: |
---|
35 | |
---|
36 | --built-shared says 'yes' if libcurl was built shared |
---|
37 | --ca ca bundle install path |
---|
38 | --cc compiler |
---|
39 | --cflags pre-processor and compiler flags |
---|
40 | --checkfor [version] check for (lib)curl of the specified version |
---|
41 | --configure the arguments given to configure when building curl |
---|
42 | --features newline separated list of enabled features |
---|
43 | --help display this help and exit |
---|
44 | --libs library linking information |
---|
45 | --prefix curl install prefix |
---|
46 | --protocols newline separated list of enabled protocols |
---|
47 | --ssl-backends output the SSL backends libcurl was built to support |
---|
48 | --static-libs static libcurl library linking information |
---|
49 | --version output version information |
---|
50 | --vernum output the version information as a number (hexadecimal) |
---|
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 |
---|
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= ;; |
---|
67 | esac |
---|
68 | |
---|
69 | case "$1" in |
---|
70 | --built-shared) |
---|
71 | echo yes |
---|
72 | ;; |
---|
73 | |
---|
74 | --ca) |
---|
75 | echo "/opt/local/share/curl/curl-ca-bundle.crt" |
---|
76 | ;; |
---|
77 | |
---|
78 | --cc) |
---|
79 | echo "/usr/bin/clang" |
---|
80 | ;; |
---|
81 | |
---|
82 | --prefix) |
---|
83 | echo "$prefix" |
---|
84 | ;; |
---|
85 | |
---|
86 | --feature|--features) |
---|
87 | for feature in AsynchDNS GSASL HTTPS-proxy IDN IPv6 Largefile NTLM NTLM_WB PSL SSL TLS-SRP UnixSockets alt-svc libz zstd ""; do |
---|
88 | test -n "$feature" && echo "$feature" |
---|
89 | done |
---|
90 | ;; |
---|
91 | |
---|
92 | --protocols) |
---|
93 | for protocol in DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP; do |
---|
94 | echo "$protocol" |
---|
95 | done |
---|
96 | ;; |
---|
97 | |
---|
98 | --version) |
---|
99 | echo libcurl 7.76.0 |
---|
100 | exit 0 |
---|
101 | ;; |
---|
102 | |
---|
103 | --checkfor) |
---|
104 | checkfor=$2 |
---|
105 | cmajor=`echo $checkfor | cut -d. -f1` |
---|
106 | cminor=`echo $checkfor | cut -d. -f2` |
---|
107 | # when extracting the patch part we strip off everything after a |
---|
108 | # dash as that's used for things like version 1.2.3-CVS |
---|
109 | cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1` |
---|
110 | |
---|
111 | vmajor=`echo 7.76.0 | cut -d. -f1` |
---|
112 | vminor=`echo 7.76.0 | cut -d. -f2` |
---|
113 | # when extracting the patch part we strip off everything after a |
---|
114 | # dash as that's used for things like version 1.2.3-CVS |
---|
115 | vpatch=`echo 7.76.0 | cut -d. -f3 | cut -d- -f1` |
---|
116 | |
---|
117 | if test "$vmajor" -gt "$cmajor"; then |
---|
118 | exit 0; |
---|
119 | fi |
---|
120 | if test "$vmajor" -eq "$cmajor"; then |
---|
121 | if test "$vminor" -gt "$cminor"; then |
---|
122 | exit 0 |
---|
123 | fi |
---|
124 | if test "$vminor" -eq "$cminor"; then |
---|
125 | if test "$cpatch" -le "$vpatch"; then |
---|
126 | exit 0 |
---|
127 | fi |
---|
128 | fi |
---|
129 | fi |
---|
130 | |
---|
131 | echo "requested version $checkfor is newer than existing 7.76.0" |
---|
132 | exit 1 |
---|
133 | ;; |
---|
134 | |
---|
135 | --vernum) |
---|
136 | echo 074c00 |
---|
137 | exit 0 |
---|
138 | ;; |
---|
139 | |
---|
140 | --help) |
---|
141 | usage 0 |
---|
142 | ;; |
---|
143 | |
---|
144 | --cflags) |
---|
145 | if test "X$cppflag_curl_staticlib" = "X-DCURL_STATICLIB"; then |
---|
146 | CPPFLAG_CURL_STATICLIB="-DCURL_STATICLIB " |
---|
147 | else |
---|
148 | CPPFLAG_CURL_STATICLIB="" |
---|
149 | fi |
---|
150 | if test "X${prefix}/include" = "X/usr/include"; then |
---|
151 | echo "$CPPFLAG_CURL_STATICLIB" |
---|
152 | else |
---|
153 | echo "${CPPFLAG_CURL_STATICLIB}-I${prefix}/include" |
---|
154 | fi |
---|
155 | ;; |
---|
156 | |
---|
157 | --libs) |
---|
158 | if test "X${exec_prefix}/lib" != "X/usr/lib" -a "X${exec_prefix}/lib" != "X/usr/lib64"; then |
---|
159 | CURLLIBDIR="-L${exec_prefix}/lib " |
---|
160 | else |
---|
161 | CURLLIBDIR="" |
---|
162 | fi |
---|
163 | if test "Xyes" = "Xno"; then |
---|
164 | echo ${CURLLIBDIR}-lcurl -lidn2 -lgsasl -lpsl -lssl -lcrypto -lssl -lcrypto -lzstd -lz |
---|
165 | else |
---|
166 | echo ${CURLLIBDIR}-lcurl |
---|
167 | fi |
---|
168 | ;; |
---|
169 | --ssl-backends) |
---|
170 | echo "OpenSSL" |
---|
171 | ;; |
---|
172 | |
---|
173 | --static-libs) |
---|
174 | if test "Xyes" != "Xno" ; then |
---|
175 | echo ${exec_prefix}/lib/libcurl.a -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lidn2 -lgsasl -lpsl -lssl -lcrypto -lssl -lcrypto -lzstd -lz |
---|
176 | else |
---|
177 | echo "curl was built with static libraries disabled" >&2 |
---|
178 | exit 1 |
---|
179 | fi |
---|
180 | ;; |
---|
181 | |
---|
182 | --configure) |
---|
183 | echo " '--prefix=/opt/local' '--disable-silent-rules' '--enable-ipv6' '--without-brotli' '--without-cyassl' '--without-gnutls' '--without-gssapi' '--without-libmetalink' '--without-librtmp' '--without-libssh2' '--without-nghttp2' '--without-nss' '--without-polarssl' '--with-ssl=/opt/local' '--without-darwinssl' '--disable-ares' '--disable-ldap' '--disable-ldaps' '--with-libidn2=/opt/local' '--with-zlib=/opt/local' 'ac_cv_prog_AWK=/usr/bin/awk' '--with-ca-bundle=/opt/local/share/curl/curl-ca-bundle.crt' 'CC=/usr/bin/clang' 'CFLAGS=-pipe -Os -mmacosx-version-min=11.2 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' 'CPPFLAGS=-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'" |
---|
184 | ;; |
---|
185 | |
---|
186 | *) |
---|
187 | echo "unknown option: $1" |
---|
188 | usage 1 |
---|
189 | ;; |
---|
190 | esac |
---|
191 | shift |
---|
192 | done |
---|
193 | |
---|
194 | exit 0 |
---|