added --disable-[protocol] support
[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   --cc        compiler
20   --cflags    pre-processor and compiler flags
21   --feature   newline separated list of enabled features
22   --help      display this help and exit
23   --libs      library linking information
24   --prefix    curl install prefix
25   --version   output version information
26   --vernum    output the version information as a number (hexadecimal)
27 EOF
28
29     exit $1
30 }
31
32 if test $# -eq 0; then
33     usage 1
34 fi
35
36 while test $# -gt 0; do
37     case "$1" in
38     # this deals with options in the style
39     # --option=value and extracts the value part
40     # [not currently used]
41     -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
42     *) value= ;;
43     esac
44
45     case "$1" in
46     --cc)
47         echo @CC@
48         ;;
49
50     --prefix)
51         echo $prefix
52         ;;
53
54     --feature)
55         if test "@OPENSSL_ENABLED@" = "1"; then
56           echo "SSL"
57         fi
58         if test "@KRB4_ENABLED@" = "1"; then
59           echo "KRB4"
60         fi
61         if test "@IPV6_ENABLED@" = "1"; then
62           echo "IPv6"
63         fi
64         if test "@CURL_DISABLE_HTTP@" = "1"; then
65           echo "HTTP-disabled"
66         fi
67         if test "@CURL_DISABLE_FTP@" = "1"; then
68           echo "FTP-disabled"
69         fi
70         if test "@CURL_DISABLE_GOPHER@" = "1"; then
71           echo "GOPHER-disabled"
72         fi
73         if test "@CURL_DISABLE_FILE@" = "1"; then
74           echo "FILE-disabled"
75         fi
76         if test "@CURL_DISABLE_TELNET@" = "1"; then
77           echo "TELNET-disabled"
78         fi
79         if test "@CURL_DISABLE_LDAP@" = "1"; then
80           echo "LDAP-disabled"
81         fi
82         if test "@CURL_DISABLE_DICT@" = "1"; then
83           echo "DICT-disabled"
84         fi
85         ;;
86
87     --version)
88         echo libcurl @VERSION@
89         exit 0
90         ;;
91
92     --vernum)
93         echo @VERSIONNUM@
94         exit 0
95         ;;
96
97     --help)
98         usage 0
99         ;;
100
101     --cflags)
102         echo -I@includedir@
103         ;;
104
105     --libs)
106         echo -L@libdir@ -lcurl @LDFLAGS@ @LIBS@
107         ;;
108
109     *)
110         echo "unknown option: $1"
111         usage
112         exit 1
113         ;;
114     esac
115     shift
116 done
117
118 exit 0