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_CONFIG_SUBDIRS([Open-ILS/xul/staff_client/external/libmar])
29 AC_SUBST([abs_top_builddir])
30 #-----------------------------------
31 # Checks for programs.
32 #-----------------------------------
43 #-----------------------------------
45 #-----------------------------------
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;
54 # openils_updates=true;
55 # openils_reporter=true;
56 # openils_client_xul=true;
57 # openils_server_xul=true ;;
58 # no) openils_all=false ;;
59 # *) AC_MSG_ERROR([please choose another value for --enable-openils-all (supported values are yes or no])
63 # install evergreen-core?
65 [ --disable-core disables installation of the Evergreen core components ],
66 [case "${enableval}" in
67 yes) openils_core=true ;;
68 no) openils_core=false ;;
69 *) AC_MSG_ERROR([please choose another value for --disable-core (supported values are yes or no])
73 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
75 # install evergreen-web?
78 [ --disable-web disables installation of the Evergreen web modules ],
79 [case "${enableval}" in
80 yes) openils_web=true ;;
81 no) openils_web=false ;;
82 *) AC_MSG_ERROR([please choose another value for --disable-web (supported values are yes or no])
86 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
88 # install evergreen-updates?
90 AC_ARG_ENABLE([updates],
91 [ --disable-updates disables installation of the Evergreen updates folder ],
92 [case "${enableval}" in
93 yes) openils_updates=true ;;
94 no) openils_updates=false ;;
95 *) AC_MSG_ERROR([please choose another value for --disable-updates (supported values are yes or no])
97 [openils_updates=true])
99 AM_CONDITIONAL([BUILDILSUPDATES], [test x$openils_updates = xtrue])
101 # Default updates host?
102 AC_ARG_WITH([updateshost],
103 [ --with-updateshost=hostname default hostname for automatic updates (default is blank)],
104 [AUTOUPDATE_HOST=${withval}],
106 AC_SUBST([AUTOUPDATE_HOST])
108 # Default updates host?
109 AC_ARG_WITH([initialhost],
110 [ --with-initialhost=hostname default hostname for staff client (default is blank)],
111 [INITIAL_HOST=${withval}],
113 AC_SUBST([INITIAL_HOST])
116 # install Evergreen Apache modules?
117 AC_ARG_ENABLE([apache-modules],
118 [ --disable-apache-modules disables installation of the Evergreen Apache modules ],
119 [case "${enableval}" in
120 yes) build_apachemods=true ;;
121 no) build_apachemods=false ;;
122 *) AC_MSG_ERROR([please choose another value for --disable-apache-modules (supported values are yes or no])
124 [build_apachemods=true])
126 AM_CONDITIONAL([BUILDAPACHEMODS], [test x$build_apachemods = xtrue])
128 # build evergreen-reporter ?
130 AC_ARG_ENABLE([reporter],
131 [ --disable-reporter disables installation of the Evergreen reporter module ],
132 [case "${enableval}" in
133 yes) openils_reporter=true ;;
134 no) openils_reporter=false ;;
135 *) AC_MSG_ERROR([please choose another value for --disable-reporter (supported values are yes or no])
137 [openils_reporter=true])
139 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
141 # build evergreen-client ?
143 AC_ARG_ENABLE([client],
144 [ --disable-client disables installation of the Evergreen staff client ],
145 [case "${enableval}" in
146 yes) openils_client=true ;;
147 no) openils_client=false ;;
148 *) AC_MSG_ERROR([please choose another value for --disable-client (supported values are yes or no])
150 [openils_client=true])
152 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
155 # build evergreen java ?
157 AC_ARG_ENABLE([java],
158 [ --enable-java enables installation of the Evergreen Java components ],
159 [case "${enableval}" in
160 yes) evergreen_java=true ;;
161 no) evergreen_java=false ;;
162 *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no])
164 [evergreen_java=false])
166 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
169 # build the evergreen python modules?
171 AC_ARG_ENABLE([python],
172 [ --enable-python enables installation of the Evergreen Python modules ],
173 [case "${enableval}" in
174 yes) EG_PYTHON_INSTALL=true ;;
175 no) EG_PYTHON_INSTALL=false ;;
176 *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)])
178 [EG_PYTHON_INSTALL=false])
180 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
182 #-----------------------------------
183 # Check for dependencies
184 #-----------------------------------
185 AC_PATH_PROG([OSRF_CONFIG], [osrf_config])
186 if test "x$OSRF_CONFIG" == "x"; then
187 AC_MSG_ERROR([Could not find osrf_config.
188 Ensure OpenSRF is installed and that the PATH environment variable includes
189 the OpenSRF executables. For example: PATH=\$PATH:/openils/bin ./configure])
192 AC_ARG_WITH([opensrf-headers],
193 [ --with-opensrf-headers=path location of the OpenSRF header files],
194 [OPENSRF_HEADERS=${withval}],
195 [OPENSRF_HEADERS=`$OSRF_CONFIG --includedir`])
196 AC_SUBST([OPENSRF_HEADERS])
198 # We need this for JavaScript
199 AC_ARG_WITH([opensrf-libs],
200 [ --with-opensrf-libs=path location of the OpenSRF libraries],
201 [OPENSRF_LIBS=${withval}],
202 [OPENSRF_LIBS=`$OSRF_CONFIG --libdir`])
203 AC_SUBST([OPENSRF_LIBS])
206 [ --with-tmp=path location of the Evergreen temporary directory (default is /tmp) ],
212 [ --with-apxs=path location of the apxs Apache configuration tool (default is /usr/bin/apxs2)],
214 [APXS2=/usr/bin/apxs2])
216 # If the passed in value doesn't work, try some reasonable defaults
217 # Fedora puts the file in /usr/sbin/apxs, for example
218 if ! test -x "$APXS2"; then
219 for i in /usr/bin /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin ; do
220 for j in apxs apxs2 ; do
221 if test -x "$i/$j"; then
230 AC_ARG_WITH([libxml2],
231 [ --with-libxml2=path location of the libxml2 headers (default is /usr/include/libxml2)],
232 [LIBXML2_HEADERS=${withval}],
233 [LIBXML2_HEADERS=/usr/include/libxml2/])
234 AC_SUBST([LIBXML2_HEADERS])
237 [ --with-dbi=path location of the libdbi driver libraries (default is /usr/local/lib/dbd)],
238 [DBI_LIBS=${withval}],
239 [DBI_LIBS=/usr/local/lib/dbd/])
241 # If the passed in value doesn't work, fall back to reasonable defaults
242 # Distributions are starting to package a good version of libdbi / libdbd
243 if ! test -d "$DBI_LIBS"; then
244 for i in /usr/lib/dbd/ /usr/lib64/dbd /usr/local/lib/dbd/ ; do
245 if test -d "$i"; then
253 if test "x$openils_core" = "xtrue"; then
255 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
256 if test $MEMCACHED = "no"; then
257 AC_MSG_ERROR([*** memcached not found, aborting])
260 AC_CHECK_PROG([ASPELL],aspell,yes,no)
261 if test $ASPELL = "no"; then
262 AC_MSG_ERROR([*** aspell not found, aborting])
265 AC_CHECK_PROG([CPAN],cpan,yes,no)
266 if test $CPAN = "no"; then
267 AC_MSG_ERROR([*** cpan not found, aborting])
270 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
271 if test $YAZ = "no"; then
272 AC_MSG_ERROR([*** yaz not found, aborting])
275 AC_CHECK_PROG([PERL],perl,yes,no)
276 if test $PERL = "no"; then
277 AC_MSG_ERROR([*** perl not found, aborting])
280 #------------------------------------
281 # Checks for libraries.
282 #------------------------------------
284 # Check for the rest of the libraries
286 #check for dynamic linking functions
287 AC_CHECK_LIB(dl,dlopen)
289 #check for the libdbi library
290 AC_CHECK_LIB(dbi,dbi_initialize)
292 #to check for the availability and function of a particular
293 #driver we need a runtime check (since the driver is loaded
294 #dynamically). This example checks for the mysql driver
295 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
298 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
299 [AC_MSG_RESULT("yes")],
300 [AC_MSG_FAILURE("pgsql driver not installed?")])
302 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
303 AC_CHECK_LIB([ncurses], [main], [], AC_MSG_ERROR(*** OpenILS requires libncurses))
305 # IF the OpenSRF libs are installed in a non-standard location, such as
306 # /openils/lib, the compilation test will fail. Support that case.
307 LDFLAGS="-L$OPENSRF_LIBS"
309 AC_CHECK_LIB([opensrf], [osrfMessageFree], [], AC_MSG_ERROR(*** OpenILS requires libopensrf))
310 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
311 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
312 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
313 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
315 #------------------------------------
316 # Checks for header files.
317 #------------------------------------
320 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
322 #-------------------------------------------------------------------
323 # Checks for typedefs, structures, and compiler characteristics.
324 #-------------------------------------------------------------------
331 #-------------------------------------------------------------------
332 # Checks for library functions.
333 #-------------------------------------------------------------------
337 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
339 #----------------------------
340 # Create Makefiles/Output
341 #----------------------------
343 AC_CONFIG_FILES([Open-ILS/examples/Makefile
344 Open-ILS/src/c-apps/Makefile
345 Open-ILS/src/c-apps/tests/Makefile
346 Open-ILS/src/extras/Makefile
347 Open-ILS/src/java/Makefile
348 Open-ILS/src/python/Makefile])
351 if test "x$build_apachemods" = "xtrue"; then
353 #-----------------------------------
354 # Set install path variables
355 #-----------------------------------
357 #APACHE PREFORK DEV TEST
358 AC_MSG_CHECKING([APXS2])
359 if test -x "${APXS2}"; then
362 AC_MSG_ERROR([*** apxs not found in ${APXS2}, aborting])
365 AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
368 AC_CONFIG_FILES([Makefile
369 Open-ILS/src/Makefile
370 Open-ILS/src/perlmods/Makefile
371 Open-ILS/web/Makefile
372 Open-ILS/updates/Makefile
373 Open-ILS/xul/staff_client/Makefile
374 Open-ILS/src/extras/eg_config
377 if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
381 #-------------------------------------------------
383 #-------------------------------------------------
386 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
389 AC_MSG_RESULT([-------- Installation Options: --------])
390 if test "$openils_core" = "true" ; then
391 AC_MSG_RESULT([Evergreen Core: yes])
393 AC_MSG_RESULT([Evergreen Core: no])
395 if test "$build_apachemods" = "true" ; then
396 AC_MSG_RESULT([Evergreen Apache module: yes])
398 AC_MSG_RESULT([Evergreen Apache module: no])
400 if test "$openils_web" = "true" ; then
401 AC_MSG_RESULT([Evergreen Web: yes])
403 AC_MSG_RESULT([Evergreen Web: no])
405 if test "$openils_updates" = "true" ; then
406 AC_MSG_RESULT([Evergreen Updates: yes])
408 AC_MSG_RESULT([Evergreen Updates: no])
410 if test "$openils_reporter" = "true" ; then
411 AC_MSG_RESULT([Evergreen Reporter: yes])
413 AC_MSG_RESULT([Evergreen Reporter: no])
415 if test "$openils_client" = "true" ; then
416 AC_MSG_RESULT([Evergreen Staff Client: yes])
418 AC_MSG_RESULT([Evergreen Staff Client: no])
420 if test "$EG_PYTHON_INSTALL" = "true" ; then
421 AC_MSG_RESULT([Evergreen Python Components: yes])
423 AC_MSG_RESULT([Evergreen Python Components: no])
425 if test "$evergreen_java" = "true" ; then
426 AC_MSG_RESULT([Evergreen Java Components: yes])
428 AC_MSG_RESULT([Evergreen Java Components: no])
431 AC_MSG_RESULT([-------- Installation Directories --------])
432 AC_MSG_RESULT(Installation directory prefix: ${prefix})
433 AC_MSG_RESULT(Temporary directory: ${TMP})
434 AC_MSG_RESULT(APXS2 location: ${APXS2})
435 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
436 AC_MSG_RESULT(libdbi location: ${DBI_LIBS})
437 AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS})
438 AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS})
440 AC_MSG_RESULT([----------------------------------------------------------------------])