From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14308 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Chris Hall Newsgroups: gmane.linux.lib.musl.general Subject: Fwd: Re: Detecting musl at compile and/or configure time Date: Sun, 30 Jun 2019 13:03:27 +0100 Message-ID: <3767f116-4a52-e9ef-a2ee-df1c23719e34@gmch.uk> References: <26f5537f-a876-209c-a27c-cd2619f5c834@gmch.uk> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="207707"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 To: musl@lists.openwall.com Original-X-From: musl-return-14324-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jun 30 14:03:42 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hhYYY-000rwT-Lv for gllmg-musl@m.gmane.org; Sun, 30 Jun 2019 14:03:42 +0200 Original-Received: (qmail 26086 invoked by uid 550); 30 Jun 2019 12:03:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 26068 invoked from network); 30 Jun 2019 12:03:39 -0000 X-Forwarded-Message-Id: <26f5537f-a876-209c-a27c-cd2619f5c834@gmch.uk> In-Reply-To: <26f5537f-a876-209c-a27c-cd2619f5c834@gmch.uk> Content-Language: en-GB Xref: news.gmane.org gmane.linux.lib.musl.general:14308 Archived-At: On 29/06/2019 14:27, A. Wilcox wrote: > On 06/29/19 06:48, Chris Hall wrote: >> >> Is there a supported way of detecting that one is building against >> the musl libc ? ... > The musl libc specifically does not have a FTM (feature test macro) > because it aims to be an exact implementation of C11 / POSIX and > therefore it has no "quirks" to detect. I too aim for perfection, but find that I approach it asymptotically :-) However, restating the question in those terms: how should I detect that one is *not* building against some library which is *not* musl ? [Given that other libraries may be equally discrete.] ... > See here for more information: > > https://wiki.musl-libc.org/faq.html#Q:-Why-is-there-no-%3Ccode%3E__MUSL__%3C/code%3E-macro? FWIW: I read https://www.musl-libc.org/faq.html, but did not also find the wiki's FAQ :-( > Is there a reason you wish to detect musl at configure/compile time? > Perhaps if we knew the reason, we could help you make your code more > portable and/or not require such detection. I have a little build system which tries to detect the "usual suspects" automatically, even without a full configure/cmake/etc. step. If the detection process fails, it generates a warning and the user must (at least) add a '-Dxxx' to suppress that. I confess I have only recently stumbled across musl. Perhaps systems which default to musl are so rare that I can, as a practical matter, ignore them ? The question then is whether to add a '-DqLIB_MUSL' gizmo to my build stuff -- so that "musl-gcc -DqLIB_MUSL" will do the trick. Thanks, Chris