aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile16
-rw-r--r--backends/ilang/ilang_backend.cc1
-rw-r--r--frontends/verilog/verilog_frontend.cc1
-rw-r--r--kernel/compatibility.cc (renamed from kernel/posix_compatibility.cc)7
-rw-r--r--kernel/compatibility.h (renamed from kernel/posix_compatibility.h)22
-rw-r--r--kernel/log.cc1
-rw-r--r--kernel/register.cc5
-rw-r--r--kernel/rtlil.cc1
-rw-r--r--libs/svgviewer/.gitignore1
-rw-r--r--passes/techmap/techmap.cc1
11 files changed, 31 insertions, 27 deletions
diff --git a/.gitignore b/.gitignore
index 10491a3a1..f251d2b6d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,9 +8,7 @@
/qtcreator.config
/qtcreator.creator
/qtcreator.creator.user
-/libs/svgviewer/svgviewer.app
/Makefile.conf
-/minisat
/abc
/yosys
/yosys-abc
diff --git a/Makefile b/Makefile
index 5e6df2425..325f25a17 100644
--- a/Makefile
+++ b/Makefile
@@ -22,9 +22,11 @@ TARGETS = yosys yosys-config
all: top-all
-CXXFLAGS = -Wall -Wextra -ggdb -I"$(shell pwd)" -MD -D_YOSYS_ -fPIC -include kernel/posix_compatibility.h -I${DESTDIR}/include
+CXXFLAGS = -Wall -Wextra -ggdb -I"$(shell pwd)" -MD -D_YOSYS_ -fPIC -I${DESTDIR}/include
LDFLAGS = -L${DESTDIR}/lib
LDLIBS = -lstdc++ -lreadline -lm -ldl
+QMAKE = qmake-qt4
+SED = sed
ifeq (Darwin,$(findstring Darwin,$(shell uname)))
# add macports include and library path to search directories, don't use '-rdynamic' and '-lrt':
@@ -35,8 +37,6 @@ ifeq (Darwin,$(findstring Darwin,$(shell uname)))
else
LDFLAGS += -rdynamic
LDLIBS += -lrt
- QMAKE = qmake-qt4
- SED = sed
endif
YOSYS_VER := 0.2.0+
@@ -56,12 +56,12 @@ ABCPULL = 1
ifeq ($(CONFIG),clang-debug)
CXX = clang
-CXXFLAGS += -std=c++11 -O0
+CXXFLAGS += -std=c++11 -Os
endif
ifeq ($(CONFIG),gcc-debug)
CXX = gcc
-CXXFLAGS += -std=gnu++0x -O0
+CXXFLAGS += -std=gnu++0x -Os
endif
ifeq ($(CONFIG),release)
@@ -96,16 +96,18 @@ CXXFLAGS += $(patsubst %,-I$(VERIFIC_DIR)/%,$(VERIFIC_COMPONENTS)) -D'VERIFIC_DI
LDLIBS += $(patsubst %,$(VERIFIC_DIR)/%/*-linux.a,$(VERIFIC_COMPONENTS))
endif
-OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o kernel/posix_compatibility.o
+OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o
+OBJS += kernel/compatibility.o
OBJS += libs/bigint/BigIntegerAlgorithms.o libs/bigint/BigInteger.o libs/bigint/BigIntegerUtils.o
OBJS += libs/bigint/BigUnsigned.o libs/bigint/BigUnsignedInABase.o
OBJS += libs/sha1/sha1.o
OBJS += libs/subcircuit/subcircuit.o
-OBJS += libs/ezsat/ezsat.o
+OBJS += libs/ezsat/ezsat.o
OBJS += libs/ezsat/ezminisat.o
+
OBJS += libs/minisat/Options.o
OBJS += libs/minisat/SimpSolver.o
OBJS += libs/minisat/Solver.o
diff --git a/backends/ilang/ilang_backend.cc b/backends/ilang/ilang_backend.cc
index c585d40c5..b3d96b28e 100644
--- a/backends/ilang/ilang_backend.cc
+++ b/backends/ilang/ilang_backend.cc
@@ -23,6 +23,7 @@
*/
#include "ilang_backend.h"
+#include "kernel/compatibility.h"
#include "kernel/register.h"
#include "kernel/log.h"
#include <string>
diff --git a/frontends/verilog/verilog_frontend.cc b/frontends/verilog/verilog_frontend.cc
index 13c2676db..8e9efa173 100644
--- a/frontends/verilog/verilog_frontend.cc
+++ b/frontends/verilog/verilog_frontend.cc
@@ -27,6 +27,7 @@
*/
#include "verilog_frontend.h"
+#include "kernel/compatibility.h"
#include "kernel/register.h"
#include "kernel/log.h"
#include "libs/sha1/sha1.h"
diff --git a/kernel/posix_compatibility.cc b/kernel/compatibility.cc
index d3fb00873..2ef023eb3 100644
--- a/kernel/posix_compatibility.cc
+++ b/kernel/compatibility.cc
@@ -27,6 +27,7 @@
#include <errno.h>
#if !(_XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L)
+
typedef struct memstream {
off_t pos;
off_t size;
@@ -110,7 +111,7 @@ static int memstream_close (void * cookie)
return 0;
}
-FILE * fmemopen (void * buf, size_t size, const char * mode)
+FILE * compat_fmemopen (void * buf, size_t size, const char * mode)
{
memstream_t * mem = (memstream_t *) malloc(sizeof(memstream_t));
memset(mem, 0, sizeof(memstream_t));
@@ -120,7 +121,7 @@ FILE * fmemopen (void * buf, size_t size, const char * mode)
return funopen(mem, memstream_read, memstream_write, memstream_seek, memstream_close);
}
-FILE * open_memstream (char ** bufp, size_t * sizep)
+FILE * compat_open_memstream (char ** bufp, size_t * sizep)
{
memstream_t * mem = (memstream_t *) malloc(sizeof(memstream_t));
memset(mem, 0, sizeof(memstream_t));
@@ -130,5 +131,5 @@ FILE * open_memstream (char ** bufp, size_t * sizep)
return funopen(mem, memstream_read, memstream_write, memstream_seek, memstream_close);
}
-#endif
+#endif /* !(_XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L) */
diff --git a/kernel/posix_compatibility.h b/kernel/compatibility.h
index ed8fc8966..58e0b52e9 100644
--- a/kernel/posix_compatibility.h
+++ b/kernel/compatibility.h
@@ -17,24 +17,20 @@
*
*/
-#ifndef POSIX_COMPATIBILITY_H
-#define POSIX_COMPATIBILITY_H
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
+#ifndef COMPATIBILITY_H
+#define COMPATIBILITY_H
#if !(_XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L)
#include <stdio.h>
#include <stdlib.h>
-FILE * open_memstream (char ** bufp, size_t * sizep);
-FILE * fmemopen (void * buf, size_t size, const char * mode);
-#endif
+#define open_memstream compat_open_memstream
+#define fmemopen compat_fmemopen
+
+FILE * compat_open_memstream (char ** bufp, size_t * sizep);
+FILE * compat_fmemopen (void * buf, size_t size, const char * mode);
-#if defined(__cplusplus)
-}
-#endif
+#endif /* !(_XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L) */
-#endif
+#endif /* COMPATIBILITY_H */
diff --git a/kernel/log.cc b/kernel/log.cc
index 779f93737..b2c92e4e1 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -18,6 +18,7 @@
*/
#include "kernel/log.h"
+#include "kernel/compatibility.h"
#include "backends/ilang/ilang_backend.h"
#include <sys/time.h>
diff --git a/kernel/register.cc b/kernel/register.cc
index ab5cba11b..511afaac0 100644
--- a/kernel/register.cc
+++ b/kernel/register.cc
@@ -17,8 +17,9 @@
*
*/
-#include "register.h"
-#include "log.h"
+#include "kernel/compatibility.h"
+#include "kernel/register.h"
+#include "kernel/log.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 21fcae2b5..7259845a0 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -17,6 +17,7 @@
*
*/
+#include "kernel/compatibility.h"
#include "kernel/rtlil.h"
#include "kernel/log.h"
#include "frontends/verilog/verilog_frontend.h"
diff --git a/libs/svgviewer/.gitignore b/libs/svgviewer/.gitignore
index b92d91f8b..b46f84a66 100644
--- a/libs/svgviewer/.gitignore
+++ b/libs/svgviewer/.gitignore
@@ -3,3 +3,4 @@ moc_mainwindow.cpp
moc_svgview.cpp
qrc_svgviewer.cpp
svgviewer
+svgviewer.app
diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc
index 0ca601e3b..69ffb9230 100644
--- a/passes/techmap/techmap.cc
+++ b/passes/techmap/techmap.cc
@@ -17,6 +17,7 @@
*
*/
+#include "kernel/compatibility.h"
#include "kernel/register.h"
#include "kernel/sigtools.h"
#include "kernel/log.h"