Makefile patch for package building. Code change to handle warnings.

This commit is contained in:
Paul Mosier 2022-12-03 18:37:26 -05:00
parent bdd140b94a
commit 0e430dcd9e
2 changed files with 8 additions and 7 deletions

View File

@ -1,6 +1,6 @@
PREFIX = /usr/local
PREFIX ?= /usr/local
CC = g++
CCFLAGS = -Wall $(shell pkg-config --cflags sword)
CCFLAGS ?= -Wall $(shell pkg-config --cflags sword)
TARGET = scriptura
INCLUDES = -I/usr/include/sword -I/usr/include/ncursesw
LDFLAGS = -lmenuw -lformw -lncursesw -lstdc++ $(shell pkg-config --libs sword)
@ -27,11 +27,11 @@ doc:
install:
cp -v scriptura $(PREFIX)/bin
install -m 0755 -D scriptura $(DESTDIR)$(PREFIX)/bin/scriptura
uninstall:
rm -v $PREFIX/bin
rm -v $(DESTDIR)$(PREFIX)/bin
clean:

View File

@ -203,8 +203,7 @@ int main(int argc, char** argv) {
printf("done.\n");
}
}
config.filename = configfile;
config.load();
config = *(new sword::SWConfig(configfile));
// ensure some needed config settings are in place
if (! strcmp(config["layout"]["panels"], ""))
@ -214,7 +213,8 @@ int main(int argc, char** argv) {
if (! strcmp(config["defaults"]["searchkey"], ""))
config["defaults"]["searchkey"] = "2 Tim 1:7";
if (! strcmp(config["defaults"]["module"], ""))
config["defaults"]["module"] = "KJV";
// XXX -- should load install manager, and if default module is present, verify it
config["defaults"]["module"] = "KJVA";
if (! strcmp(config["defaults"]["searchtype"], "")) {
char* temp;
asprintf(&temp, "%d", DEFSEARCH);
@ -275,6 +275,7 @@ int main(int argc, char** argv) {
config[pages[i][j]]["searchkey"] = config["defaults"]["searchkey"]);
}
// XXX -- confirm this module actually exists; if not, then use our default because we've already sanitized that
if (linking && (! strcmp(config[pages[i][j]]["module"], "")))
config[pages[i][j]]["module"] = config["defaults"]["module"];