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