curl-config.in 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #! /bin/sh
  2. #
  3. # The idea to this kind of setup info script was stolen from numerous
  4. # other packages, such as neon, libxml and gnome.
  5. #
  6. # $Id$
  7. #
  8. prefix=@prefix@
  9. exec_prefix=@exec_prefix@
  10. includedir=@includedir@
  11. usage()
  12. {
  13. cat <<EOF
  14. Usage: curl-config [OPTION]
  15. Available values for OPTION include:
  16. --ca ca bundle install path
  17. --cc compiler
  18. --cflags pre-processor and compiler flags
  19. --features newline separated list of enabled features
  20. --protocols newline separated list of enabled protocols
  21. --help display this help and exit
  22. --libs library linking information
  23. --prefix curl install prefix
  24. --version output version information
  25. --vernum output the version information as a number (hexadecimal)
  26. EOF
  27. exit $1
  28. }
  29. if test $# -eq 0; then
  30. usage 1
  31. fi
  32. while test $# -gt 0; do
  33. case "$1" in
  34. # this deals with options in the style
  35. # --option=value and extracts the value part
  36. # [not currently used]
  37. -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  38. *) value= ;;
  39. esac
  40. case "$1" in
  41. --ca)
  42. echo "@CURL_CA_BUNDLE@"
  43. ;;
  44. --cc)
  45. echo "@CC@"
  46. ;;
  47. --prefix)
  48. echo "$prefix"
  49. ;;
  50. --feature|--features)
  51. if test "@USE_SSLEAY@" = "1"; then
  52. echo "SSL"
  53. NTLM=1 # OpenSSL implies NTLM
  54. elif test -n "@USE_GNUTLS@"; then
  55. echo "SSL"
  56. fi
  57. if test "@KRB4_ENABLED@" = "1"; then
  58. echo "KRB4"
  59. fi
  60. if test "@IPV6_ENABLED@" = "1"; then
  61. echo "IPv6"
  62. fi
  63. if test "@HAVE_LIBZ@" = "1"; then
  64. echo "libz"
  65. fi
  66. if test "@HAVE_ARES@" = "1"; then
  67. echo "AsynchDNS"
  68. fi
  69. if test "@IDN_ENABLED@" = "1"; then
  70. echo "IDN"
  71. fi
  72. if test "@USE_WINDOWS_SSPI@" = "1"; then
  73. echo "SSPI"
  74. NTLM=1
  75. fi
  76. if test "$NTLM" = "1"; then
  77. echo "NTLM"
  78. fi
  79. ;;
  80. --protocols)
  81. if test "@CURL_DISABLE_HTTP@" != "1"; then
  82. echo "HTTP"
  83. if test "@USE_SSLEAY@" = "1"; then
  84. echo "HTTPS"
  85. fi
  86. fi
  87. if test "@CURL_DISABLE_FTP@" != "1"; then
  88. echo "FTP"
  89. if test "@USE_SSLEAY@" = "1"; then
  90. echo "FTPS"
  91. fi
  92. fi
  93. if test "@CURL_DISABLE_GOPHER@" != "1"; then
  94. echo "GOPHER"
  95. fi
  96. if test "@CURL_DISABLE_FILE@" != "1"; then
  97. echo "FILE"
  98. fi
  99. if test "@CURL_DISABLE_TELNET@" != "1"; then
  100. echo "TELNET"
  101. fi
  102. if test "@CURL_DISABLE_LDAP@" != "1"; then
  103. echo "LDAP"
  104. fi
  105. if test "@CURL_DISABLE_DICT@" != "1"; then
  106. echo "DICT"
  107. fi
  108. ;;
  109. --version)
  110. echo libcurl @VERSION@
  111. exit 0
  112. ;;
  113. --vernum)
  114. echo @VERSIONNUM@
  115. exit 0
  116. ;;
  117. --help)
  118. usage 0
  119. ;;
  120. --cflags)
  121. if test "X@includedir@" = "X/usr/include"; then
  122. echo ""
  123. else
  124. echo "-I@includedir@"
  125. fi
  126. ;;
  127. --libs)
  128. echo -L@libdir@ -lcurl @LDFLAGS@ @LIBS@
  129. ;;
  130. *)
  131. echo "unknown option: $1"
  132. usage 1
  133. ;;
  134. esac
  135. shift
  136. done
  137. exit 0