diff options
author | Noah Slater <nslater@apache.org> | 2012-12-03 10:06:06 +0100 |
---|---|---|
committer | Dave Cottlehuber <dch@apache.org> | 2012-12-11 14:10:52 +0100 |
commit | 719d2b6e43328de1eacf4f94accfdb478375d95d (patch) | |
tree | 0be0d70dc4aa8d15661858997a966756b88ad41d /configure.ac | |
parent | 84226656ab3fad6f95029aad993be9f5ec4f1794 (diff) | |
download | couchdb-719d2b6e43328de1eacf4f94accfdb478375d95d.tar.gz |
Integrate Sphinx into autotools
Integrate Sphinx into autotools
- Remove M4 macros and require as external dependencies instead
- Skip help2man generation if help2man is not installed
- ensure THANKS file is only updated during make distcheck
- Add TexInfo, PDF, HTML doc targets via Sphinx
- Add licenses and header compliance checking
- support optional builds of PDF, HTML, texinfo via Sphinx and pdflatex
- support skipping docs or compiler tests for happy developers
Travis: clean up package dependencies
- include sphinx via aptitude
- use spidermonkey 1.8.5 instead of default libmozjs
- include latex components for building PDFs
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 390 |
1 files changed, 282 insertions, 108 deletions
diff --git a/configure.ac b/configure.ac index 3c0e231e7..5246830a1 100644 --- a/configure.ac +++ b/configure.ac @@ -10,27 +10,30 @@ dnl WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the dnl License for the specific language governing permissions and limitations dnl under the License. -AC_INIT([LOCAL_PACKAGE_NAME], [LOCAL_VERSION], [LOCAL_BUG_URI], +AC_INIT( + [LOCAL_PACKAGE_NAME], + [LOCAL_VERSION], + [LOCAL_BUG_URI], [LOCAL_PACKAGE_TARNAME]) -AC_PREREQ([2.59]) +AC_PREREQ([2.68]) AC_CONFIG_SRCDIR([CHANGES]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) -AM_CONFIG_HEADER([config.h]) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([src/snappy/google-snappy/config.h]) AM_INIT_AUTOMAKE([1.6.3 foreign]) -AC_GNU_SOURCE +AC_USE_SYSTEM_EXTENSIONS AC_ENABLE_SHARED AC_DISABLE_STATIC AC_PROG_CC LT_INIT([win32-dll]) -AC_PROG_LIBTOOL +LT_INIT AC_PROG_LN_S PKG_PROG_PKG_CONFIG @@ -48,32 +51,36 @@ AC_CHECK_FUNC([mmap]) AC_MSG_CHECKING([if the compiler supports __builtin_expect]) -AC_TRY_COMPILE(, [ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_expect(1, 1) ? 1 : 0 -], [ +]])],[ snappy_have_builtin_expect=yes AC_MSG_RESULT([yes]) -], [ +],[ snappy_have_builtin_expect=no AC_MSG_RESULT([no]) ]) + if test x$snappy_have_builtin_expect = xyes ; then - AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.]) + AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], + [Define to 1 if the compiler supports __builtin_expect.]) fi AC_MSG_CHECKING([if the compiler supports __builtin_ctzll]) -AC_TRY_COMPILE(, [ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return (__builtin_ctzll(0x100000000LL) == 32) ? 1 : 0 -], [ +]])],[ snappy_have_builtin_ctz=yes AC_MSG_RESULT([yes]) -], [ +],[ snappy_have_builtin_ctz=no AC_MSG_RESULT([no]) ]) + if test x$snappy_have_builtin_ctz = xyes ; then - AC_DEFINE([HAVE_BUILTIN_CTZ], [1], [Define to 1 if the compiler supports __builtin_ctz and friends.]) + AC_DEFINE([HAVE_BUILTIN_CTZ], [1], + [Define to 1 if the compiler supports __builtin_ctz and friends.]) fi if test "$ac_cv_header_stdint_h" = "yes"; then @@ -94,16 +101,18 @@ SNAPPY_PATCHLEVEL="snappy_patchlevel" AC_SUBST([SNAPPY_MAJOR]) AC_SUBST([SNAPPY_MINOR]) AC_SUBST([SNAPPY_PATCHLEVEL]) -dnl End of google snappy specific config AC_MSG_CHECKING([for pthread_create in -lpthread]) original_LIBS="$LIBS" LIBS="-lpthread $original_LIBS" -AC_TRY_LINK([#include<pthread.h>], - [pthread_create((void *)0, (void *)0, (void *)0, (void *)0)], - [pthread=yes], [pthread=no]) +AC_LINK_IFELSE([ + AC_LANG_PROGRAM( + [[#include<pthread.h>]], + [[pthread_create((void *)0, (void *)0, (void *)0, (void *)0)]])], + [pthread=yes], + [pthread=no]) if test x${pthread} = xyes; then AC_MSG_RESULT([yes]) @@ -113,28 +122,32 @@ else fi AC_PATH_PROG([ERL], [erl]) + AS_IF([test x${ERL} = x], [ AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?]) - ]) +]) -AC_ARG_WITH([erlang], [AC_HELP_STRING([--with-erlang=PATH], - [set PATH to the Erlang include directory])], [ +AC_ARG_WITH([erlang], + [AS_HELP_STRING([--with-erlang=PATH], + [set PATH to the Erlang include directory]) +], [ ERLANG_FLAGS="-I$withval" ], [ realerl=`readlink -f $ERL 2>/dev/null` AS_IF([test $? -eq 0], [ - erlbase=`dirname $realerl` - erlbase=`dirname $erlbase` - ERLANG_FLAGS="-I${erlbase}/usr/include" - ], [ - # Failed to figure out where erl is installed.. - # try to add some default directories to search - ERLANG_FLAGS="-I${libdir}/erlang/usr/include" - ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/lib/erlang/usr/include" - ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/local/lib/erlang/usr/include" - ERLANG_FLAGS="$ERLANG_FLAGS -I/opt/local/lib/erlang/usr/include" - ]) + erlbase=`dirname $realerl` + erlbase=`dirname $erlbase` + ERLANG_FLAGS="-I${erlbase}/usr/include" + ], [ + # Failed to figure out where erl is installed.. + # try to add some default directories to search + ERLANG_FLAGS="-I${libdir}/erlang/usr/include" + ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/lib/erlang/usr/include" + ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/local/lib/erlang/usr/include" + ERLANG_FLAGS="$ERLANG_FLAGS -I/opt/local/lib/erlang/usr/include" + ]) ]) + AC_SUBST(ERLANG_FLAGS) PKG_CHECK_MODULES([JS], [mozjs185], [ @@ -152,30 +165,35 @@ PKG_CHECK_MODULES([JS], [mozjs185], [ ]) ]) -AC_ARG_WITH([js-include], [AC_HELP_STRING([--with-js-include=PATH], - [set PATH to the SpiderMonkey include directory])], [ +AC_ARG_WITH([js-include], + [AS_HELP_STRING([--with-js-include=PATH], + [set PATH to the SpiderMonkey include directory]) +], [ JS_INCLUDE="$withval" JS_CFLAGS="-I$JS_INCLUDE" ], []) -AC_ARG_WITH([js-lib], [AC_HELP_STRING([--with-js-lib=PATH], - [set PATH to the SpiderMonkey library directory])], - [ +AC_ARG_WITH([js-lib], + [AS_HELP_STRING([--with-js-lib=PATH], + [set PATH to the SpiderMonkey library directory]) +], [ JS_LIB_DIR=$withval JS_LIBS="-L$withval" ], []) use_js_trunk=no -AC_ARG_ENABLE([js-trunk], [AC_HELP_STRING([--enable-js-trunk], - [allow use of SpiderMonkey versions newer than js185-1.0.0])], [ + +AC_ARG_ENABLE([js-trunk], + [AS_HELP_STRING([--enable-js-trunk], + [allow use of SpiderMonkey versions newer than js185-1.0.0]) +], [ use_js_trunk=$enableval ], []) AC_ARG_VAR([ERLC_FLAGS], [general flags to prepend to ERLC_FLAGS]) AC_ARG_VAR([FLAGS], [general flags to prepend to LDFLAGS and CPPFLAGS]) -AS_CASE([$(uname -s)], - [CYGWIN*], [] , - [*], [ + +AS_CASE([$(uname -s)], [CYGWIN*], [] , [*], [ CPPFLAGS="$CPPFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include/js" CPPFLAGS="$CPPFLAGS -I/usr/local/include" @@ -185,6 +203,7 @@ AS_CASE([$(uname -s)], LDFLAGS="$LDFLAGS -L/opt/local/lib" LDFLAGS="$LDFLAGS -L/usr/local/lib" ]) + CPPFLAGS="$CPPFLAGS $FLAGS" LDFLAGS="$LDFLAGS $FLAGS" @@ -194,33 +213,31 @@ CFLAGS="-O2 $CFLAGS" LIBS="$LIBS $LDFLAGS" -AS_CASE([$(uname -s)], - [CYGWIN*], [ - JS_CFLAGS="-DXP_WIN $JS_CFLAGS" - IS_WINDOWS="TRUE" - ] , - [*], [ - # XP_UNIX required for jsapi.h and has been tested to work on Linux and Darwin. - JS_CFLAGS="-DXP_UNIX $JS_CFLAGS" +AS_CASE([$(uname -s)], [CYGWIN*], [ + JS_CFLAGS="-DXP_WIN $JS_CFLAGS" + IS_WINDOWS="TRUE" +], [*], [ + # XP_UNIX required for jsapi.h, tested on Linux and Darwin. + JS_CFLAGS="-DXP_UNIX $JS_CFLAGS" ]) AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE]) OLD_LIBS="$LIBS" LIBS="$JS_LIBS $LIBS" + OLD_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$JS_CFLAGS $CPPFLAGS" AC_CHECK_HEADER([jsapi.h], [], [ - AC_CHECK_HEADER([js/jsapi.h], - [ + AC_CHECK_HEADER([js/jsapi.h], [ CPPFLAGS="$CPPFLAGS -I$JS_INCLUDE/js" - ], - [ - AC_MSG_ERROR([Could not find the jsapi header. + ], [ + AC_MSG_ERROR([Could not find the jsapi header. Are the Mozilla SpiderMonkey headers installed?]) - ])]) + ]) +]) AC_CHECK_LIB([mozjs185], [JS_NewContext], [JS_LIB_BASE=mozjs185], [ AC_CHECK_LIB([mozjs185-1.0], [JS_NewContext], [JS_LIB_BASE=mozjs185-1.0], [ @@ -230,13 +247,18 @@ AC_CHECK_LIB([mozjs185], [JS_NewContext], [JS_LIB_BASE=mozjs185], [ AC_CHECK_LIB([js32], [JS_NewContext], [JS_LIB_BASE=js32], [ AC_MSG_ERROR([Could not find the js library. -Is the Mozilla SpiderMonkey library installed?])])])])])])]) +Is the Mozilla SpiderMonkey library installed?]) + ]) + ]) + ]) + ]) + ]) +]) # Figure out what version of SpiderMonkey to use AC_CHECK_LIB([$JS_LIB_BASE], [JS_NewCompartmentAndGlobalObject], # Prevent people from accidentally using SpiderMonkey's that are too new - if test "$use_js_trunk" = "no"; then AC_CHECK_DECL([JSOPTION_ANONFUNFIX], [], [ AC_MSG_ERROR([Your SpiderMonkey library is too new. @@ -246,23 +268,27 @@ enforcement of preventing anonymous functions in a statement context. This will most likely break your existing JavaScript code as well as render all example code invalid. -If you wish to ignore this error pass --enable-js-trunk to ./configure.])], - [[#include <jsapi.h>]]) +If you wish to ignore this error pass --enable-js-trunk to ./configure.]) + ], [ + [#include <jsapi.h>] + ]) fi - AC_DEFINE([SM185], [1], - [Use SpiderMonkey 1.8.5])) + AC_DEFINE([SM185], [1], [Use SpiderMonkey 1.8.5]) +) AC_CHECK_LIB([$JS_LIB_BASE], [JS_ThrowStopIteration], AC_DEFINE([SM180], [1], - [Use SpiderMonkey 1.8.0])) + [Use SpiderMonkey 1.8.0]) +) AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength], AC_DEFINE([HAVE_JS_GET_STRING_CHARS_AND_LENGTH], [1], - [Use newer JS_GetCharsAndLength function.])) + [Use newer JS_GetCharsAndLength function.]) +) # Else, hope that 1.7.0 works -# Deal with JSScript -> JSObject -> JSScript switcheroo +# Deal with JSScript to JSObject to JSScript switcheroo AC_CHECK_TYPE([JSScript*], [AC_DEFINE([JSSCRIPT_TYPE], [JSScript*], [Use JSObject* for scripts])], @@ -273,9 +299,7 @@ AC_CHECK_TYPE([JSScript*], AC_DEFINE([COUCHJS_NAME], ["couchjs"], ["CouchJS executable name."]) if test x${IS_WINDOWS} = xTRUE; then - AC_DEFINE([COUCHJS_NAME], ["couchjs.exe"], ["CouchJS executable name."]) - if test -f "$JS_LIB_DIR/$JS_LIB_BASE.dll"; then # seamonkey 1.7- build layout on Windows JS_LIB_BINARY="$JS_LIB_DIR/$JS_LIB_BASE.dll" @@ -288,50 +312,53 @@ if test x${IS_WINDOWS} = xTRUE; then fi fi AC_SUBST(JS_LIB_BINARY) - # On windows we need to know the path to the openssl binaries. - AC_ARG_WITH([openssl-bin-dir], [AC_HELP_STRING([--with-openssl-bin-dir=PATH], - [path to the open ssl binaries for distribution on Windows])], [ + AC_ARG_WITH([openssl-bin-dir], + [AS_HELP_STRING([--with-openssl-bin-dir=PATH], + [path to the open ssl binaries for distribution on Windows]) + ], [ openssl_bin_dir=`cygpath -m "$withval"` AC_SUBST(openssl_bin_dir) ], []) - # Windows uses Inno setup - look for its compiler. AC_PATH_PROG([INNO_COMPILER_EXECUTABLE], [iscc]) if test x${INNO_COMPILER_EXECUTABLE} = x; then AC_MSG_WARN([You will be unable to build the Windows installer.]) fi - # We need the msvc redistributables for this platform too # (in theory we could just install the assembly locally - but # there are at least 4 directories with binaries, meaning 4 copies; # so using the redist .exe means it ends up installed globally...) - AC_ARG_WITH([msvc-redist-dir], [AC_HELP_STRING([--with-msvc-redist-dir=PATH], - [path to the msvc redistributables for the Windows platform])], [ + AC_ARG_WITH([msvc-redist-dir], + [AS_HELP_STRING([--with-msvc-redist-dir=PATH], + [path to the msvc redistributables for the Windows platform]) + ], [ msvc_redist_dir=`cygpath -m "$withval"` msvc_redist_name="vcredist_x86.exe" AC_SUBST(msvc_redist_dir) AC_SUBST(msvc_redist_name) ], []) if test ! -f ${msvc_redist_dir}/${msvc_redist_name}; then - AC_MSG_WARN([The MSVC redistributable seems to be missing; expect the installer to fail.]) + AC_MSG_WARN([Installer may fail due to missing MSVC redistributable.]) fi fi JS_LIBS="-l$JS_LIB_BASE -lm $JS_LIBS" + AC_SUBST(JS_LIBS) LIBS="$OLD_LIBS" CPPFLAGS="$OLD_CPPFLAGS" - -AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH], - [set PATH to the Win32 native ICU binaries directory])], [ +AC_ARG_WITH([win32-icu-binaries], + [AS_HELP_STRING([--with-win32-icu-binaries=PATH], + [set PATH to the Win32 native ICU binaries directory]) +], [ ICU_CPPFLAGS="-I$withval/include" ICU_LIBS="-L$withval/lib -licuuc -licudt -licuin" ICU_BIN=$withval/bin ], [ - AC_CHECK_ICU([3.4.1]) + AX_CHECK_ICU([3.4.1]) ICU_BIN= ]) @@ -341,16 +368,20 @@ AC_SUBST(ICU_LIBS) AC_SUBST(ICU_BIN) use_curl=yes -AC_ARG_WITH([win32-curl], [AC_HELP_STRING([--with-win32-curl=PATH], - [set PATH to the Win32 native curl directory])], [ + +AC_ARG_WITH([win32-curl], + [AS_HELP_STRING([--with-win32-curl=PATH], + [set PATH to the Win32 native curl directory]) +], [ # default build on windows is a static lib, and that's what we want too CURL_CFLAGS="-I$withval/include -DCURL_STATICLIB" CURL_LIBS="-L$withval/lib -llibcurl -lWs2_32 -lkernel32 -luser32 -ladvapi32 -lWldap32" # OpenSSL libraries may be pulled in via libcurl if it was built with SSL # these are libeay32 ssleay32 instead of crypto ssl on unix ], [ - AC_CHECK_CURL([7.18.0], - [AC_DEFINE([HAVE_CURL], [1], ["Provide HTTP support to couchjs"])], [ + AX_LIB_CURL([7.18.0],[ + AC_DEFINE([HAVE_CURL], [1], ["Provide HTTP support to couchjs"]) + ],[ AC_MSG_WARN([You will be unable to run some JavaScript unit tests.]) use_curl=no CURL_LIBS= @@ -392,56 +423,97 @@ if test `echo $version | ${AWK} "{print \\$2}"` -eq 7; then fi fi -otp_release="`${ERL} -noshell -eval 'io:put_chars(erlang:system_info(otp_release)).' -s erlang halt`" +otp_release="`\ + ${ERL} -noshell \ + -eval 'io:put_chars(erlang:system_info(otp_release)).' \ + -s erlang halt`" + AC_SUBST(otp_release) + AM_CONDITIONAL([USE_OTP_NIFS], [test x$otp_release \> xR13B03]) AM_CONDITIONAL([USE_EJSON_COMPARE_NIF], [test x$otp_release \> xR14B03]) -has_crypto=`${ERL} -eval "case application:load(crypto) of ok -> ok; _ -> exit(no_crypto) end." -noshell -s init stop` +has_crypto=`\ + ${ERL} -eval "\ + case application:load(crypto) of ok -> ok; _ -> exit(no_crypto) end. \ + " -noshell -s init stop` if test -n "$has_crypto"; then - AC_MSG_ERROR([Could not find the Erlang crypto library. Has Erlang been compiled with OpenSSL support?]) + AC_MSG_ERROR([Could not find the Erlang crypto library. + +Has Erlang been compiled with OpenSSL support?]) fi AC_PATH_PROG([ERLC], [erlc]) if test x${ERLC} = x; then - AC_MSG_ERROR([Could not find the `erlc' executable. Is Erlang installed?]) + AC_MSG_ERROR([Could not find the `erlc' executable. + +Is Erlang installed?]) fi OLD_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$ERLANG_FLAGS $CPPFLAGS" + AC_CHECK_HEADER([erl_driver.h], [], [ AC_MSG_ERROR([Could not find the `erl_driver.h' header. -Are the Erlang headers installed? Use the `--with-erlang' option to specify the -path to the Erlang include directory.])]) -CPPFLAGS="$OLD_CPPFLAGS" +Are the Erlang headers installed? -AC_PATH_PROG([HELP2MAN_EXECUTABLE], [help2man]) -if test x${HELP2MAN_EXECUTABLE} = x; then - AC_MSG_WARN([You will be unable to regenerate any man pages.]) -fi +Use the `--with-erlang' option to specify the Erlang include directory.]) +]) + +CPPFLAGS="$OLD_CPPFLAGS" use_init=yes use_launchd=yes native_mochijson_enabled=no +tests_enabled=yes +docs_enabled=yes +strictness_enabled=no -AC_ARG_ENABLE([init], [AC_HELP_STRING([--disable-init], - [don't install init script where applicable])], [ +AC_ARG_ENABLE([init], + [AS_HELP_STRING([--disable-init], + [don't install init script where applicable]) +], [ use_init=$enableval ], []) -AC_ARG_ENABLE([launchd], [AC_HELP_STRING([--disable-launchd], - [don't install launchd configuration where applicable])], [ +AC_ARG_ENABLE([launchd], + [AS_HELP_STRING([--disable-launchd], + [don't install launchd configuration where applicable]) +], [ use_launchd=$enableval ], []) -AC_ARG_ENABLE([native-mochijson], [AC_HELP_STRING([--enable-native-mochijson], - [compile mochijson to native code (EXPERIMENTAL)])], [ +AC_ARG_ENABLE([native-mochijson], + [AS_HELP_STRING([--enable-native-mochijson], + [compile mochijson to native code (EXPERIMENTAL)]) +], [ native_mochijson_enabled=$enableval ], []) +AC_ARG_ENABLE([tests], + [AS_HELP_STRING([--disable-tests], + [skip tests during build]) +], [ + tests_enabled=$enableval +], []) + +AC_ARG_ENABLE([docs], + [AS_HELP_STRING([--disable-docs], + [skip docs during build]) +], [ + docs_enabled=$enableval +], []) + +AC_ARG_ENABLE([strictness], + [AS_HELP_STRING([--enable-strictness], + [exit when optional checks fail]) +], [ + strictness_enabled=$enableval +], []) + init_enabled=false launchd_enabled=false @@ -474,26 +546,122 @@ if test "$use_launchd" = "yes"; then fi fi -AC_ARG_VAR([ERL], [path to the `erl' executable]) -AC_ARG_VAR([ERLC], [path to the `erlc' executable]) -AC_ARG_VAR([HELP2MAN_EXECUTABLE], [path to the `help2man' program]) +AC_CHECK_PROG([HAS_HELP2MAN], [help2man], [yes]) + +if test x${HAS_HELP2MAN} = x; then + if test x${strictness_enabled} = xyes; then + AC_MSG_ERROR([Could not find the `help2man' executable.]) + else + AC_MSG_WARN([You will be unable to regenerate man pages.]) + fi +fi + +AC_CHECK_PROG([HAS_PDFLATEX], [pdflatex], [yes]) + +if test x${HAS_PDFLATEX} = x; then + if test x${strictness_enabled} = xyes; then + AC_MSG_ERROR([Could not find the `pdflatex' executable. + +Is LaTeX installed?]) + else + AC_MSG_WARN([You will be unable to regenerate PDF documentation.]) + fi +fi + +AC_CHECK_PROG([HAS_MAKEINFO], [makeinfo], [yes]) + +if test x${HAS_MAKEINFO} = x; then + if test x${strictness_enabled} = xyes; then + AC_MSG_ERROR([Could not find the `makeinfo' executable. + +Is GNU Texinfo installed?]) + else + AC_MSG_WARN([You will be unable to regenerate info documentation.]) + fi +fi + +AC_CHECK_PROG([HAS_INSTALLINFO], [install-info], [yes]) -if test -n "$HELP2MAN_EXECUTABLE"; then - help2man_enabled=true +if test x${HAS_INSTALLINFO} = x; then + if test x${strictness_enabled} = xyes; then + AC_MSG_ERROR([Could not find the `install-info' executable. + +Is GNU Texinfo installed?]) + else + AC_MSG_WARN([You will be unable to install info documentation.]) + fi +fi + +AC_CHECK_PROG([HAS_SPHINX_BUILD], [sphinx-build], [yes]) + +if test x${HAS_SPHINX_BUILD} = x; then + if test x${strictness_enabled} = xyes; then + AC_MSG_ERROR([Could not find the `sphinx-build' executable.]) + else + AC_MSG_WARN([You will be unable to regenerate documentation.]) + fi +fi + +if test x${docs_enabled} = xyes; then + if test x${HAS_HELP2MAN} = xyes; then + build_man=yes + fi + if test x${HAS_SPHINX_BUILD} = xyes; then + build_html=yes + if test x${HAS_MAKEINFO} = xyes; then + build_info=yes + fi + if test x${HAS_PDFLATEX} = xyes; then + build_pdf=yes + fi + fi +fi + +if test x${strictness_enabled} = xyes; then + AX_PYTHON_MODULE([pygments], [fatal]) +else + AX_PYTHON_MODULE([pygments]) +fi + +AC_MSG_CHECKING(pygments version >= 1.5) + +python 2> /dev/null << EOF +import sys +import pygments + +if float(pygments.__version__) >= 1.5: + sys.exit(0) +else: + sys.exit(1) +EOF + +if test $? -eq 0; then + AC_MSG_RESULT(yes) else - if test -f "$srcdir/bin/couchdb.1" -a -f "$srcdir/src/couchdb/priv/couchjs.1"; then - help2man_enabled=true + AC_MSG_RESULT(no) + if test x${strictness_enabled} = xyes; then + AC_MSG_ERROR([Your copy of pygments is out of date.], 1) else - help2man_enabled=false + AC_MSG_WARN([Syntax highlighting may not work.]) fi fi +AC_ARG_VAR([ERL], [path to the `erl' executable]) +AC_ARG_VAR([ERLC], [path to the `erlc' executable]) + AM_CONDITIONAL([INIT], [test x${init_enabled} = xtrue]) AM_CONDITIONAL([LAUNCHD], [test x${launchd_enabled} = xtrue]) -AM_CONDITIONAL([HELP2MAN], [test x${help2man_enabled} = xtrue]) AM_CONDITIONAL([USE_NATIVE_MOCHIJSON], [test x${native_mochijson_enabled} = xyes]) AM_CONDITIONAL([USE_CURL], [test x${use_curl} = xyes]) +AM_CONDITIONAL([BUILD_MAN], [test x${build_man} = xyes]) +AM_CONDITIONAL([BUILD_INFO], [test x${build_info} = xyes]) +AM_CONDITIONAL([BUILD_PDF], [test x${build_pdf} = xyes]) +AM_CONDITIONAL([BUILD_HTML], [test x${build_html} = xyes]) + +AM_CONDITIONAL([TESTS], [test x${tests_enabled} = xyes]) +AM_CONDITIONAL([STRICTNESS], [test x${strictness_enabled} = xyes]) + AC_SUBST([package_author_name], ["LOCAL_PACKAGE_AUTHOR_NAME"]) AC_SUBST([package_author_address], ["LOCAL_PACKAGE_AUTHOR_ADDRESS"]) AC_SUBST([package_identifier], ["LOCAL_PACKAGE_IDENTIFIER"]) @@ -549,6 +717,8 @@ AC_CONFIG_FILES([etc/logrotate.d/Makefile]) AC_CONFIG_FILES([etc/windows/Makefile]) AC_CONFIG_FILES([etc/Makefile]) AC_CONFIG_FILES([share/Makefile]) +AC_CONFIG_FILES([share/doc/Makefile]) +AC_CONFIG_FILES([share/doc/build/Makefile]) AC_CONFIG_FILES([src/Makefile]) AC_CONFIG_FILES([src/couch_index/Makefile]) AC_CONFIG_FILES([src/couch_mrview/Makefile]) @@ -581,14 +751,18 @@ AC_OUTPUT # identifies this dastardly mix as a unix variant, and libtool kindly # passes incorrect flags and names through to the MS linker. The simplest fix # is to modify libtool via sed to remove those options. +# # As this is only done once at first configure, and subsequent config or source # changes may trigger a silent reversion to the non-functioning original. +# # Changes are; +# # 1. replace LIB$name with $name in libname_spec (e.g. libicu -> icu) to ensure # correct windows versions of .lib and .dlls are found or generated. # 2. remove incompatible \w-link\w from archive_cmds # 3. remove GNU-style directives to be passed through to the linker # 4. swap GNU-style shared library flags with MS -dll variant +# # This obscene hackery is tracked under COUCHDB-440 and COUCHDB-1197. if test x${IS_WINDOWS} = xTRUE; then |