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([libxml2],
224 [ --with-libxml2=path location of the libxml2 headers (default is /usr/include/libxml2)],
225 [LIBXML2_HEADERS=${withval}],
226 [LIBXML2_HEADERS=/usr/include/libxml2/])
227 AC_SUBST([LIBXML2_HEADERS])
230 [ --with-dbi=path location of the libdbi driver libraries (default is /usr/local/lib/dbd)],
231 [DBI_LIBS=${withval}],
232 [DBI_LIBS=/usr/local/lib/dbd/])
234 # If the passed in value doesn't work, fall back to reasonable defaults
235 # Distributions are starting to package a good version of libdbi / libdbd
236 if ! test -d "$DBI_LIBS"; then
237 for i in /usr/lib/dbd/ /usr/lib64/dbd /usr/local/lib/dbd/ ; do
238 if test -d "$i"; then
246 if test "x$openils_core" = "xtrue"; then
248 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
249 if test $MEMCACHED = "no"; then
250 AC_MSG_ERROR([*** memcached not found, aborting])
253 AC_CHECK_PROG([ASPELL],aspell,yes,no)
254 if test $ASPELL = "no"; then
255 AC_MSG_ERROR([*** aspell not found, aborting])
258 AC_CHECK_PROG([CPAN],cpan,yes,no)
259 if test $CPAN = "no"; then
260 AC_MSG_ERROR([*** cpan not found, aborting])
263 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
264 if test $YAZ = "no"; then
265 AC_MSG_ERROR([*** yaz not found, aborting])
268 AC_CHECK_PROG([PERL],perl,yes,no)
269 if test $PERL = "no"; then
270 AC_MSG_ERROR([*** perl not found, aborting])
273 #------------------------------------
274 # Checks for libraries.
275 #------------------------------------
277 # Check for the rest of the libraries
279 #check for dynamic linking functions
280 AC_CHECK_LIB(dl,dlopen)
282 #check for the libdbi library
283 AC_CHECK_LIB(dbi,dbi_initialize)
285 #to check for the availability and function of a particular
286 #driver we need a runtime check (since the driver is loaded
287 #dynamically). This example checks for the mysql driver
288 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
291 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
292 [AC_MSG_RESULT("yes")],
293 [AC_MSG_FAILURE("pgsql driver not installed?")])
295 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
296 AC_CHECK_LIB([ncurses], [main], [], AC_MSG_ERROR(*** OpenILS requires libncurses))
297 AC_CHECK_LIB([opensrf], [osrfMessageFree], [], AC_MSG_ERROR(*** OpenILS requires libopensrf))
298 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
299 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
300 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
301 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
303 #------------------------------------
304 # Checks for header files.
305 #------------------------------------
308 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
310 #-------------------------------------------------------------------
311 # Checks for typedefs, structures, and compiler characteristics.
312 #-------------------------------------------------------------------
319 #-------------------------------------------------------------------
320 # Checks for library functions.
321 #-------------------------------------------------------------------
325 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
327 #----------------------------
328 # Create Makefiles/Output
329 #----------------------------
331 AC_CONFIG_FILES([Open-ILS/examples/Makefile
332 Open-ILS/src/c-apps/Makefile
333 Open-ILS/src/extras/Makefile
334 Open-ILS/src/java/Makefile
335 Open-ILS/src/python/Makefile])
338 if test "x$build_apachemods" = "xtrue"; then
340 #-----------------------------------
341 # Set install path variables
342 #-----------------------------------
344 #APACHE PREFORK DEV TEST
345 AC_MSG_CHECKING([APXS2])
346 if test -x "${APXS2}"; then
349 AC_MSG_ERROR([*** apxs not found in ${APXS2}, aborting])
352 AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
355 AC_CONFIG_FILES([Makefile
356 Open-ILS/src/Makefile
357 Open-ILS/src/perlmods/Makefile
358 Open-ILS/web/Makefile
359 Open-ILS/updates/Makefile
360 Open-ILS/xul/staff_client/Makefile
361 Open-ILS/src/extras/eg_config
364 if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
368 #-------------------------------------------------
370 #-------------------------------------------------
373 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
376 AC_MSG_RESULT([-------- Installation Options: --------])
377 if test "$openils_core" = "true" ; then
378 AC_MSG_RESULT([Evergreen Core: yes])
380 AC_MSG_RESULT([Evergreen Core: no])
382 if test "$build_apachemods" = "true" ; then
383 AC_MSG_RESULT([Evergreen Apache module: yes])
385 AC_MSG_RESULT([Evergreen Apache module: no])
387 if test "$openils_web" = "true" ; then
388 AC_MSG_RESULT([Evergreen Web: yes])
390 AC_MSG_RESULT([Evergreen Web: no])
392 if test "$openils_updates" = "true" ; then
393 AC_MSG_RESULT([Evergreen Updates: yes])
395 AC_MSG_RESULT([Evergreen Updates: no])
397 if test "$openils_reporter" = "true" ; then
398 AC_MSG_RESULT([Evergreen Reporter: yes])
400 AC_MSG_RESULT([Evergreen Reporter: no])
402 if test "$openils_client" = "true" ; then
403 AC_MSG_RESULT([Evergreen Staff Client: yes])
405 AC_MSG_RESULT([Evergreen Staff Client: no])
407 if test "$EG_PYTHON_INSTALL" = "true" ; then
408 AC_MSG_RESULT([Evergreen Python Components: yes])
410 AC_MSG_RESULT([Evergreen Python Components: no])
412 if test "$evergreen_java" = "true" ; then
413 AC_MSG_RESULT([Evergreen Java Components: yes])
415 AC_MSG_RESULT([Evergreen Java Components: no])
418 AC_MSG_RESULT([-------- Installation Directories --------])
419 AC_MSG_RESULT(Installation directory prefix: ${prefix})
420 AC_MSG_RESULT(Temporary directory: ${TMP})
421 AC_MSG_RESULT(APXS2 location: ${APXS2})
422 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
423 AC_MSG_RESULT(libdbi location: ${DBI_LIBS})
424 AC_MSG_RESULT(OpenSRF headers location: ${OPENSRF_HEADERS})
425 AC_MSG_RESULT(OpenSRF libraries location: ${OPENSRF_LIBS})
427 AC_MSG_RESULT([----------------------------------------------------------------------])