Karol Pietrzak pointed out that simply including the include dir in --cflags
[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 "@HAVE_LIBZ@" = "1"; then
70           echo "libz"
71         fi
72         if test "@CURL_DISABLE_HTTP@" = "1"; then
73           echo "HTTP-disabled"
74         fi
75         if test "@CURL_DISABLE_FTP@" = "1"; then
76           echo "FTP-disabled"
77         fi
78         if test "@CURL_DISABLE_GOPHER@" = "1"; then
79           echo "GOPHER-disabled"
80         fi
81         if test "@CURL_DISABLE_FILE@" = "1"; then
82           echo "FILE-disabled"
83         fi
84         if test "@CURL_DISABLE_TELNET@" = "1"; then
85           echo "TELNET-disabled"
86         fi
87         if test "@CURL_DISABLE_LDAP@" = "1"; then
88           echo "LDAP-disabled"
89         fi
90         if test "@CURL_DISABLE_DICT@" = "1"; then
91           echo "DICT-disabled"
92         fi
93         ;;
94
95     --version)
96         echo libcurl @VERSION@
97         exit 0
98         ;;
99
100     --vernum)
101         echo @VERSIONNUM@
102         exit 0
103         ;;
104
105     --help)
106         usage 0
107         ;;
108
109     --cflags)
110         #echo -I@includedir@
111         echo ""
112         ;;
113
114     --libs)
115         echo -L@libdir@ -lcurl @LDFLAGS@ @LIBS@
116         ;;
117
118     *)
119         echo "unknown option: $1"
120         usage
121         exit 1
122         ;;
123     esac
124     shift
125 done
126
127 exit 0