]> git.evergreen-ils.org Git - working/Evergreen.git/blob - configure.ac
We don't really need to link against libyaz
[working/Evergreen.git] / configure.ac
1 # Copyright (C) 2008 Equinox Software, Inc.
2 # Kevin Beswick <kevinbeswick00@gmail.com>
3 #
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.
8 #
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.
13
14
15 #---------------------------
16 # Init
17 #---------------------------
18
19 export PATH=${PATH}:/usr/sbin
20 AC_PREREQ(2.59)
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/])
26 AC_SUBST(prefix)
27 AC_SUBST([abs_top_builddir])
28
29 #-----------------------------------
30 # Checks for programs.
31 #-----------------------------------
32
33 AC_PROG_LIBTOOL
34 AC_PROG_CC
35 AC_PROG_INSTALL
36 AC_PROG_LN_S
37 AC_PROG_MAKE_SET
38
39 #-----------------------------------
40 # Install options 
41 #-----------------------------------
42
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;
48 #        openils_core=true;
49 #        openils_web=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])
55 #esac],
56 #[openils_all=false])
57
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])
65 esac],
66 [openils_core=true])
67
68 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
69
70 # install evergreen-web?
71
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])
78 esac],
79 [openils_web=true])
80
81 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
82
83 # build evergreen-reporter ?
84
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])
91 esac],
92 [openils_reporter=true])
93
94 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
95
96 # build evergreen-client ?
97
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])
104 esac],
105 [openils_client=true])
106
107 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
108
109
110 # build evergreen java ?
111
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])
118 esac],
119 [evergreen_java=false])
120
121 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
122
123
124 # build the evergreen python modules?
125
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)])
132 esac],
133 [EG_PYTHON_INSTALL=false])
134
135 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
136
137
138
139 #-----------------------------------
140 # Check for dependencies 
141 #-----------------------------------
142
143 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
144 if test $MEMCACHED = "no"; then
145         AC_MSG_ERROR([*** memcached not found, aborting])
146 fi
147
148 AC_CHECK_PROG([ASPELL],aspell,yes,no)
149 if test $ASPELL = "no"; then
150         AC_MSG_ERROR([*** aspell not found, aborting])
151 fi
152
153 AC_CHECK_PROG([CPAN],cpan,yes,no)
154 if test $CPAN = "no"; then
155         AC_MSG_ERROR([*** cpan not found, aborting])
156 fi
157
158 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
159 if test $YAZ = "no"; then
160         AC_MSG_ERROR([*** yaz not found, aborting])
161 fi
162
163 AC_CHECK_PROG([PERL],perl,yes,no)
164 if test $PERL = "no"; then 
165         AC_MSG_ERROR([*** perl not found, aborting])
166 fi
167
168
169 #-----------------------------------
170 # Set install path variables 
171 #-----------------------------------
172
173 AC_ARG_WITH([tmp],
174 [ --with-tmp=path               location for the tmp dir for OpenILS (default is /tmp) ],
175 [TMP=${withval}],
176 [TMP=/tmp])
177 AC_SUBST([TMP])
178
179
180 APXS2=`apxs2 -q BINDIR`/apxs2
181 AC_SUBST([APXS2])
182
183 APACHE2_HEADERS=`apxs2 -q INCLUDEDIR`
184 AC_SUBST([APACHE2_HEADERS])
185
186 APR_HEADERS=`apr-config --includedir`
187 AC_SUBST([APR_HEADERS])
188
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])
194
195 AC_ARG_WITH([dbi],
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/])
199 AC_SUBST([DBI_LIBS])
200
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])
206
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])
212
213 #------------------------------------
214 # Checks for libraries. 
215 #------------------------------------
216
217 # Check for the existance of libraries in non-standard locations
218
219 AC_MSG_CHECKING(for -lopensrf)
220 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
221 AC_MSG_RESULT([yes])
222 else
223 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
224 fi
225
226 # Check for the rest of the libraries
227
228 #check for dynamic linking functions
229 AC_CHECK_LIB(dl,dlopen)
230
231 #check for the libdbi library
232 AC_CHECK_LIB(dbi,dbi_initialize)
233
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)])
238 AC_RUN_IFELSE(
239   [AC_LANG_PROGRAM(,
240     [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
241   [AC_MSG_RESULT("yes")],
242   [AC_MSG_FAILURE("pgsql driver not installed?")])
243
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))
250
251
252 #------------------------------------
253 # Checks for header files.
254 #------------------------------------
255
256 AC_HEADER_STDC
257 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
258
259 #-------------------------------------------------------------------
260 # Checks for typedefs, structures, and compiler characteristics.
261 #-------------------------------------------------------------------
262
263 AC_C_CONST
264 AC_TYPE_SIZE_T
265 AC_STRUCT_TM
266 AC_HEADER_STDBOOL
267
268 #-------------------------------------------------------------------
269 # Checks for library functions.
270 #-------------------------------------------------------------------
271
272 AC_FUNC_STRFTIME
273 AC_FUNC_STRTOD
274 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
275
276 #----------------------------
277 # Create Makefiles/Output
278 #----------------------------
279
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
291                  build/i18n/Makefile],  [if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi])
292 AC_OUTPUT
293
294 #-------------------------------------------------
295 # OUTPUT STUFF 
296 #-------------------------------------------------
297
298 AC_MSG_RESULT([])
299 AC_MSG_RESULT([--------------------- Configuration options:  -----------------------])
300
301 AC_MSG_RESULT([])
302 AC_MSG_RESULT([-------- Installation Options: --------])
303 if test "$openils_core" = "true" ; then
304         AC_MSG_RESULT([Evergreen Core:                  yes])
305 else
306         AC_MSG_RESULT([Evergreen Core:                  no])
307 fi
308 if test "$openils_web" = "true" ; then
309         AC_MSG_RESULT([Evergreen Web:                   yes])
310 else
311         AC_MSG_RESULT([Evergreen Web:                   no])
312 fi
313 if test "$openils_reporter" = "true" ; then
314         AC_MSG_RESULT([Evergreen Reporter:              yes])
315 else
316         AC_MSG_RESULT([Evergreen Reporter:              no])
317 fi
318 if test "$openils_client" = "true" ; then
319         AC_MSG_RESULT([Evergreen Staff Client:          yes])
320 else
321         AC_MSG_RESULT([Evergreen Staff Client:          no])
322 fi
323 if test "$EG_PYTHON_INSTALL" = "true" ; then
324         AC_MSG_RESULT([Evergreen Python Components:     yes])
325 else
326         AC_MSG_RESULT([Evergreen Python Components:     no])
327 fi
328 if test "$evergreen_java" = "true" ; then
329         AC_MSG_RESULT([Evergreen Java Components:       yes])
330 else
331         AC_MSG_RESULT([Evergreen Java Components:       no])
332 fi
333 AC_MSG_RESULT([]) 
334 AC_MSG_RESULT([-------- Installation Directories --------])
335 AC_MSG_RESULT(Installation dir prefix:                  ${prefix})
336 AC_MSG_RESULT(Temporary dir location:                   ${TMP})
337 AC_MSG_RESULT(APXS2 dir location:                       ${APXS2})
338 AC_MSG_RESULT(Apache headers location:                  ${APACHE2_HEADERS})
339 AC_MSG_RESULT(APR headers location:                     ${APR_HEADERS})
340 AC_MSG_RESULT(libxml headers location:                  ${LIBXML2_HEADERS})
341 AC_MSG_RESULT(libdbi dir location:                      ${DBI_LIBS})
342 AC_MSG_RESULT(OpenSRF Headers location:                 ${OPENSRF_HEADERS})
343 AC_MSG_RESULT(OpenSRF Libraries location:               ${OPENSRF_LIBS})
344
345 AC_MSG_RESULT([----------------------------------------------------------------------])
346