mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 08:47:35 +02:00
Autodetect configuration items
This commit is contained in:
parent
1e2dac3026
commit
24109550cd
1 changed files with 44 additions and 3 deletions
|
@ -4,9 +4,6 @@
|
|||
#
|
||||
# Configuration options for the makefile
|
||||
|
||||
# Platform-specific flags, set to 0 if not supported
|
||||
CYC_PLATFORM_HAS_MEMSTREAM ?= 1
|
||||
|
||||
# Compiler options
|
||||
CFLAGS ?= -O2 -Wall -Iinclude -L.
|
||||
COMP_CFLAGS ?= -O2 -Wall -I$(PREFIX)/include -L$(PREFIX)/lib
|
||||
|
@ -38,3 +35,47 @@ INCDIR ?= $(PREFIX)/include/cyclone
|
|||
DATADIR ?= $(PREFIX)/share/cyclone
|
||||
|
||||
DESTDIR ?=
|
||||
|
||||
# Automatically detect platform-specific flags, instead of using autoconf
|
||||
#CYC_PLATFORM_HAS_MEMSTREAM ?= 1
|
||||
CYC_PLATFORM_HAS_MEMSTREAM := $(shell echo "main(){char *buf; int len; open_memstream(&buf, &len);}" | gcc -xc - >/dev/null 2>/dev/null && echo 1 || echo 0)
|
||||
|
||||
# code from chibi's makefile to detect platform
|
||||
ifndef PLATFORM
|
||||
ifeq ($(shell uname),Darwin)
|
||||
PLATFORM=macosx
|
||||
else
|
||||
ifeq ($(shell uname),FreeBSD)
|
||||
PLATFORM=bsd
|
||||
else
|
||||
ifeq ($(shell uname),NetBSD)
|
||||
PLATFORM=bsd
|
||||
else
|
||||
ifeq ($(shell uname),OpenBSD)
|
||||
PLATFORM=bsd
|
||||
else
|
||||
ifeq ($(shell uname),DragonFly)
|
||||
PLATFORM=bsd
|
||||
else
|
||||
ifeq ($(shell uname -o),Msys)
|
||||
PLATFORM=mingw
|
||||
SOLIBDIR = $(BINDIR)
|
||||
DIFFOPTS = -b
|
||||
else
|
||||
ifeq ($(shell uname -o),Cygwin)
|
||||
PLATFORM=cygwin
|
||||
SOLIBDIR = $(BINDIR)
|
||||
DIFFOPTS = -b
|
||||
else
|
||||
ifeq ($(shell uname -o),GNU/Linux)
|
||||
PLATFORM=linux
|
||||
else
|
||||
PLATFORM=unix
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Add table
Reference in a new issue