]> git.evergreen-ils.org Git - Evergreen.git/blob - configure.ac
testing, ignore
[Evergreen.git] / configure.ac
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 #---------------------------
16 # Init
17 #---------------------------
18
19 export PATH=${PATH}:/usr/sbin
20 AC_PREREQ(2.59)
21 AC_INIT(Open-ILS, trunk, open-ils-dev@list.georgialibraries.org)
22 AM_INIT_AUTOMAKE([OpenILS], [trunk])
23 AC_REVISION($Revision: 0.1 $)
24 AC_CONFIG_SRCDIR([configure.ac])
25 AC_PREFIX_DEFAULT([/openils/])
26 AC_SUBST(prefix)
27 AC_SUBST([abs_top_builddir])
28
29 #-----------------------------------
30 # Checks for programs.
31 #-----------------------------------
32
33 AC_PROG_LIBTOOL
34 AC_PROG_CC
35 AC_PROG_INSTALL
36 AC_PROG_LN_S
37 AC_PROG_MAKE_SET
38
39 #-----------------------------------
40 # Install options 
41 #-----------------------------------
42
43 # install openils-all?
44 #AC_ARG_ENABLE([openils-all],
45 #[  --enable-openils-all    enables the installation of the default openils system (base system,web,staffclient) ],
46 #[case "${enableval}" in
47 #    yes) openils_all=true;
48 #        openils_core=true;
49 #        openils_web=true;
50 #        openils_reporter=true;
51 #        openils_client_xul=true;
52 #        openils_server_xul=true ;;
53 #    no)  openils_all=false ;;
54 #  *) AC_MSG_ERROR([please choose another value for --enable-openils-all (supported values are yes or no])
55 #esac],
56 #[openils_all=false])
57
58 # install evergreen-core?
59 AC_ARG_ENABLE([core],
60 [  --disable-core    disables installation of the Evergreen core components ],
61 [case "${enableval}" in
62     yes) openils_core=true ;;
63     no)  openils_core=false ;;
64   *) AC_MSG_ERROR([please choose another value for --disable-core (supported values are yes or no])
65 esac],
66 [openils_core=true])
67
68 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
69
70 # install evergreen-web?
71
72 AC_ARG_ENABLE([web],
73 [  --disable-web    disables installation of the Evergreen web modules ],
74 [case "${enableval}" in
75     yes) openils_web=true ;;
76     no)  openils_web=false ;;
77   *) AC_MSG_ERROR([please choose another value for --disable-web (supported values are yes or no])
78 esac],
79 [openils_web=true])
80
81 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
82
83 # build evergreen-reporter ?
84
85 AC_ARG_ENABLE([reporter],
86 [  --disable-reporter    disables installation of the Evergreen reporter module ],
87 [case "${enableval}" in
88     yes) openils_reporter=true ;;
89     no)  openils_reporter=false ;;
90   *) AC_MSG_ERROR([please choose another value for --disable-reporter (supported values are yes or no])
91 esac],
92 [openils_reporter=true])
93
94 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
95
96 # build evergreen-client ?
97
98 AC_ARG_ENABLE([client],
99 [  --disable-client    disables installation of the Evergreen staff client ],
100 [case "${enableval}" in
101     yes) openils_client=true ;;
102     no)  openils_client=false ;;
103   *) AC_MSG_ERROR([please choose another value for --disable-client (supported values are yes or no])
104 esac],
105 [openils_client=true])
106
107 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
108
109
110 # build evergreen java ?
111
112 AC_ARG_ENABLE([java],
113 [  --enable-java    enables installation of the Evergreen Java components ],
114 [case "${enableval}" in
115     yes) evergreen_java=true ;;
116     no)  evergreen_java=false ;;
117   *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no])
118 esac],
119 [evergreen_java=false])
120
121 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
122
123
124 # build the evergreen python modules?
125
126 AC_ARG_ENABLE([python],
127 [  --enable-python    enables installation of the Evergreen Python modules ],
128 [case "${enableval}" in
129     yes) EG_PYTHON_INSTALL=true ;;
130     no)  EG_PYTHON_INSTALL=false ;;
131   *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)])
132 esac],
133 [EG_PYTHON_INSTALL=false])
134
135 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
136
137
138
139 #-----------------------------------
140 # Check for dependencies 
141 #-----------------------------------
142
143 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
144 if test $MEMCACHED = "no"; then
145         AC_MSG_ERROR([*** memcached not found, aborting])
146 fi
147
148 AC_CHECK_PROG([ASPELL],aspell,yes,no)
149 if test $ASPELL = "no"; then
150         AC_MSG_ERROR([*** aspell not found, aborting])
151 fi
152
153 AC_CHECK_PROG([CPAN],cpan,yes,no)
154 if test $CPAN = "no"; then
155         AC_MSG_ERROR([*** cpan not found, aborting])
156 fi
157
158 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
159 if test $YAZ = "no"; then
160         AC_MSG_ERROR([*** yaz not found, aborting])
161 fi
162
163 AC_CHECK_PROG([PERL],perl,yes,no)
164 if test $PERL = "no"; then 
165         AC_MSG_ERROR([*** perl not found, aborting])
166 fi
167
168
169 #-----------------------------------
170 # Set install path variables 
171 #-----------------------------------
172
173 AC_ARG_WITH([tmp],
174 [  --with-tmp=path             location of the Evergreen temporary directory (default is /tmp) ],
175 [TMP=${withval}],
176 [TMP=/tmp])
177 AC_SUBST([TMP])
178
179
180 APXS2=`apxs2 -q BINDIR`/apxs2
181 AC_SUBST([APXS2])
182
183 APACHE2_HEADERS=`apxs2 -q INCLUDEDIR`
184 AC_SUBST([APACHE2_HEADERS])
185
186 APR_HEADERS=`apr-config --includedir`
187 AC_SUBST([APR_HEADERS])
188
189 AC_ARG_WITH([libxml2],
190 [  --with-libxml2=path         location of the libxml2 headers (default is /usr/include/libxml2)],
191 [LIBXML2_HEADERS=${withval}],
192 [LIBXML2_HEADERS=/usr/include/libxml2/])
193 AC_SUBST([LIBXML2_HEADERS])
194
195 AC_ARG_WITH([dbi],
196 [  --with-dbi=path             location of the libdbi libraries (default is /usr/local/lib/dbd)],
197 [DBI_LIBS=${withval}],
198 [DBI_LIBS=/usr/local/lib/dbd/])
199 AC_SUBST([DBI_LIBS])
200
201 AC_ARG_WITH([opensrf-headers],
202 [  --with-opensrf-headers=path location of the OpenSRF header files (default is /openils/include/)],
203 [OPENSRF_HEADERS=${withval}],
204 [OPENSRF_HEADERS=/openils/include/])
205 AC_SUBST([OPENSRF_HEADERS])
206
207 AC_ARG_WITH([opensrf-libs],
208 [  --with-opensrf-libs=path    location of the OpenSRF libraries (default is /openils/lib/)],
209 [OPENSRF_LIBS=${withval}],
210 [OPENSRF_LIBS=/openils/lib/])
211 AC_SUBST([OPENSRF_LIBS])
212
213 #------------------------------------
214 # Checks for libraries. 
215 #------------------------------------
216
217 # Check for the existence of libraries in non-standard locations
218
219 AC_MSG_CHECKING(for -lopensrf)
220 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
221 AC_MSG_RESULT([yes])
222 else
223 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
224 fi
225
226 # Check for the rest of the libraries
227
228 #check for dynamic linking functions
229 AC_CHECK_LIB(dl,dlopen)
230
231 #check for the libdbi library
232 AC_CHECK_LIB(dbi,dbi_initialize)
233
234 #to check for the availability and function of a particular
235 #driver we need a runtime check (since the driver is loaded
236 #dynamically). This example checks for the mysql driver
237 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
238 AC_RUN_IFELSE(
239   [AC_LANG_PROGRAM(,
240     [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
241   [AC_MSG_RESULT("yes")],
242   [AC_MSG_FAILURE("pgsql driver not installed?")])
243
244 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
245 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
246 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
247 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
248 AC_CHECK_LIB([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
249 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
250
251
252 #------------------------------------
253 # Checks for header files.
254 #------------------------------------
255
256 AC_HEADER_STDC
257 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
258
259 #-------------------------------------------------------------------
260 # Checks for typedefs, structures, and compiler characteristics.
261 #-------------------------------------------------------------------
262
263 AC_C_CONST
264 AC_TYPE_SIZE_T
265 AC_STRUCT_TM
266 AC_HEADER_STDBOOL
267
268 #-------------------------------------------------------------------
269 # Checks for library functions.
270 #-------------------------------------------------------------------
271
272 AC_FUNC_STRFTIME
273 AC_FUNC_STRTOD
274 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
275
276 #----------------------------
277 # Create Makefiles/Output
278 #----------------------------
279
280 AC_CONFIG_FILES([Makefile
281                  Open-ILS/examples/Makefile
282                  Open-ILS/src/Makefile
283                  Open-ILS/src/apachemods/Makefile
284                  Open-ILS/src/c-apps/Makefile
285                  Open-ILS/src/extras/Makefile
286                  Open-ILS/src/java/Makefile
287                  Open-ILS/src/python/Makefile
288                  Open-ILS/xul/staff_client/Makefile
289                  Open-ILS/src/extras/eg_config],  [if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi])
290 AC_OUTPUT
291
292 #-------------------------------------------------
293 # OUTPUT STUFF 
294 #-------------------------------------------------
295
296 AC_MSG_RESULT([])
297 AC_MSG_RESULT([--------------------- Configuration options:  -----------------------])
298
299 AC_MSG_RESULT([])
300 AC_MSG_RESULT([-------- Installation Options: --------])
301 if test "$openils_core" = "true" ; then
302         AC_MSG_RESULT([Evergreen Core:                  yes])
303 else
304         AC_MSG_RESULT([Evergreen Core:                  no])
305 fi
306 if test "$openils_web" = "true" ; then
307         AC_MSG_RESULT([Evergreen Web:                   yes])
308 else
309         AC_MSG_RESULT([Evergreen Web:                   no])
310 fi
311 if test "$openils_reporter" = "true" ; then
312         AC_MSG_RESULT([Evergreen Reporter:              yes])
313 else
314         AC_MSG_RESULT([Evergreen Reporter:              no])
315 fi
316 if test "$openils_client" = "true" ; then
317         AC_MSG_RESULT([Evergreen Staff Client:          yes])
318 else
319         AC_MSG_RESULT([Evergreen Staff Client:          no])
320 fi
321 if test "$EG_PYTHON_INSTALL" = "true" ; then
322         AC_MSG_RESULT([Evergreen Python Components:     yes])
323 else
324         AC_MSG_RESULT([Evergreen Python Components:     no])
325 fi
326 if test "$evergreen_java" = "true" ; then
327         AC_MSG_RESULT([Evergreen Java Components:       yes])
328 else
329         AC_MSG_RESULT([Evergreen Java Components:       no])
330 fi
331 AC_MSG_RESULT([]) 
332 AC_MSG_RESULT([-------- Installation Directories --------])
333 AC_MSG_RESULT(Installation directory prefix:            ${prefix})
334 AC_MSG_RESULT(Temporary directory:                      ${TMP})
335 AC_MSG_RESULT(APXS2 location:                           ${APXS2})
336 AC_MSG_RESULT(Apache headers location:                  ${APACHE2_HEADERS})
337 AC_MSG_RESULT(APR headers location:                     ${APR_HEADERS})
338 AC_MSG_RESULT(libxml2 headers location:                 ${LIBXML2_HEADERS})
339 AC_MSG_RESULT(libdbi location:                          ${DBI_LIBS})
340 AC_MSG_RESULT(OpenSRF headers location:                 ${OPENSRF_HEADERS})
341 AC_MSG_RESULT(OpenSRF libraries location:               ${OPENSRF_LIBS})
342
343 AC_MSG_RESULT([----------------------------------------------------------------------])
344