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 #-----------------------------------
39 #-----------------------------------
41 #-----------------------------------
43 # install openils-all?
44 #AC_ARG_ENABLE([openils-all],
45 #[ --enable-openils-all enables the installation of the default openils system (base system,web,staffclient) ],
46 #[case "${enableval}" in
47 # yes) openils_all=true;
50 # openils_reporter=true;
51 # openils_client_xul=true;
52 # openils_server_xul=true ;;
53 # no) openils_all=false ;;
54 # *) AC_MSG_ERROR([please choose another value for --enable-openils-all (supported values are yes or no])
58 # install evergreen-core?
59 AC_ARG_ENABLE([evergreen-core],
60 [ --disable-evergreen-core disables the installation of the evergreen core components ],
61 [case "${enableval}" in
62 yes) openils_core=true ;;
63 no) openils_core=false ;;
64 *) AC_MSG_ERROR([please choose another value for --disable-evergreen-core (supported values are yes or no])
68 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
70 # install evergreen-web?
72 AC_ARG_ENABLE([evergreen-web],
73 [ --disable-evergreen-web disables the installation of the openils web modules ],
74 [case "${enableval}" in
75 yes) openils_web=true ;;
76 no) openils_web=false ;;
77 *) AC_MSG_ERROR([please choose another value for --disable-evergreen-web (supported values are yes or no])
81 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
83 # build evergreen-reporter ?
85 AC_ARG_ENABLE([evergreen-reporter],
86 [ --disable-evergreen-reporter disables the installation of the evergreen reporter module ],
87 [case "${enableval}" in
88 yes) openils_reporter=true ;;
89 no) openils_reporter=false ;;
90 *) AC_MSG_ERROR([please choose another value for --disable-evergreen-reporter (supported values are yes or no])
92 [openils_reporter=true])
94 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
96 # build evergreen-client ?
98 AC_ARG_ENABLE([evergreen-client],
99 [ --disable-evergreen-client disables the installation of the evergreen staff client ],
100 [case "${enableval}" in
101 yes) openils_client=true ;;
102 no) openils_client=false ;;
103 *) AC_MSG_ERROR([please choose another value for --disable-evergreen-client (supported values are yes or no])
105 [openils_client=true])
107 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
110 # build evergreen java ?
112 AC_ARG_ENABLE([evergreen-java],
113 [ --enable-evergreen-java enables the installation of the evergreen java components ],
114 [case "${enableval}" in
115 yes) evergreen_java=true ;;
116 no) evergreen_java=false ;;
117 *) AC_MSG_ERROR([please choose another value for --enable-evergreen-java (supported values are yes or no])
119 [evergreen_java=false])
121 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
124 # build the evergreen python modules?
126 AC_ARG_ENABLE([evergreen-python],
127 [ --enable-evergreen-python enables the installation of the evergreen python modules ],
128 [case "${enableval}" in
129 yes) EG_PYTHON_INSTALL=true ;;
130 no) EG_PYTHON_INSTALL=false ;;
131 *) AC_MSG_ERROR([please choose another value for --enable-python-install (supported values are yes or no)])
133 [EG_PYTHON_INSTALL=false])
135 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
139 #-----------------------------------
140 # Check for dependencies
141 #-----------------------------------
143 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
144 if test $MEMCACHED = "no"; then
145 AC_MSG_ERROR([*** memcached not found, aborting])
148 AC_CHECK_PROG([ASPELL],aspell,yes,no)
149 if test $ASPELL = "no"; then
150 AC_MSG_ERROR([*** aspell not found, aborting])
153 AC_CHECK_PROG([CPAN],cpan,yes,no)
154 if test $CPAN = "no"; then
155 AC_MSG_ERROR([*** cpan not found, aborting])
158 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
159 if test $YAZ = "no"; then
160 AC_MSG_ERROR([*** yaz not found, aborting])
163 AC_CHECK_PROG([PERL],perl,yes,no)
164 if test $PERL = "no"; then
165 AC_MSG_ERROR([*** perl not found, aborting])
169 #-----------------------------------
170 # Set install path variables
171 #-----------------------------------
174 [ --with-tmp=path location for the tmp dir for OpenILS (default is /tmp) ],
180 APXS2=`apxs2 -q BINDIR`/apxs2
183 APACHE2_HEADERS=`apxs2 -q INCLUDEDIR`
184 AC_SUBST([APACHE2_HEADERS])
186 APR_HEADERS=`apr-config --includedir`
187 AC_SUBST([APR_HEADERS])
189 AC_ARG_WITH([libxml],
190 [ --with-libxml=path location of the libxml headers (default is /usr/include/libxml2)],
191 [LIBXML2_HEADERS=${withval}],
192 [LIBXML2_HEADERS=/usr/include/libxml2/])
193 AC_SUBST([LIBXML2_HEADERS])
196 [ --with-dbi=path location of the libdbi libraries (default is /usr/local/lib/dbd)],
197 [DBI_LIBS=${withval}],
198 [DBI_LIBS=/usr/local/lib/dbd/])
201 AC_ARG_WITH([opensrf-headers],
202 [ --with-opensrf-headers=path location of the opensrf header files (default is /openils/include/)],
203 [OPENSRF_HEADERS=${withval}],
204 [OPENSRF_HEADERS=/openils/include/])
205 AC_SUBST([OPENSRF_HEADERS])
207 AC_ARG_WITH([opensrf-libs],
208 [ --with-opensrf-libs=path location of the opensrf libraries (default is /openils/lib/)],
209 [OPENSRF_LIBS=${withval}],
210 [OPENSRF_LIBS=/openils/lib/])
211 AC_SUBST([OPENSRF_LIBS])
213 #------------------------------------
214 # Checks for libraries.
215 #------------------------------------
217 # Check for the existance of libraries in non-standard locations
219 AC_MSG_CHECKING(for -lopensrf)
220 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
223 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
226 # Check for the rest of the libraries
228 #check for dynamic linking functions
229 AC_CHECK_LIB(dl,dlopen)
231 #check for the libdbi library
232 AC_CHECK_LIB(dbi,dbi_initialize)
234 #to check for the availability and function of a particular
235 #driver we need a runtime check (since the driver is loaded
236 #dynamically). This example checks for the mysql driver
237 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
240 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
241 [AC_MSG_RESULT("yes")],
242 [AC_MSG_FAILURE("pgsql driver not installed?")])
244 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
245 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
246 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
247 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
248 AC_CHECK_LIB([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
249 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
252 #------------------------------------
253 # Checks for header files.
254 #------------------------------------
257 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
259 #-------------------------------------------------------------------
260 # Checks for typedefs, structures, and compiler characteristics.
261 #-------------------------------------------------------------------
268 #-------------------------------------------------------------------
269 # Checks for library functions.
270 #-------------------------------------------------------------------
274 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
276 #----------------------------
277 # Create Makefiles/Output
278 #----------------------------
280 AC_CONFIG_FILES([Makefile
281 Open-ILS/examples/Makefile
282 Open-ILS/src/Makefile
283 Open-ILS/src/apachemods/Makefile
284 Open-ILS/src/c-apps/Makefile
285 Open-ILS/src/extras/Makefile
286 Open-ILS/src/java/Makefile
287 Open-ILS/src/python/Makefile
288 Open-ILS/xul/staff_client/Makefile
289 Open-ILS/src/offline/offline-config.pl
290 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])
293 #-------------------------------------------------
295 #-------------------------------------------------
298 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
301 AC_MSG_RESULT([-------- Installation Options: --------])
302 if test "$openils_core" = "true" ; then
303 AC_MSG_RESULT([Evergreen Core: yes])
305 AC_MSG_RESULT([Evergreen Core: no])
307 if test "$openils_web" = "true" ; then
308 AC_MSG_RESULT([Evergreen Web: yes])
310 AC_MSG_RESULT([Evergreen Web: no])
312 if test "$openils_reporter" = "true" ; then
313 AC_MSG_RESULT([Evergreen Reporter: yes])
315 AC_MSG_RESULT([Evergreen Reporter: no])
317 if test "$openils_client" = "true" ; then
318 AC_MSG_RESULT([Evergreen Staff Client: yes])
320 AC_MSG_RESULT([Evergreen Staff Client: no])
322 if test "$EG_PYTHON_INSTALL" = "true" ; then
323 AC_MSG_RESULT([Evergreen Python Components: yes])
325 AC_MSG_RESULT([Evergreen Python Components: no])
327 if test "$evergreen_java" = "true" ; then
328 AC_MSG_RESULT([Evergreen Java Components: yes])
330 AC_MSG_RESULT([Evergreen Java Components: no])
333 AC_MSG_RESULT([-------- Installation Directories --------])
334 AC_MSG_RESULT(Installation dir prefix: ${prefix})
335 AC_MSG_RESULT(Temporary dir location: ${TMP})
336 AC_MSG_RESULT(APXS2 dir location: ${APXS2})
337 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
338 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
339 AC_MSG_RESULT(libxml headers location: ${LIBXML2_HEADERS})
340 AC_MSG_RESULT(libdbi dir location: ${DBI_LIBS})
341 AC_MSG_RESULT(OpenSRF Headers location: ${OPENSRF_HEADERS})
342 AC_MSG_RESULT(OpenSRF Libraries location: ${OPENSRF_LIBS})
344 AC_MSG_RESULT([----------------------------------------------------------------------])