]> git.notmuchmail.org Git - notmuch/commitdiff
Merge tag '0.20'
authorDavid Bremner <david@tethera.net>
Sun, 31 May 2015 10:06:40 +0000 (12:06 +0200)
committerDavid Bremner <david@tethera.net>
Sun, 31 May 2015 10:06:40 +0000 (12:06 +0200)
notmuch 0.20 release

configure

index 4af7ba94f7bd344cba6fb9e355e10ae5034717a4..2065fcdf6f4ce3af7b5570b3092804027af68df9 100755 (executable)
--- a/configure
+++ b/configure
@@ -47,6 +47,7 @@ CC=${CC:-cc}
 CXX=${CXX:-c++}
 CFLAGS=${CFLAGS:--g -O2}
 CPPFLAGS=${CPPFLAGS:-}
+CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}
 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
 LDFLAGS=${LDFLAGS:-}
 XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}
@@ -269,6 +270,35 @@ dependencies are available:
 EOF
 
 errors=0
+printf "int main(void){return 0;}\n" > minimal.c
+
+printf "Sanity checking C compilation environment... "
+if ${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
+then
+    printf "OK.\n"
+else
+    printf "Fail.\n"
+    errors=$((errors + 1))
+fi
+
+printf "Sanity checking C++ compilation environment... "
+if ${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
+then
+    printf "OK.\n"
+else
+    printf "Fail.\n"
+    errors=$((errors + 1))
+fi
+
+if [ $errors -gt 0 ]; then
+    cat <<EOF
+*** Error: Initial sanity checking of environment failed.  Please try
+running configure in a clean environment, and if the problem persists,
+report a bug.
+EOF
+    rm -f minimal minimal.c
+    exit 1
+fi
 
 if pkg-config --version > /dev/null 2>&1; then
     have_pkg_config=1
@@ -690,8 +720,6 @@ else
 fi
 rm -f compat/check_asctime
 
-printf "int main(void){return 0;}\n" > minimal.c
-
 printf "Checking for rpath support... "
 if ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
 then