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 #-----------------------------------
185 AC_ARG_WITH([opensrf-headers],
186 [ --with-opensrf-headers=path location of the OpenSRF header files],
187 [OPENSRF_HEADERS=${withval}],
188 [OPENSRF_HEADERS=`osrf_config --includedir`])
189 AC_SUBST([OPENSRF_HEADERS])
191 # We need this for JavaScript
192 AC_ARG_WITH([opensrf-libs],
193 [ --with-opensrf-libs=path location of the OpenSRF libraries],
194 [OPENSRF_LIBS=${withval}],
195 [OPENSRF_LIBS=`osrf_config --libdir`])
196 AC_SUBST([OPENSRF_LIBS])
199 [ --with-tmp=path location of the Evergreen temporary directory (default is /tmp) ],
205 [ --with-apxs=path location of the apxs Apache configuration tool (default is /usr/bin/apxs2)],
207 [APXS2=/usr/bin/apxs2])
209 # If the passed in value doesn't work, try some reasonable defaults
210 # Fedora puts the file in /usr/sbin/apxs, for example
211 if ! test -x "$APXS2"; then
212 for i in /usr/bin /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin ; do
213 for j in apxs apxs2 ; do
214 if test -x "$i/$j"; then
223 AC_ARG_WITH([apache],
224 [ --with-apache=path location of the Apache headers (default is /usr/include/apache2)],
225 [APACHE2_HEADERS=${withval}],
226 [APACHE2_HEADERS=/usr/include/apache2])
227 AC_SUBST([APACHE2_HEADERS])
230 [ --with-apr=path location of the Apache Portable Runtime (APR) headers (default is /usr/include/apr-1.0/)],
231 [APR_HEADERS=${withval}],
232 [APR_HEADERS=/usr/include/apr-1.0])
233 AC_SUBST([APR_HEADERS])
235 AC_ARG_WITH([libxml2],
236 [ --with-libxml2=path location of the libxml2 headers (default is /usr/include/libxml2)],
237 [LIBXML2_HEADERS=${withval}],
238 [LIBXML2_HEADERS=/usr/include/libxml2/])
239 AC_SUBST([LIBXML2_HEADERS])
242 [ --with-dbi=path location of the libdbi driver libraries (default is /usr/local/lib/dbd)],
243 [DBI_LIBS=${withval}],
244 [DBI_LIBS=/usr/local/lib/dbd/])
246 # If the passed in value doesn't work, fall back to reasonable defaults
247 # Distributions are starting to package a good version of libdbi / libdbd
248 if ! test -d "$DBI_LIBS"; then
249 for i in /usr/lib/dbd/ /usr/lib64/dbd /usr/local/lib/dbd/ ; do
250 if test -d "$i"; then
258 if test "x$openils_core" = "xtrue"; then
260 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
261 if test $MEMCACHED = "no"; then
262 AC_MSG_ERROR([*** memcached not found, aborting])
265 AC_CHECK_PROG([ASPELL],aspell,yes,no)
266 if test $ASPELL = "no"; then
267 AC_MSG_ERROR([*** aspell not found, aborting])
270 AC_CHECK_PROG([CPAN],cpan,yes,no)
271 if test $CPAN = "no"; then
272 AC_MSG_ERROR([*** cpan not found, aborting])
275 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
276 if test $YAZ = "no"; then
277 AC_MSG_ERROR([*** yaz not found, aborting])
280 AC_CHECK_PROG([PERL],perl,yes,no)
281 if test $PERL = "no"; then
282 AC_MSG_ERROR([*** perl not found, aborting])
285 #------------------------------------
286 # Checks for libraries.
287 #------------------------------------
289 # Check for the rest of the libraries
291 #check for dynamic linking functions
292 AC_CHECK_LIB(dl,dlopen)
294 #check for the libdbi library
295 AC_CHECK_LIB(dbi,dbi_initialize)
297 #to check for the availability and function of a particular
298 #driver we need a runtime check (since the driver is loaded
299 #dynamically). This example checks for the mysql driver
300 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
303 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
304 [AC_MSG_RESULT("yes")],
305 [AC_MSG_FAILURE("pgsql driver not installed?")])
307 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
308 AC_CHECK_LIB([ncurses], [main], [], AC_MSG_ERROR(*** OpenILS requires libncurses))
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/extras/Makefile
346 Open-ILS/src/java/Makefile
347 Open-ILS/src/python/Makefile])
350 if test "x$build_apachemods" = "xtrue"; then
352 #-----------------------------------
353 # Set install path variables
354 #-----------------------------------
356 #APACHE PREFORK DEV TEST
357 AC_MSG_CHECKING([APXS2])
358 if test -x "${APXS2}"; then
361 AC_MSG_ERROR([*** apxs not found in ${APXS2}, aborting])
364 AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
367 AC_CONFIG_FILES([Makefile
368 Open-ILS/src/Makefile
369 Open-ILS/src/perlmods/Makefile
370 Open-ILS/web/Makefile
371 Open-ILS/updates/Makefile
372 Open-ILS/xul/staff_client/Makefile
373 Open-ILS/src/extras/eg_config
376 if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
380 #-------------------------------------------------
382 #-------------------------------------------------
385 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
388 AC_MSG_RESULT([-------- Installation Options: --------])
389 if test "$openils_core" = "true" ; then
390 AC_MSG_RESULT([Evergreen Core: yes])
392 AC_MSG_RESULT([Evergreen Core: no])
394 if test "$build_apachemods" = "true" ; then
395 AC_MSG_RESULT([Evergreen Apache module: yes])
397 AC_MSG_RESULT([Evergreen Apache module: no])
399 if test "$openils_web" = "true" ; then
400 AC_MSG_RESULT([Evergreen Web: yes])
402 AC_MSG_RESULT([Evergreen Web: no])
404 if test "$openils_updates" = "true" ; then
405 AC_MSG_RESULT([Evergreen Updates: yes])
407 AC_MSG_RESULT([Evergreen Updates: no])
409 if test "$openils_reporter" = "true" ; then
410 AC_MSG_RESULT([Evergreen Reporter: yes])
412 AC_MSG_RESULT([Evergreen Reporter: no])
414 if test "$openils_client" = "true" ; then
415 AC_MSG_RESULT([Evergreen Staff Client: yes])
417 AC_MSG_RESULT([Evergreen Staff Client: no])
419 if test "$EG_PYTHON_INSTALL" = "true" ; then
420 AC_MSG_RESULT([Evergreen Python Components: yes])
422 AC_MSG_RESULT([Evergreen Python Components: no])
424 if test "$evergreen_java" = "true" ; then
425 AC_MSG_RESULT([Evergreen Java Components: yes])
427 AC_MSG_RESULT([Evergreen Java Components: no])
430 AC_MSG_RESULT([-------- Installation Directories --------])
431 AC_MSG_RESULT(Installation directory prefix: ${prefix})
432 AC_MSG_RESULT(Temporary directory: ${TMP})
433 AC_MSG_RESULT(APXS2 location: ${APXS2})
434 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
435 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
436 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
437 AC_MSG_RESULT(libdbi location: ${DBI_LIBS})
438 AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS})
439 AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS})
441 AC_MSG_RESULT([----------------------------------------------------------------------])