Better support for thread-support flag detection with clang
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 16 Feb 2011 21:06:36 +0000 (23:06 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 16 Feb 2011 21:15:54 +0000 (23:15 +0200)
When testing the stderr produced by various thread-support flags, also
run a compilation in addition to a link, because clang warns on
certain flags when compiling but not when linking.

config/acx_pthread.m4
configure

index ceb161a556ae295918f853dfadbd08b5a6a6305f..6ff241eba19405290f287d0835779603df77377e 100644 (file)
@@ -142,7 +142,8 @@ main (int argc, char **argv)
 }
 _ACEOF
             rm -f conftest.$ac_objext conftest$ac_exeext
-            if test "`(eval $ac_link 2>&1 1>&5)`" = ""; then
+            # Check both linking and compiling, because they might tolerate different options.
+            if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval $ac_compile 2>&1 1>&5)`" = ""; then
                 # we continue with more flags because Linux needs -lpthread
                 # for libpq builds on PostgreSQL.  The test above only
                 # tests for building binaries, not shared libraries.
index f4d11abc7e1cfd446f733e20c9aa3124721f8d1e..a13bf24c8df99708c3612e2b64a3eee1e0368711 100755 (executable)
--- a/configure
+++ b/configure
@@ -22814,7 +22814,8 @@ main (int argc, char **argv)
 }
 _ACEOF
             rm -f conftest.$ac_objext conftest$ac_exeext
-            if test "`(eval $ac_link 2>&1 1>&5)`" = ""; then
+            # Check both linking and compiling, because they might tolerate different options.
+            if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval $ac_compile 2>&1 1>&5)`" = ""; then
                 # we continue with more flags because Linux needs -lpthread
                 # for libpq builds on PostgreSQL.  The test above only
                 # tests for building binaries, not shared libraries.