aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-09-19 10:16:53 +0200
committerJim Lawson <ucbjrl@berkeley.edu>2018-10-08 11:38:10 -0700
commit24951ddc777f9cc70670e3f833a7f89cad98f476 (patch)
tree958e914ca5c8fb0f795099228a235d58a5fccac7
parent33ac82a5fe7a1cad1e947f8f2350c123af592deb (diff)
downloadyosys-24951ddc777f9cc70670e3f833a7f89cad98f476.tar.gz
yosys-24951ddc777f9cc70670e3f833a7f89cad98f476.tar.bz2
yosys-24951ddc777f9cc70670e3f833a7f89cad98f476.zip
Fix Cygwin build and document needed packages
-rw-r--r--Makefile9
-rw-r--r--README.md4
-rw-r--r--kernel/yosys.cc2
3 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7698047ec..365b92ea4 100644
--- a/Makefile
+++ b/Makefile
@@ -175,6 +175,12 @@ LD = gcc-4.8
CXXFLAGS += -std=c++11 -Os
ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H"
+else ifeq ($(CONFIG),cygwin)
+CXX = gcc
+LD = gcc
+CXXFLAGS += -std=gnu++11 -Os
+ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H"
+
else ifeq ($(CONFIG),emcc)
CXX = emcc
LD = emcc
@@ -729,6 +735,9 @@ config-msys2: clean
config-msys2-64: clean
echo 'CONFIG := msys2-64' > Makefile.conf
+config-cygwin: clean
+ echo 'CONFIG := cygwin' > Makefile.conf
+
config-gcov: clean
echo 'CONFIG := gcc' > Makefile.conf
echo 'ENABLE_GCOV := 1' >> Makefile.conf
diff --git a/README.md b/README.md
index 424d9bbf2..41ae4ac18 100644
--- a/README.md
+++ b/README.md
@@ -69,6 +69,10 @@ On FreeBSD use the following command to install all prerequisites:
On FreeBSD system use gmake instead of make. To run tests use:
% MAKE=gmake CC=cc gmake test
+For Cygwin use the following command to install all prerequisites, or select these additional packages:
+
+ setup-x86_64.exe -q --packages=bison,flex,gcc-core,gcc-g++,git,libffi-devel,libreadline-devel,make,pkg-config,python3,tcl-devel
+
There are also pre-compiled Yosys binary packages for Ubuntu and Win32 as well
as a source distribution for Visual Studio. Visit the Yosys download page for
more information: http://www.clifford.at/yosys/download.html
diff --git a/kernel/yosys.cc b/kernel/yosys.cc
index 264b1f63d..ad032899c 100644
--- a/kernel/yosys.cc
+++ b/kernel/yosys.cc
@@ -166,7 +166,7 @@ std::string vstringf(const char *fmt, va_list ap)
std::string string;
char *str = NULL;
-#ifdef _WIN32
+#if defined(_WIN32 )|| defined(__CYGWIN__)
int sz = 64, rc;
while (1) {
va_list apc;