From owner-freebsd-current Tue Sep 1 22:56:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA18312 for freebsd-current-outgoing; Tue, 1 Sep 1998 22:56:52 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from mail.camalott.com (mail.camalott.com [208.203.140.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA18299 for ; Tue, 1 Sep 1998 22:56:50 -0700 (PDT) (envelope-from joelh@gnu.org) Received: from detlev.UUCP (tex-127.camalott.com [208.229.74.127]) by mail.camalott.com (8.8.7/8.8.5) with ESMTP id AAA05434; Wed, 2 Sep 1998 00:57:23 -0500 Received: (from joelh@localhost) by detlev.UUCP (8.9.1/8.9.1) id AAA04314; Wed, 2 Sep 1998 00:55:29 -0500 (CDT) (envelope-from joelh) Date: Wed, 2 Sep 1998 00:55:29 -0500 (CDT) Message-Id: <199809020555.AAA04314@detlev.UUCP> To: joki@kuebart.stuttgart.netsurf.de CC: joki@kuebart.stuttgart.netsurf.de, joki@shire.domestic.de, galatalt@stuy.edu, dfr@nlsystems.com, freebsd-current@FreeBSD.ORG In-reply-to: <199809020541.HAA01432@yacht.domestic.de> (message from Joachim Kuebart on Wed, 2 Sep 1998 07:41:18 +0200 (CEST)) Subject: Re: XFree86 and ELF From: Joel Ray Holveck Reply-to: joelh@gnu.org References: <199809020541.HAA01432@yacht.domestic.de> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>> This is due to the fact that I am unaware of a portable way to check >>> if we're on an ELF system. Bear in mind it might be a prehistoric >>> -stable version, so it isn't just a question of `objformat`. >> Am I confused? What's wrong with looking for #ifdef __ELF__ ? > The files being discussed are processed by cpp. __ELF__ if set only > when cpp is called from the compiler front end cc. What if you use cc -E instead? I've seen many shell tests, so I may as well add my own, which doesn't depend on our ELF's current idiosyncrasies quite as much (suitable mechanisms should be substituted for printf if non-BSD usability is desired): VAR=`printf '#ifdef __ELF__\nelf\n#else\na.out\n#endif' | cc -P -E -` Happy hacking, joelh -- Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message