summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am7
-rw-r--r--src/storage/ngram_kyotodb.cpp3
2 files changed, 10 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 5600c86..b38a980 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,10 +49,17 @@ libpinyin_la_LIBADD = storage/libstorage.la lookup/liblookup.la @GLIB2_LIBS@
libpinyin_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libpinyin.ver \
-version-info @LT_VERSION_INFO@
+if KYOTOCABINET
+libpinyin_la_LDFLAGS += @KYOTOCABINET_LIBS@
+endif
+
libpinyin_internal_la_SOURCES = pinyin_internal.cpp
libpinyin_internal_la_LIBADD = storage/libstorage.la lookup/liblookup.la
+if KYOTOCABINET
+libpinyin_internal_la_LDFLAGS = @KYOTOCABINET_LIBS@
+endif
## Note:
## As libpinyin internal interface will change, only provides static library
diff --git a/src/storage/ngram_kyotodb.cpp b/src/storage/ngram_kyotodb.cpp
index 98d44dc..0c62357 100644
--- a/src/storage/ngram_kyotodb.cpp
+++ b/src/storage/ngram_kyotodb.cpp
@@ -76,6 +76,9 @@ bool Bigram::load_db(const char * dbfile){
/* create on-memory db. */
m_db = new ProtoHashDB;
+ if ( !m_db->open("-", ProtoHashDB::OWRITER|ProtoHashDB::OCREATE) )
+ return false;
+
/* load db into memory. */
BasicDB * tmp_db = new HashDB;
tmp_db->open(dbfile, BasicDB::OREADER);