]> git.notmuchmail.org Git - notmuch/commitdiff
configure: Remove space from IFS (using tab as necessary)
authorCarl Worth <cworth@cworth.org>
Fri, 4 Jun 2010 23:51:32 +0000 (16:51 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 4 Jun 2010 23:51:32 +0000 (16:51 -0700)
The idea here is to more easily support filenames with spaces in them
in various loops. We're about to add a loop over the paths configured
by the dynamic linker. Hopefully, they wouldn't contain spaces, but
one never knows so we might as well be prepared.

configure

index 40538e14eec0f3aa9263eeb4b0d1b84282837429..07bac08b8377d575b4a5ba7dbf0068b59e1ce7e7 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,13 @@
 #! /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}
@@ -7,7 +15,7 @@ CXX=${CXX:-g++}
 CFLAGS=${CFLAGS:--O2}
 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
 LDFLAGS=${LDFLAGS:-}
-XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config-1.1 xapian-config}
+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