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 #-----------------------------------
44 #-----------------------------------
46 #-----------------------------------
48 # install openils-all?
49 #AC_ARG_ENABLE([openils-all],
50 #[ --enable-openils-all enables the installation of the default openils system (base system,web,staffclient) ],
51 #[case "${enableval}" in
52 # yes) openils_all=true;
55 # openils_updates=true;
56 # openils_reporter=true;
57 # openils_client_xul=true;
58 # openils_server_xul=true ;;
59 # no) openils_all=false ;;
60 # *) AC_MSG_ERROR([please choose another value for --enable-openils-all (supported values are yes or no])
64 # install evergreen-core?
66 [ --disable-core disables installation of the Evergreen core components ],
67 [case "${enableval}" in
68 yes) openils_core=true ;;
69 no) openils_core=false ;;
70 *) AC_MSG_ERROR([please choose another value for --disable-core (supported values are yes or no])
74 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
76 # install evergreen-web?
79 [ --disable-web disables installation of the Evergreen web modules ],
80 [case "${enableval}" in
81 yes) openils_web=true ;;
82 no) openils_web=false ;;
83 *) AC_MSG_ERROR([please choose another value for --disable-web (supported values are yes or no])
87 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
89 # install evergreen-updates?
91 AC_ARG_ENABLE([updates],
92 [ --disable-updates disables installation of the Evergreen updates folder ],
93 [case "${enableval}" in
94 yes) openils_updates=true ;;
95 no) openils_updates=false ;;
96 *) AC_MSG_ERROR([please choose another value for --disable-updates (supported values are yes or no])
98 [openils_updates=true])
100 AM_CONDITIONAL([BUILDILSUPDATES], [test x$openils_updates = xtrue])
102 # Default updates host?
103 AC_ARG_WITH([updateshost],
104 [ --with-updateshost=hostname default hostname for automatic updates (default is blank)],
105 [AUTOUPDATE_HOST=${withval}],
107 AC_SUBST([AUTOUPDATE_HOST])
109 # Default updates host?
110 AC_ARG_WITH([initialhost],
111 [ --with-initialhost=hostname default hostname for staff client (default is blank)],
112 [INITIAL_HOST=${withval}],
114 AC_SUBST([INITIAL_HOST])
117 # install Evergreen Apache modules?
118 AC_ARG_ENABLE([apache-modules],
119 [ --disable-apache-modules disables installation of the Evergreen Apache modules ],
120 [case "${enableval}" in
121 yes) build_apachemods=true ;;
122 no) build_apachemods=false ;;
123 *) AC_MSG_ERROR([please choose another value for --disable-apache-modules (supported values are yes or no])
125 [build_apachemods=true])
127 AM_CONDITIONAL([BUILDAPACHEMODS], [test x$build_apachemods = xtrue])
129 # build evergreen-reporter ?
131 AC_ARG_ENABLE([reporter],
132 [ --disable-reporter disables installation of the Evergreen reporter module ],
133 [case "${enableval}" in
134 yes) openils_reporter=true ;;
135 no) openils_reporter=false ;;
136 *) AC_MSG_ERROR([please choose another value for --disable-reporter (supported values are yes or no])
138 [openils_reporter=true])
140 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
142 # build evergreen-client ?
144 AC_ARG_ENABLE([client],
145 [ --disable-client disables installation of the Evergreen staff client ],
146 [case "${enableval}" in
147 yes) openils_client=true ;;
148 no) openils_client=false ;;
149 *) AC_MSG_ERROR([please choose another value for --disable-client (supported values are yes or no])
151 [openils_client=true])
153 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
156 # build evergreen java ?
158 AC_ARG_ENABLE([java],
159 [ --enable-java enables installation of the Evergreen Java components ],
160 [case "${enableval}" in
161 yes) evergreen_java=true ;;
162 no) evergreen_java=false ;;
163 *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no])
165 [evergreen_java=false])
167 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
170 # build the evergreen python modules?
172 AC_ARG_ENABLE([python],
173 [ --enable-python enables installation of the Evergreen Python modules ],
174 [case "${enableval}" in
175 yes) EG_PYTHON_INSTALL=true ;;
176 no) EG_PYTHON_INSTALL=false ;;
177 *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)])
179 [EG_PYTHON_INSTALL=false])
181 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
183 #-----------------------------------
184 # Check for dependencies
185 #-----------------------------------
187 AC_ARG_WITH([opensrf-headers],
188 [ --with-opensrf-headers=path location of the OpenSRF header files (default is /openils/include/)],
189 [OPENSRF_HEADERS=${withval}],
190 [OPENSRF_HEADERS=/openils/include/])
191 AC_SUBST([OPENSRF_HEADERS])
193 # We need this for JavaScript
194 AC_ARG_WITH([opensrf-libs],
195 [ --with-opensrf-libs=path location of the OpenSRF libraries (default is /openils/lib/)],
196 [OPENSRF_LIBS=${withval}],
197 [OPENSRF_LIBS=/openils/lib/])
198 AC_SUBST([OPENSRF_LIBS])
201 [ --with-tmp=path location of the Evergreen temporary directory (default is /tmp) ],
207 [ --with-apxs=path location of the apxs Apache configuration tool (default is /usr/bin/apxs2)],
209 [APXS2=/usr/bin/apxs2])
211 # If the passed in value doesn't work, try some reasonable defaults
212 # Fedora puts the file in /usr/sbin/apxs, for example
213 if ! test -x "$APXS2"; then
214 for i in /usr/bin /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin ; do
215 for j in apxs apxs2 ; do
216 if test -x "$i/$j"; then
225 AC_ARG_WITH([apache],
226 [ --with-apache=path location of the Apache headers (default is /usr/include/apache2)],
227 [APACHE2_HEADERS=${withval}],
228 [APACHE2_HEADERS=/usr/include/apache2])
229 AC_SUBST([APACHE2_HEADERS])
232 [ --with-apr=path location of the Apache Portable Runtime (APR) headers (default is /usr/include/apr-1.0/)],
233 [APR_HEADERS=${withval}],
234 [APR_HEADERS=/usr/include/apr-1.0])
235 AC_SUBST([APR_HEADERS])
237 AC_ARG_WITH([libxml2],
238 [ --with-libxml2=path location of the libxml2 headers (default is /usr/include/libxml2)],
239 [LIBXML2_HEADERS=${withval}],
240 [LIBXML2_HEADERS=/usr/include/libxml2/])
241 AC_SUBST([LIBXML2_HEADERS])
244 [ --with-dbi=path location of the libdbi driver libraries (default is /usr/local/lib/dbd)],
245 [DBI_LIBS=${withval}],
246 [DBI_LIBS=/usr/local/lib/dbd/])
248 # If the passed in value doesn't work, fall back to reasonable defaults
249 # Distributions are starting to package a good version of libdbi / libdbd
250 if ! test -d "$DBI_LIBS"; then
251 for i in /usr/lib/dbd/ /usr/lib64/dbd /usr/local/lib/dbd/ ; do
252 if test -d "$i"; then
260 if test "x$openils_core" = "xtrue"; then
262 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
263 if test $MEMCACHED = "no"; then
264 AC_MSG_ERROR([*** memcached not found, aborting])
267 AC_CHECK_PROG([ASPELL],aspell,yes,no)
268 if test $ASPELL = "no"; then
269 AC_MSG_ERROR([*** aspell not found, aborting])
272 AC_CHECK_PROG([CPAN],cpan,yes,no)
273 if test $CPAN = "no"; then
274 AC_MSG_ERROR([*** cpan not found, aborting])
277 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
278 if test $YAZ = "no"; then
279 AC_MSG_ERROR([*** yaz not found, aborting])
282 AC_CHECK_PROG([PERL],perl,yes,no)
283 if test $PERL = "no"; then
284 AC_MSG_ERROR([*** perl not found, aborting])
287 #------------------------------------
288 # Checks for libraries.
289 #------------------------------------
291 # Check for the existence of libraries in non-standard locations
293 AC_MSG_CHECKING(for -lopensrf)
294 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
297 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
300 # Check for the rest of the libraries
302 #check for dynamic linking functions
303 AC_CHECK_LIB(dl,dlopen)
305 #check for the libdbi library
306 AC_CHECK_LIB(dbi,dbi_initialize)
308 #to check for the availability and function of a particular
309 #driver we need a runtime check (since the driver is loaded
310 #dynamically). This example checks for the mysql driver
311 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
314 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
315 [AC_MSG_RESULT("yes")],
316 [AC_MSG_FAILURE("pgsql driver not installed?")])
318 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
319 AC_CHECK_LIB([ncurses], [main], [], AC_MSG_ERROR(*** OpenILS requires libncurses))
320 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
321 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
322 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
323 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
326 #------------------------------------
327 # Checks for header files.
328 #------------------------------------
331 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
333 #-------------------------------------------------------------------
334 # Checks for typedefs, structures, and compiler characteristics.
335 #-------------------------------------------------------------------
342 #-------------------------------------------------------------------
343 # Checks for library functions.
344 #-------------------------------------------------------------------
348 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
350 #----------------------------
351 # Create Makefiles/Output
352 #----------------------------
354 AC_CONFIG_FILES([Open-ILS/examples/Makefile
355 Open-ILS/src/c-apps/Makefile
356 Open-ILS/src/extras/Makefile
357 Open-ILS/src/java/Makefile
358 Open-ILS/src/python/Makefile])
361 if test "x$build_apachemods" = "xtrue"; then
363 #-----------------------------------
364 # Set install path variables
365 #-----------------------------------
367 #APACHE PREFORK DEV TEST
368 AC_MSG_CHECKING([APXS2])
369 if test -x "${APXS2}"; then
372 AC_MSG_ERROR([*** apxs not found in ${APXS2}, aborting])
375 AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
378 AC_CONFIG_FILES([Makefile
379 Open-ILS/src/Makefile
380 Open-ILS/src/perlmods/Makefile
381 Open-ILS/web/Makefile
382 Open-ILS/updates/Makefile
383 Open-ILS/xul/staff_client/Makefile
384 Open-ILS/src/extras/eg_config
387 if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
391 #-------------------------------------------------
393 #-------------------------------------------------
396 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
399 AC_MSG_RESULT([-------- Installation Options: --------])
400 if test "$openils_core" = "true" ; then
401 AC_MSG_RESULT([Evergreen Core: yes])
403 AC_MSG_RESULT([Evergreen Core: no])
405 if test "$build_apachemods" = "true" ; then
406 AC_MSG_RESULT([Evergreen Apache module: yes])
408 AC_MSG_RESULT([Evergreen Apache module: no])
410 if test "$openils_web" = "true" ; then
411 AC_MSG_RESULT([Evergreen Web: yes])
413 AC_MSG_RESULT([Evergreen Web: no])
415 if test "$openils_updates" = "true" ; then
416 AC_MSG_RESULT([Evergreen Updates: yes])
418 AC_MSG_RESULT([Evergreen Updates: no])
420 if test "$openils_reporter" = "true" ; then
421 AC_MSG_RESULT([Evergreen Reporter: yes])
423 AC_MSG_RESULT([Evergreen Reporter: no])
425 if test "$openils_client" = "true" ; then
426 AC_MSG_RESULT([Evergreen Staff Client: yes])
428 AC_MSG_RESULT([Evergreen Staff Client: no])
430 if test "$EG_PYTHON_INSTALL" = "true" ; then
431 AC_MSG_RESULT([Evergreen Python Components: yes])
433 AC_MSG_RESULT([Evergreen Python Components: no])
435 if test "$evergreen_java" = "true" ; then
436 AC_MSG_RESULT([Evergreen Java Components: yes])
438 AC_MSG_RESULT([Evergreen Java Components: no])
441 AC_MSG_RESULT([-------- Installation Directories --------])
442 AC_MSG_RESULT(Installation directory prefix: ${prefix})
443 AC_MSG_RESULT(Temporary directory: ${TMP})
444 AC_MSG_RESULT(APXS2 location: ${APXS2})
445 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
446 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
447 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
448 AC_MSG_RESULT(libdbi location: ${DBI_LIBS})
449 AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS})
450 AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS})
452 AC_MSG_RESULT([----------------------------------------------------------------------])