Created
May 14, 2016 08:55
-
-
Save kjmkznr/a22c20394bfa623e4ee482435f05f548 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| CC="gcc" | |
| OPT="-march=native" | |
| NATIVE=$(echo | ${CC} -E -v ${OPT} - 2>&1 | grep cc1) | |
| NOARCH=$(echo | ${CC} -E -v - 2>&1 | grep cc1) | |
| for native in ${NATIVE} ; do | |
| FOUND=0 | |
| for noarch in ${NOARCH} ; do | |
| if [ "${native}" = "${noarch}" -a "${native}" != "${OPT}" ] ; then | |
| FOUND=1 | |
| break | |
| fi | |
| done | |
| if [ ${FOUND} -eq 0 ] ; then | |
| echo -n "${native} " | |
| fi | |
| done | |
| echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment