Docs: Fixing broken link
[Evergreen.git] / configure.ac
index dd0b098..dacb5a3 100644 (file)
@@ -24,10 +24,9 @@ AC_INIT(Open-ILS, trunk, open-ils-dev@list.georgialibraries.org)
 AM_INIT_AUTOMAKE([OpenILS], [trunk])
 AC_REVISION($Revision: 0.1 $)
 AC_CONFIG_SRCDIR([configure.ac])
-AC_PREFIX_DEFAULT([/openils/])
+AC_CONFIG_SUBDIRS([Open-ILS/xul/staff_client/external/libmar])
 AC_SUBST(prefix)
 AC_SUBST([abs_top_builddir])
-
 #-----------------------------------
 # Checks for programs.
 #-----------------------------------
@@ -106,6 +105,14 @@ AC_ARG_WITH([updateshost],
 [AUTOUPDATE_HOST=])
 AC_SUBST([AUTOUPDATE_HOST])
 
+# Default updates host?
+AC_ARG_WITH([initialhost],
+[  --with-initialhost=hostname    default hostname for staff client (default is blank)],
+[INITIAL_HOST=${withval}],
+[INITIAL_HOST=])
+AC_SUBST([INITIAL_HOST])
+
+
 # install Evergreen Apache modules?
 AC_ARG_ENABLE([apache-modules],
 [  --disable-apache-modules    disables installation of the Evergreen Apache modules ],
@@ -175,20 +182,6 @@ AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
 #-----------------------------------
 # Check for dependencies 
 #-----------------------------------
-
-AC_ARG_WITH([opensrf-headers],
-[  --with-opensrf-headers=path location of the OpenSRF header files (default is /openils/include/)],
-[OPENSRF_HEADERS=${withval}],
-[OPENSRF_HEADERS=/openils/include/])
-AC_SUBST([OPENSRF_HEADERS])
-
-# We need this for JavaScript
-AC_ARG_WITH([opensrf-libs],
-[  --with-opensrf-libs=path    location of the OpenSRF libraries (default is /openils/lib/)],
-[OPENSRF_LIBS=${withval}],
-[OPENSRF_LIBS=/openils/lib/])
-AC_SUBST([OPENSRF_LIBS])
-
 AC_ARG_WITH([tmp],
 [  --with-tmp=path             location of the Evergreen temporary directory (default is /tmp) ],
 [TMP=${withval}],
@@ -214,18 +207,6 @@ if ! test -x "$APXS2"; then
 fi
 AC_SUBST([APXS2])
 
-AC_ARG_WITH([apache],
-[  --with-apache=path          location of the Apache headers (default is /usr/include/apache2)],
-[APACHE2_HEADERS=${withval}],
-[APACHE2_HEADERS=/usr/include/apache2])
-AC_SUBST([APACHE2_HEADERS])
-
-AC_ARG_WITH([apr],
-[  --with-apr=path             location of the Apache Portable Runtime (APR) headers (default is /usr/include/apr-1.0/)],
-[APR_HEADERS=${withval}],
-[APR_HEADERS=/usr/include/apr-1.0])
-AC_SUBST([APR_HEADERS])
-
 AC_ARG_WITH([libxml2],
 [  --with-libxml2=path         location of the libxml2 headers (default is /usr/include/libxml2)],
 [LIBXML2_HEADERS=${withval}],
@@ -233,9 +214,15 @@ AC_ARG_WITH([libxml2],
 AC_SUBST([LIBXML2_HEADERS])
 
 AC_ARG_WITH([dbi],
-[  --with-dbi=path             location of the libdbi driver libraries (default is /usr/local/lib/dbd)],
+[  --with-dbi=path             location of the libdbi driver libraries (default is /usr/lib/x86_64-linux-gnu/dbd/)],
 [DBI_LIBS=${withval}],
-[DBI_LIBS=/usr/local/lib/dbd/])
+[DBI_LIBS=/usr/lib/x86_64-linux-gnu/dbd/])
+
+AC_ARG_WITH([perlbase],
+[  --with-perlbase=path        base location to install Perl modules (default based on Config.pm)],
+[PERL_BASE=${withval}],
+[PERL_BASE=x])
+AC_SUBST([PERL_BASE])
 
 # If the passed in value doesn't work, fall back to reasonable defaults
 # Distributions are starting to package a good version of libdbi / libdbd
@@ -249,8 +236,30 @@ if ! test -d "$DBI_LIBS"; then
 fi
 AC_SUBST([DBI_LIBS])
 
+AM_CONDITIONAL(CHECK_TESTS, test x$enable_tests = xyes)
+
 if test "x$openils_core" = "xtrue"; then
 
+    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`])
+    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`])
+    AC_SUBST([OPENSRF_LIBS])
+
     AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
     if test $MEMCACHED = "no"; then
         AC_MSG_ERROR([*** memcached not found, aborting])
@@ -280,15 +289,6 @@ if test "x$openils_core" = "xtrue"; then
     # Checks for libraries. 
     #------------------------------------
 
-    # Check for the existence of libraries in non-standard locations
-
-    AC_MSG_CHECKING(for -lopensrf)
-    if test -e ${OPENSRF_LIBS}/libopensrf.so; then
-    AC_MSG_RESULT([yes])
-    else
-    AC_MSG_ERROR([*** libopensrf not found (or not in location specified to configure), aborting])
-    fi
-
     # Check for the rest of the libraries
 
     #check for dynamic linking functions
@@ -309,10 +309,17 @@ 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))
+
+    # 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([xslt], [main], [], AC_MSG_ERROR(*** OpenILS requires libxslt))
     AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
