]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix bugs in check for gcc's precompiled header bug.
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Sat, 28 Oct 2006 10:31:43 +0000 (10:31 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Sat, 28 Oct 2006 10:31:43 +0000 (10:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure
configure.in

index d8e90b30cc7e8f0ba266c6c00289b80d1fde2237..40829efb68df7c6d684df6b6d3be22cc7a7c3738 100755 (executable)
--- a/configure
+++ b/configure
@@ -47209,25 +47209,34 @@ if test "${wx_cv_gcc_pch_bug+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-            wx_cv_gcc_pch_bug=no
-            echo 'const wchar_t test_var[] = L"wide string";' > conftest.h
+            echo '#include <stdio.h>
+                  const wchar_t test_var[] = L"awidetest";' > conftest.h
+
+            echo '#include "conftest.h"
+                  int main()
+                  {
+                     printf("%ls\n", test_var);
+                     return 0;
+                  }' > conftest.cpp
+
+            wx_cv_gcc_pch_bug="pch not supported"
 
             if $CXX conftest.h >/dev/null 2>&1
             then
 
             if $CXX conftest.h >/dev/null 2>&1
             then
-                {
-                    echo '#include "conftest.h"'
-                    echo 'const wchar_t *test() { return test_var; }'
-                } > conftest.cpp
+                wx_cv_gcc_pch_bug=
 
 
-                if $CXX -c -o conftest.o conftest.cpp >/dev/null 2>&1
+                if $CXX -o conftest conftest.cpp >/dev/null 2>&1
                 then
                 then
-                    tr -dc 'a-z' < conftest.o |
-                        grep 'widestring' >/dev/null ||
+                    if tr -dc '[a-z]' < conftest | grep awidetest >/dev/null
+                    then
+                        wx_cv_gcc_pch_bug=no
+                    else
                         wx_cv_gcc_pch_bug=yes
                         wx_cv_gcc_pch_bug=yes
+                    fi
                 fi
             fi
 
                 fi
             fi
 
-            rm -f conftest.h conftest.gch conftest.cpp conftest.o
+            rm -f conftest.h conftest.gch conftest.cpp conftest
 
 fi
 echo "$as_me:$LINENO: result: $wx_cv_gcc_pch_bug" >&5
 
 fi
 echo "$as_me:$LINENO: result: $wx_cv_gcc_pch_bug" >&5
index 6b6c71f37b66e56b3404e04a9615a754830d2969..53af4d850aa162a1ae08fa3376c7194fc9dbad46 100644 (file)
@@ -7618,25 +7618,34 @@ then
         [for gcc precompiled header bug],
         [wx_cv_gcc_pch_bug],
         [[
         [for gcc precompiled header bug],
         [wx_cv_gcc_pch_bug],
         [[
-            wx_cv_gcc_pch_bug=no
-            echo 'const wchar_t test_var[] = L"wide string";' > conftest.h
+            echo '#include <stdio.h>
+                  const wchar_t test_var[] = L"awidetest";' > conftest.h
+
+            echo '#include "conftest.h"
+                  int main()
+                  {
+                     printf("%ls\n", test_var);
+                     return 0;
+                  }' > conftest.cpp
+
+            wx_cv_gcc_pch_bug="pch not supported"
 
             if $CXX conftest.h >/dev/null 2>&1
             then
 
             if $CXX conftest.h >/dev/null 2>&1
             then
-                {
-                    echo '#include "conftest.h"'
-                    echo 'const wchar_t *test() { return test_var; }'
-                } > conftest.cpp
+                wx_cv_gcc_pch_bug=
 
 
-                if $CXX -c -o conftest.o conftest.cpp >/dev/null 2>&1
+                if $CXX -o conftest conftest.cpp >/dev/null 2>&1
                 then
                 then
-                    tr -dc 'a-z' < conftest.o |
-                        grep 'widestring' >/dev/null ||
+                    if tr -dc '[a-z]' < conftest | grep awidetest >/dev/null
+                    then
+                        wx_cv_gcc_pch_bug=no
+                    else
                         wx_cv_gcc_pch_bug=yes
                         wx_cv_gcc_pch_bug=yes
+                    fi
                 fi
             fi
 
                 fi
             fi
 
-            rm -f conftest.h conftest.gch conftest.cpp conftest.o
+            rm -f conftest.h conftest.gch conftest.cpp conftest
         ]])
 
     if test "$wx_cv_gcc_pch_bug" = yes; then
         ]])
 
     if test "$wx_cv_gcc_pch_bug" = yes; then