Merge pull request #58 from set-soft/master

Added a new config variable CHIPDB_SUBDIR.
This commit is contained in:
Clifford Wolf 2016-10-14 09:21:23 +02:00 committed by GitHub
commit 1796d4354f
3 changed files with 4 additions and 3 deletions

View File

@ -3,6 +3,7 @@ CC ?= $(CXX)
PKG_CONFIG ?= pkg-config
DESTDIR ?=
PREFIX ?= /usr/local
CHIPDB_SUBDIR ?= icebox
ifeq ($(MXE),1)
EXE = .exe

View File

@ -1,6 +1,6 @@
include ../config.mk
LDLIBS = -lm -lstdc++
CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include -DPREFIX='"$(PREFIX)"'
CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include -DPREFIX='"$(PREFIX)"' -DCHIPDB_SUBDIR='"$(CHIPDB_SUBDIR)"'
ifeq ($(STATIC),1)
LDFLAGS += -static

View File

@ -295,9 +295,9 @@ void read_chipdb()
#else
homedir += getenv("HOME");
#endif
snprintf(buffer, 1024, "%s%s/share/icebox/chipdb-%s.txt", homedir.c_str(), PREFIX+1, config_device.c_str());
snprintf(buffer, 1024, "%s%s/share/" CHIPDB_SUBDIR "/chipdb-%s.txt", homedir.c_str(), PREFIX+1, config_device.c_str());
} else
snprintf(buffer, 1024, "%s/share/icebox/chipdb-%s.txt", PREFIX, config_device.c_str());
snprintf(buffer, 1024, PREFIX "/share/" CHIPDB_SUBDIR "/chipdb-%s.txt", config_device.c_str());
FILE *fdb = fopen(buffer, "r");
if (fdb == nullptr) {