|
| 1 | +#! /bin/sh |
| 2 | +#*************************************************************************** |
| 3 | +# _ _ ____ _ |
| 4 | +# Project ___| | | | _ \| | |
| 5 | +# / __| | | | |_) | | |
| 6 | +# | (__| |_| | _ <| |___ |
| 7 | +# \___|\___/|_| \_\_____| |
| 8 | +# |
| 9 | +# Copyright (C) 2001 - 2022, Daniel Stenberg, <[email protected]>, 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 | +# SPDX-License-Identifier: curl |
| 23 | +# |
| 24 | +########################################################################### |
| 25 | + |
| 26 | +prefix="/app/libcurl-android/jni/build/curl/arm64-v8a" |
| 27 | +exec_prefix=${prefix} |
| 28 | +includedir=${prefix}/include |
| 29 | +cppflag_curl_staticlib= |
| 30 | + |
| 31 | +usage() |
| 32 | +{ |
| 33 | + cat <<EOF |
| 34 | +Usage: curl-config [OPTION] |
| 35 | +
|
| 36 | +Available values for OPTION include: |
| 37 | +
|
| 38 | + --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) |
| 53 | +EOF |
| 54 | + |
| 55 | + exit $1 |
| 56 | +} |
| 57 | + |
| 58 | +if test $# -eq 0; then |
| 59 | + usage 1 |
| 60 | +fi |
| 61 | + |
| 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 "/app/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang" |
| 82 | + ;; |
| 83 | + |
| 84 | + --prefix) |
| 85 | + echo "$prefix" |
| 86 | + ;; |
| 87 | + |
| 88 | + --feature|--features) |
| 89 | + for feature in AsynchDNS HSTS HTTPS-proxy IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets alt-svc libz threadsafe ""; 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 MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP; do |
| 96 | + echo "$protocol" |
| 97 | + done |
| 98 | + ;; |
| 99 | + |
| 100 | + --version) |
| 101 | + echo libcurl 7.86.0-DEV |
| 102 | + 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 7.86.0-DEV | cut -d. -f1` |
| 114 | + vminor=`echo 7.86.0-DEV | 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 7.86.0-DEV | 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 7.86.0-DEV" |
| 134 | + exit 1 |
| 135 | + ;; |
| 136 | + |
| 137 | + --vernum) |
| 138 | + echo 075600 |
| 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="" |
| 164 | + fi |
| 165 | + if test "Xyes" = "Xno"; then |
| 166 | + echo ${CURLLIBDIR}-lcurl -lssl -lcrypto -lssl -lcrypto -lz -lssl -lcrypto -lc++ -lz |
| 167 | + else |
| 168 | + echo ${CURLLIBDIR}-lcurl |
| 169 | + fi |
| 170 | + ;; |
| 171 | + --ssl-backends) |
| 172 | + echo "OpenSSL v3+" |
| 173 | + ;; |
| 174 | + |
| 175 | + --static-libs) |
| 176 | + if test "Xyes" != "Xno" ; then |
| 177 | + echo "${exec_prefix}/lib/libcurl.a" -L/app/libcurl-android/jni/build/openssl/arm64-v8a/lib -L/app/libcurl-android/jni/build/zlib/arm64-v8a/lib -L/app/libcurl-android/jni/build/zlib/arm64-v8a/lib -L/app/libcurl-android/jni/build/openssl/arm64-v8a/lib -lssl -lcrypto -lssl -lcrypto -lz -lssl -lcrypto -lc++ -lz |
| 178 | + else |
| 179 | + echo "curl was built with static libraries disabled" >&2 |
| 180 | + exit 1 |
| 181 | + fi |
| 182 | + ;; |
| 183 | + |
| 184 | + --configure) |
| 185 | + echo " '--host=aarch64-linux-android' '--prefix=/app/libcurl-android/jni/build/curl/arm64-v8a' '--with-ssl=/app/libcurl-android/jni/build/openssl/arm64-v8a' '--with-zlib=/app/libcurl-android/jni/build/zlib/arm64-v8a' '--enable-static' '--enable-shared' '--disable-verbose' '--enable-threaded-resolver' '--enable-ipv6' 'host_alias=aarch64-linux-android' 'CC=/app/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang' 'CFLAGS=--sysroot=/app/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot -march=armv8-a -fPIC' 'LDFLAGS=-L/app/libcurl-android/jni/build/openssl/arm64-v8a/lib -L/app/libcurl-android/jni/build/zlib/arm64-v8a/lib' 'LIBS=-lssl -lcrypto -lc++ -lz' 'CPPFLAGS=-I/app/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --sysroot=/app/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot'" |
| 186 | + ;; |
| 187 | + |
| 188 | + *) |
| 189 | + echo "unknown option: $1" |
| 190 | + usage 1 |
| 191 | + ;; |
| 192 | + esac |
| 193 | + shift |
| 194 | +done |
| 195 | + |
| 196 | +exit 0 |
0 commit comments