Provide some level of support for legacy install locations
authorDan Scott <dscott@laurentian.ca>
Tue, 22 Jan 2013 14:52:52 +0000 (09:52 -0500)
committerMike Rylander <mrylander@gmail.com>
Thu, 28 Feb 2013 17:34:16 +0000 (12:34 -0500)
If someone really wants to keep OpenSRF and Evergreen installed in
/openils, then enable the configure script to find the osrf_config
script and add the library location to the test to prevent it from
failing.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
configure.ac

index 87698eb..fab6180 100644 (file)
@@ -181,18 +181,24 @@ AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
 #-----------------------------------
 # Check for dependencies 
 #-----------------------------------
 #-----------------------------------
 # 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}],
 
 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}],
 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_SUBST([OPENSRF_LIBS])
 
 AC_ARG_WITH([tmp],
@@ -294,6 +300,11 @@ if test "x$openils_core" = "xtrue"; then
 
     AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
     AC_CHECK_LIB([ncurses], [main], [], AC_MSG_ERROR(*** OpenILS requires libncurses))
 
     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))
     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))