Subject: How to check for ELF
To: None <>
From: Todd Vierling <>
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
	system is not ELF

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; Bus.