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/])
28 AC_CONFIG_MACRO_DIR([m4])
35 AC_DEFUN([AC_PYTHON_MOD],[
40 AC_MSG_CHECKING($PYTHON_NAME module: $1)
41 $PYTHON -c "import $1" 2>/dev/null
45 eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
47 AC_MSG_ERROR(failed to find required module $1)
54 #-------------------------------
55 # Installation options
56 #-------------------------------
58 # build and install the java libs?
60 [ --enable-java enable building and installing the java libraries],
61 [case "${enableval}" in
62 yes) OSRF_INSTALL_JAVA=true ;;
63 no) OSRF_INSTALL_JAVA=false ;;
64 *) AC_MSG_ERROR([please choose another value for --enable-java (supported values are yes or no)]) ;;
66 [OSRF_INSTALL_JAVA=false])
68 AM_CONDITIONAL([BUILDJAVA], [test x$OSRF_INSTALL_JAVA = xtrue])
69 AC_SUBST([OSRF_INSTALL_JAVA])
71 # install the javascript files?
72 AC_ARG_ENABLE([javascript],
73 [ --disable-javascript disable installing JavaScript libraries],
74 [case "${enableval}" in
75 yes) OSRF_INSTALL_JAVASCRIPT=true ;;
76 no) OSRF_INSTALL_JAVASCRIPT=false ;;
77 *) AC_MSG_ERROR([please choose another value for --disable-javascript (supported values are yes or no)]) ;;
79 [OSRF_INSTALL_JAVASCRIPT=true])
81 AM_CONDITIONAL([INSTALLJAVASCRIPT], [test x$OSRF_INSTALL_JAVASCRIPT = xtrue])
82 AC_SUBST([OSRF_INSTALL_JAVASCRIPT])
84 # install the OpenSRF core files?
86 [ --disable-core disable installing core files],
87 [case "${enableval}" in
88 yes) OSRF_INSTALL_CORE=true ;;
89 no) OSRF_INSTALL_CORE=false ;;
90 *) AC_MSG_ERROR([please choose another value for --disable-core (supported values are yes or no)]) ;;
92 [OSRF_INSTALL_CORE=true])
94 AM_CONDITIONAL([BUILDCORE], [test x$OSRF_INSTALL_CORE = xtrue])
95 AC_SUBST([OSRF_INSTALL_CORE])
98 # build and install the python modules
99 AC_ARG_ENABLE([python],
100 [ --enable-python enable building and installing python modules],
101 [case "${enableval}" in
102 yes) OSRF_INSTALL_PYTHON=true ;;
103 no) OSRF_INSTALL_PYTHON=false ;;
104 *) AC_MSG_ERROR([please choose another value for --enable-python (supported values are yes or no)]) ;;
106 [OSRF_INSTALL_PYTHON=false])
108 AM_CONDITIONAL([BUILDPYTHON], [test x$OSRF_INSTALL_PYTHON = xtrue])
109 AC_SUBST([OSRF_INSTALL_PYTHON])
114 [ --enable-debug Turn on debugging],
115 [case "${enableval}" in
118 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
120 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
122 # path to the directory containing the java dependency jar files (included if java installs)
123 if test $OSRF_INSTALL_JAVA; then
124 AC_SUBST([OSRF_JAVA_DEPSDIR], [/opt/java])
127 #--------------------------------
128 # Checks for programs.
129 #--------------------------------
137 #------------------------------
138 # Set install path variables
139 #------------------------------
141 [ --with-tmp=path location for the temporary dir for OpenSRF (default is /tmp)],
147 [ --with-apxs=path location of the apxs Apache configuration tool (default is /usr/bin/apxs2)],
149 [APXS2=/usr/bin/apxs2])
152 AC_ARG_WITH([apache],
153 [ --with-apache=path location of the Apache headers (default is /usr/include/apache2)],
154 [APACHE2_HEADERS=${withval}],
155 [APACHE2_HEADERS=/usr/include/apache2])
156 AC_SUBST([APACHE2_HEADERS])
159 [ --with-apr=path location of the apr headers (default is /usr/include/apr-1.0/)],
160 [APR_HEADERS=${withval}],
161 [APR_HEADERS=/usr/include/apr-1.0])
162 AC_SUBST([APR_HEADERS])
164 AC_ARG_WITH([libxml],
165 [ --with-libxml=path location of the libxml headers (default is /usr/include/libxml2/))],
166 [LIBXML2_HEADERS=${withval}],
167 [LIBXML2_HEADERS=/usr/include/libxml2/])
168 AC_SUBST([LIBXML2_HEADERS])
170 AC_ARG_WITH([includes],
171 [ --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)],
172 [EXTRA_USER_INCLUDES=${withval}])
174 AC_ARG_WITH([libraries],
175 [ --with-libraries=DIRECTORIES a colon-separated list of directories to search for libraries (Example: --with-libraries=/lib:/usr/lib)],
176 [EXTRA_USER_LIBRARIES=${withval}])
178 # Change these lists to proper compiler/linker options
183 for dir in $EXTRA_USER_INCLUDES; do
184 if test -d "$dir"; then
185 INCLUDES="$INCLUDES -I$dir"
187 AC_MSG_WARN([*** Include directory $dir does not exist.])
192 for dir in $EXTRA_USER_LIBRARIES; do
193 if test -d "$dir"; then
194 LIBDIRS="$LIBDIRS -L$dir"
196 AC_MSG_WARN([*** Library directory $dir does not exist.])
203 AC_CONFIG_FILES([Makefile
206 if test "x$OSRF_INSTALL_CORE" = "xtrue"; then
207 #--------------------------------
208 # Check for dependencies.
209 #--------------------------------
211 #APACHE PREFORK DEV TEST
212 AC_MSG_CHECKING([APXS])
213 if test -f "${APXS2}"; then
216 AC_MSG_ERROR([*** apxs not found, aborting])
220 if test x$OSRF_INSTALL_PYTHON = xtrue; then
221 AC_CHECK_PROG([HAVE_PYTHON],python,yes,no)
222 if test $HAVE_PYTHON = "no"; then
223 AC_MSG_ERROR([*** python not found, aborting])
225 AC_PYTHON_MOD([setuptools])
229 #-----------------------------
230 # Checks for libraries.
231 #-----------------------------
233 AC_CHECK_LIB([dl], [dlerror], [],AC_MSG_ERROR(***OpenSRF requires libdl))
234 AC_SEARCH_LIBS([mc_req_free], [memcache], [], AC_MSG_ERROR(***OpenSRF requires memcache development headers))
235 AC_CHECK_LIB([ncurses], [initscr], [], AC_MSG_ERROR(***OpenSRF requires ncurses development headers))
236 AC_CHECK_LIB([readline], [readline], [], AC_MSG_ERROR(***OpenSRF requires readline development headers))
237 AC_CHECK_LIB([xml2], [xmlAddID], [], AC_MSG_ERROR(***OpenSRF requires xml2 development headers))
241 #-----------------------------
242 # Checks for header files.
243 #-----------------------------
247 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])
249 #------------------------------------------------------------------
250 # Checks for typedefs, structures, and compiler characteristics.
251 #------------------------------------------------------------------
260 #----------------------------------
261 # Checks for library functions.
262 #----------------------------------
266 AC_FUNC_SELECT_ARGTYPES
271 AC_CHECK_FUNCS([bzero dup2 gethostbyname gethostname gettimeofday memset select socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strtol])
273 #------------------------------------
274 # Configuration and output
275 #------------------------------------
277 AC_CONFIG_FILES([doc/dokuwiki-doc-stubber.pl
278 examples/math_xul_client/Makefile
279 examples/math_bench.pl
280 examples/math_client.py
281 examples/multisession-test.pl
286 src/libopensrf/Makefile
288 src/ports/strn_compat/Makefile
300 AC_MSG_RESULT([--------------------- Configuration options: -----------------------])
302 if test "$OSRF_INSTALL_JAVA" = "true" ; then
303 AC_MSG_RESULT([OSRF install java?: yes])
304 AC_MSG_RESULT([Java deps dir: $OSRF_JAVA_DEPSDIR])
306 AC_MSG_RESULT([OSRF install java?: no])
309 if test "$OSRF_INSTALL_PYTHON" = "true" ; then
310 AC_MSG_RESULT([OSRF install python?: yes])
312 AC_MSG_RESULT([OSRF install python?: no])
315 AC_MSG_RESULT(Installation directory prefix: ${prefix})
316 AC_MSG_RESULT(Tmp dir location: ${TMP})
317 AC_MSG_RESULT(APXS2 location: ${APXS2})
318 AC_MSG_RESULT(Apache headers location: ${APACHE2_HEADERS})
319 AC_MSG_RESULT(APR headers location: ${APR_HEADERS})
320 AC_MSG_RESULT(libxml2 headers location: ${LIBXML2_HEADERS})
326 AC_MSG_RESULT([----------------------------------------------------------------------])