curl-config 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. #! /bin/sh
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) 2001 - 2012, 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.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.
  21. #
  22. ###########################################################################
  23. prefix=/usr
  24. exec_prefix=/usr
  25. includedir=/usr/include
  26. cppflag_curl_staticlib=
  27. usage()
  28. {
  29. cat <<EOF
  30. Usage: curl-config [OPTION]
  31. Available values for OPTION include:
  32. --built-shared says 'yes' if libcurl was built shared
  33. --ca ca bundle install path
  34. --cc compiler
  35. --cflags pre-processor and compiler flags
  36. --checkfor [version] check for (lib)curl of the specified version
  37. --configure the arguments given to configure when building curl
  38. --features newline separated list of enabled features
  39. --help display this help and exit
  40. --libs library linking information
  41. --prefix curl install prefix
  42. --protocols newline separated list of enabled protocols
  43. --static-libs static libcurl library linking information
  44. --version output version information
  45. --vernum output the version information as a number (hexadecimal)
  46. EOF
  47. exit $1
  48. }
  49. if test $# -eq 0; then
  50. usage 1
  51. fi
  52. while test $# -gt 0; do
  53. case "$1" in
  54. # this deals with options in the style
  55. # --option=value and extracts the value part
  56. # [not currently used]
  57. -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  58. *) value= ;;
  59. esac
  60. case "$1" in
  61. --built-shared)
  62. echo yes
  63. ;;
  64. --ca)
  65. echo "/etc/ssl/certs/ca-certificates.crt"
  66. ;;
  67. --cc)
  68. echo "arm-linux-gnueabihf-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot="
  69. ;;
  70. --prefix)
  71. echo "$prefix"
  72. ;;
  73. --feature|--features)
  74. for feature in SSL IPv6 UnixSockets libz NTLM NTLM_WB TLS-SRP ""; do
  75. test -n "$feature" && echo "$feature"
  76. done
  77. ;;
  78. --protocols)
  79. for protocol in FILE FTP FTPS HTTP HTTPS; do
  80. echo "$protocol"
  81. done
  82. ;;
  83. --version)
  84. echo libcurl 7.50.1
  85. exit 0
  86. ;;
  87. --checkfor)
  88. checkfor=$2
  89. cmajor=`echo $checkfor | cut -d. -f1`
  90. cminor=`echo $checkfor | cut -d. -f2`
  91. # when extracting the patch part we strip off everything after a
  92. # dash as that's used for things like version 1.2.3-CVS
  93. cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1`
  94. checknum=`echo "$cmajor*256*256 + $cminor*256 + ${cpatch:-0}" | bc`
  95. numuppercase=`echo 073201 | tr 'a-f' 'A-F'`
  96. nownum=`echo "obase=10; ibase=16; $numuppercase" | bc`
  97. if test "$nownum" -ge "$checknum"; then
  98. # silent success
  99. exit 0
  100. else
  101. echo "requested version $checkfor is newer than existing 7.50.1"
  102. exit 1
  103. fi
  104. ;;
  105. --vernum)
  106. echo 073201
  107. exit 0
  108. ;;
  109. --help)
  110. usage 0
  111. ;;
  112. --cflags)
  113. if test "X$cppflag_curl_staticlib" = "X-DCURL_STATICLIB"; then
  114. CPPFLAG_CURL_STATICLIB="-DCURL_STATICLIB "
  115. else
  116. CPPFLAG_CURL_STATICLIB=""
  117. fi
  118. if test "X/usr/include" = "X/usr/include"; then
  119. echo "$CPPFLAG_CURL_STATICLIB"
  120. else
  121. echo "${CPPFLAG_CURL_STATICLIB}-I/usr/include"
  122. fi
  123. ;;
  124. --libs)
  125. if test "X/usr/lib" != "X/usr/lib" -a "X/usr/lib" != "X/usr/lib64"; then
  126. CURLLIBDIR="-L/usr/lib "
  127. else
  128. CURLLIBDIR=""
  129. fi
  130. if test "Xyes" = "Xyes"; then
  131. echo ${CURLLIBDIR}-lcurl -lssl -lcrypto -lz
  132. else
  133. echo ${CURLLIBDIR}-lcurl
  134. fi
  135. ;;
  136. --static-libs)
  137. if test "Xyes" != "Xno" ; then
  138. echo /usr/lib/libcurl.a -L/home/gtbldadm/tools/linaro-2016.11/arm-linux-gnueabihf/lib -Wl,-rpath-link,/home/gtbldadm/tools/linaro-2016.11/arm-linux-gnueabihf/lib -Wl,-O1 -Wl,--hash-style=gnu -L/usr/lib/..//lib -lssl -lcrypto -lz
  139. else
  140. echo "curl was built with static libraries disabled" >&2
  141. exit 1
  142. fi
  143. ;;
  144. --configure)
  145. echo " '--build=x86_64-linux' '--host=arm-linux-gnueabi' '--target=arm-linux-gnueabi' '--prefix=/usr' '--exec_prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/libexec' '--datadir=/usr/share' '--sysconfdir=/etc' '--sharedstatedir=/com' '--localstatedir=/var' '--libdir=/usr/lib' '--includedir=/usr/include' '--oldincludedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--disable-silent-rules' '--disable-dependency-tracking' '--with-libtool-sysroot=' '--enable-crypto-auth' '--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt' '--without-libmetalink' '--without-libpsl' '--without-nghttp2' '--disable-dict' '--without-gnutls' '--disable-gopher' '--disable-imap' '--enable-ipv6' '--without-gssapi' '--disable-ldap' '--disable-ldaps' '--without-libidn' '--without-libssh2' '--disable-pop3' '--disable-proxy' '--without-librtmp' '--disable-rtsp' '--disable-smb' '--disable-smtp' '--with-ssl' '--with-random=/dev/urandom' '--disable-telnet' '--disable-tftp' '--with-zlib=/usr/lib/../' 'build_alias=x86_64-linux' 'host_alias=arm-linux-gnueabi' 'target_alias=arm-linux-gnueabi' 'CC=arm-linux-gnueabihf-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=' 'CFLAGS= -isystem/home/gtbldadm/tools/linaro-2016.11/arm-linux-gnueabihf/include -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/curl/7.50.1-r0=/usr/src/debug/curl/7.50.1-r0 -fdebug-prefix-map=/oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux= -fdebug-prefix-map== ' 'LDFLAGS= -L/home/gtbldadm/tools/linaro-2016.11/arm-linux-gnueabihf/lib -Wl,-rpath-link,/home/gtbldadm/tools/linaro-2016.11/arm-linux-gnueabihf/lib -Wl,-O1 -Wl,--hash-style=gnu' 'CPPFLAGS= -isystem/home/gtbldadm/tools/linaro-2016.11/arm-linux-gnueabihf/include ' 'CPP=arm-linux-gnueabihf-gcc -E --sysroot= -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard'"
  146. ;;
  147. *)
  148. echo "unknown option: $1"
  149. usage 1
  150. ;;
  151. esac
  152. shift
  153. done
  154. exit 0