X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=c86a227cd7268fe622303efeb86ebf5063285574;hp=ec8c3fd361cb9061197dc29ab326a142a1d65ad9;hb=f6cb896bc4c0bafca1acd5ac3fb45169cd893e29;hpb=2186cac8e7bbc07c6aba0e1fbea91ca789814ecd diff --git a/configure b/configure index ec8c3fd3..c86a227c 100755 --- a/configure +++ b/configure @@ -1,12 +1,21 @@ #! /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')" + +# Since we don't have space in IFS we use tab to separate things in lists +tab="$(printf '\t')" + # Set several defaults (optionally specified by the user in # environemnt variables) CC=${CC:-gcc} CXX=${CXX:-g++} CFLAGS=${CFLAGS:--O2} CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)} -XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config-1.1 xapian-config} +LDFLAGS=${LDFLAGS:-} +XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config-1.1${tab}xapian-config} # 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 @@ -77,7 +86,9 @@ Additional options are accepted for compatibility with other 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 --disable-maintainer-mode Currently ignored @@ -119,8 +130,26 @@ for option; do build_option=${build_option#*-} build_vendor=${build_option%%-*} build_os=${build_option#*-} + elif [ "${option%%=*}" = '--host' ] ; then + host_option="${option#*=}" + case ${host_option} in + *-*-*) ;; + *) + echo "Unrecognized value for --host option: ${host_option}" + echo "Should be: --" + echo "See:" + echo " $0 --help" + echo "" + exit 1 + esac + host_cpu=${host_option%%-*} + host_option=${host_option#*-} + host_vendor=${host_option%%-*} + host_os=${host_option#*-} elif [ "${option%%=*}" = '--infodir' ] ; then true + elif [ "${option%%=*}" = '--datadir' ] ; then + true elif [ "${option%%=*}" = '--localstatedir' ] ; then true elif [ "${option%%=*}" = '--libexecdir' ] ; then @@ -138,6 +167,12 @@ for option; do fi done +# We set this value early, (rather than just while printing the +# Makefile.config file later like most values), because we need to +# actually investigate this value compared to the ldconfig_paths value +# below. +libdir_expanded=${LIBDIR:-${PREFIX}/lib} + cat </dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p') + for path in $ldconfig_paths; do + echo "Checking $path compared to $libdir_expanded" + if [ "$path" = "$libdir_expanded" ]; then + libdir_in_ldconfig=1 + fi + done +else + printf "Unknown.\n" + cat <