Fix bugs in check for gcc's precompiled header bug.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
29
configure
vendored
29
configure
vendored
@@ -47209,25 +47209,34 @@ if test "${wx_cv_gcc_pch_bug+set}" = set; then
|
|||||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
else
|
else
|
||||||
|
|
||||||
wx_cv_gcc_pch_bug=no
|
echo '#include <stdio.h>
|
||||||
echo 'const wchar_t test_var[] = L"wide string";' > conftest.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
|
if $CXX conftest.h >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
{
|
wx_cv_gcc_pch_bug=
|
||||||
echo '#include "conftest.h"'
|
|
||||||
echo 'const wchar_t *test() { return test_var; }'
|
|
||||||
} > conftest.cpp
|
|
||||||
|
|
||||||
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 |
|
if tr -dc '[a-z]' < conftest | grep awidetest >/dev/null
|
||||||
grep 'widestring' >/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
|
fi
|
||||||
echo "$as_me:$LINENO: result: $wx_cv_gcc_pch_bug" >&5
|
echo "$as_me:$LINENO: result: $wx_cv_gcc_pch_bug" >&5
|
||||||
|
29
configure.in
29
configure.in
@@ -7618,25 +7618,34 @@ then
|
|||||||
[for gcc precompiled header bug],
|
[for gcc precompiled header bug],
|
||||||
[wx_cv_gcc_pch_bug],
|
[wx_cv_gcc_pch_bug],
|
||||||
[[
|
[[
|
||||||
wx_cv_gcc_pch_bug=no
|
echo '#include <stdio.h>
|
||||||
echo 'const wchar_t test_var[] = L"wide string";' > conftest.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
|
if $CXX conftest.h >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
{
|
wx_cv_gcc_pch_bug=
|
||||||
echo '#include "conftest.h"'
|
|
||||||
echo 'const wchar_t *test() { return test_var; }'
|
|
||||||
} > conftest.cpp
|
|
||||||
|
|
||||||
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 |
|
if tr -dc '[a-z]' < conftest | grep awidetest >/dev/null
|
||||||
grep 'widestring' >/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
|
||||||
|
Reference in New Issue
Block a user