Subject: How to check for ELF
To: None <tech-pkg@netbsd.org>
From: Todd Vierling <tv@pobox.com>
List: tech-pkg
Date: 08/16/1998 19:13:38
I just had the inspiration for a very simple way to check whether a NetBSD
toolchain is ELF. Since all of our compilers define __ELF__ in that case:
if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]; then
system is ELF
else
system is not ELF
fi
This should work in GNU autoconf scripts, and should even work on a
cross-compiler with target of NetBSD ($CC set appropriately, of course).
--
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)