Created
November 25, 2013 06:11
-
-
Save zeroxia/7637039 to your computer and use it in GitHub Desktop.
Show what macros are predefined by your GCC. e.g., for Android, you can rely on -D__ANDROID__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Hello, world" | |
# PC linux | |
echo | gcc -dM -E - | less | |
# For the Android NDK toolchains | |
echo | /opt/android/android-ndk/toolchains/x86-4.4.3/prebuilt/linux-x86/bin/i686-linux-android-gcc -dM -E - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To east the execution of those cross-compilation toolchain commands, you can create a utility script to help you omit the long prefix. e.g., for Android, create an
NDK
script in yourPATH
like this:Remember to
chmod +x NDK
. Then above command is transformed into:echo | NDK gcc -dM -E - | less