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>
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.
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.
17 #---------------------------
19 #---------------------------
21 export PATH=${PATH}:/usr/sbin
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/])
29 AC_SUBST([abs_top_builddir])
31 #-----------------------------------
32 # Checks for programs.
33 #-----------------------------------
42 #-----------------------------------
44 #-----------------------------------
46 # install openils-all?
47 #AC_ARG_ENABLE([openils-all],
48 #[ --enable-openils-all enables the installation of the default openils system (base system,web,staffclient) ],
49 #[case "${enableval}" in
50 # yes) openils_all=true;
53 # openils_reporter=true;
54 # openils_client_xul=true;
55 # openils_server_xul=true ;;
56 # no) openils_all=false ;;
57 # *) AC_MSG_ERROR([please choose another value for --enable-openils-all (supported values are yes or no])
61 # install evergreen-core?
63 [ --disable-core disables installation of the Evergreen core components ],
64 [case "${enableval}" in
65 yes) openils_core=true ;;
66 no) openils_core=false ;;
67 *) AC_MSG_ERROR([please choose another value for --disable-core (supported values are yes or no])
71 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
73 # install evergreen-web?
76 [ --disable-web disables installation of the Evergreen web modules ],
77 [case "${enableval}" in
78 yes) openils_web=true ;;
79 no) openils_web=false ;;
80 *) AC_MSG_ERROR([please choose another value for --disable-web (supported values are yes or no])
84 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
86 # build evergreen-reporter ?
88 AC_ARG_ENABLE([reporter],
89 [ --disable-reporter disables installation of the Evergreen reporter module ],
90 [case "${enableval}" in
91 yes) openils_reporter=true ;;
92 no) openils_reporter=false ;;
93 *) AC_MSG_ERROR([please choose another value for --disable-reporter (supported values are yes or no])
95 [openils_reporter=true])
97 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
99 # build evergreen-client ?
101 AC_ARG_ENABLE([client],
102 [ --disable-client disables installation of the Evergreen staff client ],
103 [case "${enableval}" in
104 yes) openils_client=true ;;
105 no) openils_client=false ;;
106 *) AC_MSG_ERROR([please choose another value for --disable-client (supported values are yes or no])
108 [openils_client=true])
110 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
113 # build evergreen java ?
115 AC_ARG_ENABLE([java],
116 [ --enable-java enables installation of the Evergreen Java components ],
117 [case "${enableval}" in
118 yes) evergreen_java=true ;;
119 no) evergreen_java=false ;;
120 *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no])
122 [evergreen_java=false])
124 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
127 # build the evergreen python modules?
129 AC_ARG_ENABLE([python],
130 [ --enable-python enables installation of the Evergreen Python modules ],
131 [case "${enableval}" in
132 yes) EG_PYTHON_INSTALL=true ;;
133 no) EG_PYTHON_INSTALL=false ;;
134 *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)])
136 [EG_PYTHON_INSTALL=false])
138 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
142 #-----------------------------------
143 # Check for dependencies
144 #-----------------------------------
146 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
147 if test $MEMCACHED = "no"; then
148 AC_MSG_ERROR([*** memcached not found, aborting])
151 AC_CHECK_PROG([ASPELL],aspell,yes,no)
152 if test $ASPELL = "no"; then
153 AC_MSG_ERROR([*** aspell not found, aborting])
156 AC_CHECK_PROG([CPAN],cpan,yes,no)
157 if test $CPAN = "no"; then
158 AC_MSG_ERROR([*** cpan not found, aborting])
161 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
162 if test $YAZ = "no"; then
163 AC_MSG_ERROR([*** yaz not found, aborting])
166 AC_CHECK_PROG([PERL],perl,yes,no)
167 if test $PERL = "no"; then
168 AC_MSG_ERROR([*** perl not found, aborting])
172 #-----------------------------------
173 # Set install path variables
174 #-----------------------------------
177 [ --with-tmp=path location of the Evergreen temporary directory (default is /tmp) ],
183 APXS2=`apxs2 -q BINDIR`/apxs2
186 APACHE2_HEADERS=`apxs2 -q INCLUDEDIR`
187 AC_SUBST([APACHE2_HEADERS])
189 APR_HEADERS=`apr-config --includedir`
190 AC_SUBST([APR_HEADERS])
192 AC_ARG_WITH([libxml2],
193 [ --with-libxml2=path location of the libxml2 headers (default is /usr/include/libxml2)],
194 [LIBXML2_HEADERS=${withval}],
195 [LIBXML2_HEADERS=/usr/include/libxml2/])
196 AC_SUBST([LIBXML2_HEADERS])
199 [ --with-dbi=path location of the libdbi libraries (default is /usr/local/lib/dbd)],
200 [DBI_LIBS=${withval}],
201 [DBI_LIBS=/usr/local/lib/dbd/])
204 AC_ARG_WITH([opensrf-headers],
205 [ --with-opensrf-headers=path location of the OpenSRF header files (default is /openils/include/)],
206 [OPENSRF_HEADERS=${withval}],
207 [OPENSRF_HEADERS=/openils/include/])
208 AC_SUBST([OPENSRF_HEADERS])
210 AC_ARG_WITH([opensrf-libs],
211 [ --with-opensrf-libs=path location of the OpenSRF libraries (default is /openils/lib/)],
212 [OPENSRF_LIBS=${withval}],
213 [OPENSRF_LIBS=/openils/lib/])
214 AC_SUBST([OPENSRF_LIBS])
216 #------------------------------------
217 # Checks for libraries.
218 #------------------------------------
220 # Check for the existence of libraries in non-standard locations
222 AC_MSG_CHECKING(for -lopensrf)
223 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
226 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
229 # Check for the rest of the libraries
231 #check for dynamic linking functions
232 AC_CHECK_LIB(dl,dlopen)
234 #check for the libdbi library
235 AC_CHECK_LIB(dbi,dbi_initialize)
237 #to check for the availability and function of a particular
238 #driver we need a runtime check (since the driver is loaded
239 #dynamically). This example checks for the mysql driver
240 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
243 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
244 [AC_MSG_RESULT("yes")],
245 [AC_MSG_FAILURE("pgsql driver not installed?")])
247 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
248 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
249 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
250 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
251 AC_CHECK_LIB([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
252 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
255 #------------------------------------
256 # Checks for header files.
257 #------------------------------------
260 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
262 #-------------------------------------------------------------------
263 # Checks for typedefs, structures, and compiler characteristics.
264 #-------------------------------------------------------------------
271 #-------------------------------------------------------------------
272 # Checks for library functions.
273 #-------------------------------------------------------------------
277 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
279 #----------------------------
280 # Create Makefiles/Output
281 #----------------------------
283 AC_CONFIG_FILES([Makefile
284 Open-ILS/examples/Makefile
285 Open-ILS/src/Makefile
286 Open-ILS/src/apachemods/Makefile
287 Open-ILS/src/c-apps/Makefile
288 Open-ILS/src/extras/Makefile
289 Open-ILS/src/java/Makefile
290 Open-ILS/src/python/Makefile
291 Open-ILS/xul/staff_client/Makefile
292 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])
295 #-------------------------------------------------
297 #-------------------------------------------------
300 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
303 AC_MSG_RESULT([-------- Installation Options: --------])
304 if test "$openils_core" = "true" ; then
305 AC_MSG_RESULT([Evergreen Core: yes])
307 AC_MSG_RESULT([Evergreen Core: no])
309 if test "$openils_web" = "true" ; then
310 AC_MSG_RESULT([Evergreen Web: yes])
312 AC_MSG_RESULT([Evergreen Web: no])
314 if test "$openils_reporter" = "true" ; then
315 AC_MSG_RESULT([Evergreen Reporter: yes])
317 AC_MSG_RESULT([Evergreen Reporter: no])
319 if test "$openils_client" = "true" ; then
320 AC_MSG_RESULT([Evergreen Staff Client: yes])
322 AC_MSG_RESULT([Evergreen Staff Client: no])
324 if test "$EG_PYTHON_INSTALL" = "true" ; then
325 AC_MSG_RESULT([Evergreen Python Components: yes])
327 AC_MSG_RESULT([Evergreen Python Components: no])
329 if test "$evergreen_java" = "true" ; then
330 AC_MSG_RESULT([Evergreen Java Components: yes])
332 AC_MSG_RESULT([Evergreen Java Components: no])
335 AC_MSG_RESULT([-------- Installation Directories --------])
336 AC_MSG_RESULT(Installation directory prefix: ${prefix})
337 AC_MSG_RESULT(Temporary directory: ${TMP})
338 AC_MSG_RESULT(APXS2 location: ${APXS2})
339 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
340 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
341 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
342 AC_MSG_RESULT(libdbi location: ${DBI_LIBS})
343 AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS})
344 AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS})
346 AC_MSG_RESULT([----------------------------------------------------------------------])