+    PKG_CHECK_MODULES(pcre, libpcre >= 3.0.0)
 
 
     #------------------------------------
@@ -339,12 +346,22 @@ if test "x$openils_core" = "xtrue"; then
     AC_FUNC_STRTOD
     AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
 
+    #---------------------------------
+    # Check for unit test framework.
+    #---------------------------------
+    PKG_CHECK_MODULES([CHECK], [check >= 0.9.0], [enable_tests=yes],
+                      [enable_tests=no])
+    if test "x$enable_tests" = "xno"; then
+        AC_MSG_WARN(Check unit testing framework not found.)
+    fi
+
     #----------------------------
     # Create Makefiles/Output
     #----------------------------
 
     AC_CONFIG_FILES([Open-ILS/examples/Makefile
              Open-ILS/src/c-apps/Makefile
+             Open-ILS/src/c-apps/tests/Makefile
              Open-ILS/src/extras/Makefile
              Open-ILS/src/java/Makefile
              Open-ILS/src/python/Makefile])
@@ -369,28 +386,14 @@ fi
 
 AC_CONFIG_FILES([Makefile
          Open-ILS/src/Makefile
+         Open-ILS/src/perlmods/Makefile
          Open-ILS/web/Makefile
          Open-ILS/updates/Makefile
          Open-ILS/xul/staff_client/Makefile
          Open-ILS/src/extras/eg_config
-         Open-ILS/src/extras/fast-extract
-         Open-ILS/src/extras/import/marc2are.pl
-         Open-ILS/src/extras/import/marc2bre.pl
-         Open-ILS/src/extras/import/marc2sre.pl
-         Open-ILS/src/extras/import/parallel_pg_loader.pl
-         Open-ILS/src/support-scripts/authority_control_fields.pl
-         Open-ILS/src/support-scripts/marc_export
-         Open-ILS/src/perlmods/Makefile
-         Open-ILS/src/perlmods/lib/OpenILS/Utils/Cronscript.pm],
+         ],
         [
             if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
-            if test -e "./Open-ILS/src/extras/fast-extract"; then chmod 755 Open-ILS/src/extras/fast-extract; fi;
-            if test -e "./Open-ILS/src/extras/import/marc2are.pl"; then chmod 755 Open-ILS/src/extras/import/marc2are.pl; fi;
-            if test -e "./Open-ILS/src/extras/import/marc2bre.pl"; then chmod 755 Open-ILS/src/extras/import/marc2bre.pl; fi;
-            if test -e "./Open-ILS/src/extras/import/marc2sre.pl"; then chmod 755 Open-ILS/src/extras/import/marc2sre.pl; fi;
-            if test -e "./Open-ILS/src/extras/import/parallel_pg_loader.pl"; then chmod 755 Open-ILS/src/extras/import/parallel_pg_loader.pl; fi;
-            if test -e "./Open-ILS/src/support-scripts/authority_control_fields.pl"; then chmod 755 Open-ILS/src/support-scripts/authority_control_fields.pl; fi;
-            if test -e "./Open-ILS/src/support-scripts/marc_export"; then chmod 755 Open-ILS/src/support-scripts/marc_export; fi;
         ])
 AC_OUTPUT
 
@@ -448,8 +451,6 @@ AC_MSG_RESULT([-------- Installation Directories --------])
 AC_MSG_RESULT(Installation directory prefix:            ${prefix})
 AC_MSG_RESULT(Temporary directory:                      ${TMP})
 AC_MSG_RESULT(APXS2 location:                           ${APXS2})
-AC_MSG_RESULT(Apache headers location:                  ${APACHE2_HEADERS})
-AC_MSG_RESULT(APR headers location:                     ${APR_HEADERS})
 AC_MSG_RESULT(libxml2 headers location:                 ${LIBXML2_HEADERS})
 AC_MSG_RESULT(libdbi location:                          ${DBI_LIBS})
 AC_MSG_RESULT(OpenSRF headers location:                 ${OPENSRF_HEADERS})