359a034970eb847ace72092c086f9a5f7e802669
[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 -e 's|osrf|@abs_top_srcdir@/src/python/osrf|g' \
56     -e 's|srfsh\.py|@abs_top_srcdir@/src/python/srfsh.py|g' @srcdir@/src/python/setup.py.in > @srcdir@/src/python/setup.py
57 }
58
59 function showHelp {
60          echo 
61          echo "------------------------------------------------------------"
62          echo " osrf_config                                                "
63          echo " Shows configuration of opensrf                             "
64          echo "------------------------------------------------------------"
65          echo
66          echo "Usage: osrf_config [--option]"
67          echo 
68          echo "Options: "
69          echo
70          echo "--help                  displays help"
71          echo "--version               displays version number of osrf"
72          echo "--installed             displays options that were installed"
73          echo "--prefix                displays prefix"
74          echo "--bindir                displays bindir"
75          echo "--libdir                displays libdir"
76          echo "--tmp                   displays tmp"
77          echo "--includedir            displays includedir"
78          echo "--sysconfdir            displays sysconfdir"
79          echo "--apxs                  displays location of apxs"
80          echo "--apache                displays location of apache2 headers"
81          echo "--apr                   displays location of apr headers"
82          echo "--libxml                displays location of libxml2 headers" 
83          echo
84 }
85
86 case "$1" in
87      --installed)
88                 showInstalled;
89                 ;;
90      --cconfig) cconfig;
91                 ;;
92      --libxml)
93                 echo @LIBXML2_HEADERS@;
94                 ;;
95      --apr)
96                 echo @APR_HEADERS@;
97                 ;;
98      --apache)
99                 echo @APACHE2_HEADERS@;
100                 ;;
101      --prefix)
102                 echo @prefix@
103                 ;;
104      --version) 
105                 echo @PACKAGE_STRING@;
106                 ;;
107      --bindir)
108                 echo @bindir@
109                 ;;
110      --libdir)
111                 echo @libdir@;
112                 ;;
113      --sysconfdir)
114                 echo @sysconfdir@;
115                 ;;
116      --localstatedir)
117                 echo @localstatedir@;
118                 ;;
119      --tmpdir)
120                 echo @TMP@;
121                 ;;
122      --apxs)
123                 echo @APXS2@;
124                 ;;
125      --includedir)
126                 echo @includedir@;
127                 ;;
128      --docdir)
129                 echo @docdir@;
130                 ;;
131      --help)
132                 showHelp;
133                 ;;
134      *)
135                 showAll;
136                 ;;
137 esac