1#! @SHELL@
2#
3# Simple script to provide configuration information about libparsifal
4#
5PACKAGE="@PACKAGE@"
6VERSION="@VERSION@"
7build_os="@build_os@"
8
9prefix="@prefix@"
10exec_prefix="@exec_prefix@"
11bindir="@bindir@"
12libdir="@libdir@"
13sbindir="@sbindir@"
14libexecdir="@libexecdir@"
15datarootdir="@datarootdir@"
16datadir="@datadir@"
17sysconfdir="@sysconfdir@"
18sharedstatedir="@sharedstatedir@"
19localstatedir="@localstatedir@"
20includedir="@includedir@"
21CFLAGS="@CFLAGS@"
22CPPFLAGS="@CPPFLAGS@"
23LIBS="@LIBS@"
24
25usage()
26{
27  exit_code=$1
28  cat <<EOF
29Usage: parsifal-config [OPTION]
30
31    This tool is provided to query information about how
32    libparsifal was configured and installed.
33
34Generic options:
35    --version       show libparsifal version
36    --help          display this help and exit
37
38Installation directories libparsifal was configured to:
39    --prefix        root for all platform independent files
40    --exec-prefix   root for all platform specific files
41    --bindir        platform specific executables
42    --libdir        platform specific libraries
43    --includedir    platform independent C (and C++) header files
44
45Compilation flags for libparsifal clients:
46    --libs          print library linking flags
47    --cflags        print pre-processor and compiler flags
48    --cppflags      print pre-processor flags
49    --libtool-libs  print library linking flags for libtool
50EOF
51   exit $exit_code
52}
53
54if test $# -eq 0; then
55  usage 1
56fi
57
58case "$build_os" in
59  darwin*)
60    rpath_str=""
61    ;;
62  *)
63    rpath_str="-Wl,-rpath,$libdir"
64    ;;
65esac
66
67while test $# -gt 0; do
68  case $1 in
69  --version)
70    echo $VERSION
71    ;;
72  --help)
73    usage 0
74    ;;
75  --prefix)
76    echo $prefix
77    exit 0
78    ;;
79  --exec-prefix)
80    echo $exec_prefix
81    exit 0
82    ;;
83  --bindir)
84    echo $bindir
85    exit 0
86    ;;
87  --libdir)
88    echo $libdir
89    ;;
90  --includedir)
91    echo $includedir
92    ;;
93  --libs)
94    echo "-L${libdir} ${rpath_str} -lparsifal ${LIBS}"
95    ;;
96  --cflags)
97    echo "$CPPFLAGS $CFLAGS"
98    ;;
99  --cppflags)
100    echo "$CPPFLAGS"
101    ;;
102  --libtool-libs)
103    echo "${libdir}/libparsifal.la"
104    ;;
105  *)
106    usage 1
107    ;;
108  esac
109  shift
110done
111
112exit 0
113