tiny tool for outputting curl config variables
[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 are:
18
19   --prefix              curl install prefix
20   --libs                library linking information
21   --cflags              pre-processor and compiler flags
22   --help                display this help and exit
23   --version             output version information
24 EOF
25
26     exit $1
27 }
28
29 if test $# -eq 0; then
30     usage 1
31 fi
32
33 cflags=false
34 libs=false
35
36 while test $# -gt 0; do
37     case "$1" in
38     -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
39     *) optarg= ;;
40     esac
41
42     case "$1" in
43     --prefix=*)
44         prefix=$optarg
45         ;;
46
47     --prefix)
48         echo $prefix
49         ;;
50
51     --version)
52         echo curl @VERSION@
53         exit 0
54         ;;
55
56     --help)
57         usage 0
58         ;;
59
60     --cflags)
61         echo @CPPFLAGS@ @CFLAGS@
62         ;;
63
64     --libs)
65         echo @LDFLAGS@ @LIBS@
66         ;;
67
68     *)
69         usage
70         exit 1
71         ;;
72     esac
73     shift
74 done
75
76 exit 0