initial steps toward OS X portage
[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          if test "$JAVA" = "true"; then
25             echo "OSRF_JAVA"
26          fi
27          if test "$PYTHON" = "true"; then
28             echo "OSRF_PYTHON"
29          fi
30 }
31
32 function showAll {
33          echo @PACKAGE_STRING@  
34          echo PREFIX=@prefix@
35          echo BINDIR=@bindir@
36          echo LIBDIR=@libdir@
37          echo TMP=@TMP@
38          echo INCLUDEDIR=@includedir@
39          echo SYSCONFDIR=@sysconfdir@
40          echo APXS2=@APXS2@
41          echo APACHE2_HEADERS=@APACHE2_HEADERS@
42          echo APR_HEADERS=@APR_HEADERS@
43          echo LIBXML2_HEADERS=@LIBXML2_HEADERS@
44          echo 
45          echo "Installed modules:"
46          showInstalled;
47 }
48
49 function cconfig {
50          
51 sed -e 's|osrf|@abs_top_srcdir@/src/python/osrf|g' \
52     -e 's|srfsh\.py|@abs_top_srcdir@/src/python/srfsh.py|g' @srcdir@/src/python/setup.py.in > @srcdir@/src/python/setup.py
53 }
54
55 function showHelp {
56          echo 
57          echo "------------------------------------------------------------"
58          echo " osrf_config                                                "
59          echo " Shows configuration of opensrf                             "
60          echo "------------------------------------------------------------"
61          echo
62          echo "Usage: osrf_config [--option]"
63          echo 
64          echo "Options: "
65          echo
66          echo "--help                  displays help"
67          echo "--version               displays version number of osrf"
68          echo "--installed             displays options that were installed"
69          echo "--prefix                displays prefix"
70          echo "--bindir                displays bindir"
71          echo "--libdir                displays libdir"
72          echo "--tmp                   displays tmp"
73          echo "--includedir            displays includedir"
74          echo "--sysconfdir            displays sysconfdir"
75          echo "--apxs                  displays location of apxs"
76          echo "--apache                displays location of apache2 headers"
77          echo "--apr                   displays location of apr headers"
78          echo "--libxml                displays location of libxml2 headers" 
79          echo
80 }
81
82 case "$1" in
83      --installed)
84                 showInstalled;
85                 ;;
86      --cconfig) cconfig;
87                 ;;
88      --libxml)
89                 echo @LIBXML2_HEADERS@;
90                 ;;
91      --apr)
92                 echo @APR_HEADERS@;
93                 ;;
94      --apache)
95                 echo @APACHE2_HEADERS@;
96                 ;;
97      --prefix)
98                 echo @prefix@
99                 ;;
100      --version) 
101                 echo @PACKAGE_STRING@;
102                 ;;
103      --bindir)
104                 echo @bindir@
105                 ;;
106      --libdir)
107                 echo @libdir@;
108                 ;;
109      --sysconfdir)
110                 echo @sysconfdir@;
111                 ;;
112      --localstatedir)
113                 echo @localstatedir@;
114                 ;;
115      --tmpdir)
116                 echo @TMP@;
117                 ;;
118      --apxs)
119                 echo @APXS2@;
120                 ;;
121      --includedir)
122                 echo @includedir@;
123                 ;;
124      --docdir)
125                 echo @docdir@;
126                 ;;
127      --help)
128                 showHelp;
129                 ;;
130      *)
131                 showAll;
132                 ;;
133 esac