~ chicken-core (chicken-5) /Makefile.detect
Trap1# -*- Makefile -*-2#3# Detect the PLATFORM with uname.4# Based on Chibi Scheme auto-detector5# Heavily revamped by John Cowan6# Copyright (c) 2009-2018 Alex Shinn, John Cowan7# BSD license at <https://github.com/ashinn/chibi-scheme/blob/master/COPYING>89ifndef PLATFORM1011# First check is for pure MinGW, which doesn't have uname.12# In cmd.exe, echo "test" outputs "test", with quotes.13test:=$(shell echo "test")14quote:=$(findstring ",$(test))1516ifeq ($(quote),")17PLATFORM=mingw18else1920# Now we can use uname tests21uname_s:=$(shell uname)22uname_o:=$(shell uname -o 2>/dev/null)2324# Check for specific platforms25ifeq ($(uname_o),Msys)26PLATFORM=mingw-msys27endif2829ifeq ($(uname_s),Darwin)30PLATFORM=macosx31endif3233ifeq ($(uname_s),FreeBSD)34PLATFORM=bsd35endif3637ifeq ($(uname_s),NetBSD)38PLATFORM=bsd39endif4041ifeq ($(uname_s),OpenBSD)42PLATFORM=bsd43endif4445ifeq ($(uname_s),DragonFly)46PLATFORM=bsd47endif4849ifeq ($(uname_o),Cygwin)50PLATFORM=cygwin51endif5253ifeq ($(uname_o),Android)54PLATFORM=android55endif5657ifeq ($(uname_o),GNU/Linux)58PLATFORM=linux59endif6061ifeq ($(uname_o),Linux)62PLATFORM=linux63endif6465ifeq ($(uname_s),SunOS)66PLATFORM=solaris67endif6869ifeq ($(uname_s),Haiku)70PLATFORM=haiku71endif7273ifeq ($(uname_s),BeOS)74PLATFORM=haiku75endif7677ifeq ($(uname_s),GNU)78PLATFORM=hurd79endif8081ifeq ($(uname_s),AIX)82PLATFORM=aix83endif8485# add more options here8687endif # have uname88endif # undef PLATFORM