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.
14 # Process this file with autoconf to produce a configure script.
17 #-------------------------------
19 #-------------------------------
21 export PATH=${PATH}:/usr/sbin
23 AC_INIT([OpenSRF],[trunk],[open-ils-dev@list.georgialibraries.org])
24 AM_INIT_AUTOMAKE([OpenSRF], [trunk])
25 AC_REVISION($Revision: 0.1 $)
26 AC_CONFIG_SRCDIR([configure.ac])
27 AC_PREFIX_DEFAULT([/opensrf/])
34 AC_DEFUN([AC_PYTHON_MOD],[
39 AC_MSG_CHECKING($PYTHON_NAME module: $1)
40 $PYTHON -c "import $1" 2>/dev/null
44 eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
46 AC_MSG_ERROR(failed to find required module $1)
53 #-------------------------------
54 # Installation options
55 #-------------------------------
57 # build and install the java libs?
59 [ --enable-java enable building and installing the java libraries],
60 [case "${enableval}" in
61 yes) OSRF_INSTALL_JAVA=true ;;
62 no) OSRF_INSTALL_JAVA=false ;;
63 *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no)]) ;;
65 [OSRF_INSTALL_JAVA=false])
67 AM_CONDITIONAL([BUILDJAVA], [test x$OSRF_INSTALL_JAVA = xtrue])
68 AC_SUBST([OSRF_INSTALL_JAVA])
70 # build and install the python modules
71 AC_ARG_ENABLE([python],
72 [ --enable-python enable building and installing python modules],
73 [case "${enableval}" in
74 yes) OSRF_INSTALL_PYTHON=true ;;
75 no) OSRF_INSTALL_PYTHON=false ;;
76 *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)]) ;;
78 [OSRF_INSTALL_PYTHON=false])
80 AM_CONDITIONAL([BUILDPYTHON], [test x$OSRF_INSTALL_PYTHON = xtrue])
81 AC_SUBST([OSRF_INSTALL_PYTHON])
86 [ --enable-debug Turn on debugging],
87 [case "${enableval}" in
90 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
92 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
95 # path to the directory containing the java dependency jar files (included if java installs)
96 if test $OSRF_INSTALL_JAVA; then
97 AC_SUBST([OSRF_JAVA_DEPSDIR], [/opt/java])
102 #--------------------------------
103 # Checks for programs.
104 #--------------------------------
112 #------------------------------
113 # Set install path variables
114 #------------------------------
116 [ --with-tmp=path location for the tmp dir for openSRF (default is /tmp)],
122 [ --with-apxs=path location of apxs (default is /usr/bin/apxs2)],
124 [APXS2=/usr/bin/apxs2])
127 AC_ARG_WITH([apache],
128 [ --with-apache=path location of the apache headers (default is /usr/include/apache2)],
129 [APACHE2_HEADERS=${withval}],
130 [APACHE2_HEADERS=/usr/include/apache2])
131 AC_SUBST([APACHE2_HEADERS])
134 [ --with-apr=path location of the apr headers (default is /usr/include/apr-1.0/)],
135 [APR_HEADERS=${withval}],
136 [APR_HEADERS=/usr/include/apr-1.0])
137 AC_SUBST([APR_HEADERS])
139 AC_ARG_WITH([libxml],
140 [ --with-libxml=path location of the libxml headers (default is /usr/include/libxml2/))],
141 [LIBXML2_HEADERS=${withval}],
142 [LIBXML2_HEADERS=/usr/include/libxml2/])
143 AC_SUBST([LIBXML2_HEADERS])
145 AC_ARG_WITH([includes],
146 [ --with-includes=DIRECTORIES a colon-separated list of directories that will be added to the list the compiler searches for header files (Example: --with-includes=/path/headers:/anotherpath/moreheaders)],
147 [EXTRA_USER_INCLUDES=${withval}])
149 AC_ARG_WITH([libraries],
150 [ --with-libraries=DIRECTORIES a colon-separated list of directories to search for libraries (Example: --with-libraries=/lib:/usr/lib)],
151 [EXTRA_USER_LIBRARIES=${withval}])
153 # Change these lists to proper compiler/linker options
158 for dir in $EXTRA_USER_INCLUDES; do
159 if test -d "$dir"; then
160 INCLUDES="$INCLUDES -I$dir"
162 AC_MSG_WARN([*** Include directory $dir does not exist.])
167 for dir in $EXTRA_USER_LIBRARIES; do
168 if test -d "$dir"; then
169 LIBDIRS="$LIBDIRS -L$dir"
171 AC_MSG_WARN([*** Library directory $dir does not exist.])
178 #--------------------------------
179 # Check for dependencies.
180 #--------------------------------
182 #APACHE PREFORK DEV TEST
183 AC_MSG_CHECKING([APXS])
184 if test -f "${APXS2}"; then
187 AC_MSG_ERROR([*** apxs not found, aborting])
191 if test x$OSRF_INSTALL_PYTHON = xtrue; then
192 AC_CHECK_PROG([HAVE_PYTHON],python,yes,no)
193 if test $HAVE_PYTHON = "no"; then
194 AC_MSG_ERROR([*** python not found, aborting])
196 AC_PYTHON_MOD([setuptools])
200 #-----------------------------
201 # Checks for libraries.
202 #-----------------------------
204 AC_CHECK_LIB([dl], [dlerror], [],AC_MSG_ERROR(***OpenSRF requires libdl))
205 AC_SEARCH_LIBS([mc_req_free], [memcache], [], AC_MSG_ERROR(***OpenSRF requires memcache development headers))
206 AC_CHECK_LIB([ncurses], [initscr], [], AC_MSG_ERROR(***OpenSRF requires ncurses development headers))
207 AC_CHECK_LIB([readline], [readline], [], AC_MSG_ERROR(***OpenSRF requires readline development headers))
208 AC_CHECK_LIB([xml2], [xmlAddID], [], AC_MSG_ERROR(***OpenSRF requires xml2 development headers))
212 #-----------------------------
213 # Checks for header files.
214 #-----------------------------
218 AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h])
220 #------------------------------------------------------------------
221 # Checks for typedefs, structures, and compiler characteristics.
222 #------------------------------------------------------------------
231 #----------------------------------
232 # Checks for library functions.
233 #----------------------------------
237 AC_FUNC_SELECT_ARGTYPES
242 AC_CHECK_FUNCS([bzero dup2 gethostbyname gethostname gettimeofday memset select socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strtol])
244 #------------------------------------
245 # Configuration and output
246 #------------------------------------
248 AC_CONFIG_FILES([Makefile
249 doc/dokuwiki-doc-stubber.pl
250 examples/math_xul_client/Makefile
251 examples/math_bench.pl
252 examples/math_client.py
253 examples/multisession-test.pl
259 src/libopensrf/Makefile
260 src/ports/strn_compat/Makefile
264 bin/osrf_config], [if test -e "./bin/osrf_config"; then chmod 755 bin/osrf_config; fi])
270 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
272 if test "$OSRF_INSTALL_JAVA" = "true" ; then
273 AC_MSG_RESULT([OSRF install java?: yes])
274 AC_MSG_RESULT([Java deps dir: $OSRF_JAVA_DEPSDIR])
276 AC_MSG_RESULT([OSRF install java?: no])
279 if test "$OSRF_INSTALL_PYTHON" = "true" ; then
280 AC_MSG_RESULT([OSRF install python?: yes])
282 AC_MSG_RESULT([OSRF install python?: no])
285 AC_MSG_RESULT(Installation directory prefix: ${prefix})
286 AC_MSG_RESULT(Tmp dir location: ${TMP})
287 AC_MSG_RESULT(APXS2 location: ${APXS2})
288 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
289 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
290 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
296 AC_MSG_RESULT([----------------------------------------------------------------------])