David Shaw finally removed all traces of Gopher and we are now officially
[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 # OpenSSL implies NTLM
64         elif test -n "@USE_GNUTLS@"; then
65           echo "SSL"
66         fi
67         if test "@KRB4_ENABLED@" = "1"; then
68           echo "KRB4"
69         fi
70         if test "@IPV6_ENABLED@" = "1"; then
71           echo "IPv6"
72         fi
73         if test "@HAVE_LIBZ@" = "1"; then
74           echo "libz"
75         fi
76         if test "@HAVE_ARES@" = "1"; then
77           echo "AsynchDNS"
78         fi
79         if test "@IDN_ENABLED@" = "1"; then
80           echo "IDN"
81         fi
82         if test "@USE_WINDOWS_SSPI@" = "1"; then
83           echo "SSPI"
84           NTLM=1
85         fi
86         if test "$NTLM" = "1"; then
87           echo "NTLM"
88         fi
89         ;;
90
91     --protocols)
92         if test "@CURL_DISABLE_HTTP@" != "1"; then
93           echo "HTTP"
94           if test "@USE_SSLEAY@" = "1"; then
95             echo "HTTPS"
96           fi
97         fi
98         if test "@CURL_DISABLE_FTP@" != "1"; then
99           echo "FTP"
100           if test "@USE_SSLEAY@" = "1"; then
101             echo "FTPS"
102           fi
103         fi
104         if test "@CURL_DISABLE_FILE@" != "1"; then
105           echo "FILE"
106         fi
107         if test "@CURL_DISABLE_TELNET@" != "1"; then
108           echo "TELNET"
109         fi
110         if test "@CURL_DISABLE_LDAP@" != "1"; then
111           echo "LDAP"
112         fi
113         if test "@CURL_DISABLE_DICT@" != "1"; then
114           echo "DICT"
115         fi
116         if test "@CURL_DISABLE_TFTP@" != "1"; then
117           echo "TFTP"
118         fi
119         ;;
120     --version)
121         echo libcurl @VERSION@
122         exit 0
123         ;;
124
125     --vernum)
126         echo @VERSIONNUM@
127         exit 0
128         ;;
129
130     --help)
131         usage 0
132         ;;
133
134     --cflags)
135         if test "X@includedir@" = "X/usr/include"; then
136           echo ""
137         else
138           echo "-I@includedir@"
139         fi
140         ;;
141
142     --libs)
143         echo -L@libdir@ -lcurl @LDFLAGS@ @LIBS@
144         ;;
145
146     *)
147         echo "unknown option: $1"
148         usage 1
149         ;;
150     esac
151     shift
152 done
153
154 exit 0