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;
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?
60 AC_ARG_ENABLE([evergreen-core],
61 [ --disable-evergreen-core disables the 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-evergreen-core (supported values are yes or no])
69 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
71 # install evergreen-web?
73 AC_ARG_ENABLE([evergreen-web],
74 [ --disable-evergreen-web disables the installation of the openils 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-evergreen-web (supported values are yes or no])
82 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
86 #AC_ARG_ENABLE([openils-db],
87 #[ --disable-openils-db disables the installation of the openils db modules ],
88 #[case "${enableval}" in
89 # yes) openils_db=true ;;
90 # no) openils_db=false ;;
91 # *) AC_MSG_ERROR([please choose another value for --disable-openils-db (supported values are yes or no])
95 #AM_CONDITIONAL([BUILDILSDB], [test x$openils_db = xtrue])
97 # build evergreen-reporter ?
99 AC_ARG_ENABLE([evergreen-reporter],
100 [ --disable-evergreen-reporter disables the 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-evergreen-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([evergreen-client],
113 [ --disable-evergreen-client disables the 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-evergreen-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([evergreen-java],
127 [ --enable-evergreen-java enables the 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-evergreen-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([evergreen-python],
141 [ --enable-evergreen-python enables the 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-install (supported values are yes or no)])
147 [EG_PYTHON_INSTALL=false])
149 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
153 #-----------------------------------
154 # Check for dependencies
155 #-----------------------------------
157 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
158 if test $MEMCACHED = "no"; then
159 AC_MSG_ERROR([*** memcached not found, aborting])
162 AC_CHECK_PROG([ASPELL],aspell,yes,no)
163 if test $ASPELL = "no"; then
164 AC_MSG_ERROR([*** aspell not found, aborting])
167 AC_CHECK_PROG([CPAN],cpan,yes,no)
168 if test $CPAN = "no"; then
169 AC_MSG_ERROR([*** cpan not found, aborting])
172 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
173 if test $YAZ = "no"; then
174 AC_MSG_ERROR([*** yaz not found, aborting])
177 AC_CHECK_PROG([PERL],perl,yes,no)
178 if test $PERL = "no"; then
179 AC_MSG_ERROR([*** perl not found, aborting])
183 #-----------------------------------
184 # Set install path variables
185 #-----------------------------------
188 [ --with-tmp=path location for the tmp dir for OpenILS (default is /tmp) ],
194 APXS2=`apxs2 -q BINDIR`/apxs2
197 APACHE2_HEADERS=`apxs2 -q INCLUDEDIR`
198 AC_SUBST([APACHE2_HEADERS])
200 APR_HEADERS=`apr-config --includedir`
201 AC_SUBST([APR_HEADERS])
203 AC_ARG_WITH([libxml],
204 [ --with-libxml=path location of the libxml headers (default is /usr/include/libxml2)],
205 [LIBXML2_HEADERS=${withval}],
206 [LIBXML2_HEADERS=/usr/include/libxml2/])
207 AC_SUBST([LIBXML2_HEADERS])
210 [ --with-dbi=path location of the libdbi libraries (default is /usr/local/lib/dbd)],
211 [DBI_LIBS=${withval}],
212 [DBI_LIBS=/usr/local/lib/dbd/])
215 AC_ARG_WITH([opensrf-headers],
216 [ --with-opensrf-headers=path location of the opensrf header files (default is /openils/include/)],
217 [OPENSRF_HEADERS=${withval}],
218 [OPENSRF_HEADERS=/openils/include/])
219 AC_SUBST([OPENSRF_HEADERS])
221 AC_ARG_WITH([opensrf-libs],
222 [ --with-opensrf-libs=path location of the opensrf libraries (default is /openils/lib/)],
223 [OPENSRF_LIBS=${withval}],
224 [OPENSRF_LIBS=/openils/lib/])
225 AC_SUBST([OPENSRF_LIBS])
227 #-------------------------------------------------------------
229 #-------------------------------------------------------------
231 AC_ARG_WITH([dbdrvr],
232 [ --with-dbdrvr=name name of the database driver to be used by open-ils (default is Pg)],
237 if test $DBDRVR="Pg"; then
238 AC_CHECK_PROG([PGSQL],pg,yes,no)
239 if test $PGSQL = "no"; then
240 AC_MSG_ERROR([*** postgresql not found, aborting])
244 AC_ARG_WITH([dbhost],
245 [ --with-dbhost=address name of the database hostname to be used by open-ils (default is 127.0.0.1)],
250 AC_ARG_WITH([dbport],
251 [ --with-dbport=number name of the database port to be used by open-ils (default is 5432)],
256 AC_ARG_WITH([dbname],
257 [ --with-dbname=name name of the database to be used by open-ils (default is evergreen)],
262 AC_ARG_WITH([dbuser],
263 [ --with-dbuser=name name of the database username to be used by open-ils (default is postgres)],
269 [ --with-dbver=number version of the database to be used by open-ils, leaving out the periods in the version number (default is 82)],
276 [ --with-dbpw=password password of the database to be used by open-ils (default is postgres)],
281 #------------------------------------
282 # Checks for libraries.
283 #------------------------------------
285 # Check for the existance of libraries in non-standard locations
287 AC_MSG_CHECKING(for -lopensrf)
288 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
291 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
294 # Check for the rest of the libraries
296 #check for dynamic linking functions
297 AC_CHECK_LIB(dl,dlopen)
299 #check for the libdbi library
300 AC_CHECK_LIB(dbi,dbi_initialize)
302 #to check for the availability and function of a particular
303 #driver we need a runtime check (since the driver is loaded
304 #dynamically). This example checks for the mysql driver
305 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
308 [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
309 [AC_MSG_RESULT("yes")],
310 [AC_MSG_FAILURE("pgsql driver not installed?")])
312 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
313 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
314 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
315 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
316 AC_CHECK_LIB([yaz], [main], [], AC_MSG_ERROR(*** OpenILS requires libyaz))
317 AC_CHECK_LIB([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
318 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
321 #------------------------------------
322 # Checks for header files.
323 #------------------------------------
326 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
328 #-------------------------------------------------------------------
329 # Checks for typedefs, structures, and compiler characteristics.
330 #-------------------------------------------------------------------
337 #-------------------------------------------------------------------
338 # Checks for library functions.
339 #-------------------------------------------------------------------
343 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
346 #------------------------------------
347 # Generate some config files
348 #------------------------------------
349 # write out the DB bootstrapping config
350 CONFIG_FILE='Open-ILS/src/cgi-bin/setup.pl';
351 rm -f "$CONFIG_FILE";
352 echo "Writing bootstrapping config to $CONFIG_FILE...";
354 STR='$main::config{dsn} =';
355 STR="$STR 'dbi:${DBDRVR}:host=";
356 STR="${STR}${DBHOST};dbname=";
357 STR="${STR}${DBNAME};port=";
358 STR="${STR}${DBPORT}';";
359 echo "$STR" >> "$CONFIG_FILE";
361 STR='$main::config{usr} =';
362 STR="$STR '$DBUSER';";
363 echo "$STR" >> "$CONFIG_FILE";
365 STR='$main::config{pw} =';
367 echo "$STR" >> "$CONFIG_FILE";
369 echo '$main::config{index} = "config.cgi";' >> "$CONFIG_FILE";
371 #----------------------------
372 # Create Makefiles/Output
373 #----------------------------
375 AC_CONFIG_FILES([Makefile
376 Open-ILS/examples/Makefile
377 Open-ILS/src/Makefile
378 Open-ILS/src/apachemods/Makefile
379 Open-ILS/src/c-apps/Makefile
380 Open-ILS/src/extras/Makefile
381 Open-ILS/src/java/Makefile
382 Open-ILS/src/python/Makefile
383 Open-ILS/xul/staff_client/Makefile
384 Open-ILS/src/offline/offline-config.pl
385 Open-ILS/src/extras/eg_config
386 build/i18n/Makefile], [if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi])
390 #-------------------------------------------------
392 #-------------------------------------------------
395 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
398 AC_MSG_RESULT([-------- Installation Options: --------])
399 if test "$openils_core" = "true" ; then
400 AC_MSG_RESULT([Evergreen Core: yes])
402 AC_MSG_RESULT([Evergreen Core: no])
404 if test "$openils_web" = "true" ; then
405 AC_MSG_RESULT([Evergreen Web: yes])
407 AC_MSG_RESULT([Evergreen Web: no])
409 if test "$openils_reporter" = "true" ; then
410 AC_MSG_RESULT([Evergreen Reporter: yes])
412 AC_MSG_RESULT([Evergreen Reporter: no])
414 if test "$openils_client" = "true" ; then
415 AC_MSG_RESULT([Evergreen Staff Client: yes])
417 AC_MSG_RESULT([Evergreen Staff Client: no])
419 if test "$EG_PYTHON_INSTALL" = "true" ; then
420 AC_MSG_RESULT([Evergreen Python Components: yes])
422 AC_MSG_RESULT([Evergreen Python Components: no])
424 if test "$evergreen_java" = "true" ; then
425 AC_MSG_RESULT([Evergreen Java Components: yes])
427 AC_MSG_RESULT([Evergreen Java Components: no])
430 AC_MSG_RESULT([-------- DB Info --------])
431 AC_MSG_RESULT([Driver: ${DBDRVR}])
432 AC_MSG_RESULT([Host: ${DBHOST}])
433 AC_MSG_RESULT([Port: ${DBPORT}])
434 AC_MSG_RESULT([DB Name: ${DBNAME}])
435 AC_MSG_RESULT([Username: ${DBUSER}])
436 AC_MSG_RESULT([Version: ${DBVER}])
437 AC_MSG_RESULT([Password: ${DBPW}])
439 AC_MSG_RESULT([-------- Installation Directories --------])
440 AC_MSG_RESULT(Installation dir prefix: ${prefix})
441 AC_MSG_RESULT(Temporary dir location: ${TMP})
442 AC_MSG_RESULT(APXS2 dir location: ${APXS2})
443 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
444 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
445 AC_MSG_RESULT(libxml headers location: ${LIBXML2_HEADERS})
446 AC_MSG_RESULT(libdbi dir location: ${DBI_LIBS})
447 AC_MSG_RESULT(OpenSRF Headers location: ${OPENSRF_HEADERS})
448 AC_MSG_RESULT(OpenSRF Libraries location: ${OPENSRF_LIBS})
450 AC_MSG_RESULT([----------------------------------------------------------------------])