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])
179 AC_ARG_WITH([apache],
180 [ --with-apache=path location of the Apache headers (default is /usr/include/apache2)],
181 [APACHE2_HEADERS=${withval}],
182 [APACHE2_HEADERS=/usr/include/apache2])
183 AC_SUBST([APACHE2_HEADERS])
186 [ --with-apr=path location of the Apache Portable Runtime (APR) headers (default is /usr/include/apr-1.0/)],
187 [APR_HEADERS=${withval}],
188 [APR_HEADERS=/usr/include/apr-1.0])
189 AC_SUBST([APR_HEADERS])
191 AC_ARG_WITH([libxml2],
192 [ --with-libxml2=path location of the libxml2 headers (default is /usr/include/libxml2)],
193 [LIBXML2_HEADERS=${withval}],
194 [LIBXML2_HEADERS=/usr/include/libxml2/])
195 AC_SUBST([LIBXML2_HEADERS])
198 [ --with-dbi=path location of the libdbi libraries (default is /usr/local/lib/dbd)],
199 [DBI_LIBS=${withval}],
200 [DBI_LIBS=/usr/local/lib/dbd/])
203 if test "x$openils_core" = "xtrue"; then
205 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
206 if test $MEMCACHED = "no"; then
207 AC_MSG_ERROR([*** memcached not found, aborting])
210 AC_CHECK_PROG([ASPELL],aspell,yes,no)
211 if test $ASPELL = "no"; then
212 AC_MSG_ERROR([*** aspell not found, aborting])
215 AC_CHECK_PROG([CPAN],cpan,yes,no)
216 if test $CPAN = "no"; then
217 AC_MSG_ERROR([*** cpan not found, aborting])
220 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
221 if test $YAZ = "no"; then
222 AC_MSG_ERROR([*** yaz not found, aborting])
225 AC_CHECK_PROG([PERL],perl,yes,no)
226 if test $PERL = "no"; then
227 AC_MSG_ERROR([*** perl not found, aborting])
230 #------------------------------------
231 # Checks for libraries.
232 #------------------------------------
234 # Check for the existence of libraries in non-standard locations
236 AC_MSG_CHECKING(for -lopensrf)
237 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
240 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
243 # Check for the rest of the libraries
245 #check for dynamic linking functions
246 AC_CHECK_LIB(dl,dlopen)
248 #check for the libdbi library
249 AC_CHECK_LIB(dbi,dbi_initialize)
251 #to check for the availability and function of a particular
252 #driver we need a runtime check (since the driver is loaded
253 #dynamically). This example checks for the mysql driver
254 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
257 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
258 [AC_MSG_RESULT("yes")],
259 [AC_MSG_FAILURE("pgsql driver not installed?")])
261 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
262 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
263 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
264 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
265 AC_CHECK_LIB([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
266 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
269 #------------------------------------
270 # Checks for header files.
271 #------------------------------------
274 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
276 #-------------------------------------------------------------------
277 # Checks for typedefs, structures, and compiler characteristics.
278 #-------------------------------------------------------------------
285 #-------------------------------------------------------------------
286 # Checks for library functions.
287 #-------------------------------------------------------------------
291 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
293 #----------------------------
294 # Create Makefiles/Output
295 #----------------------------
297 AC_CONFIG_FILES([Open-ILS/examples/Makefile
298 Open-ILS/src/c-apps/Makefile
299 Open-ILS/src/extras/Makefile
300 Open-ILS/src/java/Makefile
301 Open-ILS/src/python/Makefile])
304 if test "x$build_apachemods" = "xtrue"; then
306 #-----------------------------------
307 # Set install path variables
308 #-----------------------------------
310 #APACHE PREFORK DEV TEST
311 AC_MSG_CHECKING([APXS2])
312 if test -x "${APXS2}"; then
315 AC_MSG_ERROR([*** apxs not found, aborting])
318 AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
321 AC_CONFIG_FILES([Makefile
322 Open-ILS/src/Makefile
323 Open-ILS/web/Makefile
324 Open-ILS/xul/staff_client/Makefile
325 Open-ILS/src/extras/eg_config], [if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi])
328 #-------------------------------------------------
330 #-------------------------------------------------
333 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
336 AC_MSG_RESULT([-------- Installation Options: --------])
337 if test "$openils_core" = "true" ; then
338 AC_MSG_RESULT([Evergreen Core: yes])
340 AC_MSG_RESULT([Evergreen Core: no])
342 if test "$build_apachemods" = "true" ; then
343 AC_MSG_RESULT([Evergreen Apache module: yes])
345 AC_MSG_RESULT([Evergreen Apache module: no])
347 if test "$openils_web" = "true" ; then
348 AC_MSG_RESULT([Evergreen Web: yes])
350 AC_MSG_RESULT([Evergreen Web: no])
352 if test "$openils_reporter" = "true" ; then
353 AC_MSG_RESULT([Evergreen Reporter: yes])
355 AC_MSG_RESULT([Evergreen Reporter: no])
357 if test "$openils_client" = "true" ; then
358 AC_MSG_RESULT([Evergreen Staff Client: yes])
360 AC_MSG_RESULT([Evergreen Staff Client: no])
362 if test "$EG_PYTHON_INSTALL" = "true" ; then
363 AC_MSG_RESULT([Evergreen Python Components: yes])
365 AC_MSG_RESULT([Evergreen Python Components: no])
367 if test "$evergreen_java" = "true" ; then
368 AC_MSG_RESULT([Evergreen Java Components: yes])
370 AC_MSG_RESULT([Evergreen Java Components: no])
373 AC_MSG_RESULT([-------- Installation Directories --------])
374 AC_MSG_RESULT(Installation directory prefix: ${prefix})
375 AC_MSG_RESULT(Temporary directory: ${TMP})
376 AC_MSG_RESULT(APXS2 location: ${APXS2})
377 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
378 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
379 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
380 AC_MSG_RESULT(libdbi location: ${DBI_LIBS})
381 AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS})
382 AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS})
384 AC_MSG_RESULT([----------------------------------------------------------------------])