| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright 2014 Google Inc. | 3 # Copyright 2014 Google Inc. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
| 7 | 7 |
| 8 """Function for generating the SkUserConfig file, customized for Android.""" | 8 """Function for generating the SkUserConfig file, customized for Android.""" |
| 9 | 9 |
| 10 import os | 10 import os |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 # Now add the defines specific to Android. Write a custom build guard to | 69 # Now add the defines specific to Android. Write a custom build guard to |
| 70 # ensure they don't get defined more than once. | 70 # ensure they don't get defined more than once. |
| 71 dst.write('\n// Android defines:\n') | 71 dst.write('\n// Android defines:\n') |
| 72 dst.write('#ifndef ' + BUILD_GUARD + '\n') | 72 dst.write('#ifndef ' + BUILD_GUARD + '\n') |
| 73 dst.write('#define ' + BUILD_GUARD + '\n') | 73 dst.write('#define ' + BUILD_GUARD + '\n') |
| 74 | 74 |
| 75 # Add conditional defines manually: | 75 # Add conditional defines manually: |
| 76 | 76 |
| 77 # do this build check for other tools that still read this header | 77 # do this build check for other tools that still read this header |
| 78 dst.write('#ifdef ANDROID\n') | 78 dst.write('#ifdef ANDROID\n') |
| 79 dst.write('\t#include <utils/misc.h>\n') | 79 dst.write(' #include <utils/misc.h>\n') |
| 80 dst.write('#endif\n\n') | 80 dst.write('#endif\n\n') |
| 81 | 81 |
| 82 dst.write('#if __BYTE_ORDER == __BIG_ENDIAN\n') | 82 dst.write('#if __BYTE_ORDER == __BIG_ENDIAN\n') |
| 83 dst.write('\t#define SK_CPU_BENDIAN\n') | 83 dst.write(' #define SK_CPU_BENDIAN\n') |
| 84 dst.write('\t#undef SK_CPU_LENDIAN\n') | 84 dst.write(' #undef SK_CPU_LENDIAN\n') |
| 85 dst.write('#else\n') | 85 dst.write('#else\n') |
| 86 dst.write('\t#define SK_CPU_LENDIAN\n') | 86 dst.write(' #define SK_CPU_LENDIAN\n') |
| 87 dst.write('\t#undef SK_CPU_BENDIAN\n') | 87 dst.write(' #undef SK_CPU_BENDIAN\n') |
| 88 dst.write('#endif\n\n') | 88 dst.write('#endif\n\n') |
| 89 | 89 |
| 90 # Now add the defines from the gyp files. | 90 # Now add the defines from the gyp files. |
| 91 for item in ordered_set: | 91 for item in ordered_set: |
| 92 # Although our defines may have '=' in them, when written to the header | 92 # Although our defines may have '=' in them, when written to the header |
| 93 # there should be a space between the macro and what it replaces. | 93 # there should be a space between the macro and what it replaces. |
| 94 dst.write('#define ' + item.replace('=', ' ') + '\n') | 94 dst.write('#define ' + item.replace('=', ' ') + '\n') |
| 95 | 95 |
| 96 dst.write('\n#endif // ' + BUILD_GUARD + '\n') | 96 dst.write('\n#endif // ' + BUILD_GUARD + '\n') |
| OLD | NEW |