diff options
author | Qt by Nokia <qt-info@nokia.com> | 2011-04-27 12:05:43 +0200 |
---|---|---|
committer | axis <qt-info@nokia.com> | 2011-04-27 12:05:43 +0200 |
commit | 38be0d13830efd2d98281c645c3a60afe05ffece (patch) | |
tree | 6ea73f3ec77f7d153333779883e8120f82820abe /config.tests/unix/precomp.test |
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
Qt Git wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:
http://qt.gitorious.org/qt/pages/GitIntroductionWithQt
If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.
Branched from the monolithic repo, Qt master branch, at commit
896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'config.tests/unix/precomp.test')
-rwxr-xr-x | config.tests/unix/precomp.test | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/config.tests/unix/precomp.test b/config.tests/unix/precomp.test new file mode 100755 index 0000000000..f7c5a0275c --- /dev/null +++ b/config.tests/unix/precomp.test @@ -0,0 +1,54 @@ +#!/bin/sh + +PRECOMP_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 + +case "$COMPILER" in +icpc) + cat >header.h <<EOF +#define HEADER_H + +EOF + >header.cpp + cat >source.cpp <<EOF +#ifndef HEADER_H +#error no go +#endif + +EOF + + rm -f header.pchi + $COMPILER -pch-create header.pchi -include header.h -c header.cpp -o header.o >/dev/null 2>&1 \ + && $COMPILER -pch-use header.pchi -include header.h -c source.cpp -o source.o >/dev/null 2>&1 \ + && PRECOMP_SUPPORT=yes + + rm -f header.h header.cpp source.cpp + rm -f header.pchi header.o source.o + ;; + +*g++*|c++) + case `"$COMPILER" -dumpversion 2>/dev/null` in + 3.*) + ;; + *) + + >precomp_header.h + if $COMPILER -x c-header precomp_header.h >/dev/null 2>&1; then + $COMPILER -x c++-header precomp_header.h && PRECOMP_SUPPORT=yes + fi + rm -f precomp_header.h precomp_header.h.gch + ;; + esac + ;; +esac + + +# done +if [ "$PRECOMP_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support enabled." + exit 1 +fi |