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 #-----------------------------------
40 #-----------------------------------
42 #-----------------------------------
44 # install openils-all?
45 #AC_ARG_ENABLE([openils-all],
46 #[ --enable-openils-all enables the installation of the default openils system (base system,web,staffclient) ],
47 #[case "${enableval}" in
48 # yes) openils_all=true;
51 # openils_reporter=true;
52 # openils_client_xul=true;
53 # openils_server_xul=true ;;
54 # no) openils_all=false ;;
55 # *) AC_MSG_ERROR([please choose another value for --enable-openils-all (supported values are yes or no])
59 # install evergreen-core?
61 [ --disable-core disables installation of the Evergreen core components ],
62 [case "${enableval}" in
63 yes) openils_core=true ;;
64 no) openils_core=false ;;
65 *) AC_MSG_ERROR([please choose another value for --disable-core (supported values are yes or no])
69 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
71 # install evergreen-web?
74 [ --disable-web disables installation of the Evergreen web modules ],
75 [case "${enableval}" in
76 yes) openils_web=true ;;
77 no) openils_web=false ;;
78 *) AC_MSG_ERROR([please choose another value for --disable-web (supported values are yes or no])
82 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
84 # install Evergreen Apache modules?
85 AC_ARG_ENABLE([apache-modules],
86 [ --disable-apache-modules disables installation of the Evergreen Apache modules ],
87 [case "${enableval}" in
88 yes) build_apachemods=true ;;
89 no) build_apachemods=false ;;
90 *) AC_MSG_ERROR([please choose another value for --disable-apache-modules (supported values are yes or no])
92 [build_apachemods=true])
94 AM_CONDITIONAL([BUILDAPACHEMODS], [test x$build_apachemods = xtrue])
96 # build evergreen-reporter ?
98 AC_ARG_ENABLE([reporter],
99 [ --disable-reporter disables installation of the Evergreen reporter module ],
100 [case "${enableval}" in
101 yes) openils_reporter=true ;;
102 no) openils_reporter=false ;;
103 *) AC_MSG_ERROR([please choose another value for --disable-reporter (supported values are yes or no])
105 [openils_reporter=true])
107 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
109 # build evergreen-client ?
111 AC_ARG_ENABLE([client],
112 [ --disable-client disables installation of the Evergreen staff client ],
113 [case "${enableval}" in
114 yes) openils_client=true ;;
115 no) openils_client=false ;;
116 *) AC_MSG_ERROR([please choose another value for --disable-client (supported values are yes or no])
118 [openils_client=true])
120 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
123 # build evergreen java ?
125 AC_ARG_ENABLE([java],
126 [ --enable-java enables installation of the Evergreen Java components ],
127 [case "${enableval}" in
128 yes) evergreen_java=true ;;
129 no) evergreen_java=false ;;
130 *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no])
132 [evergreen_java=false])
134 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
137 # build the evergreen python modules?
139 AC_ARG_ENABLE([python],
140 [ --enable-python enables installation of the Evergreen Python modules ],
141 [case "${enableval}" in
142 yes) EG_PYTHON_INSTALL=true ;;
143 no) EG_PYTHON_INSTALL=false ;;
144 *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)])
146 [EG_PYTHON_INSTALL=false])
148 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
150 #-----------------------------------
151 # Check for dependencies
152 #-----------------------------------
154 AC_ARG_WITH([opensrf-headers],
155 [ --with-opensrf-headers=path location of the OpenSRF header files (default is /openils/include/)],
156 [OPENSRF_HEADERS=${withval}],
157 [OPENSRF_HEADERS=/openils/include/])
158 AC_SUBST([OPENSRF_HEADERS])
160 # We need this for JavaScript
161 AC_ARG_WITH([opensrf-libs],
162 [ --with-opensrf-libs=path location of the OpenSRF libraries (default is /openils/lib/)],
163 [OPENSRF_LIBS=${withval}],
164 [OPENSRF_LIBS=/openils/lib/])
165 AC_SUBST([OPENSRF_LIBS])
168 [ --with-tmp=path location of the Evergreen temporary directory (default is /tmp) ],
174 [ --with-apxs=path location of the apxs Apache configuration tool (default is /usr/bin/apxs2)],
176 [APXS2=/usr/bin/apxs2])
178 # If the passed in value doesn't work, try some reasonable defaults
179 # Fedora puts the file in /usr/sbin/apxs, for example
180 if ! test -x "$APXS2"; then
181 for i in /usr/bin /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin ; do
182 for j in apxs apxs2 ; do
183 if test -x "$i/$j"; then
192 AC_ARG_WITH([apache],
193 [ --with-apache=path location of the Apache headers (default is /usr/include/apache2)],
194 [APACHE2_HEADERS=${withval}],
195 [APACHE2_HEADERS=/usr/include/apache2])
196 AC_SUBST([APACHE2_HEADERS])
199 [ --with-apr=path location of the Apache Portable Runtime (APR) headers (default is /usr/include/apr-1.0/)],
200 [APR_HEADERS=${withval}],
201 [APR_HEADERS=/usr/include/apr-1.0])
202 AC_SUBST([APR_HEADERS])
204 AC_ARG_WITH([libxml2],
205 [ --with-libxml2=path location of the libxml2 headers (default is /usr/include/libxml2)],
206 [LIBXML2_HEADERS=${withval}],
207 [LIBXML2_HEADERS=/usr/include/libxml2/])
208 AC_SUBST([LIBXML2_HEADERS])
211 [ --with-dbi=path location of the libdbi driver libraries (default is /usr/local/lib/dbd)],
212 [DBI_LIBS=${withval}],
213 [DBI_LIBS=/usr/local/lib/dbd/])
215 # If the passed in value doesn't work, fall back to reasonable defaults
216 # Distributions are starting to package a good version of libdbi / libdbd
217 if ! test -d "$DBI_LIBS"; then
218 for i in /usr/lib/dbd/ /usr/local/lib/dbd/ ; do
219 if test -d "$i"; then
227 if test "x$openils_core" = "xtrue"; then
229 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
230 if test $MEMCACHED = "no"; then
231 AC_MSG_ERROR([*** memcached not found, aborting])
234 AC_CHECK_PROG([ASPELL],aspell,yes,no)
235 if test $ASPELL = "no"; then
236 AC_MSG_ERROR([*** aspell not found, aborting])
239 AC_CHECK_PROG([CPAN],cpan,yes,no)
240 if test $CPAN = "no"; then
241 AC_MSG_ERROR([*** cpan not found, aborting])
244 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
245 if test $YAZ = "no"; then
246 AC_MSG_ERROR([*** yaz not found, aborting])
249 AC_CHECK_PROG([PERL],perl,yes,no)
250 if test $PERL = "no"; then
251 AC_MSG_ERROR([*** perl not found, aborting])
254 #------------------------------------
255 # Checks for libraries.
256 #------------------------------------
258 # Check for the existence of libraries in non-standard locations
260 AC_MSG_CHECKING(for -lopensrf)
261 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
264 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
267 # Check for the rest of the libraries
269 #check for dynamic linking functions
270 AC_CHECK_LIB(dl,dlopen)
272 #check for the libdbi library
273 AC_CHECK_LIB(dbi,dbi_initialize)
275 #to check for the availability and function of a particular
276 #driver we need a runtime check (since the driver is loaded
277 #dynamically). This example checks for the mysql driver
278 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
281 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
282 [AC_MSG_RESULT("yes")],
283 [AC_MSG_FAILURE("pgsql driver not installed?")])
285 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
286 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
287 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
288 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
289 AC_CHECK_LIB([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
290 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
293 #------------------------------------
294 # Checks for header files.
295 #------------------------------------
298 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
300 #-------------------------------------------------------------------
301 # Checks for typedefs, structures, and compiler characteristics.
302 #-------------------------------------------------------------------
309 #-------------------------------------------------------------------
310 # Checks for library functions.
311 #-------------------------------------------------------------------
315 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
317 #----------------------------
318 # Create Makefiles/Output
319 #----------------------------
321 AC_CONFIG_FILES([Open-ILS/examples/Makefile
322 Open-ILS/src/c-apps/Makefile
323 Open-ILS/src/extras/Makefile
324 Open-ILS/src/java/Makefile
325 Open-ILS/src/python/Makefile])
328 if test "x$build_apachemods" = "xtrue"; then
330 #-----------------------------------
331 # Set install path variables
332 #-----------------------------------
334 #APACHE PREFORK DEV TEST
335 AC_MSG_CHECKING([APXS2])
336 if test -x "${APXS2}"; then
339 AC_MSG_ERROR([*** apxs not found in ${APXS2}, aborting])
342 AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
345 AC_CONFIG_FILES([Makefile
346 Open-ILS/src/Makefile
347 Open-ILS/web/Makefile
348 Open-ILS/xul/staff_client/Makefile
349 Open-ILS/src/extras/eg_config
350 Open-ILS/src/extras/fast-extract],
352 if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
353 if test -e "./Open-ILS/src/extras/fast-extract"; then chmod 755 Open-ILS/src/extras/fast-extract; fi;
357 #-------------------------------------------------
359 #-------------------------------------------------
362 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
365 AC_MSG_RESULT([-------- Installation Options: --------])
366 if test "$openils_core" = "true" ; then
367 AC_MSG_RESULT([Evergreen Core: yes])
369 AC_MSG_RESULT([Evergreen Core: no])
371 if test "$build_apachemods" = "true" ; then
372 AC_MSG_RESULT([Evergreen Apache module: yes])
374 AC_MSG_RESULT([Evergreen Apache module: no])
376 if test "$openils_web" = "true" ; then
377 AC_MSG_RESULT([Evergreen Web: yes])
379 AC_MSG_RESULT([Evergreen Web: no])
381 if test "$openils_reporter" = "true" ; then
382 AC_MSG_RESULT([Evergreen Reporter: yes])
384 AC_MSG_RESULT([Evergreen Reporter: no])
386 if test "$openils_client" = "true" ; then
387 AC_MSG_RESULT([Evergreen Staff Client: yes])
389 AC_MSG_RESULT([Evergreen Staff Client: no])
391 if test "$EG_PYTHON_INSTALL" = "true" ; then
392 AC_MSG_RESULT([Evergreen Python Components: yes])
394 AC_MSG_RESULT([Evergreen Python Components: no])
396 if test "$evergreen_java" = "true" ; then
397 AC_MSG_RESULT([Evergreen Java Components: yes])
399 AC_MSG_RESULT([Evergreen Java Components: no])
402 AC_MSG_RESULT([-------- Installation Directories --------])
403 AC_MSG_RESULT(Installation directory prefix: ${prefix})
404 AC_MSG_RESULT(Temporary directory: ${TMP})
405 AC_MSG_RESULT(APXS2 location: ${APXS2})
406 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
407 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
408 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
409 AC_MSG_RESULT(libdbi location: ${DBI_LIBS})
410 AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS})
411 AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS})
413 AC_MSG_RESULT([----------------------------------------------------------------------])