X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=bbf30cd51c92ad0856a1e4eb5692500a973af5b0;hp=c7ec4145afb37518d2d2155911f86ef61effece2;hb=18967ef7506566c3b7b5332893a3876da051ca5d;hpb=26b4cc4aad93e25dab1e1f38f19f1ae69cde389c diff --git a/configure b/configure index c7ec4145..bbf30cd5 100755 --- a/configure +++ b/configure @@ -1,12 +1,25 @@ #! /bin/sh -# Removing space from IFS makes it much easier to support filenames -# with spaces. See http://www.dwheeler.com/essays/filenames-in-shell.html -# for gory details. -IFS="$(printf '\n\t')" +srcdir=$(dirname "$0") -# Since we don't have space in IFS we use tab to separate things in lists -tab="$(printf '\t')" +# For a non-srcdir configure invocation (such as ../configure), create +# the directory structure and copy Makefiles. +if [ "$srcdir" != "." ]; then + + for dir in . $(grep "^subdirs *=" "$srcdir"/Makefile | sed -e "s/subdirs *= *//"); do + mkdir -p "$dir" + cp "$srcdir"/"$dir"/Makefile.local "$dir" + 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 ideal0. + cp -a "$srcdir"/emacs/*.el emacs +fi # Set several defaults (optionally specified by the user in # environemnt variables) @@ -343,11 +356,16 @@ elif [ $uname = "Linux" ] ; then platform=LINUX linker_resolves_library_dependencies=1 ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p') + # Separate ldconfig_paths only on newline (not on any potential + # embedded space characters in any filenames). + OLD_IFS=$IFS + IFS="$(printf '\n')" for path in $ldconfig_paths; do if [ "$path" = "$libdir_expanded" ]; then libdir_in_ldconfig=1 fi done + IFS=$OLD_IFS else printf "Unknown.\n" cat < /dev/null 2>&1 +if ${CC} -o compat/have_getline "$srcdir"/compat/have_getline.c > /dev/null 2>&1 then printf "Yes.\n" have_getline=1 @@ -438,7 +456,7 @@ fi rm -f compat/have_getline printf "Checking for strcasestr... " -if ${CC} -o compat/have_strcasestr compat/have_strcasestr.c > /dev/null 2>&1 +if ${CC} -o compat/have_strcasestr "$srcdir"/compat/have_strcasestr.c > /dev/null 2>&1 then printf "Yes.\n" have_strcasestr=1 @@ -511,6 +529,29 @@ cat > Makefile.config <