#-----------------------------------
# Check for dependencies
#-----------------------------------
+AC_PATH_PROG([OSRF_CONFIG], [osrf_config])
+if test "x$OSRF_CONFIG" == "x"; then
+ AC_MSG_ERROR([Could not find osrf_config.
+ Ensure OpenSRF is installed and that the PATH environment variable includes
+ the OpenSRF executables. For example: PATH=\$PATH:/openils/bin ./configure])
+fi
AC_ARG_WITH([opensrf-headers],
[ --with-opensrf-headers=path location of the OpenSRF header files],
[OPENSRF_HEADERS=${withval}],
-[OPENSRF_HEADERS=`osrf_config --includedir`])
+[OPENSRF_HEADERS=`$OSRF_CONFIG --includedir`])
AC_SUBST([OPENSRF_HEADERS])
# We need this for JavaScript
AC_ARG_WITH([opensrf-libs],
[ --with-opensrf-libs=path location of the OpenSRF libraries],
[OPENSRF_LIBS=${withval}],
-[OPENSRF_LIBS=`osrf_config --libdir`])
+[OPENSRF_LIBS=`$OSRF_CONFIG --libdir`])
AC_SUBST([OPENSRF_LIBS])
AC_ARG_WITH([tmp],
AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
AC_CHECK_LIB([ncurses], [main], [], AC_MSG_ERROR(*** OpenILS requires libncurses))
+
+ # IF the OpenSRF libs are installed in a non-standard location, such as
+ # /openils/lib, the compilation test will fail. Support that case.
+ LDFLAGS="-L$OPENSRF_LIBS"
+
AC_CHECK_LIB([opensrf], [osrfMessageFree], [], AC_MSG_ERROR(*** OpenILS requires libopensrf))
AC_CHECK_LIB([readline], [main], [], AC_MSG_ERROR(*** OpenILS requires libreadline))
AC_CHECK_LIB([xml2], [main], [], AC_MSG_ERROR(*** OpenILS requires libxml2))