1 # Copyright (C) 2008 Equinox Software, Inc.
2 # Kevin Beswick <kevinbeswick00@gmail.com>
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
15 #---------------------------
17 #---------------------------
19 export PATH=${PATH}:/usr/sbin
21 AC_INIT(Open-ILS, trunk, open-ils-dev@list.georgialibraries.org)
22 AM_INIT_AUTOMAKE([OpenILS], [trunk])
23 AC_REVISION($Revision: 0.1 $)
24 AC_CONFIG_SRCDIR([configure.ac])
25 AC_PREFIX_DEFAULT([/openils/])
27 AC_SUBST([abs_top_builddir])
29 #-----------------------------------
30 # Checks for programs.
31 #-----------------------------------
41 #-----------------------------------
43 #-----------------------------------
45 # install openils-all?
46 #AC_ARG_ENABLE([openils-all],
47 #[ --enable-openils-all enables the installation of the default openils system (base system,web,staffclient) ],
48 #[case "${enableval}" in
49 # yes) openils_all=true;
52 # openils_reporter=true;
53 # openils_client_xul=true;
54 # openils_server_xul=true ;;
55 # no) openils_all=false ;;
56 # *) AC_MSG_ERROR([please choose another value for --enable-openils-all (supported values are yes or no])
60 # install evergreen-core?
62 [ --disable-core disables installation of the Evergreen core components ],
63 [case "${enableval}" in
64 yes) openils_core=true ;;
65 no) openils_core=false ;;
66 *) AC_MSG_ERROR([please choose another value for --disable-core (supported values are yes or no])
70 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
72 # install evergreen-web?
75 [ --disable-web disables installation of the Evergreen web modules ],
76 [case "${enableval}" in
77 yes) openils_web=true ;;
78 no) openils_web=false ;;
79 *) AC_MSG_ERROR([please choose another value for --disable-web (supported values are yes or no])
83 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
85 # install Evergreen Apache modules?
86 AC_ARG_ENABLE([apache-modules],
87 [ --disable-apache-modules disables installation of the Evergreen Apache modules ],
88 [case "${enableval}" in
89 yes) build_apachemods=true ;;
90 no) build_apachemods=false ;;
91 *) AC_MSG_ERROR([please choose another value for --disable-apache-modules (supported values are yes or no])
93 [build_apachemods=true])
95 AM_CONDITIONAL([BUILDAPACHEMODS], [test x$build_apachemods = xtrue])
97 # build evergreen-reporter ?
99 AC_ARG_ENABLE([reporter],
100 [ --disable-reporter disables installation of the Evergreen reporter module ],
101 [case "${enableval}" in
102 yes) openils_reporter=true ;;
103 no) openils_reporter=false ;;
104 *) AC_MSG_ERROR([please choose another value for --disable-reporter (supported values are yes or no])
106 [openils_reporter=true])
108 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
110 # build evergreen-client ?
112 AC_ARG_ENABLE([client],
113 [ --disable-client disables installation of the Evergreen staff client ],
114 [case "${enableval}" in
115 yes) openils_client=true ;;
116 no) openils_client=false ;;
117 *) AC_MSG_ERROR([please choose another value for --disable-client (supported values are yes or no])
119 [openils_client=true])
121 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
124 # build evergreen java ?
126 AC_ARG_ENABLE([java],
127 [ --enable-java enables installation of the Evergreen Java components ],
128 [case "${enableval}" in
129 yes) evergreen_java=true ;;
130 no) evergreen_java=false ;;
131 *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no])
133 [evergreen_java=false])
135 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
138 # build the evergreen python modules?
140 AC_ARG_ENABLE([python],
141 [ --enable-python enables installation of the Evergreen Python modules ],
142 [case "${enableval}" in
143 yes) EG_PYTHON_INSTALL=true ;;
144 no) EG_PYTHON_INSTALL=false ;;
145 *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)])
147 [EG_PYTHON_INSTALL=false])
149 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
151 #-----------------------------------
152 # Check for dependencies
153 #-----------------------------------
155 AC_ARG_WITH([opensrf-headers],
156 [ --with-opensrf-headers=path location of the OpenSRF header files (default is /openils/include/)],
157 [OPENSRF_HEADERS=${withval}],
158 [OPENSRF_HEADERS=/openils/include/])
159 AC_SUBST([OPENSRF_HEADERS])
161 # We need this for JavaScript
162 AC_ARG_WITH([opensrf-libs],
163 [ --with-opensrf-libs=path location of the OpenSRF libraries (default is /openils/lib/)],
164 [OPENSRF_LIBS=${withval}],
165 [OPENSRF_LIBS=/openils/lib/])
166 AC_SUBST([OPENSRF_LIBS])
169 [ --with-tmp=path location of the Evergreen temporary directory (default is /tmp) ],
175 [ --with-apxs=path location of the apxs Apache configuration tool (default is /usr/bin/apxs2)],
177 [APXS2=/usr/bin/apxs2])
179 # If the passed in value doesn't work, try some reasonable defaults
180 # Fedora puts the file in /usr/sbin/apxs, for example
181 if ! test -x "$APXS2"; then
182 for i in /usr/bin /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin ; do
183 for j in apxs apxs2 ; do
184 if test -x "$i/$j"; then
193 AC_ARG_WITH([apache],
194 [ --with-apache=path location of the Apache headers (default is /usr/include/apache2)],
195 [APACHE2_HEADERS=${withval}],
196 [APACHE2_HEADERS=/usr/include/apache2])
197 AC_SUBST([APACHE2_HEADERS])
200 [ --with-apr=path location of the Apache Portable Runtime (APR) headers (default is /usr/include/apr-1.0/)],
201 [APR_HEADERS=${withval}],
202 [APR_HEADERS=/usr/include/apr-1.0])
203 AC_SUBST([APR_HEADERS])
205 AC_ARG_WITH([libxml2],
206 [ --with-libxml2=path location of the libxml2 headers (default is /usr/include/libxml2)],
207 [LIBXML2_HEADERS=${withval}],
208 [LIBXML2_HEADERS=/usr/include/libxml2/])
209 AC_SUBST([LIBXML2_HEADERS])
212 [ --with-dbi=path location of the libdbi driver libraries (default is /usr/local/lib/dbd)],
213 [DBI_LIBS=${withval}],
214 [DBI_LIBS=/usr/local/lib/dbd/])
216 # If the passed in value doesn't work, fall back to reasonable defaults
217 # Distributions are starting to package a good version of libdbi / libdbd
218 if ! test -d "$DBI_LIBS"; then
219 for i in /usr/lib/dbd/ /usr/local/lib/dbd/ ; do
220 if test -d "$i"; then
228 if test "x$openils_core" = "xtrue"; then
230 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
231 if test $MEMCACHED = "no"; then
232 AC_MSG_ERROR([*** memcached not found, aborting])
235 AC_CHECK_PROG([ASPELL],aspell,yes,no)
236 if test $ASPELL = "no"; then
237 AC_MSG_ERROR([*** aspell not found, aborting])
240 AC_CHECK_PROG([CPAN],cpan,yes,no)
241 if test $CPAN = "no"; then
242 AC_MSG_ERROR([*** cpan not found, aborting])
245 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
246 if test $YAZ = "no"; then
247 AC_MSG_ERROR([*** yaz not found, aborting])
250 AC_CHECK_PROG([PERL],perl,yes,no)
251 if test $PERL = "no"; then
252 AC_MSG_ERROR([*** perl not found, aborting])
255 #------------------------------------
256 # Checks for libraries.
257 #------------------------------------
259 # Check for the existence of libraries in non-standard locations
261 AC_MSG_CHECKING(for -lopensrf)
262 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
265 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
268 # Check for the rest of the libraries
270 #check for dynamic linking functions
271 AC_CHECK_LIB(dl,dlopen)
273 #check for the libdbi library
274 AC_CHECK_LIB(dbi,dbi_initialize)
276 #to check for the availability and function of a particular
277 #driver we need a runtime check (since the driver is loaded
278 #dynamically). This example checks for the mysql driver
279 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
282 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
283 [AC_MSG_RESULT("yes")],
284 [AC_MSG_FAILURE("pgsql driver not installed?")])
286 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
287 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
288 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
289 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
290 AC_CHECK_LIB([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
291 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
294 #------------------------------------
295 # Checks for header files.
296 #------------------------------------
299 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
301 #-------------------------------------------------------------------
302 # Checks for typedefs, structures, and compiler characteristics.
303 #-------------------------------------------------------------------
310 #-------------------------------------------------------------------
311 # Checks for library functions.
312 #-------------------------------------------------------------------
316 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
318 #----------------------------
319 # Create Makefiles/Output
320 #----------------------------
322 AC_CONFIG_FILES([Open-ILS/examples/Makefile
323 Open-ILS/src/c-apps/Makefile
324 Open-ILS/src/extras/Makefile
325 Open-ILS/src/java/Makefile
326 Open-ILS/src/python/Makefile])
329 if test "x$build_apachemods" = "xtrue"; then
331 #-----------------------------------
332 # Set install path variables
333 #-----------------------------------
335 #APACHE PREFORK DEV TEST
336 AC_MSG_CHECKING([APXS2])
337 if test -x "${APXS2}"; then
340 AC_MSG_ERROR([*** apxs not found in ${APXS2}, aborting])
343 AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
346 AC_CONFIG_FILES([Makefile
347 Open-ILS/src/Makefile
348 Open-ILS/web/Makefile
349 Open-ILS/xul/staff_client/Makefile
350 Open-ILS/src/extras/eg_config
351 Open-ILS/src/extras/fast-extract],
353 if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
354 if test -e "./Open-ILS/src/extras/fast-extract"; then chmod 755 Open-ILS/src/extras/fast-extract; fi;
358 #-------------------------------------------------
360 #-------------------------------------------------
363 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
366 AC_MSG_RESULT([-------- Installation Options: --------])
367 if test "$openils_core" = "true" ; then
368 AC_MSG_RESULT([Evergreen Core: yes])
370 AC_MSG_RESULT([Evergreen Core: no])
372 if test "$build_apachemods" = "true" ; then
373 AC_MSG_RESULT([Evergreen Apache module: yes])
375 AC_MSG_RESULT([Evergreen Apache module: no])
377 if test "$openils_web" = "true" ; then
378 AC_MSG_RESULT([Evergreen Web: yes])
380 AC_MSG_RESULT([Evergreen Web: no])
382 if test "$openils_reporter" = "true" ; then
383 AC_MSG_RESULT([Evergreen Reporter: yes])
385 AC_MSG_RESULT([Evergreen Reporter: no])
387 if test "$openils_client" = "true" ; then
388 AC_MSG_RESULT([Evergreen Staff Client: yes])
390 AC_MSG_RESULT([Evergreen Staff Client: no])
392 if test "$EG_PYTHON_INSTALL" = "true" ; then
393 AC_MSG_RESULT([Evergreen Python Components: yes])
395 AC_MSG_RESULT([Evergreen Python Components: no])
397 if test "$evergreen_java" = "true" ; then
398 AC_MSG_RESULT([Evergreen Java Components: yes])
400 AC_MSG_RESULT([Evergreen Java Components: no])
403 AC_MSG_RESULT([-------- Installation Directories --------])
404 AC_MSG_RESULT(Installation directory prefix: ${prefix})
405 AC_MSG_RESULT(Temporary directory: ${TMP})
406 AC_MSG_RESULT(APXS2 location: ${APXS2})
407 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
408 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
409 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
410 AC_MSG_RESULT(libdbi location: ${DBI_LIBS})
411 AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS})
412 AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS})
414 AC_MSG_RESULT([----------------------------------------------------------------------])