On Wed, Jul 8, 2015 at 3:18 PM, Dimitry Andric <d...@freebsd.org> wrote: > Check whether the path starts with /usr/bin, maybe? Normally, you would > check for the existence of a random header in a configure script. But > from within a C source file, it's not that easy. > > That said, immintrin.h is available for all usable versions of clang, > and should be available in all versions of gcc >= 4.4 (at least, if I > read gcc's commit history correctly). And gcc in base is definitely not > 4.4. :-)
$ cat ~/has_immintrin.c #include <sys/cdefs.h> #if __has_include(<immintrin.h>) #error "I have immintrin.h" #else #error "I don't have immintrin.h" #endif $ clang -c ~/has_immintrin.c /home/ngie/has_immintrin.c:4:2: error: "I have immintrin.h" #error "I have immintrin.h" ^ 1 error generated. $ gcc -c ~/has_immintrin.c /home/ngie/has_immintrin.c:6:2: error: #error "I don't have immintrin.h" Sadly this macro wasn't added until gcc 5.x: https://gcc.gnu.org/gcc-5/changes.html Cheers, -NGie _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"