]> git.notmuchmail.org Git - notmuch/blobdiff - configure
new: Cleanup. De-duplicate file name removal code.
[notmuch] / configure
index 157ecf39086b08a62fa55760fa964d44ad80574b..3999ce8f3a80509dda16572a3a92bcbf4035a103 100755 (executable)
--- a/configure
+++ b/configure
@@ -22,7 +22,7 @@ if [ "$srcdir" != "." ]; then
 fi
 
 # Set several defaults (optionally specified by the user in
-# environemnt variables)
+# environment variables)
 CC=${CC:-gcc}
 CXX=${CXX:-g++}
 CFLAGS=${CFLAGS:--O2}
@@ -355,17 +355,30 @@ elif [ $uname = "Linux" ] ; then
     printf "Linux\n"
     platform=LINUX
     linker_resolves_library_dependencies=1
+
+    printf "Checking for $libdir_expanded in ldconfig... "
     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).
+    # embedded space characters in any filenames). Note, we use a
+    # literal newline in the source here rather than something like:
+    #
+    #  IFS=$(printf '\n')
+    #
+    # because the shell's command substitution deletes any trailing newlines.
     OLD_IFS=$IFS
-    IFS="$(printf '\n')"
+    IFS="
+"
     for path in $ldconfig_paths; do
        if [ "$path" = "$libdir_expanded" ]; then
            libdir_in_ldconfig=1
        fi
     done
     IFS=$OLD_IFS
+    if [ "$libdir_in_ldconfig" = '0' ]; then
+       printf "No (will set RPATH)\n"
+    else
+       printf "Yes\n"
+    fi
 else
     printf "Unknown.\n"
     cat <<EOF
@@ -529,8 +542,13 @@ cat > Makefile.config <<EOF
 # changes, (and this could happen by simply calling "make" if the
 # configure script is updated).
 
+# The top-level directory for the source, (the directory containing
+# the configure script). This may be different than the build
+# directory (the current directory at the time configure was run).
 srcdir = ${srcdir}
 
+configure_options = $@
+
 # We use vpath directives (rather than the VPATH variable) since the
 # VPATH variable matches targets as well as prerequisites, (which is
 # not useful since then a target left-over from a srcdir build would
@@ -590,7 +608,7 @@ includedir = ${INCLUDEDIR:=\$(prefix)/include}
 # The directory to which man pages should be installed
 mandir = ${MANDIR:=\$(prefix)/share/man}
 
-# The directory to which read-only (configuration) filesshould be installed
+# The directory to which read-only (configuration) files should be installed
 sysconfdir = ${SYSCONFDIR:=\$(prefix)/etc}
 
 # The directory to which emacs lisp files should be installed