]> git.notmuchmail.org Git - notmuch/blobdiff - configure
Avoid database corruption by not adding partially-constructed mail documents.
[notmuch] / configure
index c522ad8524becfdb28ff73aefefbca6bb08c0411..40538e14eec0f3aa9263eeb4b0d1b84282837429 100755 (executable)
--- a/configure
+++ b/configure
@@ -6,6 +6,7 @@ CC=${CC:-gcc}
 CXX=${CXX:-g++}
 CFLAGS=${CFLAGS:--O2}
 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
+LDFLAGS=${LDFLAGS:-}
 XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config-1.1 xapian-config}
 
 # We don't allow the EMACS or GZIP Makefile variables inherit values
@@ -257,15 +258,26 @@ else
     have_emacs=0
 fi
 
-printf "Checking for Mac OS X (for shared library)... "
+printf "Checking which platform we are on... "
 if [ `uname` = "Darwin" ] ; then
-    printf "Yes.\n"
-    mac_os_x=1
+    printf "Mac OS X.\n"
+    platform=MACOSX
     linker_resolves_library_dependencies=0
-else
-    printf "No.\n"
-    mac_os_x=0
+elif [ `uname` = "SunOS" ] ; then
+    printf "Solaris.\n"
+    platform=SOLARIS
+    linker_resolves_library_dependencies=0
+elif [ `uname` = "Linux" ] ; then
+    printf "Linux\n"
+    platform=LINUX
     linker_resolves_library_dependencies=1
+else
+    printf "Unknown.\n"
+    cat <<EOF
+
+*** Warning: Unknown platform. Notmuch might or might not build correctly.
+
+EOF
 fi
 
 if [ $errors -gt 0 ]; then
@@ -389,6 +401,9 @@ CFLAGS = ${CFLAGS}
 # Default FLAGS for C++ compiler (can be overridden by user such as "make CXXFLAGS=-g")
 CXXFLAGS = ${CXXFLAGS}
 
+# Default FLAGS for the linker (can be overridden by user such as "make LDFLAGS=-znow")
+LDFLAGS = ${LDFLAGS}
+
 # Flags to enable warnings when using the C++ compiler
 WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
 
@@ -433,9 +448,8 @@ HAVE_GETLINE = ${have_getline}
 # build its own version)
 HAVE_STRCASESTR = ${have_strcasestr}
 
-# Whether we are building on OS X.  This will affect how we build the
-# shared library.
-MAC_OS_X = ${mac_os_x}
+# Supported platforms (so far) are: LINUX, MACOSX, SOLARIS
+PLATFORM = ${platform}
 
 # Whether the linker will automatically resolve the dependency of one
 # library on another (if not, then linking a binary requires linking