added 'curl-config --vernum' for hardcore hex version output
[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   --libs      library linking information
23   --prefix    curl install prefix
24   --version   output version information
25 EOF
26
27     exit $1
28 }
29
30 if test $# -eq 0; then
31     usage 1
32 fi
33
34 while test $# -gt 0; do
35     case "$1" in
36     # this deals with options in the style
37     # --option=value and extracts the value part
38     # [not currently used]
39     -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
40     *) value= ;;
41     esac
42
43     case "$1" in
44     --prefix)
45         echo $prefix
46         ;;
47
48     --feature)
49         if test "@OPENSSL_ENABLED@" = "1"; then
50           echo "SSL"
51         fi
52         if test "@KRB4_ENABLED@" = "1"; then
53           echo "KRB4"
54         fi
55         if test "@IPV6_ENABLED@" = "1"; then
56           echo "IPv6"
57         fi
58         ;;
59
60     --version)
61         echo libcurl @VERSION@
62         exit 0
63         ;;
64
65     --vernum)
66         echo @VERSIONNUM@
67         exit 0
68         ;;
69
70     --help)
71         usage 0
72         ;;
73
74     --cflags)
75         echo @CPPFLAGS@
76         ;;
77
78     --libs)
79         echo @LDFLAGS@ @LIBS@
80         ;;
81
82     *)
83         usage
84         exit 1
85         ;;
86     esac
87     shift
88 done
89
90 exit 0