]>
git.ipfire.org Git - thirdparty/gcc.git/blob - fixincludes/mkfixinc.sh
5 echo "Usage: $0 <target-mach-triplet>"
12 # Check for special fix rules for particular targets
20 powerpc-
*-eabisim* | \
23 powerpcle-
*-eabisim* | \
25 # IF there is no include fixing,
26 # THEN create a no-op fixer and exit
27 (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
32 # We only want to fix stdlib.h in mingw.
33 # FIXME: Is SED available on mingw?
34 (cat > ${target} << EOF
38 if [ "x\$OUTPUT_DIR" = "x" ]; then
39 echo fixincludes: no output directory specified
43 if [ ! -d \$OUTPUT_DIR ]; then
44 echo fixincludes: output dir \"\$OUTPUT_DIR\" is an invalid directory
49 if [ "x\$INPUT_DIR" = "x" ]; then
50 echo fixincludes: no input directory specified
54 if [ ! -d \$INPUT_DIR ]; then
55 echo fixincludes: input dir \"\$INPUT_DIR\" is an invalid directory
59 INPUT_STDLIB_H=\$INPUT_DIR/stdlib.h
60 if [ ! -f \$INPUT_STDLIB_H ]; then
61 echo fixincludes: \"stdlib.h\" is an invalid file
65 OUTPUT_STDLIB_H=\$OUTPUT_DIR/stdlib.h
66 sed -e "s/\(.*_rotl.*\)/#if __GNUC__ < 4 || (__GNUC__ == 4 \&\& __GNUC_MINOR__ < 5)\n\1/" \
67 -e "s/\(.*_lrotr.*\)/\1\n#else\n\#include <x86intrin.h>\n#endif/" \
68 \$INPUT_STDLIB_H > \$OUTPUT_STDLIB_H
76 cat < ${srcdir}/fixinc.
in > ${target} ||
exit 1