Make building & installing the core components of Evergreen optional.
[Evergreen.git] / configure.ac
index b74d270..229e4d7 100644 (file)
@@ -30,6 +30,7 @@ AC_SUBST([abs_top_builddir])
 # Checks for programs.
 #-----------------------------------
 
 # Checks for programs.
 #-----------------------------------
 
+
 AC_PROG_LIBTOOL
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_LIBTOOL
 AC_PROG_CC
 AC_PROG_INSTALL
@@ -80,6 +81,18 @@ esac],
 
 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
 
 
 AM_CONDITIONAL([BUILDILSWEB], [test x$openils_web = xtrue])
 
+# install Evergreen Apache modules?
+AC_ARG_ENABLE([apache-modules],
+[  --disable-apache-modules    disables installation of the Evergreen Apache modules ],
+[case "${enableval}" in
+    yes) build_apachemods=true ;;
+    no)  build_apachemods=false ;;
+  *) AC_MSG_ERROR([please choose another value for --disable-apache-modules (supported values are yes or no])
+esac],
+[build_apachemods=true])
+
+AM_CONDITIONAL([BUILDAPACHEMODS], [test x$build_apachemods = xtrue])
+
 # build evergreen-reporter ?
 
 AC_ARG_ENABLE([reporter],
 # build evergreen-reporter ?
 
 AC_ARG_ENABLE([reporter],
@@ -134,41 +147,22 @@ esac],
 
 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
 
 
 AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue])
 
-
-
 #-----------------------------------
 # Check for dependencies 
 #-----------------------------------
 
 #-----------------------------------
 # Check for dependencies 
 #-----------------------------------
 
-AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
-if test $MEMCACHED = "no"; then
-       AC_MSG_ERROR([*** memcached not found, aborting])
-fi
-
-AC_CHECK_PROG([ASPELL],aspell,yes,no)
-if test $ASPELL = "no"; then
-       AC_MSG_ERROR([*** aspell not found, aborting])
-fi
-
-AC_CHECK_PROG([CPAN],cpan,yes,no)
-if test $CPAN = "no"; then
-       AC_MSG_ERROR([*** cpan not found, aborting])
-fi
-
-AC_CHECK_PROG([YAZ],yaz-config,yes,no)
-if test $YAZ = "no"; then
-       AC_MSG_ERROR([*** yaz not found, aborting])
-fi
-
-AC_CHECK_PROG([PERL],perl,yes,no)
-if test $PERL = "no"; then 
-       AC_MSG_ERROR([*** perl not found, aborting])
-fi
-
+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])
 
 
-#-----------------------------------
-# Set install path variables 
-#-----------------------------------
+# 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) ],
 
 AC_ARG_WITH([tmp],
 [  --with-tmp=path             location of the Evergreen temporary directory (default is /tmp) ],
@@ -176,14 +170,22 @@ AC_ARG_WITH([tmp],
 [TMP=/tmp])
 AC_SUBST([TMP])
 
 [TMP=/tmp])
 AC_SUBST([TMP])
 
-
-APXS2=`apxs2 -q BINDIR`/apxs2
+AC_ARG_WITH([apxs],
+[  --with-apxs=path            location of the apxs Apache configuration tool (default is /usr/bin/apxs2)],
+[APXS2=${withval}],
+[APXS2=/usr/bin/apxs2])
 AC_SUBST([APXS2])
 
 AC_SUBST([APXS2])
 
-APACHE2_HEADERS=`apxs2 -q INCLUDEDIR`
+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_SUBST([APACHE2_HEADERS])
 
-APR_HEADERS=`apr-config --includedir`
+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],
 AC_SUBST([APR_HEADERS])
 
 AC_ARG_WITH([libxml2],
@@ -198,95 +200,129 @@ AC_ARG_WITH([dbi],
 [DBI_LIBS=/usr/local/lib/dbd/])
 AC_SUBST([DBI_LIBS])
 
 [DBI_LIBS=/usr/local/lib/dbd/])
 AC_SUBST([DBI_LIBS])
 
