David Shaw added --protocols, and thus the --feature no longer mentions what
[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         fi
64         if test "@KRB4_ENABLED@" = "1"; then
65           echo "KRB4"
66         fi
67         if test "@IPV6_ENABLED@" = "1"; then
68           echo "IPv6"
69         fi
70         if test "@HAVE_LIBZ@" = "1"; then
71           echo "libz"
72         fi
73         if test "@HAVE_ARES@" = "1"; then
74           echo "AsynchDNS"
75         fi
76         ;;
77
78     --protocols)
79         if test "@CURL_DISABLE_HTTP@" != "1"; then
80           echo "HTTP"
81           if test "@USE_SSLEAY@" = "1"; then
82             echo "HTTPS"
83           fi
84         fi
85         if test "@CURL_DISABLE_FTP@" != "1"; then
86           echo "FTP"
87           if test "@USE_SSLEAY@" = "1"; then
88             echo "FTPS"
89           fi
90         fi
91         if test "@CURL_DISABLE_GOPHER@" != "1"; then
92           echo "GOPHER"
93         fi
94         if test "@CURL_DISABLE_FILE@" != "1"; then
95           echo "FILE"
96         fi
97         if test "@CURL_DISABLE_TELNET@" != "1"; then
98           echo "TELNET"
99         fi
100         if test "@CURL_DISABLE_LDAP@" != "1"; then
101           echo "LDAP"
102         fi
103         if test "@CURL_DISABLE_DICT@" != "1"; then
104           echo "DICT"
105         fi
106         ;;
107     --version)
108         echo libcurl @VERSION@
109         exit 0
110         ;;
111
112     --vernum)
113         echo @VERSIONNUM@
114         exit 0
115         ;;
116
117     --help)
118         usage 0
119         ;;
120
121     --cflags)
122         if test "X@includedir@" = "X/usr/include"; then
123           echo ""
124         else
125           echo "-I@includedir@"
126         fi
127         ;;
128
129     --libs)
130         echo -L@libdir@ -lcurl @LDFLAGS@ @LIBS@
131         ;;
132
133     *)
134         echo "unknown option: $1"
135         usage 1
136         ;;
137     esac
138     shift
139 done
140
141 exit 0