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])
28 AC_SUBST([abs_top_builddir])
29 #-----------------------------------
30 # Checks for programs.
31 #-----------------------------------
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_updates=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])
62 # install evergreen-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])
72 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
74 # install evergreen-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])
85 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
87 # install evergreen-updates?
89 AC_ARG_ENABLE([updates],
90 [ --disable-updates disables installation of the Evergreen updates folder ],
91 [case "${enableval}" in
92 yes) openils_updates=true ;;
93 no) openils_updates=false ;;
94 *) AC_MSG_ERROR([please choose another value for --disable-updates (supported values are yes or no])
96 [openils_updates=true])
98 AM_CONDITIONAL([BUILDILSUPDATES], [test x$openils_updates = xtrue])
100 # Default updates host?
101 AC_ARG_WITH([updateshost],
102 [ --with-updateshost=hostname default hostname for automatic updates (default is blank)],
103 [AUTOUPDATE_HOST=${withval}],
105 AC_SUBST([AUTOUPDATE_HOST])
107 # Default updates host?
108 AC_ARG_WITH([initialhost],
109 [ --with-initialhost=hostname default hostname for staff client (default is blank)],
110 [INITIAL_HOST=${withval}],
112 AC_SUBST([INITIAL_HOST])
115 # install Evergreen Apache modules?
116 AC_ARG_ENABLE([apache-modules],
117 [ --disable-apache-modules disables installation of the Evergreen Apache modules ],
118 [case "${enableval}" in
119 yes) build_apachemods=true ;;
120 no) build_apachemods=false ;;
121 *) AC_MSG_ERROR([please choose another value for --disable-apache-modules (supported values are yes or no])
123 [build_apachemods=true])
125 AM_CONDITIONAL([BUILDAPACHEMODS], [test x$build_apachemods = xtrue])
127 # build evergreen-reporter ?
129 AC_ARG_ENABLE([reporter],
130 [ --disable-reporter disables installation of the Evergreen reporter module ],
131 [case "${enableval}" in
132 yes) openils_reporter=true ;;
133 no) openils_reporter=false ;;
134 *) AC_MSG_ERROR([please choose another value for --disable-reporter (supported values are yes or no])
136 [openils_reporter=true])
138 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
140 # build evergreen-client ?
142 AC_ARG_ENABLE([client],
143 [ --disable-client disables installation of the Evergreen staff client ],
144 [case "${enableval}" in
145 yes) openils_client=true ;;
146 no) openils_client=false ;;
147 *) AC_MSG_ERROR([please choose another value for --disable-client (supported values are yes or no])
149 [openils_client=true])
151 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
154 # build evergreen java ?
156 AC_ARG_ENABLE([java],
157 [ --enable-java enables installation of the Evergreen Java components ],
158 [case "${enableval}" in
159 yes) evergreen_java=true ;;
160 no) evergreen_java=false ;;
161 *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no])
163 [evergreen_java=false])
165 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
168 # build the evergreen python modules?
170 AC_ARG_ENABLE([python],
171 [ --enable-python enables installation of the Evergreen Python modules ],
172 [case "${enableval}" in
173 yes) EG_PYTHON_INSTALL=true ;;
174 no) EG_PYTHON_INSTALL=false ;;
175 *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)])
177 [EG_PYTHON_INSTALL=false])
179 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
181 #-----------------------------------
182 # Check for dependencies
183 #-----------------------------------
184 AC_PATH_PROG([OSRF_CONFIG], [osrf_config])
185 if test "x$OSRF_CONFIG" == "x"; then
186 AC_MSG_ERROR([Could not find osrf_config.
187 Ensure OpenSRF is installed and that the PATH environment variable includes
188 the OpenSRF executables. For example: PATH=\$PATH:/openils/bin ./configure])
191 AC_ARG_WITH([opensrf-headers],
192 [ --with-opensrf-headers=path location of the OpenSRF header files],
193 [OPENSRF_HEADERS=${withval}],
194 [OPENSRF_HEADERS=`$OSRF_CONFIG --includedir`])
195 AC_SUBST([OPENSRF_HEADERS])
197 # We need this for JavaScript
198 AC_ARG_WITH([opensrf-libs],
199 [ --with-opensrf-libs=path location of the OpenSRF libraries],
200 [OPENSRF_LIBS=${withval}],
201 [OPENSRF_LIBS=`$OSRF_CONFIG --libdir`])
202 AC_SUBST([OPENSRF_LIBS])
205 [ --with-tmp=path location of the Evergreen temporary directory (default is /tmp) ],
211 [ --with-apxs=path location of the apxs Apache configuration tool (default is /usr/bin/apxs2)],
213 [APXS2=/usr/bin/apxs2])
215 # If the passed in value doesn't work, try some reasonable defaults
216 # Fedora puts the file in /usr/sbin/apxs, for example
217 if ! test -x "$APXS2"; then
218 for i in /usr/bin /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin ; do
219 for j in apxs apxs2 ; do
220 if test -x "$i/$j"; then
229 AC_ARG_WITH([libxml2],
230 [ --with-libxml2=path location of the libxml2 headers (default is /usr/include/libxml2)],
231 [LIBXML2_HEADERS=${withval}],
232 [LIBXML2_HEADERS=/usr/include/libxml2/])
233 AC_SUBST([LIBXML2_HEADERS])
236 [ --with-dbi=path location of the libdbi driver libraries (default is /usr/local/lib/dbd)],
237 [DBI_LIBS=${withval}],
238 [DBI_LIBS=/usr/local/lib/dbd/])
240 # If the passed in value doesn't work, fall back to reasonable defaults
241 # Distributions are starting to package a good version of libdbi / libdbd
242 if ! test -d "$DBI_LIBS"; then
243 for i in /usr/lib/dbd/ /usr/lib64/dbd /usr/local/lib/dbd/ ; do
244 if test -d "$i"; then
252 if test "x$openils_core" = "xtrue"; then
254 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
255 if test $MEMCACHED = "no"; then
256 AC_MSG_ERROR([*** memcached not found, aborting])
259 AC_CHECK_PROG([ASPELL],aspell,yes,no)
260 if test $ASPELL = "no"; then
261 AC_MSG_ERROR([*** aspell not found, aborting])
264 AC_CHECK_PROG([CPAN],cpan,yes,no)
265 if test $CPAN = "no"; then
266 AC_MSG_ERROR([*** cpan not found, aborting])
269 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
270 if test $YAZ = "no"; then
271 AC_MSG_ERROR([*** yaz not found, aborting])
274 AC_CHECK_PROG([PERL],perl,yes,no)
275 if test $PERL = "no"; then
276 AC_MSG_ERROR([*** perl not found, aborting])
279 #------------------------------------
280 # Checks for libraries.
281 #------------------------------------
283 # Check for the rest of the libraries
285 #check for dynamic linking functions
286 AC_CHECK_LIB(dl,dlopen)
288 #check for the libdbi library
289 AC_CHECK_LIB(dbi,dbi_initialize)
291 #to check for the availability and function of a particular
292 #driver we need a runtime check (since the driver is loaded
293 #dynamically). This example checks for the mysql driver
294 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
297 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
298 [AC_MSG_RESULT("yes")],
299 [AC_MSG_FAILURE("pgsql driver not installed?")])
301 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
302 AC_CHECK_LIB([ncurses], [main], [], AC_MSG_ERROR(*** OpenILS requires libncurses))
304 # IF the OpenSRF libs are installed in a non-standard location, such as
305 # /openils/lib, the compilation test will fail. Support that case.
306 LDFLAGS="-L$OPENSRF_LIBS"
308 AC_CHECK_LIB([opensrf], [osrfMessageFree], [], AC_MSG_ERROR(*** OpenILS requires libopensrf))
309 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
310 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
311 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
312 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
314 #------------------------------------
315 # Checks for header files.
316 #------------------------------------
319 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
321 #-------------------------------------------------------------------
322 # Checks for typedefs, structures, and compiler characteristics.
323 #-------------------------------------------------------------------
330 #-------------------------------------------------------------------
331 # Checks for library functions.
332 #-------------------------------------------------------------------
336 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
338 #----------------------------
339 # Create Makefiles/Output
340 #----------------------------
342 AC_CONFIG_FILES([Open-ILS/examples/Makefile
343 Open-ILS/src/c-apps/Makefile
344 Open-ILS/src/extras/Makefile
345 Open-ILS/src/java/Makefile
346 Open-ILS/src/python/Makefile])
349 if test "x$build_apachemods" = "xtrue"; then
351 #-----------------------------------
352 # Set install path variables
353 #-----------------------------------
355 #APACHE PREFORK DEV TEST
356 AC_MSG_CHECKING([APXS2])
357 if test -x "${APXS2}"; then
360 AC_MSG_ERROR([*** apxs not found in ${APXS2}, aborting])
363 AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
366 AC_CONFIG_FILES([Makefile
367 Open-ILS/src/Makefile
368 Open-ILS/src/perlmods/Makefile
369 Open-ILS/web/Makefile
370 Open-ILS/updates/Makefile
371 Open-ILS/xul/staff_client/Makefile
372 Open-ILS/src/extras/eg_config
375 if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
379 #-------------------------------------------------
381 #-------------------------------------------------
384 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
387 AC_MSG_RESULT([-------- Installation Options: --------])
388 if test "$openils_core" = "true" ; then
389 AC_MSG_RESULT([Evergreen Core: yes])
391 AC_MSG_RESULT([Evergreen Core: no])
393 if test "$build_apachemods" = "true" ; then
394 AC_MSG_RESULT([Evergreen Apache module: yes])
396 AC_MSG_RESULT([Evergreen Apache module: no])
398 if test "$openils_web" = "true" ; then
399 AC_MSG_RESULT([Evergreen Web: yes])
401 AC_MSG_RESULT([Evergreen Web: no])
403 if test "$openils_updates" = "true" ; then
404 AC_MSG_RESULT([Evergreen Updates: yes])
406 AC_MSG_RESULT([Evergreen Updates: no])
408 if test "$openils_reporter" = "true" ; then
409 AC_MSG_RESULT([Evergreen Reporter: yes])
411 AC_MSG_RESULT([Evergreen Reporter: no])
413 if test "$openils_client" = "true" ; then
414 AC_MSG_RESULT([Evergreen Staff Client: yes])
416 AC_MSG_RESULT([Evergreen Staff Client: no])
418 if test "$EG_PYTHON_INSTALL" = "true" ; then
419 AC_MSG_RESULT([Evergreen Python Components: yes])
421 AC_MSG_RESULT([Evergreen Python Components: no])
423 if test "$evergreen_java" = "true" ; then
424 AC_MSG_RESULT([Evergreen Java Components: yes])
426 AC_MSG_RESULT([Evergreen Java Components: no])
429 AC_MSG_RESULT([-------- Installation Directories --------])
430 AC_MSG_RESULT(Installation directory prefix: ${prefix})
431 AC_MSG_RESULT(Temporary directory: ${TMP})
432 AC_MSG_RESULT(APXS2 location: ${APXS2})
433 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
434 AC_MSG_RESULT(libdbi location: ${DBI_LIBS})
435 AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS})
436 AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS})
438 AC_MSG_RESULT([----------------------------------------------------------------------])