|
1 |
| -#! /bin/sh |
| 1 | +#!/bin/sh |
2 | 2 | #***************************************************************************
|
3 | 3 | # _ _ ____ _
|
4 | 4 | # Project ___| | | | _ \| |
|
|
24 | 24 | ###########################################################################
|
25 | 25 |
|
26 | 26 | prefix="/mingw32"
|
| 27 | +# Used in ${exec_prefix}/lib |
| 28 | +# shellcheck disable=SC2034 |
27 | 29 | exec_prefix=${prefix}
|
| 30 | +# shellcheck disable=SC2034 |
28 | 31 | includedir=${prefix}/include
|
29 | 32 | cppflag_curl_staticlib=
|
30 | 33 |
|
31 | 34 | usage()
|
32 | 35 | {
|
33 |
| - cat <<EOF |
| 36 | + cat <<EOF |
34 | 37 | Usage: curl-config [OPTION]
|
35 | 38 |
|
36 | 39 | Available values for OPTION include:
|
37 | 40 |
|
38 | 41 | --built-shared says 'yes' if libcurl was built shared
|
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 |
| - --configure the arguments given to configure when building curl |
44 |
| - --features newline separated list of enabled features |
45 |
| - --help display this help and exit |
46 |
| - --libs library linking information |
47 |
| - --prefix curl install prefix |
48 |
| - --protocols newline separated list of enabled protocols |
49 |
| - --ssl-backends output the SSL backends libcurl was built to support |
50 |
| - --static-libs static libcurl library linking information |
51 |
| - --version output version information |
52 |
| - --vernum output the version information as a number (hexadecimal) |
| 42 | + --ca CA bundle install path |
| 43 | + --cc compiler |
| 44 | + --cflags preprocessor and compiler flags |
| 45 | + --checkfor [version] check for (lib)curl of the specified version |
| 46 | + --configure the arguments given to configure when building curl |
| 47 | + --features newline separated list of enabled features |
| 48 | + --help display this help and exit |
| 49 | + --libs library linking information |
| 50 | + --prefix curl install prefix |
| 51 | + --protocols newline separated list of enabled protocols |
| 52 | + --ssl-backends output the SSL backends libcurl was built to support |
| 53 | + --static-libs static libcurl library linking information |
| 54 | + --version output version information |
| 55 | + --vernum output version as a hexadecimal number |
53 | 56 | EOF
|
54 | 57 |
|
55 |
| - exit $1 |
| 58 | + exit "$1" |
56 | 59 | }
|
57 | 60 |
|
58 |
| -if test $# -eq 0; then |
59 |
| - usage 1 |
| 61 | +if test "$#" -eq 0; then |
| 62 | + usage 1 |
60 | 63 | fi
|
61 | 64 |
|
62 |
| -while test $# -gt 0; do |
63 |
| - case "$1" in |
64 |
| - # this deals with options in the style |
65 |
| - # --option=value and extracts the value part |
66 |
| - # [not currently used] |
67 |
| - -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
68 |
| - *) value= ;; |
69 |
| - esac |
70 |
| - |
71 |
| - case "$1" in |
72 |
| - --built-shared) |
73 |
| - echo yes |
74 |
| - ;; |
75 |
| - |
76 |
| - --ca) |
77 |
| - echo |
78 |
| - ;; |
79 |
| - |
80 |
| - --cc) |
81 |
| - echo "gcc" |
82 |
| - ;; |
83 |
| - |
84 |
| - --prefix) |
85 |
| - echo "$prefix" |
86 |
| - ;; |
87 |
| - |
88 |
| - --feature|--features) |
89 |
| - for feature in AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM PSL SPNEGO SSL SSPI UnixSockets alt-svc brotli libz threadsafe zstd ""; do |
90 |
| - test -n "$feature" && echo "$feature" |
91 |
| - done |
92 |
| - ;; |
93 |
| - |
94 |
| - --protocols) |
95 |
| - for protocol in DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS IPFS IPNS LDAP LDAPS MQTT POP3 POP3S RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP; do |
96 |
| - echo "$protocol" |
97 |
| - done |
98 |
| - ;; |
99 |
| - |
100 |
| - --version) |
101 |
| - echo libcurl 8.7.1 |
| 65 | +while test "$#" -gt 0; do |
| 66 | + case "$1" in |
| 67 | + --built-shared) |
| 68 | + echo 'yes' |
| 69 | + ;; |
| 70 | + |
| 71 | + --ca) |
| 72 | + echo '' |
| 73 | + ;; |
| 74 | + |
| 75 | + --cc) |
| 76 | + echo 'gcc' |
| 77 | + ;; |
| 78 | + |
| 79 | + --prefix) |
| 80 | + echo "$prefix" |
| 81 | + ;; |
| 82 | + |
| 83 | + --feature|--features) |
| 84 | + for feature in AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM PSL SPNEGO SSL SSPI UnixSockets alt-svc brotli libz threadsafe zstd ""; do |
| 85 | + test -n "$feature" && echo "$feature" |
| 86 | + done |
| 87 | + ;; |
| 88 | + |
| 89 | + --protocols) |
| 90 | + # shellcheck disable=SC2043 |
| 91 | + for protocol in DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS IPFS IPNS LDAP LDAPS MQTT POP3 POP3S RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP; do |
| 92 | + echo "$protocol" |
| 93 | + done |
| 94 | + ;; |
| 95 | + |
| 96 | + --version) |
| 97 | + echo 'libcurl 8.8.0' |
| 98 | + exit 0 |
| 99 | + ;; |
| 100 | + |
| 101 | + --checkfor) |
| 102 | + checkfor=$2 |
| 103 | + cmajor=$(echo "$checkfor" | cut -d. -f1) |
| 104 | + cminor=$(echo "$checkfor" | cut -d. -f2) |
| 105 | + # when extracting the patch part we strip off everything after a |
| 106 | + # dash as that's used for things like version 1.2.3-pre1 |
| 107 | + cpatch=$(echo "$checkfor" | cut -d. -f3 | cut -d- -f1) |
| 108 | + |
| 109 | + vmajor=$(echo '8.8.0' | cut -d. -f1) |
| 110 | + vminor=$(echo '8.8.0' | cut -d. -f2) |
| 111 | + # when extracting the patch part we strip off everything after a |
| 112 | + # dash as that's used for things like version 1.2.3-pre1 |
| 113 | + vpatch=$(echo '8.8.0' | cut -d. -f3 | cut -d- -f1) |
| 114 | + |
| 115 | + if test "$vmajor" -gt "$cmajor"; then |
| 116 | + exit 0 |
| 117 | + fi |
| 118 | + if test "$vmajor" -eq "$cmajor"; then |
| 119 | + if test "$vminor" -gt "$cminor"; then |
102 | 120 | exit 0
|
103 |
| - ;; |
104 |
| - |
105 |
| - --checkfor) |
106 |
| - checkfor=$2 |
107 |
| - cmajor=`echo $checkfor | cut -d. -f1` |
108 |
| - cminor=`echo $checkfor | cut -d. -f2` |
109 |
| - # when extracting the patch part we strip off everything after a |
110 |
| - # dash as that's used for things like version 1.2.3-CVS |
111 |
| - cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1` |
112 |
| - |
113 |
| - vmajor=`echo 8.7.1 | cut -d. -f1` |
114 |
| - vminor=`echo 8.7.1 | cut -d. -f2` |
115 |
| - # when extracting the patch part we strip off everything after a |
116 |
| - # dash as that's used for things like version 1.2.3-CVS |
117 |
| - vpatch=`echo 8.7.1 | cut -d. -f3 | cut -d- -f1` |
118 |
| - |
119 |
| - if test "$vmajor" -gt "$cmajor"; then |
120 |
| - exit 0; |
121 |
| - fi |
122 |
| - if test "$vmajor" -eq "$cmajor"; then |
123 |
| - if test "$vminor" -gt "$cminor"; then |
124 |
| - exit 0 |
125 |
| - fi |
126 |
| - if test "$vminor" -eq "$cminor"; then |
127 |
| - if test "$cpatch" -le "$vpatch"; then |
128 |
| - exit 0 |
129 |
| - fi |
130 |
| - fi |
131 |
| - fi |
132 |
| - |
133 |
| - echo "requested version $checkfor is newer than existing 8.7.1" |
134 |
| - exit 1 |
135 |
| - ;; |
136 |
| - |
137 |
| - --vernum) |
138 |
| - echo 080701 |
139 |
| - exit 0 |
140 |
| - ;; |
141 |
| - |
142 |
| - --help) |
143 |
| - usage 0 |
144 |
| - ;; |
145 |
| - |
146 |
| - --cflags) |
147 |
| - if test "X$cppflag_curl_staticlib" = "X-DCURL_STATICLIB"; then |
148 |
| - CPPFLAG_CURL_STATICLIB="-DCURL_STATICLIB " |
149 |
| - else |
150 |
| - CPPFLAG_CURL_STATICLIB="" |
151 |
| - fi |
152 |
| - if test "X${prefix}/include" = "X/usr/include"; then |
153 |
| - echo "$CPPFLAG_CURL_STATICLIB" |
154 |
| - else |
155 |
| - echo "${CPPFLAG_CURL_STATICLIB}-I${prefix}/include" |
156 |
| - fi |
157 |
| - ;; |
158 |
| - |
159 |
| - --libs) |
160 |
| - if test "X${exec_prefix}/lib" != "X/usr/lib" -a "X${exec_prefix}/lib" != "X/usr/lib64"; then |
161 |
| - CURLLIBDIR="-L${exec_prefix}/lib " |
162 |
| - else |
163 |
| - CURLLIBDIR="" |
| 121 | + fi |
| 122 | + if test "$vminor" -eq "$cminor"; then |
| 123 | + if test "$cpatch" -le "$vpatch"; then |
| 124 | + exit 0 |
164 | 125 | fi
|
165 |
| - if test "Xyes" = "Xno"; then |
166 |
| - echo ${CURLLIBDIR}-lcurl -lidn2 -lssh2 -lssh2 -lpsl -lbcrypt -ladvapi32 -lcrypt32 -lwldap32 -lzstd -lzstd -lbrotlidec -lbrotlidec -lz -lws2_32 |
167 |
| - else |
168 |
| - echo ${CURLLIBDIR}-lcurl |
169 |
| - fi |
170 |
| - ;; |
171 |
| - --ssl-backends) |
172 |
| - echo "Schannel" |
173 |
| - ;; |
174 |
| - |
175 |
| - --static-libs) |
176 |
| - if test "Xno" != "Xno" ; then |
177 |
| - echo "${exec_prefix}/lib/libcurl.a" -Wl,--no-seh -Wl,--large-address-aware -lidn2 -lssh2 -lssh2 -lpsl -lbcrypt -ladvapi32 -lcrypt32 -lwldap32 -lzstd -lzstd -lbrotlidec -lbrotlidec -lz -lws2_32 |
178 |
| - else |
179 |
| - echo "curl was built with static libraries disabled" >&2 |
180 |
| - exit 1 |
181 |
| - fi |
182 |
| - ;; |
183 |
| - |
184 |
| - --configure) |
185 |
| - echo " '--prefix=/mingw32' '--build=i686-w64-mingw32' '--host=i686-w64-mingw32' '--target=i686-w64-mingw32' '--disable-pthreads' '--without-random' '--disable-static' '--enable-shared' '--enable-sspi' '--enable-ldap' '--enable-ldaps' '--with-brotli' '--with-ldap-lib=wldap32' '--with-libssh2' '--with-zstd' '--with-schannel' '--without-nghttp2' '--without-ca-bundle' '--without-ca-path' '--without-librtmp' '--disable-debug' 'build_alias=i686-w64-mingw32' 'host_alias=i686-w64-mingw32' 'target_alias=i686-w64-mingw32' 'CC=gcc' 'CFLAGS=-march=pentium4 -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong' 'LDFLAGS=-Wl,--no-seh -Wl,--large-address-aware' 'CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1'" |
186 |
| - ;; |
187 |
| - |
188 |
| - *) |
189 |
| - echo "unknown option: $1" |
190 |
| - usage 1 |
191 |
| - ;; |
192 |
| - esac |
193 |
| - shift |
| 126 | + fi |
| 127 | + fi |
| 128 | + |
| 129 | + echo "requested version $checkfor is newer than existing 8.8.0" |
| 130 | + exit 1 |
| 131 | + ;; |
| 132 | + |
| 133 | + --vernum) |
| 134 | + echo '080800' |
| 135 | + exit 0 |
| 136 | + ;; |
| 137 | + |
| 138 | + --help) |
| 139 | + usage 0 |
| 140 | + ;; |
| 141 | + |
| 142 | + --cflags) |
| 143 | + if test "X$cppflag_curl_staticlib" = "X-DCURL_STATICLIB"; then |
| 144 | + CPPFLAG_CURL_STATICLIB="-DCURL_STATICLIB " |
| 145 | + else |
| 146 | + CPPFLAG_CURL_STATICLIB="" |
| 147 | + fi |
| 148 | + if test "X${prefix}/include" = "X/usr/include"; then |
| 149 | + echo "${CPPFLAG_CURL_STATICLIB}" |
| 150 | + else |
| 151 | + echo "${CPPFLAG_CURL_STATICLIB}-I${prefix}/include" |
| 152 | + fi |
| 153 | + ;; |
| 154 | + |
| 155 | + --libs) |
| 156 | + if test "X${exec_prefix}/lib" != "X/usr/lib" -a "X${exec_prefix}/lib" != "X/usr/lib64"; then |
| 157 | + CURLLIBDIR="-L${exec_prefix}/lib " |
| 158 | + else |
| 159 | + CURLLIBDIR="" |
| 160 | + fi |
| 161 | + if test "Xyes" = "Xno"; then |
| 162 | + echo "${CURLLIBDIR}-lcurl -lidn2 -lssh2 -lssh2 -lpsl -lbcrypt -ladvapi32 -lcrypt32 -lwldap32 -lzstd -lzstd -lbrotlidec -lbrotlidec -lz -lws2_32" |
| 163 | + else |
| 164 | + echo "${CURLLIBDIR}-lcurl" |
| 165 | + fi |
| 166 | + ;; |
| 167 | + |
| 168 | + --ssl-backends) |
| 169 | + echo 'Schannel' |
| 170 | + ;; |
| 171 | + |
| 172 | + --static-libs) |
| 173 | + if test "Xno" != "Xno" ; then |
| 174 | + echo "${exec_prefix}/lib/libcurl.a" -Wl,--no-seh -Wl,--large-address-aware -lidn2 -lssh2 -lssh2 -lpsl -lbcrypt -ladvapi32 -lcrypt32 -lwldap32 -lzstd -lzstd -lbrotlidec -lbrotlidec -lz -lws2_32 |
| 175 | + else |
| 176 | + echo 'curl was built with static libraries disabled' >&2 |
| 177 | + exit 1 |
| 178 | + fi |
| 179 | + ;; |
| 180 | + |
| 181 | + --configure) |
| 182 | + echo " '--prefix=/mingw32' '--build=i686-w64-mingw32' '--host=i686-w64-mingw32' '--target=i686-w64-mingw32' '--disable-pthreads' '--without-random' '--disable-static' '--enable-shared' '--enable-sspi' '--enable-ldap' '--enable-ldaps' '--with-brotli' '--with-ldap-lib=wldap32' '--with-libssh2' '--with-zstd' '--with-schannel' '--without-nghttp2' '--without-ca-bundle' '--without-ca-path' '--without-librtmp' '--disable-debug' 'build_alias=i686-w64-mingw32' 'host_alias=i686-w64-mingw32' 'target_alias=i686-w64-mingw32' 'CC=gcc' 'CFLAGS=-march=pentium4 -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong' 'LDFLAGS=-Wl,--no-seh -Wl,--large-address-aware' 'CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1'" |
| 183 | + ;; |
| 184 | + |
| 185 | + *) |
| 186 | + echo "unknown option: $1" |
| 187 | + usage 1 |
| 188 | + ;; |
| 189 | + esac |
| 190 | + shift |
194 | 191 | done
|
195 | 192 |
|
196 | 193 | exit 0
|
0 commit comments