-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])
-
-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])
-
-#------------------------------------
-# 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])
+if test "x$openils_core" = "xtrue"; then
+
+       AC_CHECK_PROG([MEMCACHED],memcached,yes,no)
+       if test $MEMCACHED = "no"; then
+               AC_MSG_ERROR([*** memcached not found, aborting])
+       fi
+
+       AC_CHECK_PROG([ASPELL],aspell,yes,no)
+       if test $ASPELL = "no"; then
+               AC_MSG_ERROR([*** aspell not found, aborting])
+       fi
+
+       AC_CHECK_PROG([CPAN],cpan,yes,no)
+       if test $CPAN = "no"; then
+               AC_MSG_ERROR([*** cpan not found, aborting])
+       fi
+
+       AC_CHECK_PROG([YAZ],yaz-config,yes,no)
+       if test $YAZ = "no"; then
+               AC_MSG_ERROR([*** yaz not found, aborting])
+       fi
+
+       AC_CHECK_PROG([PERL],perl,yes,no)
+       if test $PERL = "no"; then 
+               AC_MSG_ERROR([*** perl not found, aborting])
+       fi
+
+       #------------------------------------
+       # 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
+       AC_CHECK_LIB(dl,dlopen)
+
+       #check for the libdbi library
+       AC_CHECK_LIB(dbi,dbi_initialize)
+
+       #to check for the availability and function of a particular
+       #driver we need a runtime check (since the driver is loaded
+       #dynamically). This example checks for the mysql driver
+       AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
+       AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(,
+           [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
+         [AC_MSG_RESULT("yes")],
+         [AC_MSG_FAILURE("pgsql driver not installed?")])
+
+       AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
+       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([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
+       AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
+
+
+       #------------------------------------
+       # Checks for header files.
+       #------------------------------------
+
+       AC_HEADER_STDC
+       AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
+
+       #-------------------------------------------------------------------
+       # Checks for typedefs, structures, and compiler characteristics.
+       #-------------------------------------------------------------------
+
+       AC_C_CONST
+       AC_TYPE_SIZE_T
+       AC_STRUCT_TM
+       AC_HEADER_STDBOOL
+
+       #-------------------------------------------------------------------
+       # Checks for library functions.
+       #-------------------------------------------------------------------
+
+       AC_FUNC_STRFTIME
+       AC_FUNC_STRTOD
+       AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
+
+       #----------------------------
+       # Create Makefiles/Output
+       #----------------------------
+
+       AC_CONFIG_FILES([Open-ILS/examples/Makefile
+                        Open-ILS/src/c-apps/Makefile
+                        Open-ILS/src/extras/Makefile
+                        Open-ILS/src/java/Makefile
+                        Open-ILS/src/python/Makefile])
 fi
 
 fi
 
-# Check for the rest of the libraries
-
-#check for dynamic linking functions
-AC_CHECK_LIB(dl,dlopen)
-
-#check for the libdbi library
-AC_CHECK_LIB(dbi,dbi_initialize)
-
-#to check for the availability and function of a particular
-#driver we need a runtime check (since the driver is loaded
-#dynamically). This example checks for the mysql driver
-AC_MSG_CHECKING([for libdbi pgsql driver (dynamic load)])
-AC_RUN_IFELSE(
-  [AC_LANG_PROGRAM(,
-    [[dbi_initialize(0); return(dbi_conn_new("pgsql") ? 0 : 1);]])],
-  [AC_MSG_RESULT("yes")],
-  [AC_MSG_FAILURE("pgsql driver not installed?")])
-
-AC_CHECK_LIB([expat], [main], [], AC_MSG_ERROR(*** OpenILS requires libexpat))
-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([perl], [main], [], AC_MSG_ERROR(*** OpenILS requires libperl-dev))
-AC_CHECK_LIB([pq], [main], [], AC_MSG_ERROR(*** OpenILS requires libpq))
-
+if test "x$build_apachemods" = "xtrue"; then
 
 
-#------------------------------------
-# Checks for header files.
-#------------------------------------
+       #-----------------------------------
+       # Set install path variables 
+       #-----------------------------------
 
 
-AC_HEADER_STDC
-AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdlib.h string.h unistd.h])
+       #APACHE PREFORK DEV TEST
+       AC_MSG_CHECKING([APXS2])
+       if test -x "${APXS2}"; then
+       AC_MSG_RESULT([yes])
+       else
+       AC_MSG_ERROR([*** apxs not found, aborting])
+       fi  
 
 
-#-------------------------------------------------------------------
-# Checks for typedefs, structures, and compiler characteristics.
-#-------------------------------------------------------------------
-
-AC_C_CONST
-AC_TYPE_SIZE_T
-AC_STRUCT_TM
-AC_HEADER_STDBOOL
-
-#-------------------------------------------------------------------
-# Checks for library functions.
-#-------------------------------------------------------------------
-
-AC_FUNC_STRFTIME
-AC_FUNC_STRTOD
-AC_CHECK_FUNCS([localtime_r memset nl_langinfo setlocale strcasecmp strchr strdup strerror strncasecmp])
-
-#----------------------------
-# Create Makefiles/Output
-#----------------------------
+       AC_CONFIG_FILES([Open-ILS/src/apachemods/Makefile])
+fi
 
 AC_CONFIG_FILES([Makefile
 
 AC_CONFIG_FILES([Makefile
-                 Open-ILS/examples/Makefile
-                 Open-ILS/src/Makefile
-                 Open-ILS/src/apachemods/Makefile
-                 Open-ILS/src/c-apps/Makefile
-                 Open-ILS/src/extras/Makefile
-                 Open-ILS/src/java/Makefile
-                 Open-ILS/src/python/Makefile
-                 Open-ILS/xul/staff_client/Makefile
-                 Open-ILS/src/extras/eg_config],  [if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi])
+                Open-ILS/src/Makefile
+                Open-ILS/web/Makefile
+                Open-ILS/xul/staff_client/Makefile
+                Open-ILS/src/extras/eg_config],  [if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi])
 AC_OUTPUT
 
 #-------------------------------------------------
 AC_OUTPUT
 
 #-------------------------------------------------
@@ -303,6 +339,11 @@ if test "$openils_core" = "true" ; then
 else
        AC_MSG_RESULT([Evergreen Core:                  no])
 fi
 else
        AC_MSG_RESULT([Evergreen Core:                  no])
 fi
+if test "$build_apachemods" = "true" ; then
+        AC_MSG_RESULT([Evergreen Apache module:        yes])
+else
+        AC_MSG_RESULT([Evergreen Apache module:        no])
+fi
 if test "$openils_web" = "true" ; then
         AC_MSG_RESULT([Evergreen Web:                  yes])
 else
 if test "$openils_web" = "true" ; then
         AC_MSG_RESULT([Evergreen Web:                  yes])
 else