]> git.evergreen-ils.org Git - Evergreen.git/blob - configure.ac
Get the asset.uri seed value into SVN for posterity
[Evergreen.git] / configure.ac
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>
5 #
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.
10 #
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.
15
16
17 #---------------------------
18 # Init
19 #---------------------------
20
21 export PATH=${PATH}:/usr/sbin
22 AC_PREREQ(2.61)
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])
27 AC_PREFIX_DEFAULT([/openils/])
28 AC_SUBST(prefix)
29 AC_SUBST([abs_top_builddir])
30
31 #-----------------------------------
32 # Checks for programs.
33 #-----------------------------------
34
35 AC_PROG_LIBTOOL
36 AC_PROG_CC
37 AC_PROG_INSTALL
38 AC_PROG_LN_S
39 AC_PROG_MAKE_SET
40 AC_PROG_MKDIR_P
41
42 #-----------------------------------
43 # Install options 
44 #-----------------------------------
45
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;
51 #        openils_core=true;
52 #        openils_web=true;
53 #        openils_reporter=true;
54 #        openils_client_xul=true;
55 #        openils_server_xul=true ;;
56 #    no)  openils_all=false ;;
57 #  *) AC_MSG_ERROR([please choose another value for --enable-openils-all (supported values are yes or no])
58 #esac],
59 #[openils_all=false])
60
61 # install evergreen-core?
62 AC_ARG_ENABLE([core],
63 [  --disable-core    disables installation of the Evergreen core components ],
64 [case "${enableval}" in
65     yes) openils_core=true ;;
66     no)  openils_core=false ;;
67   *) AC_MSG_ERROR([please choose another value for --disable-core (supported values are yes or no])
68 esac],
69 [openils_core=true])
70
71 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
72
73 # install evergreen-web?
74
75 AC_ARG_ENABLE([web],
76 [  --disable-web    disables installation of the Evergreen web modules ],
77 [case "${enableval}" in
78     yes) openils_web=true ;;
79     no)  openils_web=false ;;
80   *) AC_MSG_ERROR([please choose another value for --disable-web (supported values are yes or no])
81 esac],
82 [openils_web=true])
83
84 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
85
86 # build evergreen-reporter ?
87
88 AC_ARG_ENABLE([reporter],
89 [  --disable-reporter    disables installation of the Evergreen reporter module ],
90 [case "${enableval}" in
91     yes) openils_reporter=true ;;
92     no)  openils_reporter=false ;;
93   *) AC_MSG_ERROR([please choose another value for --disable-reporter (supported values are yes or no])
94 esac],
95 [openils_reporter=true])
96
97 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
98
99 # build evergreen-client ?
100
101 AC_ARG_ENABLE([client],
102 [  --disable-client    disables installation of the Evergreen staff client ],
103 [case "${enableval}" in
104     yes) openils_client=true ;;
105     no)  openils_client=false ;;
106   *) AC_MSG_ERROR([please choose another value for --disable-client (supported values are yes or no])
107 esac],
108 [openils_client=true])
109
110 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
111
112
113 # build evergreen java ?
114
115 AC_ARG_ENABLE([java],
116 [  --enable-java    enables installation of the Evergreen Java components ],
117 [case "${enableval}" in
118     yes) evergreen_java=true ;;
119     no)  evergreen_java=false ;;
120   *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no])
121 esac],
122 [evergreen_java=false])
123
124 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
125
126
127 # build the evergreen python modules?
128
129 AC_ARG_ENABLE([python],
130 [  --enable-python    enables installation of the Evergreen Python modules ],
131 [case "${enableval}" in
132     yes) EG_PYTHON_INSTALL=true ;;
133     no)  EG_PYTHON_INSTALL=false ;;
134   *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)])
135 esac],
136 [EG_PYTHON_INSTALL=false])
137
138 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
139
140
141
142 #-----------------------------------
143 # Check for dependencies 
144 #-----------------------------------
145
146 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
147 if test $MEMCACHED = "no"; then
148         AC_MSG_ERROR([*** memcached not found, aborting])
149 fi
150
151 AC_CHECK_PROG([ASPELL],aspell,yes,no)
152 if test $ASPELL = "no"; then
153         AC_MSG_ERROR([*** aspell not found, aborting])
154 fi
155
156 AC_CHECK_PROG([CPAN],cpan,yes,no)
157 if test $CPAN = "no"; then
158         AC_MSG_ERROR([*** cpan not found, aborting])
159 fi
160
161 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
162 if test $YAZ = "no"; then
163         AC_MSG_ERROR([*** yaz not found, aborting])
164 fi
165
166 AC_CHECK_PROG([PERL],perl,yes,no)
167 if test $PERL = "no"; then 
168         AC_MSG_ERROR([*** perl not found, aborting])
169 fi
170
171
172 #-----------------------------------
173 # Set install path variables 
174 #-----------------------------------
175
176 AC_ARG_WITH([tmp],
177 [  --with-tmp=path             location of the Evergreen temporary directory (default is /tmp) ],
178 [TMP=${withval}],
179 [TMP=/tmp])
180 AC_SUBST([TMP])
181
182
183 APXS2=`apxs2 -q BINDIR`/apxs2
184 AC_SUBST([APXS2])
185
186 APACHE2_HEADERS=`apxs2 -q INCLUDEDIR`
187 AC_SUBST([APACHE2_HEADERS])
188
189 APR_HEADERS=`apr-config --includedir`
190 AC_SUBST([APR_HEADERS])
191
192 AC_ARG_WITH([libxml2],
193 [  --with-libxml2=path         location of the libxml2 headers (default is /usr/include/libxml2)],
194 [LIBXML2_HEADERS=${withval}],
195 [LIBXML2_HEADERS=/usr/include/libxml2/])
196 AC_SUBST([LIBXML2_HEADERS])
197
198 AC_ARG_WITH([dbi],
199 [  --with-dbi=path             location of the libdbi libraries (default is /usr/local/lib/dbd)],
200 [DBI_LIBS=${withval}],
201 [DBI_LIBS=/usr/local/lib/dbd/])
202 AC_SUBST([DBI_LIBS])
203
204 AC_ARG_WITH([opensrf-headers],
205 [  --with-opensrf-headers=path location of the OpenSRF header files (default is /openils/include/)],
206 [OPENSRF_HEADERS=${withval}],
207 [OPENSRF_HEADERS=/openils/include/])
208 AC_SUBST([OPENSRF_HEADERS])
209
210 AC_ARG_WITH([opensrf-libs],
211 [  --with-opensrf-libs=path    location of the OpenSRF libraries (default is /openils/lib/)],
212 [OPENSRF_LIBS=${withval}],
213 [OPENSRF_LIBS=/openils/lib/])
214 AC_SUBST([OPENSRF_LIBS])
215
216 #------------------------------------
217 # Checks for libraries. 
218 #------------------------------------
219
220 # Check for the existence of libraries in non-standard locations
221
222 AC_MSG_CHECKING(for -lopensrf)
223 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
224 AC_MSG_RESULT([yes])
225 else
226 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
227 fi
228
229 # Check for the rest of the libraries
230
231 #check for dynamic linking functions
232 AC_CHECK_LIB(dl,dlopen)
233
234 #check for the libdbi library
235 AC_CHECK_LIB(dbi,dbi_initialize)
236
237 #to check for the availability and function of a particular
238 #driver we need a runtime check (since the driver is loaded
239 #dynamically). This example checks for the mysql driver
240 AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
241 AC_RUN_IFELSE(
242   [AC_LANG_PROGRAM(,
243     [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
244   [AC_MSG_RESULT("yes")],
245   [AC_MSG_FAILURE("pgsql driver not installed?")])
246
247 AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
248 AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
249 AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))
250 AC_CHECK_LIB([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
251 AC_CHECK_LIB([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
252 AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
253
254
255 #------------------------------------
256 # Checks for header files.
257 #------------------------------------
258
259 AC_HEADER_STDC
260 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
261
262 #-------------------------------------------------------------------
263 # Checks for typedefs, structures, and compiler characteristics.
264 #-------------------------------------------------------------------
265
266 AC_C_CONST
267 AC_TYPE_SIZE_T
268 AC_STRUCT_TM
269 AC_HEADER_STDBOOL
270
271 #-------------------------------------------------------------------
272 # Checks for library functions.
273 #-------------------------------------------------------------------
274
275 AC_FUNC_STRFTIME
276 AC_FUNC_STRTOD
277 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
278
279 #----------------------------
280 # Create Makefiles/Output
281 #----------------------------
282
283 AC_CONFIG_FILES([Makefile
284                  Open-ILS/examples/Makefile
285                  Open-ILS/src/Makefile
286                  Open-ILS/src/apachemods/Makefile
287                  Open-ILS/src/c-apps/Makefile
288                  Open-ILS/src/extras/Makefile
289                  Open-ILS/src/java/Makefile
290                  Open-ILS/src/python/Makefile
291                  Open-ILS/xul/staff_client/Makefile
292                  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 AC_OUTPUT
294
295 #-------------------------------------------------
296 # OUTPUT STUFF 
297 #-------------------------------------------------
298
299 AC_MSG_RESULT([])
300 AC_MSG_RESULT([--------------------- Configuration options:  -----------------------])
301
302 AC_MSG_RESULT([])
303 AC_MSG_RESULT([-------- Installation Options: --------])
304 if test "$openils_core" = "true" ; then
305         AC_MSG_RESULT([Evergreen Core:                  yes])
306 else
307         AC_MSG_RESULT([Evergreen Core:                  no])
308 fi
309 if test "$openils_web" = "true" ; then
310         AC_MSG_RESULT([Evergreen Web:                   yes])
311 else
312         AC_MSG_RESULT([Evergreen Web:                   no])
313 fi
314 if test "$openils_reporter" = "true" ; then
315         AC_MSG_RESULT([Evergreen Reporter:              yes])
316 else
317         AC_MSG_RESULT([Evergreen Reporter:              no])
318 fi
319 if test "$openils_client" = "true" ; then
320         AC_MSG_RESULT([Evergreen Staff Client:          yes])
321 else
322         AC_MSG_RESULT([Evergreen Staff Client:          no])
323 fi
324 if test "$EG_PYTHON_INSTALL" = "true" ; then
325         AC_MSG_RESULT([Evergreen Python Components:     yes])
326 else
327         AC_MSG_RESULT([Evergreen Python Components:     no])
328 fi
329 if test "$evergreen_java" = "true" ; then
330         AC_MSG_RESULT([Evergreen Java Components:       yes])
331 else
332         AC_MSG_RESULT([Evergreen Java Components:       no])
333 fi
334 AC_MSG_RESULT([]) 
335 AC_MSG_RESULT([-------- Installation Directories --------])
336 AC_MSG_RESULT(Installation directory prefix:            ${prefix})
337 AC_MSG_RESULT(Temporary directory:                      ${TMP})
338 AC_MSG_RESULT(APXS2 location:                           ${APXS2})
339 AC_MSG_RESULT(Apache headers location:                  ${APACHE2_HEADERS})
340 AC_MSG_RESULT(APR headers location:                     ${APR_HEADERS})
341 AC_MSG_RESULT(libxml2 headers location:                 ${LIBXML2_HEADERS})
342 AC_MSG_RESULT(libdbi location:                          ${DBI_LIBS})
343 AC_MSG_RESULT(OpenSRF headers location:                 ${OPENSRF_HEADERS})
344 AC_MSG_RESULT(OpenSRF libraries location:               ${OPENSRF_LIBS})
345
346 AC_MSG_RESULT([----------------------------------------------------------------------])
347