Use autotools a bit more to our advantage:
[OpenSRF.git] / bin / osrf_config.in
1 #!/bin/bash
2 #
3 # Copyright (C) 2008 Equinox Software, Inc.
4 # Kevin Beswick <kevinbeswick00@gmail.com>
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16
17 # Shows configuration options of OSRF
18
19 prefix=@prefix@
20 exec_prefix=@exec_prefix@
21 datarootdir=@datarootdir@
22
23 function showInstalled {
24          JAVA=@OSRF_INSTALL_JAVA@
25          PYTHON=@OSRF_INSTALL_PYTHON@
26          if test "$JAVA" = "true"; then
27             echo "OSRF_JAVA"
28          fi
29          if test "$PYTHON" = "true"; then
30             echo "OSRF_PYTHON"
31          fi
32 }
33
34 function showAll {
35          echo @PACKAGE_STRING@  
36          echo PREFIX=@prefix@
37          echo BINDIR=@bindir@
38          echo LIBDIR=@libdir@
39          echo TMP=@TMP@
40          echo INCLUDEDIR=@includedir@
41          echo SYSCONFDIR=@sysconfdir@
42          echo APXS2=@APXS2@
43          echo APACHE2_HEADERS=@APACHE2_HEADERS@
44          echo APR_HEADERS=@APR_HEADERS@
45          echo LIBXML2_HEADERS=@LIBXML2_HEADERS@
46          echo 
47          echo "Installed modules:"
48          showInstalled;
49 }
50
51 function showHelp {
52          echo 
53          echo "------------------------------------------------------------"
54          echo " osrf_config                                                "
55          echo " Shows configuration of opensrf                             "
56          echo "------------------------------------------------------------"
57          echo
58          echo "Usage: osrf_config [--option]"
59          echo 
60          echo "Options: "
61          echo
62          echo "--help                  displays help"
63          echo "--version               displays version number of osrf"
64          echo "--installed             displays options that were installed"
65          echo "--prefix                displays prefix"
66          echo "--bindir                displays bindir"
67          echo "--libdir                displays libdir"
68          echo "--tmp                   displays tmp"
69          echo "--includedir            displays includedir"
70          echo "--sysconfdir            displays sysconfdir"
71          echo "--apxs                  displays location of apxs"
72          echo "--apache                displays location of apache2 headers"
73          echo "--apr                   displays location of apr headers"
74          echo "--libxml                displays location of libxml2 headers" 
75          echo
76 }
77
78 case "$1" in
79      --installed)
80                 showInstalled;
81                 ;;
82      --cconfig) cconfig;
83                 ;;
84      --libxml)
85                 echo @LIBXML2_HEADERS@;
86                 ;;
87      --apr)
88                 echo @APR_HEADERS@;
89                 ;;
90      --apache)
91                 echo @APACHE2_HEADERS@;
92                 ;;
93      --prefix)
94                 echo @prefix@
95                 ;;
96      --version) 
97                 echo @PACKAGE_STRING@;
98                 ;;
99      --bindir)
100                 echo @bindir@
101                 ;;
102      --libdir)
103                 echo @libdir@;
104                 ;;
105      --sysconfdir)
106                 echo @sysconfdir@;
107                 ;;
108      --localstatedir)
109                 echo @localstatedir@;
110                 ;;
111      --tmpdir)
112                 echo @TMP@;
113                 ;;
114      --apxs)
115                 echo @APXS2@;
116                 ;;
117      --includedir)
118                 echo @includedir@;
119                 ;;
120      --docdir)
121                 echo @docdir@;
122                 ;;
123      --help)
124                 showHelp;
125                 ;;
126      *)
127                 showAll;
128                 ;;
129 esac