source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Drop support for building without SQLite.
@ 2017-02-21 17:04 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-02-21 17:04 UTC (permalink / raw)
  To: source

Log Message:
-----------
Drop support for building without SQLite.
There whole point of the 1.13 branch is SQLite support after all.

Tags:
----
VERSION_1_13

Modified Files:
--------------
    mdocml:
        INSTALL
        Makefile
        configure
        configure.local.example
        main.c

Revision Data
-------------
Index: INSTALL
===================================================================
RCS file: /home/cvs/mdocml/mdocml/INSTALL,v
retrieving revision 1.15.2.1
retrieving revision 1.15.2.2
diff -LINSTALL -LINSTALL -u -p -r1.15.2.1 -r1.15.2.2
--- INSTALL
+++ INSTALL
@@ -66,11 +66,10 @@ Otherwise, if your system uses man.conf(
 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.
 
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/Makefile,v
retrieving revision 1.488.2.7
retrieving revision 1.488.2.8
diff -LMakefile -LMakefile -u -p -r1.488.2.7 -r1.488.2.8
--- Makefile
+++ Makefile
@@ -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)
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.43.2.11
retrieving revision 1.43.2.12
diff -Lconfigure -Lconfigure -u -p -r1.43.2.11 -r1.43.2.12
--- configure
+++ configure
@@ -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__
@@ -524,9 +501,6 @@ INSTALL_MAN	= ${INSTALL_MAN}
 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
Index: configure.local.example
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure.local.example,v
retrieving revision 1.14.2.7
retrieving revision 1.14.2.8
diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.14.2.7 -r1.14.2.8
--- configure.local.example
+++ configure.local.example
@@ -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
Index: main.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/main.c,v
retrieving revision 1.273.2.8
retrieving revision 1.273.2.9
diff -Lmain.c -Lmain.c -u -p -r1.273.2.8 -r1.273.2.9
--- main.c
+++ main.c
@@ -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, 
 		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;
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-21 17:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21 17:04 mdocml: Drop support for building without SQLite schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).