bba2b4b7c62f261e3a02dce3cccf6031f8020813
[working/Evergreen.git] / Open-ILS / src / extras / eg_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 Evergreen
18
19 prefix=@prefix@
20 exec_prefix=@prefix@
21 datarootdir=@datarootdir@
22
23 function showInstalled {
24         if test "@BUILDILSCORE_TRUE@" = ""; then
25                 echo "EG_CORE"
26         fi
27         if test "@BUILDILSWEB_TRUE@" = ""; then
28                 echo "EG_WEB"
29         fi
30         if test "@BUILDILSREPORTER_TRUE@" = ""; then
31                 echo "EG_REPORTER"
32         fi
33         if test "@BUILDILSCLIENT_TRUE@" = ""; then
34                 echo "EG_CLIENT"
35         fi
36         if test "@BUILDEGJAVA_TRUE@" = ""; then
37                 echo "EG_JAVA"
38         fi
39         if test "@BUILDEGPYTHON_TRUE@" = ""; then
40                 echo "EG_PYTHON"
41         fi
42
43
44 }
45
46 function showAll {
47          echo @PACKAGE_STRING@  
48          echo PREFIX=@prefix@
49          echo BINDIR=@bindir@
50          echo LIBDIR=@libdir@
51          echo TMP=@TMP@
52          echo INCLUDEDIR=@includedir@
53          echo SYSCONFDIR=@sysconfdir@
54          echo APXS2=@APXS2@
55          echo APACHE2_HEADERS=@APACHE2_HEADERS@
56          echo APR_HEADERS=@APR_HEADERS@
57          echo LIBXML2_HEADERS=@LIBXML2_HEADERS@
58          echo 
59          echo "Installed modules:"
60          showInstalled;
61 }
62
63
64 function showHelp {
65          echo 
66          echo "------------------------------------------------------------"
67          echo " eg_config                                                  "
68          echo " Shows configuration of evergreen                           "
69          echo "------------------------------------------------------------"
70          echo
71          echo "Usage: eg_config [--option]"
72          echo 
73          echo "Options: "
74          echo
75          echo "--help                  displays help"
76          echo "--version               displays version number of evergreen"
77          echo "--installed             displays options that were installed"
78          echo "--prefix                displays prefix"
79          echo "--bindir                displays bindir"
80          echo "--libdir                displays libdir"
81          echo "--tmp                   displays tmp"
82          echo "--includedir            displays includedir"
83          echo "--sysconfdir            displays sysconfdir"
84          echo "--apxs                  displays location of apxs"
85          echo "--apache                displays location of apache2 headers"
86          echo "--apr                   displays location of apr headers"
87          echo "--libxml                displays location of libxml2 headers" 
88          echo
89 }
90
91 case "$1" in
92      --installed)
93                 showInstalled;
94                 ;;
95      --cconfig) cconfig;
96                 ;;
97      --libxml)
98                 echo @LIBXML2_HEADERS@;
99                 ;;
100      --apr)
101                 echo @APR_HEADERS@;
102                 ;;
103      --apache)
104                 echo @APACHE2_HEADERS@;
105                 ;;
106      --prefix)
107                 echo @prefix@
108                 ;;
109      --version) 
110                 echo @PACKAGE_STRING@;
111                 ;;
112      --bindir)
113                 echo @bindir@
114                 ;;
115      --libdir)
116                 echo @libdir@;
117                 ;;
118      --sysconfdir)
119                 echo @sysconfdir@;
120                 ;;
121      --localstatedir)
122                 echo @localstatedir@;
123                 ;;
124      --tmpdir)
125                 echo @TMP@;
126                 ;;
127      --apxs)
128                 echo @APXS2@;
129                 ;;
130      --includedir)
131                 echo @includedir@;
132                 ;;
133      --docdir)
134                 echo @docdir@;
135                 ;;
136      --help)
137                 showHelp;
138                 ;;
139      *)
140                 showAll;
141                 ;;
142 esac