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