Chromium Code Reviews| Index: src/include/build_config.h |
| diff --git a/src/include/build_config.h b/src/include/build_config.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..084c0e67c212687dec89f62fe4171be13d0a7b80 |
| --- /dev/null |
| +++ b/src/include/build_config.h |
| @@ -0,0 +1,78 @@ |
| +/* |
| + * Copyright 2014 The Native Client Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef NATIVE_CLIENT_SRC_INCLUDE_BUILD_CONFIG_H_ |
| +#define NATIVE_CLIENT_SRC_INCLUDE_BUILD_CONFIG_H_ 1 |
| + |
| +#include "native_client/src/include/nacl_base.h" |
| + |
| +/* TODO(teravest): Remove this guard when builds stop defining these. */ |
|
Mark Seaborn
2014/12/29 17:51:04
To be more specific, "when the Chromium build stop
teravest
2014/12/29 22:29:28
I've removed this TODO since we might need this gu
|
| +#if !defined(NACL_WINDOWS) && !defined(NACL_LINUX) && !defined(NACL_OSX) |
| + |
| +#if defined(_WIN32) |
| +# define NACL_WINDOWS 1 |
| +#else |
| +# define NACL_WINDOWS 0 |
| +#endif |
| + |
| +#if defined(__linux__) |
| +# define NACL_LINUX 1 |
| +#else |
| +# define NACL_LINUX 0 |
| +#endif |
| + |
| +#if defined(__APPLE__) |
| +# define NACL_OSX 1 |
| +#else |
| +# define NACL_OSX 0 |
| +#endif |
| + |
| +#endif |
| + |
| +#if !defined(NACL_ANDROID) |
|
Mark Seaborn
2014/12/29 17:51:04
Why is this checked separately from NACL_WINDOWS/L
teravest
2014/12/29 22:29:29
I've lumped this in with the rest.
|
| +# if defined(ANDROID) |
| +# define NACL_ANDROID 1 |
| +# else |
| +# define NACL_ANDROID 0 |
| +# endif |
| +#endif |
| + |
| +/* TODO(teravest): Remove this guard when builds stop defining these. */ |
| +#if defined(NACL_BUILD_ARCH) && (NACL_ARCH(NACL_BUILD_ARCH) != NACL_pnacl) && !defined(NACL_BUILD_SUBARCH) |
|
Mark Seaborn
2014/12/29 17:51:04
Line is >80 chars; please wrap
teravest
2014/12/29 22:29:28
Done.
|
| +# error Please define both NACL_BUILD_ARCH and NACL_BUILD_SUBARCH. |
| +#elif !defined(NACL_BUILD_ARCH) && defined(NACL_BUILD_SUBARCH) |
| +# error Please define both NACL_BUILD_ARCH and NACL_BUILD_SUBARCH. |
| +#endif |
| + |
| + |
| +#if !defined(NACL_BUILD_ARCH) |
| + |
| +#if defined(_M_X64) || defined(__x86_64__) |
| +# define NACL_BUILD_ARCH x86 |
| +# define NACL_BUILD_SUBARCH 64 |
| +#endif |
| + |
| +#if defined(_M_IX86) || defined(__i386__) |
| +# define NACL_BUILD_ARCH x86 |
| +# define NACL_BUILD_SUBARCH 32 |
| +#endif |
| + |
| +#if defined(__ARMEL__) |
| +# define NACL_BUILD_ARCH arm |
| +# define NACL_BUILD_SUBARCH 32 |
| +#endif |
| + |
| +#if defined(__MIPSEL__) |
| +# define NACL_BUILD_ARCH mips |
| +# define NACL_BUILD_SUBARCH 32 |
| +#endif |
| + |
| +#endif /* !defined(NACL_BUILD_ARCH) */ |
| + |
| +/* TODO(teravest): Require NACL_BUILD_ARCH and NACL_BUILD_SUBARCH to be defined |
|
Mark Seaborn
2014/12/29 17:51:04
Nit: Use the NaCl style for multiline comments, wi
teravest
2014/12/29 22:29:28
Done.
|
| + * once they're defined for the pnacl translator build. */ |
| + |
| +#endif /* NATIVE_CLIENT_SRC_INCLUDE_BUILD_CONFIG_H_ */ |