]> git.evergreen-ils.org Git - Evergreen.git/blob - configure.ac
Add merging of localized ils_events.xml descriptions to "install" target
[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_db=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])
56 #esac],
57 #[openils_all=false])
58
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])
66 esac],
67 [openils_core=true])
68
69 AM_CONDITIONAL([BUILDILSCORE], [test x$openils_core = xtrue])
70
71 # install evergreen-web?
72
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])
79 esac],
80 [openils_web=true])
81
82 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
83
84 # build evergreendb ?
85 #
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])
92 #esac],
93 #[openils_db=true])
94 #
95 #AM_CONDITIONAL([BUILDILSDB], [test x$openils_db = xtrue])
96
97 # build evergreen-reporter ?
98
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])
105 esac],
106 [openils_reporter=true])
107
108 AM_CONDITIONAL([BUILDILSREPORTER], [test x$openils_reporter = xtrue])
109
110 # build evergreen-client ?
111
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])
118 esac],
119 [openils_client=true])
120
121 AM_CONDITIONAL([BUILDILSCLIENT], [test x$openils_client = xtrue])
122
123
124 # build evergreen java ?
125
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])
132 esac],
133 [evergreen_java=false])
134
135 AM_CONDITIONAL([BUILDEGJAVA], [test x$evergreen_java = xtrue])
136
137
138 # build the evergreen python modules?
139
140 AC_ARG_ENABLE([evergreen-python],
141 [  --disable-evergreen-python    disables 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 --disable-python-install (supported values are yes or no)])
146 esac],
147 [EG_PYTHON_INSTALL=true])
148
149 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
150
151
152
153 #-----------------------------------
154 # Check for dependencies 
155 #-----------------------------------
156
157 AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
158 if test $MEMCACHED = "no"; then
159         AC_MSG_ERROR([*** memcached not found, aborting])
160 fi
161
162 AC_CHECK_PROG([ASPELL],aspell,yes,no)
163 if test $ASPELL = "no"; then
164         AC_MSG_ERROR([*** aspell not found, aborting])
165 fi
166
167 AC_CHECK_PROG([CPAN],cpan,yes,no)
168 if test $CPAN = "no"; then
169         AC_MSG_ERROR([*** cpan not found, aborting])
170 fi
171
172 AC_CHECK_PROG([YAZ],yaz-config,yes,no)
173 if test $YAZ = "no"; then
174         AC_MSG_ERROR([*** yaz not found, aborting])
175 fi
176
177 AC_CHECK_PROG([PERL],perl,yes,no)
178 if test $PERL = "no"; then 
179         AC_MSG_ERROR([*** perl not found, aborting])
180 fi
181
182
183 #-----------------------------------
184 # Set install path variables 
185 #-----------------------------------
186
187 AC_ARG_WITH([tmp],
188 [ --with-tmp=path               location for the tmp dir for OpenILS (default is /tmp) ],
189 [TMP=${withval}],
190 [TMP=/tmp])
191 AC_SUBST([TMP])
192
193
194 APXS2=`apxs2 -q BINDIR`/apxs2
195 AC_SUBST([APXS2])
196
197 APACHE2_HEADERS=`apxs2 -q INCLUDEDIR`
198 AC_SUBST([APACHE2_HEADERS])
199
200 APR_HEADERS=`apr-config --includedir`
201 AC_SUBST([APR_HEADERS])
202
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])
208
209 AC_ARG_WITH([dbi],
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/])
213 AC_SUBST([DBI_LIBS])
214
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])
220
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])
226
227 #-------------------------------------------------------------
228 # Set DB Info
229 #-------------------------------------------------------------
230
231 AC_ARG_WITH([dbdrvr],
232 [ --with-dbdrvr=name            name of the database driver to be used by open-ils (default is Pg)],
233 [DBDRVR=${withval}],
234 [DBDRVR=Pg])
235 AC_SUBST([DBDRVR])
236
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])
241         fi
242 fi
243
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)],
246 [DBHOST=${withval}],
247 [DBHOST=127.0.0.1])
248 AC_SUBST([DBHOST])
249
250 AC_ARG_WITH([dbport],
251 [ --with-dbport=number            name of the database port to be used by open-ils (default is 5432)],
252 [DBPORT=${withval}],
253 [DBPORT=5432])
254 AC_SUBST([DBPORT])
255
256 AC_ARG_WITH([dbname],
257 [ --with-dbname=name            name of the database to be used by open-ils (default is evergreen)],
258 [DBNAME=${withval}],
259 [DBNAME=evergreen])
260 AC_SUBST([DBNAME])
261
262 AC_ARG_WITH([dbuser],
263 [ --with-dbuser=name            name of the database username to be used by open-ils (default is postgres)],
264 [DBUSER=${withval}],
265 [DBUSER=postgres])
266 AC_SUBST([DBUSER])
267
268 AC_ARG_WITH([dbver],
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)],
270 [DBVER=${withval}],
271 [DBVER=82])
272 AC_SUBST([DBVER])
273
274
275 AC_ARG_WITH([dbpw],
276 [ --with-dbpw=password            password of the database to be used by open-ils (default is postgres)],
277 [DBPW=${withval}],
278 [DBPW=postgres])
279 AC_SUBST([DBPW])
280
281 #------------------------------------
282 # Checks for libraries. 
283 #------------------------------------
284
285 # Check for the existance of libraries in non-standard locations
286
287 AC_MSG_CHECKING(for -lopensrf)
288 if test -e ${OPENSRF_LIBS}/libopensrf.so; then
289 AC_MSG_RESULT([yes])
290 else
291 AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
292 fi
293
294 # Check for the rest of the libraries
295
296 #check for dynamic linking functions
297 AC_CHECK_LIB(dl,dlopen)
298
299 #check for the libdbi library
300 AC_CHECK_LIB(dbi,dbi_initialize)
301
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)])
306 AC_RUN_IFELSE(
307   [AC_LANG_PROGRAM(,
308     [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
309   [AC_MSG_RESULT("yes")],
310   [AC_MSG_FAILURE("pgsql driver not installed?")])
311
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))
319
320
321 #------------------------------------
322 # Checks for header files.
323 #------------------------------------
324
325 AC_HEADER_STDC
326 AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
327
328 #-------------------------------------------------------------------
329 # Checks for typedefs, structures, and compiler characteristics.
330 #-------------------------------------------------------------------
331
332 AC_C_CONST
333 AC_TYPE_SIZE_T
334 AC_STRUCT_TM
335 AC_HEADER_STDBOOL
336
337 #-------------------------------------------------------------------
338 # Checks for library functions.
339 #-------------------------------------------------------------------
340
341 AC_FUNC_STRFTIME
342 AC_FUNC_STRTOD
343 AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
344
345
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...";
353
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";
360
361         STR='$main::config{usr} =';
362                 STR="$STR '$DBUSER';";
363         echo "$STR" >> "$CONFIG_FILE";
364         
365         STR='$main::config{pw} =';
366                 STR="$STR '$DBPW';";
367         echo "$STR" >> "$CONFIG_FILE";
368         
369         echo '$main::config{index} = "config.cgi";' >> "$CONFIG_FILE";
370
371 #----------------------------
372 # Create Makefiles/Output
373 #----------------------------
374
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])
387 AC_OUTPUT
388
389
390 #-------------------------------------------------
391 # OUTPUT STUFF 
392 #-------------------------------------------------
393
394 AC_MSG_RESULT([])
395 AC_MSG_RESULT([--------------------- Configuration options:  -----------------------])
396
397 AC_MSG_RESULT([])
398 AC_MSG_RESULT([-------- Installation Options: --------])
399 if test "$openils_core" = "true" ; then
400         AC_MSG_RESULT([Evergreen Core:                  yes])
401 else
402         AC_MSG_RESULT([Evergreen Core:                  no])
403 fi
404 if test "$openils_web" = "true" ; then
405         AC_MSG_RESULT([Evergreen Web:                   yes])
406 else
407         AC_MSG_RESULT([Evergreen Web:                   no])
408 fi
409 if test "$openils_reporter" = "true" ; then
410         AC_MSG_RESULT([Evergreen Reporter:              yes])
411 else
412         AC_MSG_RESULT([Evergreen Reporter:              no])
413 fi
414 if test "$openils_client" = "true" ; then
415         AC_MSG_RESULT([Evergreen Staff Client:          yes])
416 else
417         AC_MSG_RESULT([Evergreen Staff Client:          no])
418 fi
419 if test "$EG_PYTHON_INSTALL" = "true" ; then
420         AC_MSG_RESULT([Evergreen Python Components:     yes])
421 else
422         AC_MSG_RESULT([Evergreen Python Components:     no])
423 fi
424 if test "$evergreen_java" = "true" ; then
425         AC_MSG_RESULT([Evergreen Java Components:       yes])
426 else
427         AC_MSG_RESULT([Evergreen Java Components:       no])
428 fi
429 AC_MSG_RESULT([]) 
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}])
438 AC_MSG_RESULT([])
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})
449
450 AC_MSG_RESULT([----------------------------------------------------------------------])
451