aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-02-21 17:04:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-02-21 17:04:04 +0000
commitd9888fd16d4689697e4c6ddb3fd627d8f80d2fc3 (patch)
tree4ec0e14a409b1c6535ead44c0e5f82e4fdc68f39
parent2e0f02657765c5e07ae5bc11a3a849f007ee4681 (diff)
downloadmandoc-d9888fd16d4689697e4c6ddb3fd627d8f80d2fc3.tar.gz
mandoc-d9888fd16d4689697e4c6ddb3fd627d8f80d2fc3.tar.zst
mandoc-d9888fd16d4689697e4c6ddb3fd627d8f80d2fc3.zip
Drop support for building without SQLite.
There whole point of the 1.13 branch is SQLite support after all.
-rw-r--r--INSTALL11
-rw-r--r--Makefile15
-rwxr-xr-xconfigure44
-rw-r--r--configure.local.example11
-rw-r--r--main.c22
5 files changed, 22 insertions, 81 deletions
diff --git a/INSTALL b/INSTALL
index c811bf70..7afa1e90 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-$Id: INSTALL,v 1.15.2.1 2017/02/21 16:25:19 schwarze Exp $
+$Id: INSTALL,v 1.15.2.2 2017/02/21 17:04:04 schwarze Exp $
About mdocml, the portable mandoc distribution
----------------------------------------------
@@ -66,11 +66,10 @@ Otherwise, if your system uses man.conf(5), make sure it contains
a "manpath" line for each directory tree, and the order of these
lines meets your wishes.
-7. If you compiled with database support, run the command "sudo
-makewhatis" to build mandoc.db(5) databases in all the directory
-trees configured in step 6. Whenever installing new manual pages,
-re-run makewhatis(8) to update the databases, or apropos(1) will
-not find the new pages.
+7. Run the command "sudo makewhatis" to build mandoc.db(5) databases
+in all the directory trees configured in step 6. Whenever installing
+new manual pages, re-run makewhatis(8) to update the databases, or
+apropos(1) will not find the new pages.
8. To set up a man.cgi(8) server, read its manual page.
diff --git a/Makefile b/Makefile
index 36c8e0bd..18b6d980 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.488.2.7 2017/02/21 16:25:19 schwarze Exp $
+# $Id: Makefile,v 1.488.2.8 2017/02/21 17:04:04 schwarze Exp $
#
# Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
# Copyright (c) 2011, 2013-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -248,21 +248,18 @@ MANDOC_TERM_OBJS = eqn_term.o \
term_ps.o \
tbl_term.o
-BASE_OBJS = $(MANDOC_HTML_OBJS) \
+MAIN_OBJS = $(MANDOC_HTML_OBJS) \
$(MANDOC_MAN_OBJS) \
$(MANDOC_TERM_OBJS) \
main.o \
+ mandocdb.o \
manpath.o \
+ mansearch.o \
+ mansearch_const.o \
out.o \
tag.o \
tree.o
-MAIN_OBJS = $(BASE_OBJS)
-
-DB_OBJS = mandocdb.o \
- mansearch.o \
- mansearch_const.o
-
CGI_OBJS = $(MANDOC_HTML_OBJS) \
cgi.o \
mansearch.o \
@@ -341,7 +338,7 @@ distclean: clean
clean:
rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
- rm -f mandoc $(BASE_OBJS) $(DB_OBJS)
+ rm -f mandoc $(MAIN_OBJS)
rm -f man.cgi $(CGI_OBJS)
rm -f manpage $(MANPAGE_OBJS)
rm -f demandoc $(DEMANDOC_OBJS)
diff --git a/configure b/configure
index ac869b33..518e1ede 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: configure,v 1.43.2.11 2017/02/21 16:25:19 schwarze Exp $
+# $Id: configure,v 1.43.2.12 2017/02/21 17:04:04 schwarze Exp $
#
# Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
#
@@ -49,7 +49,6 @@ LD_OHASH=
LD_SQLITE3=
STATIC="-static"
-BUILD_DB=1
BUILD_CGI=0
HAVE_DIRENT_NAMLEN=
@@ -249,16 +248,7 @@ else
fi
# --- sqlite3 ---
-if [ ${BUILD_DB} -eq 0 ]; then
- echo "BUILD_DB=0 (manual)" 1>&2
- echo "BUILD_DB=0 (manual)" 1>&3
- echo 1>&3
- HAVE_SQLITE3=0
-elif ismanual sqlite3 SQLITE3 "${HAVE_SQLITE3}"; then
- if [ -z "${LD_SQLITE3}" ]; then
- LD_SQLITE3="-lsqlite3"
- fi
-elif [ -n "${LD_SQLITE3}" ]; then
+if [ -n "${LD_SQLITE3}" ]; then
runtest sqlite3 SQLITE3 "${LD_SQLITE3}" || true
elif singletest sqlite3 SQLITE3 "-lsqlite3"; then
LD_SQLITE3="-lsqlite3"
@@ -269,19 +259,14 @@ elif runtest sqlite3 SQLITE3 \
COMP="${COMP} -I/usr/local/include"
fi
if [ ${HAVE_SQLITE3} -eq 0 ]; then
- LD_SQLITE3=
- if [ ${BUILD_DB} -gt 0 ]; then
- echo "BUILD_DB=0 (no sqlite3)" 1>&2
- echo "BUILD_DB=0 (no sqlite3)" 1>&3
- echo 1>&3
- BUILD_DB=0
- fi
+ echo "FATAL: no sqlite3" 1>&2
+ echo "FATAL: no sqlite3" 1>&3
+ echo "Use release 1.14.1 to build without SQLite." 1>&2
+ exit 1
fi
# --- sqlite3_errstr ---
-if [ ${BUILD_DB} -eq 0 ]; then
- HAVE_SQLITE3_ERRSTR=1
-elif ismanual sqlite3_errstr SQLITE3_ERRSTR "${HAVE_SQLITE3_ERRSTR}"; then
+if ismanual sqlite3_errstr SQLITE3_ERRSTR "${HAVE_SQLITE3_ERRSTR}"; then
:
else
runtest sqlite3_errstr SQLITE3_ERRSTR "${LD_SQLITE3}" || true
@@ -395,7 +380,6 @@ cat << __HEREDOC__
#define HAVE_STRTONUM ${HAVE_STRTONUM}
#define HAVE_VASPRINTF ${HAVE_VASPRINTF}
#define HAVE_WCHAR ${HAVE_WCHAR}
-#define HAVE_SQLITE3 ${HAVE_SQLITE3}
#define HAVE_SQLITE3_ERRSTR ${HAVE_SQLITE3_ERRSTR}
#define HAVE_OHASH ${HAVE_OHASH}
#define HAVE_MANPATH ${HAVE_MANPATH}
@@ -435,7 +419,7 @@ fi
[ ${HAVE_REALLOCARRAY} -eq 0 ] && \
echo "extern void *reallocarray(void *, size_t, size_t);"
-[ ${BUILD_DB} -gt 0 -a ${HAVE_SQLITE3_ERRSTR} -eq 0 ] &&
+[ ${HAVE_SQLITE3_ERRSTR} -eq 0 ] &&
echo "extern const char *sqlite3_errstr(int);"
[ ${HAVE_STRCASESTR} -eq 0 ] && \
@@ -477,16 +461,9 @@ exec > Makefile.local
[ -z "${INSTALL_MAN}" ] && INSTALL_MAN="${INSTALL} -m 0444"
[ -z "${INSTALL_DATA}" ] && INSTALL_DATA="${INSTALL} -m 0444"
-if [ ${BUILD_DB} -eq 0 -a ${BUILD_CGI} -gt 0 ]; then
- echo "BUILD_CGI=0 (no BUILD_DB)" 1>&2
- echo "BUILD_CGI=0 (no BUILD_DB)" 1>&3
- BUILD_CGI=0
-fi
-
BUILD_TARGETS=""
[ ${BUILD_CGI} -gt 0 ] && BUILD_TARGETS="${BUILD_TARGETS} man.cgi"
-INSTALL_TARGETS="base-install"
-[ ${BUILD_DB} -gt 0 ] && INSTALL_TARGETS="${INSTALL_TARGETS} db-install"
+INSTALL_TARGETS="base-install db-install"
[ ${BUILD_CGI} -gt 0 ] && INSTALL_TARGETS="${INSTALL_TARGETS} cgi-install"
cat << __HEREDOC__
@@ -525,9 +502,6 @@ INSTALL_DATA = ${INSTALL_DATA}
LN = ${LN}
__HEREDOC__
-[ ${BUILD_DB} -gt 0 ] && \
- echo "MAIN_OBJS = \$(BASE_OBJS) \$(DB_OBJS)"
-
echo "Makefile.local: written" 1>&2
echo "Makefile.local: written" 1>&3
diff --git a/configure.local.example b/configure.local.example
index 66450009..d6979d94 100644
--- a/configure.local.example
+++ b/configure.local.example
@@ -1,4 +1,4 @@
-# $Id: configure.local.example,v 1.14.2.7 2017/02/21 16:25:19 schwarze Exp $
+# $Id: configure.local.example,v 1.14.2.8 2017/02/21 17:04:04 schwarze Exp $
#
# Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
#
@@ -174,13 +174,6 @@ INSTALL_DATA="${INSTALL} -m 0444"
# --- user settings related to database support ------------------------
-# By default, building makewhatis(8) and apropos(1) is enabled.
-# To disable it, for example to avoid the dependency on SQLite3,
-# use the following line. It that case, the remaining settings
-# in this section are irrelevant.
-
-BUILD_DB=0
-
# Autoconfiguration tries the following linker flags to find the
# SQLite3 library installed on your system. If none of these work,
# set the following variable to specify the required linker flags.
@@ -222,7 +215,6 @@ HOMEBREWDIR="${PREFIX}/Cellar"
# By default, building man.cgi(8) is disabled. To enable it, copy
# cgi.h.example to cgi.h, edit it, and use the following line.
-# Obviously, this requires that BUILD_DB is enabled, too.
BUILD_CGI=1
@@ -299,6 +291,5 @@ HAVE_STRTONUM=0
HAVE_VASPRINTF=0
HAVE_WCHAR=0
-HAVE_SQLITE3=0
HAVE_SQLITE3_ERRSTR=0
HAVE_OHASH=0
diff --git a/main.c b/main.c
index 6c568c69..47dc9bd4 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.273.2.8 2017/02/17 14:50:13 schwarze Exp $ */
+/* $Id: main.c,v 1.273.2.9 2017/02/21 17:04:04 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -81,11 +81,7 @@ struct curparse {
struct manoutput *outopts; /* output options */
};
-
-#if HAVE_SQLITE3
int mandocdb(int, char *[]);
-#endif
-
static int fs_lookup(const struct manpaths *,
size_t ipath, const char *,
const char *, const char *,
@@ -146,11 +142,9 @@ main(int argc, char *argv[])
setprogname(progname);
#endif
-#if HAVE_SQLITE3
if (strncmp(progname, "mandocdb", 8) == 0 ||
strcmp(progname, BINM_MAKEWHATIS) == 0)
return mandocdb(argc, argv);
-#endif
#if HAVE_PLEDGE
if (pledge("stdio rpath tmppath tty proc exec flock", NULL) == -1)
@@ -371,20 +365,10 @@ main(int argc, char *argv[])
/* Access the mandoc database. */
manconf_parse(&conf, conf_file, defpaths, auxpaths);
-#if HAVE_SQLITE3
mansearch_setup(1);
if ( ! mansearch(&search, &conf.manpath,
argc, argv, &res, &sz))
usage(search.argmode);
-#else
- if (search.argmode != ARG_NAME) {
- fputs("mandoc: database support not compiled in\n",
- stderr);
- return (int)MANDOCLEVEL_BADARG;
- }
- sz = 0;
-#endif
-
if (sz == 0) {
if (search.argmode == ARG_NAME)
fs_search(&search, &conf.manpath,
@@ -537,10 +521,8 @@ main(int argc, char *argv[])
out:
if (search.argmode != ARG_FILE) {
manconf_free(&conf);
-#if HAVE_SQLITE3
mansearch_free(res, sz);
mansearch_setup(0);
-#endif
}
free(defos);
@@ -682,10 +664,8 @@ fs_lookup(const struct manpaths *paths, size_t ipath,
return 0;
found:
-#if HAVE_SQLITE3
warnx("outdated mandoc.db lacks %s(%s) entry, run %s %s",
name, sec, BINM_MAKEWHATIS, paths->paths[ipath]);
-#endif
*res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage));
page = *res + (*ressz - 1);
page->file = file;