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