Added --include to set the compiler include flag for libcurl
[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   --cflags    pre-processor and compiler flags
20   --feature   newline separated list of enabled features
21   --help      display this help and exit
22   --include   display compiler flag(s) to set curl\'s include path
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     --prefix)
47         echo $prefix
48         ;;
49
50     --feature)
51         if test "@OPENSSL_ENABLED@" = "1"; then
52           echo "SSL"
53         fi
54         if test "@KRB4_ENABLED@" = "1"; then
55           echo "KRB4"
56         fi
57         if test "@IPV6_ENABLED@" = "1"; then
58           echo "IPv6"
59         fi
60         ;;
61
62     --version)
63         echo libcurl @VERSION@
64         exit 0
65         ;;
66
67     --vernum)
68         echo @VERSIONNUM@
69         exit 0
70         ;;
71
72     --help)
73         usage 0
74         ;;
75
76     --cflags)
77         echo @CPPFLAGS@
78         ;;
79
80     --include)
81         echo -I@includedir@
82         ;;
83
84     --libs)
85         echo -L@libdir@ -lcurl @LDFLAGS@ @LIBS@
86         ;;
87
88     *)
89         usage
90         exit 1
91         ;;
92     esac
93     shift
94 done
95
96 exit 0