3 changed files with 95 additions and 162 deletions
@ -1,138 +0,0 @@
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 8632252..1f93efd 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -9,3 +9,23 @@ lib
|
||||
*.swp
|
||||
*.swo
|
||||
tmux-*.log
|
||||
+native-src/zxcvbn/_frequency_lists.cpp
|
||||
+native-src/zxcvbn/_frequency_lists.hpp
|
||||
+native-src/zxcvbn/adjacency_graphs.cpp
|
||||
+native-src/zxcvbn/adjacency_graphs.hpp
|
||||
+native-src/zxcvbn/m4
|
||||
+native-src/zxcvbn/autom4te.cache
|
||||
+native-src/zxcvbn/config.log
|
||||
+native-src/zxcvbn/config.status
|
||||
+native-src/zxcvbn/config
|
||||
+native-src/zxcvbn/configure
|
||||
+native-src/zxcvbn/libtool
|
||||
+native-src/zxcvbn/aclocal.m4
|
||||
+native-src/zxcvbn/Makefile.in
|
||||
+native-src/zxcvbn/Makefile
|
||||
+native-src/zxcvbn/*.o
|
||||
+native-src/zxcvbn/*.lo
|
||||
+native-src/zxcvbn/*.la
|
||||
+native-src/zxcvbn/.deps
|
||||
+native-src/zxcvbn/.libs
|
||||
+native-src/zxcvbn/zxcvbncpp.pc
|
||||
diff --git a/native-src/zxcvbn/Makefile.am b/native-src/zxcvbn/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..1620cda
|
||||
--- /dev/null
|
||||
+++ b/native-src/zxcvbn/Makefile.am
|
||||
@@ -0,0 +1,45 @@
|
||||
+ACLOCAL_AMFLAGS = -I m4 --install
|
||||
+
|
||||
+CXXFLAGS = -std=c++14
|
||||
+
|
||||
+lib_LTLIBRARIES = libzxcvbncpp.la
|
||||
+
|
||||
+libzxcvbncpp_la_SOURCES = feedback.cpp frequency_lists.cpp matching.cpp \
|
||||
+ scoring.cpp time_estimates.cpp util.cpp \
|
||||
+ zxcvbn.cpp _frequency_lists.cpp \
|
||||
+ adjacency_graphs.cpp
|
||||
+
|
||||
+libzxcvbncpp_la_LDFLAGS = -version-info \
|
||||
+ @ZXCVBNCPP_LT_CURRENT@:@ZXCVBNCPP_LT_REVISION@:@ZXCVBNCPP_LT_AGE@
|
||||
+
|
||||
+incdir = $(includedir)/zxcvbn
|
||||
+inc_HEADERS = common.hpp feedback.hpp frequency_lists.hpp \
|
||||
+ frequency_lists_common.hpp matching.hpp optional.hpp \
|
||||
+ scoring.hpp time_estimates.hpp util.hpp zxcvbn.h \
|
||||
+ _frequency_lists.hpp adjacency_graphs.hpp
|
||||
+
|
||||
+pkgconfig_DATA = zxcvbncpp.pc
|
||||
+
|
||||
+BUILT_SOURCES = _frequency_lists.hpp _frequency_lists.cpp \
|
||||
+ adjacency_graphs.hpp adjacency_graphs.cpp
|
||||
+
|
||||
+CLEANFILES = $(BUILT_SOURCES)
|
||||
+
|
||||
+scripts_dir = $(top_srcdir)/../../data-scripts
|
||||
+data_dir = $(top_srcdir)/../../data
|
||||
+
|
||||
+_frequency_lists.hpp:
|
||||
+ $(scripts_dir)/build_frequency_lists.py $(data_dir) \
|
||||
+ _frequency_lists.hpp
|
||||
+
|
||||
+_frequency_lists.cpp:
|
||||
+ $(scripts_dir)/build_frequency_lists.py $(data_dir) \
|
||||
+ _frequency_lists.cpp
|
||||
+
|
||||
+adjacency_graphs.hpp:
|
||||
+ $(scripts_dir)/build_keyboard_adjacency_graphs.py \
|
||||
+ adjacency_graphs.hpp
|
||||
+
|
||||
+adjacency_graphs.cpp:
|
||||
+ $(scripts_dir)/build_keyboard_adjacency_graphs.py \
|
||||
+ adjacency_graphs.cpp
|
||||
diff --git a/native-src/zxcvbn/configure.ac b/native-src/zxcvbn/configure.ac
|
||||
new file mode 100644
|
||||
index 0000000..4c88e16
|
||||
--- /dev/null
|
||||
+++ b/native-src/zxcvbn/configure.ac
|
||||
@@ -0,0 +1,36 @@
|
||||
+dnl Configure template for the zxcvbn C++ library
|
||||
+
|
||||
+AC_INIT([zxcvbncpp], [0.1.0], [rian@alum.mit.edu])
|
||||
+AC_CONFIG_SRCDIR([configure.ac])
|
||||
+AC_CONFIG_MACRO_DIR([m4])
|
||||
+AC_CONFIG_AUX_DIR([config])
|
||||
+AM_INIT_AUTOMAKE([foreign])
|
||||
+PKG_INSTALLDIR
|
||||
+
|
||||
+AC_PROG_CXX
|
||||
+AC_PROG_INSTALL
|
||||
+LT_INIT
|
||||
+
|
||||
+dnl Libtool version numbers
|
||||
+dnl How to update:
|
||||
+dnl Interfaces removed: CURRENT++, AGE=0, REVISION=0
|
||||
+dnl Interfaces added: CURRENT++, AGE++, REVISION=0
|
||||
+dnl No interfaces changed: REVISION++
|
||||
+ZXCVBNCPP_LT_CURRENT=0
|
||||
+ZXCVBNCPP_LT_AGE=0
|
||||
+ZXCVBNCPP_LT_REVISION=0
|
||||
+
|
||||
+AC_SUBST(ZXCVBNCPP_LT_CURRENT)
|
||||
+AC_SUBST(ZXCVBNCPP_LT_AGE)
|
||||
+AC_SUBST(ZXCVBNCPP_LT_REVISION)
|
||||
+
|
||||
+AC_ARG_ENABLE([debug],
|
||||
+ [AS_HELP_STRING([--enable-debug],
|
||||
+ [Compile with debugging support])],
|
||||
+ [], [enable_debug=no])
|
||||
+AS_IF([test "x$enable_debug" != xyes],
|
||||
+ [AC_DEFINE([NDEBUG], [1])],
|
||||
+ [CPPFLAGS="${CPPFLAGS} -g -O0"])
|
||||
+
|
||||
+AC_CONFIG_FILES([Makefile zxcvbncpp.pc])
|
||||
+AC_OUTPUT
|
||||
diff --git a/native-src/zxcvbn/zxcvbncpp.pc.in b/native-src/zxcvbn/zxcvbncpp.pc.in
|
||||
new file mode 100644
|
||||
index 0000000..183e144
|
||||
--- /dev/null
|
||||
+++ b/native-src/zxcvbn/zxcvbncpp.pc.in
|
||||
@@ -0,0 +1,11 @@
|
||||
+prefix=@prefix@
|
||||
+exec_prefix=${prefix}
|
||||
+libdir=@libdir@
|
||||
+includedir=@includedir@
|
||||
+
|
||||
+Name: Zxcvbn-cpp
|
||||
+Description: Password strength estimation library
|
||||
+Version: @VERSION@
|
||||
+URL: https://github.com/rianhunter/zxcvbn-cpp
|
||||
+Libs: -L${libdir} -lzxcvbncpp
|
||||
+Cflags: -I${includedir}
|
@ -0,0 +1,89 @@
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 8632252..b33bda3 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -9,3 +9,8 @@ lib
|
||||
*.swp
|
||||
*.swo
|
||||
tmux-*.log
|
||||
+native-src/zxcvbn/*.o
|
||||
+native-src/zxcvbn/*.so
|
||||
+native-src/zxcvbn/_frequency_lists.?pp
|
||||
+native-src/zxcvbn/adjacency_graphs.?pp
|
||||
+
|
||||
diff --git a/native-src/zxcvbn/Makefile b/native-src/zxcvbn/Makefile
|
||||
new file mode 100644
|
||||
index 0000000..279c802
|
||||
--- /dev/null
|
||||
+++ b/native-src/zxcvbn/Makefile
|
||||
@@ -0,0 +1,70 @@
|
||||
+CXX = g++
|
||||
+CXXFLAGS = -c -std=c++14 -Wall -Wextra -fPIC
|
||||
+CPPFLAGS = -I..
|
||||
+
|
||||
+ifeq ($(DEBUG),yes)
|
||||
+ CXXFLAGS += -g -O0
|
||||
+else
|
||||
+ CXXFLAGS += -O2
|
||||
+ CPPFLAGS += -DNDEBUG
|
||||
+endif
|
||||
+
|
||||
+PREFIX = /usr/local
|
||||
+LIBDIR = $(PREFIX)/lib
|
||||
+INCLUDEDIR = $(PREFIX)/include
|
||||
+
|
||||
+LIBRARY = libzxcvbncpp.so
|
||||
+
|
||||
+SCRIPTS_DIR = ../../data-scripts
|
||||
+DATA_DIR = ../../data
|
||||
+
|
||||
+OBJS = _frequency_lists.o \
|
||||
+ adjacency_graphs.o \
|
||||
+ feedback.o \
|
||||
+ frequency_lists.o \
|
||||
+ matching.o \
|
||||
+ scoring.o \
|
||||
+ time_estimates.o \
|
||||
+ util.o \
|
||||
+ zxcvbn.o
|
||||
+
|
||||
+HEADERS = _frequency_lists.hpp \
|
||||
+ adjacency_graphs.hpp \
|
||||
+ common.hpp \
|
||||
+ feedback.hpp \
|
||||
+ frequency_lists.hpp \
|
||||
+ frequency_lists_common.hpp \
|
||||
+ matching.hpp \
|
||||
+ optional.hpp \
|
||||
+ scoring.hpp \
|
||||
+ time_estimates.hpp \
|
||||
+ util.hpp \
|
||||
+ zxcvbn.h
|
||||
+
|
||||
+$(LIBRARY): $(OBJS)
|
||||
+ $(CXX) -shared -Wl,-soname,$(LIBRARY) -o $(LIBRARY) $(OBJS)
|
||||
+
|
||||
+_frequency_lists.cpp:
|
||||
+ $(SCRIPTS_DIR)/build_frequency_lists.py $(DATA_DIR) $@
|
||||
+
|
||||
+_frequency_lists.hpp:
|
||||
+ $(SCRIPTS_DIR)/build_frequency_lists.py $(DATA_DIR) $@
|
||||
+
|
||||
+adjacency_graphs.cpp:
|
||||
+ $(SCRIPTS_DIR)/build_keyboard_adjacency_graphs.py $@
|
||||
+
|
||||
+adjacency_graphs.hpp:
|
||||
+ $(SCRIPTS_DIR)/build_keyboard_adjacency_graphs.py $@
|
||||
+
|
||||
+%.o: %.cpp $(HEADERS)
|
||||
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
|
||||
+
|
||||
+install: $(LIBRARY)
|
||||
+ install -s -m 755 -D $(LIBRARY) $(DESTDIR)$(LIBDIR)/$(LIBRARY)
|
||||
+ mkdir -p $(DESTDIR)$(INCLUDEDIR)/zxcvbn
|
||||
+ install -m 644 $(HEADERS) $(DESTDIR)$(INCLUDEDIR)/zxcvbn
|
||||
+
|
||||
+clean:
|
||||
+ rm -f $(OBJS)
|
||||
+
|
||||
+.PHONY: clean
|
Loading…
Reference in new issue