]> git.evergreen-ils.org Git - working/Evergreen.git/blob - configure.ac
Add boolean column prepayment_required to acq.purchase_order and
[working/Evergreen.git] / configure.ac
1 # Copyright (C) 2008 Equinox Software, Inc.
2 # Kevin Beswick <kevinbeswick00@gmail.com>
3 # Copyright (C) 2010 Laurentian University 
4 # Dan Scott <dscott@laurentian.ca>
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 #---------------------------
18 # Init
19 #---------------------------
20
21 export PATH=${PATH}:/usr/sbin
22 AC_PREREQ(2.61)
23 AC_INIT(Open-ILS, trunk, open-ils-dev@list.georgialibraries.org)
24 AM_INIT_AUTOMAKE([OpenILS], [trunk])
25 AC_REVISION($Revision: 0.1 $)
26 AC_CONFIG_SRCDIR([configure.ac])
27 AC_PREFIX_DEFAULT([/openils/])
28 AC_SUBST(prefix)
29 AC_SUBST([abs_top_builddir])
30
31 #-----------------------------------
32 # Checks for programs.
33 #-----------------------------------
34
35
36 AC_PROG_LIBTOOL
37 AC_PROG_CC
38 AC_PROG_INSTALL
39 AC_PROG_LN_S
40 AC_PROG_MAKE_SET
41 AC_PROG_MKDIR_P
42
43 #-----------------------------------
44 # Install options 
45 #-----------------------------------
46
47 # install openils-all?
48 #AC_ARG_ENABLE([openils-all],
49 #[  --enable-openils-all    enables the installation of the default openils system (base system,web,staffclient) ],
50 #[case "${enableval}" in
51 #    yes) openils_all=true;
52 #        openils_core=true;
53 #        openils_web=true;
54 #        openils_reporter=true;
55 #        openils_client_xul=true;
56 #        openils_server_xul=true ;;
57 #    no)  openils_all=false ;;
58 #  *) AC_MSG_ERROR([please choose another value for --enable-openils-all (supported values are yes or no])
59 #esac],
60 #[openils_all=false])
61
62 # install evergreen-core?
63 AC_ARG_ENABLE([core],
64 [  --disable-core    disables installation of the Evergreen core components ],
65 [case "${enableval}" in
66     yes) openils_core=true ;;
67     no)  openils_core=false ;;
68   *) AC_MSG_ERROR([please choose another value for --disable-core (supported values are yes or no])
69 esac],
70 [openils_core=true])
71
72 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
73
74 # install evergreen-web?
75
76 AC_ARG_ENABLE([web],
77 [  --disable-web    disables installation of the Evergreen web modules ],
78 [case "${enableval}" in
79     yes) openils_web=true ;;
80     no)  openils_web=false ;;
81   *) AC_MSG_ERROR([please choose another value for --disable-web (supported values are yes or no])
82 esac],
83 [openils_web=true])
84
85 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
86
87 # install Evergreen Apache modules?
88 AC_ARG_ENABLE([apache-modules],
89 [  --disable-apache-modules    disables installation of the Evergreen Apache modules ],
90 [case "${enableval}" in
91     yes) build_apachemods=true ;;
92     no)  build_apachemods=false ;;
93   *) AC_MSG_ERROR([please choose another value for --disable-apache-modules (supported values are yes or no])
94 esac],
95 [build_apachemods=true])
96
97 AM_CONDITIONAL([BUILDAPACHEMODS], [test x$build_apachemods = xtrue])
98
99 # build evergreen-reporter ?
100
101 AC_ARG_ENABLE([reporter],
102 [  --disable-reporter    disables installation of the Evergreen reporter module ],
103 [case "${enableval}" in
104     yes) openils_reporter=true ;;
105     no)  openils_reporter=false ;;
106   *) AC_MSG_ERROR([please choose another value for --disable-reporter (supported values are yes or no])
107 esac],
108 [openils_reporter=true])
109
110 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
111
112 # build evergreen-client ?
113
114 AC_ARG_ENABLE([client],
115 [  --disable-client    disables installation of the Evergreen staff client ],
116 [case "${enableval}" in
117     yes) openils_client=true ;;
118     no)  openils_client=false ;;
119   *) AC_MSG_ERROR([please choose another value for --disable-client (supported values are yes or no])
120 esac],
121 [openils_client=true])
122
123 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
124
125
126 # build evergreen java ?
127
128 AC_ARG_ENABLE([java],
129 [  --enable-java    enables installation of the Evergreen Java components ],
130 [case "${enableval}" in
131     yes) evergreen_java=true ;;
132     no)  evergreen_java=false ;;
133   *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no])
134 esac],
135 [evergreen_java=false])
136
137 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
138
139
140 # build the evergreen python modules?
141
142 AC_ARG_ENABLE([python],
143 [  --enable-python    enables installation of the Evergreen Python modules ],
144 [case "${enableval}" in
145     yes) EG_PYTHON_INSTALL=true ;;
146     no)  EG_PYTHON_INSTALL=false ;;
147   *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)])
148 esac],
149 [EG_PYTHON_INSTALL=false])
150
151 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
152
153 #-----------------------------------
154 # Check for dependencies 
155 #-----------------------------------
156
157 AC_ARG_WITH([opensrf-headers],
158 [  --with-opensrf-headers=path location of the OpenSRF header files (default is /openils/include/)],
159 [OPENSRF_HEADERS=${withval}],
160 [OPENSRF_HEADERS=/openils/include/])
161 AC_SUBST([OPENSRF_HEADERS])
162
163 # We need this for JavaScript
164 AC_ARG_WITH([opensrf-libs],
165 [  --with-opensrf-libs=path    location of the OpenSRF libraries (default is /openils/lib/)],
166 [OPENSRF_LIBS=${withval}],
167 [OPENSRF_LIBS=/openils/lib/])
168 AC_SUBST([OPENSRF_LIBS])
169
170 AC_ARG_WITH([tmp],
171 [  --with-tmp=path             location of the Evergreen temporary directory (default is /tmp) ],
172 [TMP=${withval}],
173 [TMP=/tmp])
174 AC_SUBST([TMP])
175
176 AC_ARG_WITH([apxs],
177 [  --with-apxs=path            location of the apxs Apache configuration tool (default is /usr/bin/apxs2)],
178 [APXS2=${withval}],
179 [APXS2=/usr/bin/apxs2])
180
181 # If the passed in value doesn't work, try some reasonable defaults
182 # Fedora puts the file in /usr/sbin/apxs, for example
183 if ! test -x "$APXS2"; then
184         for i in /usr/bin /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin ; do
185                 for j in apxs apxs2 ; do
186                         if test -x "$i/$j"; then
187                                 APXS2="$i/$j"
188                                 break
189                         fi
190                 done
191         done
192 fi
193 AC_SUBST([APXS2])
194
195 AC_ARG_WITH([apache],
196 [  --with-apache=path          location of the Apache headers (default is /usr/include/apache2)],
197 [APACHE2_HEADERS=${withval}],
198 [APACHE2_HEADERS=/usr/include/apache2])
199 AC_SUBST([APACHE2_HEADERS])
200
201 AC_ARG_WITH([apr],
202 [  --with-apr=path             location of the Apache Portable Runtime (APR) headers (default is /usr/include/apr-1.0/)],
203 [APR_HEADERS=${withval}],
204 [APR_HEADERS=/usr/include/apr-1.0])
205 AC_SUBST([APR_HEADERS])
206
207 AC_ARG_WITH([libxml2],
208 [  --with-libxml2=path         location of the libxml2 headers (default is /usr/include/libxml2)],
209 [LIBXML2_HEADERS=${withval}],
210 [LIBXML2_HEADERS=/usr/include/libxml2/])
211 AC_SUBST([LIBXML2_HEADERS])
212
213 AC_ARG_WITH([dbi],
214 [  --with-dbi=path             location of the libdbi driver libraries (default is /usr/local/lib/dbd)],
215 [DBI_LIBS=${withval}],
216 [DBI_LIBS=/usr/local/lib/dbd/])
217
218 # If the passed in value doesn't work, fall back to reasonable defaults
219 # Distributions are starting to package a good version of libdbi / libdbd
220 if ! test -d "$DBI_LIBS"; then
221         for i in /usr/lib/dbd/ /usr/local/lib/dbd/ ; do
222                 if test -d "$i"; then
223                         DBI_LIBS="$i"
224                         break
225                 fi
226         done
227 fi
228 AC_SUBST([DBI_LIBS])
229
230 if test "x$openils_core" = "xtrue"; then
231
232         AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
233         if test $MEMCACHED = "no"; then
234                 AC_MSG_ERROR([*** memcached not found, aborting])
235         fi
236
237         AC_CHECK_PROG([ASPELL],aspell,yes,no)
238         if test $ASPELL = "no"; then
239                 AC_MSG_ERROR([*** aspell not found, aborting])
240         fi
241
242         AC_CHECK_PROG([CPAN],cpan,yes,no)
243         if test $CPAN = "no"; then
244                 AC_MSG_ERROR([*** cpan not found, aborting])
245         fi
246
247         AC_CHECK_PROG([YAZ],yaz-config,yes,no)
248         if test $YAZ = "no"; then
249                 AC_MSG_ERROR([*** yaz not found, aborting])
250         fi
251
252         AC_CHECK_PROG([PERL],perl,yes,no)
253         if test $PERL = "no"; then 
254                 AC_MSG_ERROR([*** perl not found, aborting])
255         fi
256
257         #------------------------------------
258         # Checks for libraries. 
259         #------------------------------------
260
261         # Check for the existence of libraries in non-standard locations
262
263         AC_MSG_CHECKING(for -lopensrf)
264         if test -e ${OPENSRF_LIBS}/libopensrf.so; then
265         AC_MSG_RESULT([yes])
266         else
267         AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
268         fi
269
270         # Check for the rest of the libraries
271
272         #check for dynamic linking functions
273         AC_CHECK_LIB(dl,dlopen)
274
275         #check for the libdbi library
276         AC_CHECK_LIB(dbi,dbi_initialize)
277
278         #to check for the availability and function of a particular
279         #driver we need a runtime check (since the driver is loaded
280         #dynamically). This example checks for the mysql driver
281         AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
282         AC_RUN_IFELSE(
283           [AC_LANG_PROGRAM(,
284             [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
285           [AC_MSG_RESULT("yes")],
286           [AC_MSG_FAILURE("pgsql driver not installed?")])
287
288         AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
289         AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
290         AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
291         AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
292         AC_CHECK_LIB([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
293         AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
294
295
296         #------------------------------------
297         # Checks for header files.
298         #------------------------------------
299
300         AC_HEADER_STDC
301         AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
302
303         #-------------------------------------------------------------------
304         # Checks for typedefs, structures, and compiler characteristics.
305         #-------------------------------------------------------------------
306
307         AC_C_CONST
308         AC_TYPE_SIZE_T
309         AC_STRUCT_TM
310         AC_HEADER_STDBOOL
311
312         #-------------------------------------------------------------------
313         # Checks for library functions.
314         #-------------------------------------------------------------------
315
316         AC_FUNC_STRFTIME
317         AC_FUNC_STRTOD
318         AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
319
320         #----------------------------
321         # Create Makefiles/Output
322         #----------------------------
323
324         AC_CONFIG_FILES([Open-ILS/examples/Makefile
325                          Open-ILS/src/c-apps/Makefile
326                          Open-ILS/src/extras/Makefile
327                          Open-ILS/src/java/Makefile
328                          Open-ILS/src/python/Makefile])
329 fi
330
331 if test "x$build_apachemods" = "xtrue"; then
332
333         #-----------------------------------
334         # Set install path variables 
335         #-----------------------------------
336
337         #APACHE PREFORK DEV TEST
338         AC_MSG_CHECKING([APXS2])
339         if test -x "${APXS2}"; then
340         AC_MSG_RESULT([yes])
341         else
342         AC_MSG_ERROR([*** apxs not found in ${APXS2}, aborting])
343         fi  
344
345         AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
346 fi
347
348 AC_CONFIG_FILES([Makefile
349                  Open-ILS/src/Makefile
350                  Open-ILS/web/Makefile
351                  Open-ILS/xul/staff_client/Makefile
352                  Open-ILS/src/extras/eg_config
353                  Open-ILS/src/extras/fast-extract],
354                 [
355                         if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
356                         if test -e "./Open-ILS/src/extras/fast-extract"; then chmod 755 Open-ILS/src/extras/fast-extract; fi;
357                 ])
358 AC_OUTPUT
359
360 #-------------------------------------------------
361 # OUTPUT STUFF 
362 #-------------------------------------------------
363
364 AC_MSG_RESULT([])
365 AC_MSG_RESULT([--------------------- Configuration options:  -----------------------])
366
367 AC_MSG_RESULT([])
368 AC_MSG_RESULT([-------- Installation Options: --------])
369 if test "$openils_core" = "true" ; then
370         AC_MSG_RESULT([Evergreen Core:                  yes])
371 else
372         AC_MSG_RESULT([Evergreen Core:                  no])
373 fi
374 if test "$build_apachemods" = "true" ; then
375         AC_MSG_RESULT([Evergreen Apache module: yes])
376 else
377         AC_MSG_RESULT([Evergreen Apache module: no])
378 fi
379 if test "$openils_web" = "true" ; then
380         AC_MSG_RESULT([Evergreen Web:                   yes])
381 else
382         AC_MSG_RESULT([Evergreen Web:                   no])
383 fi
384 if test "$openils_reporter" = "true" ; then
385         AC_MSG_RESULT([Evergreen Reporter:              yes])
386 else
387         AC_MSG_RESULT([Evergreen Reporter:              no])
388 fi
389 if test "$openils_client" = "true" ; then
390         AC_MSG_RESULT([Evergreen Staff Client:          yes])
391 else
392         AC_MSG_RESULT([Evergreen Staff Client:          no])
393 fi
394 if test "$EG_PYTHON_INSTALL" = "true" ; then
395         AC_MSG_RESULT([Evergreen Python Components:     yes])
396 else
397         AC_MSG_RESULT([Evergreen Python Components:     no])
398 fi
399 if test "$evergreen_java" = "true" ; then
400         AC_MSG_RESULT([Evergreen Java Components:       yes])
401 else
402         AC_MSG_RESULT([Evergreen Java Components:       no])
403 fi
404 AC_MSG_RESULT([]) 
405 AC_MSG_RESULT([-------- Installation Directories --------])
406 AC_MSG_RESULT(Installation directory prefix:            ${prefix})
407 AC_MSG_RESULT(Temporary directory:                      ${TMP})
408 AC_MSG_RESULT(APXS2 location:                           ${APXS2})
409 AC_MSG_RESULT(Apache headers location:                  ${APACHE2_HEADERS})
410 AC_MSG_RESULT(APR headers location:                     ${APR_HEADERS})
411 AC_MSG_RESULT(libxml2 headers location:                 ${LIBXML2_HEADERS})
412 AC_MSG_RESULT(libdbi location:                          ${DBI_LIBS})
413 AC_MSG_RESULT(OpenSRF headers location:                 ${OPENSRF_HEADERS})
414 AC_MSG_RESULT(OpenSRF libraries location:               ${OPENSRF_LIBS})
415
416 AC_MSG_RESULT([----------------------------------------------------------------------])
417