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