X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=b2200be08a03069957c76af3a59f3fbbffd360d6;hp=d0d8f18acef8a3d2f5cfbbf2c70361b0410e0af0;hb=f5411574afd34d580e3c1256c4f0807974099fcf;hpb=9951598d11f9e883374d295f886009cdb64d8f63 diff --git a/configure b/configure index d0d8f18a..b2200be0 100755 --- a/configure +++ b/configure @@ -19,7 +19,12 @@ To work around this problem you may try to execute: # Store original IFS value so it can be changed (and restored) in many places. readonly DEFAULT_IFS="$IFS" +# The top-level directory for the source. This ./configure and all Makefiles +# are good with ${srcdir} usually being relative. Some components (e.g. tests) +# are executed in subdirectories and for those it is simpler to use +# ${NOTMUCH_SRCDIR} which holds absolute path to the source. srcdir=$(dirname "$0") +NOTMUCH_SRCDIR=$(cd "$srcdir" && pwd) subdirs="util compat lib parse-time-string completion doc emacs" subdirs="${subdirs} performance-test test test/test-databases" @@ -35,17 +40,21 @@ if [ "$srcdir" != "." ]; then cp "$srcdir"/"$dir"/Makefile "$dir" done - # Easiest way to get the test suite to work is to just copy the - # whole thing into the build directory. - cp -a "$srcdir"/test/* test - # Emacs only likes to generate compiled files next to the .el files # by default so copy these as well (which is not ideal). cp -a "$srcdir"/emacs/*.el emacs + + # We were not able to create fully working Makefile using ruby mkmf.rb + # so ruby bindings source files are copied as well (ditto -- not ideal). + mkdir bindings/ruby + cp -a "$srcdir"/bindings/ruby/*.[ch] bindings/ruby + cp -a "$srcdir"/bindings/ruby/extconf.rb bindings/ruby fi # Set several defaults (optionally specified by the user in # environment variables) +BASH=${BASH:-bash} +PERL=${PERL:-perl} CC=${CC:-cc} CXX=${CXX:-c++} CFLAGS=${CFLAGS:--g -O2} @@ -55,6 +64,7 @@ CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)} LDFLAGS=${LDFLAGS:-} XAPIAN_CONFIG=${XAPIAN_CONFIG:-} PYTHON=${PYTHON:-} +RUBY=${RUBY:-ruby} # We don't allow the EMACS or GZIP Makefile variables inherit values # from the environment as we do with CC and CXX above. The reason is @@ -111,6 +121,8 @@ Other environment variables can be used to control configure itself, library. [$XAPIAN_CONFIG] PYTHON Name of python command to use in configure and the test suite. + RUBY Name of ruby command to use in + configure and the test suite. Additionally, various options can be specified on the configure command line. @@ -129,10 +141,11 @@ Fine tuning of some installation directories is available: --libdir=DIR Install libraries to DIR [PREFIX/lib] --includedir=DIR Install header files to DIR [PREFIX/include] --mandir=DIR Install man pages to DIR [PREFIX/share/man] + --infodir=DIR Install man pages to DIR [PREFIX/share/man] --sysconfdir=DIR Read-only single-machine data [PREFIX/etc] --emacslispdir=DIR Emacs code [PREFIX/share/emacs/site-lisp] --emacsetcdir=DIR Emacs miscellaneous files [PREFIX/share/emacs/site-lisp] - --bashcompletiondir=DIR Bash completions files [SYSCONFDIR/bash_completion.d] + --bashcompletiondir=DIR Bash completions files [PREFIX/share/bash-completion/completions] --zshcompletiondir=DIR Zsh completions files [PREFIX/share/zsh/functions/Completion/Unix] Some features can be disabled (--with-feature=no is equivalent to @@ -152,7 +165,6 @@ configure-script calling conventions, but don't do anything yet: --build=-- Currently ignored --host=-- Currently ignored - --infodir=DIR Currently ignored --datadir=DIR Currently ignored --localstatedir=DIR Currently ignored --libexecdir=DIR Currently ignored @@ -175,6 +187,8 @@ for option; do INCLUDEDIR="${option#*=}" elif [ "${option%%=*}" = '--mandir' ] ; then MANDIR="${option#*=}" + elif [ "${option%%=*}" = '--infodir' ] ; then + INFODIR="${option#*=}" elif [ "${option%%=*}" = '--sysconfdir' ] ; then SYSCONFDIR="${option#*=}" elif [ "${option%%=*}" = '--emacslispdir' ] ; then @@ -255,8 +269,6 @@ for option; do true elif [ "${option%%=*}" = '--host' ] ; then true - elif [ "${option%%=*}" = '--infodir' ] ; then - true elif [ "${option%%=*}" = '--datadir' ] ; then true elif [ "${option%%=*}" = '--localstatedir' ] ; then @@ -311,22 +323,29 @@ errors=0 printf "int main(void){return 0;}\n" > minimal.c printf "Sanity checking C compilation environment... " -if ${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1 +test_cmdline="${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal" +if ${test_cmdline} > /dev/null 2>&1 then printf "OK.\n" else printf "Fail.\n" errors=$((errors + 1)) + printf Executed:; printf ' %s' ${test_cmdline}; echo + ${test_cmdline} fi printf "Sanity checking C++ compilation environment... " -if ${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1 +test_cmdline="${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal" +if ${test_cmdline} > /dev/null 2>&1 then printf "OK.\n" else printf "Fail.\n" errors=$((errors + 1)) + printf Executed:; printf ' %s' ${test_cmdline}; echo + ${test_cmdline} fi +unset test_cmdline if [ $errors -gt 0 ]; then cat < /dev/null 2>&1 && \ - ./_libversion > _libversion.sh && . ./_libversion.sh +if ${CC} ${CFLAGS} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \ + && ./_libversion > _libversion.sh && . ./_libversion.sh then printf "OK.\n" else @@ -464,15 +483,30 @@ fi # we need to have a version >= 2.6.5 to avoid a crypto bug. We need # 2.6.7 for permissive "From " header handling. GMIME_MINVER=2.6.7 +GMIME3_MINVER=3.0.3 printf "Checking for GMime development files... " -if pkg-config --exists "gmime-2.6 >= $GMIME_MINVER"; then - printf "Yes.\n" +if pkg-config --exists "gmime-3.0 > $GMIME3_MINVER"; then + printf "Yes (3.0).\n" + have_gmime=1 + gmime_cflags=$(pkg-config --cflags gmime-3.0) + gmime_ldflags=$(pkg-config --libs gmime-3.0) + gmime_major=3 + have_gmime_session_keys=1 +elif pkg-config --exists "gmime-2.6 >= $GMIME_MINVER"; then + printf "Yes (2.6).\n" have_gmime=1 gmime_cflags=$(pkg-config --cflags gmime-2.6) gmime_ldflags=$(pkg-config --libs gmime-2.6) + gmime_major=2 + if pkg-config --exists "gmime-2.6 >= 2.6.21"; then + have_gmime_session_keys=1 + else + have_gmime_session_keys=0 + fi else have_gmime=0 + have_gmime_session_keys=0 printf "No.\n" errors=$((errors + 1)) fi @@ -493,8 +527,7 @@ else fi if ! pkg-config --exists zlib; then - ${CC} ${zlib_cflags} -o compat/gen_zlib_pc \ - "$srcdir"/compat/gen_zlib_pc.c ${zlib_ldflags} > /dev/null 2>&1 && + ${CC} -o compat/gen_zlib_pc "$srcdir"/compat/gen_zlib_pc.c >/dev/null 2>&1 && compat/gen_zlib_pc > compat/zlib.pc && PKG_CONFIG_PATH="$PKG_CONFIG_PATH":compat && export PKG_CONFIG_PATH @@ -526,10 +559,30 @@ else errors=$((errors + 1)) fi +printf "Checking for bash... " +if command -v ${BASH} > /dev/null; then + have_bash=1 + bash_absolute=$(command -v ${BASH}) + printf "Yes (%s).\n" "$bash_absolute" +else + have_bash=0 + printf "No. (%s not found)\n" "${BASH}" +fi + +printf "Checking for perl... " +if command -v ${PERL} > /dev/null; then + have_perl=1 + perl_absolute=$(command -v ${PERL}) + printf "Yes (%s).\n" "$perl_absolute" +else + have_perl=0 + printf "No. (%s not found)\n" "${PERL}" +fi + printf "Checking for python... " have_python=0 -for name in ${PYTHON} python python2 python3; do +for name in ${PYTHON} python3 python python2; do if command -v $name > /dev/null; then have_python=1 python=$name @@ -593,7 +646,7 @@ fi have_ruby_dev=0 if [ $WITH_RUBY = "1" ] ; then printf "Checking for ruby development files... " - if ruby -e "require 'mkmf'"> /dev/null 2>&1; then + if ${RUBY} -e "require 'mkmf'"> /dev/null 2>&1; then printf "Yes.\n" have_ruby_dev=1 else @@ -602,6 +655,8 @@ if [ $WITH_RUBY = "1" ] ; then fi have_sphinx=0 +have_makeinfo=0 +have_install_info=0 if [ $WITH_DOCS = "1" ] ; then printf "Checking if sphinx is available and supports nroff output... " if command -v sphinx-build > /dev/null && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then @@ -610,19 +665,20 @@ if [ $WITH_DOCS = "1" ] ; then else printf "No (so will not install man pages).\n" fi -fi - -have_gpgconf_socketdir=0 -printf "Checking for gpgconf --{create,remove}-socketdir... " -if gpgconf --dump-options > /dev/null ; then - if gpgconf --dump-options | grep -q create-socketdir ; then + printf "Checking if makeinfo is available... " + if command -v makeinfo > /dev/null; then printf "Yes.\n" - have_gpgconf_socketdir=1 + have_makeinfo=1 else - printf "No.\n" + printf "No (so will not build info pages).\n" + fi + printf "Checking if install-info is available... " + if command -v install-info > /dev/null; then + printf "Yes.\n" + have_install_info=1 + else + printf "No (so will not install info pages).\n" fi -else - printf "No. (missing or broken gpgconf?)\n" fi if [ $WITH_DESKTOP = "1" ]; then @@ -635,6 +691,15 @@ if [ $WITH_DESKTOP = "1" ]; then fi fi +printf "Checking for cppcheck... " +if command -v cppcheck > /dev/null; then + have_cppcheck=1 + printf "Yes.\n" +else + have_cppcheck=0 + printf "No.\n" +fi + libdir_in_ldconfig=0 printf "Checking which platform we are on... " @@ -672,7 +737,7 @@ elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then IFS=" " for path in $ldconfig_paths; do - if [ "$path" = "$libdir_expanded" ]; then + if [ "$path" -ef "$libdir_expanded" ]; then libdir_in_ldconfig=1 fi done @@ -710,18 +775,18 @@ EOF fi if [ $have_zlib -eq 0 ]; then echo " zlib library (>= version 1.2.5.2, including development files such as headers)" - echo " http://zlib.net/" + echo " https://zlib.net/" echo fi if [ $have_gmime -eq 0 ]; then echo " GMime 2.6 library >= $GMIME_MINVER" echo " (including development files such as headers)" - echo " http://spruce.sourceforge.net/gmime/" + echo " https://github.com/jstedfast/gmime/" echo fi if [ $have_glib -eq 0 ]; then echo " Glib library >= 2.22 (including development files such as headers)" - echo " http://ftp.gnome.org/pub/gnome/sources/glib/" + echo " https://ftp.gnome.org/pub/gnome/sources/glib/" echo fi if [ $have_talloc -eq 0 ]; then @@ -927,6 +992,7 @@ cat > Makefile.config < sh.config <