Updating to version 1.13. Libgcrypt depends on libgpg-error
[platform/upstream/libgpg-error.git] / src / gpg-error-config.in
1 #!/bin/sh
2 # Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
3 #
4 # This file is free software; as a special exception the author gives
5 # unlimited permission to copy and/or distribute it, with or without
6 # modifications, as long as this notice is preserved.
7 #
8 # This file is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12
13 prefix=@prefix@
14 exec_prefix=@exec_prefix@
15 includedir=@includedir@
16 libdir=@libdir@
17 isubdirafter="@GPG_ERROR_CONFIG_ISUBDIRAFTER@"
18
19 output=""
20 mt=no
21
22 usage()
23 {
24     cat <<EOF
25 Usage: gpg-error-config [OPTIONS]
26 Options:
27         [--mt]       (must be the first option)
28         [--prefix]
29         [--exec-prefix]
30         [--version]
31         [--libs]
32         [--cflags]
33 EOF
34     exit $1
35 }
36
37 if test $# -eq 0; then
38     usage 1 1>&2
39 fi
40
41 while test $# -gt 0; do
42     case "$1" in
43         -*=*)
44             optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
45             ;;
46         *)
47             optarg=
48             ;;
49     esac
50
51     case $1 in
52         --mt)
53             mt=yes
54             ;;
55         --prefix)
56             output="$output $prefix"
57             ;;
58         --exec-prefix)
59             output="$output $exec_prefix"
60             ;;
61         --version)
62             echo "@PACKAGE_VERSION@"
63             exit 0
64             ;;
65         --cflags)
66             if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then
67                 output="$output -I$includedir"
68             fi
69             # Note: -idirafter is a gcc extension.  It is only used on
70             #       systems where gcc is the only compiler we support.
71             for i in $isubdirafter; do
72                 output="$output -idirafter ${includedir}/${i}"
73             done
74             output="$output @GPG_ERROR_CONFIG_CFLAGS@"
75             if test $mt = yes ; then
76                 output="$output @GPG_ERROR_CONFIG_MT_CFLAGS@"
77             fi
78             ;;
79         --libs)
80             case "$libdir" in
81                 /usr/lib|/usr/lib64|/lib|/lib64) ;;
82                 *)
83                     output="$output -L$libdir"
84                     ;;
85             esac
86             output="$output @GPG_ERROR_CONFIG_LIBS@"
87             if test $mt = yes ; then
88                 output="$output @GPG_ERROR_CONFIG_MT_LIBS@"
89             fi
90             ;;
91         --host)
92             echo "@GPG_ERROR_CONFIG_HOST@"
93             exit 0
94             ;;
95         *)
96             usage 1 1>&2
97             ;;
98     esac
99     shift
100 done
101
102 echo $output