]> git.saurik.com Git - wxWidgets.git/blobdiff - configure
fix gcc compilation warning
[wxWidgets.git] / configure
index e2af5464c2e3d7089f7ccc7d63c04fe0ffa53083..55357f3ef7b83aea0732eb05521f0d8653a72e8d 100755 (executable)
--- a/configure
+++ b/configure
@@ -47209,25 +47209,35 @@ if test "${wx_cv_gcc_pch_bug+set}" = set; then
   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
 
-            if $CXX conftest.h >& /dev/null
+            echo '#include "conftest.h"
+                  int main()
+                  {
+                     printf("%ls", test_var);
+                     return 0;
+                  }' > conftest.cpp
+
+            wx_cv_gcc_pch_bug="pch not supported"
+
+            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
+                if $CXX -o conftest$PROGRAM_EXT conftest.cpp >/dev/null 2>&1
                 then
-                    tr -dc 'a-z' < conftest.o |
-                        grep 'widestring' >& /dev/null ||
+                    if tr -dc '[a-z]' < conftest$PROGRAM_EXT |
+                        grep awidetest >/dev/null
+                    then
+                        wx_cv_gcc_pch_bug=no
+                    else
                         wx_cv_gcc_pch_bug=yes
+                    fi
                 fi
             fi
 
-            rm -f conftest.h conftest.gch conftest.cpp conftest.o
+            rm -f conftest.h conftest.gch conftest.cpp conftest$PROGRAM_EXT
 
 fi
 echo "$as_me:$LINENO: result: $wx_cv_gcc_pch_bug" >&5