source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Linux compatibility: Work around the lack of EFTYPE and protect
@ 2016-07-20  0:23 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2016-07-20  0:23 UTC (permalink / raw)
  To: source

Log Message:
-----------
Linux compatibility: Work around the lack of EFTYPE and protect <err.h>.

Modified Files:
--------------
    mdocml:
        Makefile.depend
        configure
        dba_write.c
        dbm.c
        dbm_map.c
        mansearch.c
        mansearch.h

Added Files:
-----------
    mdocml:
        test-EFTYPE.c

Revision Data
-------------
Index: dba_write.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/dba_write.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ldba_write.c -Ldba_write.c -u -p -r1.1 -r1.2
--- dba_write.c
+++ dba_write.c
@@ -17,9 +17,13 @@
  * Low-level functions for serializing allocation-based data to disk.
  * The interface is defined in "dba_write.h".
  */
+#include "config.h"
+
 #include <assert.h>
 #include <endian.h>
+#if HAVE_ERR
 #include <err.h>
+#endif
 #include <errno.h>
 #include <fcntl.h>
 #include <stdint.h>
Index: dbm.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/dbm.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ldbm.c -Ldbm.c -u -p -r1.1 -r1.2
--- dbm.c
+++ dbm.c
@@ -17,9 +17,13 @@
  * Map-based version of the mandoc database, for read-only access.
  * The interface is defined in "dbm.h".
  */
+#include "config.h"
+
 #include <assert.h>
 #include <endian.h>
+#if HAVE_ERR
 #include <err.h>
+#endif
 #include <errno.h>
 #include <regex.h>
 #include <stdint.h>
--- /dev/null
+++ test-EFTYPE.c
@@ -0,0 +1,7 @@
+#include <errno.h>
+
+int
+main(void)
+{
+	return !EFTYPE;
+}
Index: mansearch.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mansearch.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -Lmansearch.h -Lmansearch.h -u -p -r1.25 -r1.26
--- mansearch.h
+++ mansearch.h
@@ -1,7 +1,7 @@
 /*	$Id$ */
 /*
  * Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2013, 2014, 2016 Ingo Schwarze <schwarze@openbsd.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
Index: dbm_map.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/dbm_map.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ldbm_map.c -Ldbm_map.c -u -p -r1.1 -r1.2
--- dbm_map.c
+++ dbm_map.c
@@ -18,12 +18,16 @@
  * of the mandoc database, for read-only access.
  * The interface is defined in "dbm_map.h".
  */
+#include "config.h"
+
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 
 #include <endian.h>
+#if HAVE_ERR
 #include <err.h>
+#endif
 #include <errno.h>
 #include <fcntl.h>
 #include <regex.h>
Index: mansearch.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mansearch.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -Lmansearch.c -Lmansearch.c -u -p -r1.66 -r1.67
--- mansearch.c
+++ mansearch.c
@@ -1,7 +1,7 @@
 /*	$OpenBSD: mansearch.c,v 1.50 2016/07/09 15:23:36 schwarze Exp $ */
 /*
  * Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2013, 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -15,6 +15,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+#include "config.h"
 
 #include <sys/mman.h>
 #include <sys/types.h>
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.45
retrieving revision 1.46
diff -Lconfigure -Lconfigure -u -p -r1.45 -r1.46
--- configure
+++ configure
@@ -45,6 +45,7 @@ STATIC="-static"
 BUILD_CGI=0
 
 HAVE_DIRENT_NAMLEN=
+HAVE_EFTYPE=
 HAVE_ERR=
 HAVE_FTS=
 HAVE_GETLINE=
@@ -173,6 +174,7 @@ runtest() {
 
 # --- library functions ---
 runtest dirent-namlen	DIRENT_NAMLEN	|| true
+runtest EFTYPE		EFTYPE		|| true
 runtest err		ERR		|| true
 runtest fts		FTS		|| true
 runtest getline		GETLINE		|| true
@@ -245,6 +247,7 @@ echo "#define MAN_CONF_FILE \"/etc/${MAN
 echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\""
 [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""
 [ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
+[ ${HAVE_EFTYPE} -eq 0 ] && echo "#define EFTYPE EINVAL"
 
 cat << __HEREDOC__
 #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN}
Index: Makefile.depend
===================================================================
RCS file: /home/cvs/mdocml/mdocml/Makefile.depend,v
retrieving revision 1.23
retrieving revision 1.24
diff -LMakefile.depend -LMakefile.depend -u -p -r1.23 -r1.24
--- Makefile.depend
+++ Makefile.depend
@@ -1,13 +1,13 @@
 att.o: att.c config.h roff.h mdoc.h libmdoc.h
 cgi.o: cgi.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h main.h manconf.h mansearch.h cgi.h
-chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h libmandoc.h
+chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h libmandoc.h
 compat_err.o: compat_err.c config.h
-compat_fts.o: compat_fts.c config.h
+compat_fts.o: compat_fts.c config.h compat_fts.h
 compat_getline.o: compat_getline.c config.h
 compat_getsubopt.o: compat_getsubopt.c config.h
 compat_isblank.o: compat_isblank.c config.h
 compat_mkdtemp.o: compat_mkdtemp.c config.h
-compat_ohash.o: compat_ohash.c config.h
+compat_ohash.o: compat_ohash.c config.h compat_ohash.h
 compat_progname.o: compat_progname.c config.h
 compat_reallocarray.o: compat_reallocarray.c config.h
 compat_strcasestr.o: compat_strcasestr.c config.h
@@ -20,9 +20,9 @@ compat_vasprintf.o: compat_vasprintf.c c
 dba.o: dba.c mandoc_aux.h mansearch.h dba_write.h dba_array.h dba.h
 dba_array.o: dba_array.c mandoc_aux.h dba_write.h dba_array.h
 dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_array.h dba.h dbm.h
-dba_write.o: dba_write.c dba_write.h
-dbm.o: dbm.c mansearch.h dbm_map.h dbm.h
-dbm_map.o: dbm_map.c mansearch.h dbm_map.h dbm.h
+dba_write.o: dba_write.c config.h dba_write.h
+dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h
+dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h
 demandoc.o: demandoc.c config.h roff.h man.h mdoc.h mandoc.h
 eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h
 eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h
@@ -39,10 +39,10 @@ man_validate.o: man_validate.c config.h 
 mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h
 mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h
 mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h
-mandocdb.o: mandocdb.c config.h mandoc_aux.h mandoc_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h dba_array.h dba.h
+mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h dba_array.h dba.h
 manpage.o: manpage.c config.h manconf.h mansearch.h
 manpath.o: manpath.c config.h mandoc_aux.h manconf.h
-mansearch.o: mansearch.c mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h
+mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h
 mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
 mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
 mdoc_hash.o: mdoc_hash.c config.h mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h
@@ -59,7 +59,7 @@ read.o: read.c config.h mandoc_aux.h man
 roff.o: roff.c config.h mandoc.h mandoc_aux.h roff.h libmandoc.h roff_int.h libroff.h predefs.in
 soelim.o: soelim.c config.h compat_stringlist.h
 st.o: st.c config.h roff.h mdoc.h libmdoc.h st.in
-tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h tag.h
+tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h
 tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h
 tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h
 tbl_html.o: tbl_html.c config.h mandoc.h out.h html.h
--
 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:[~2016-07-20  0:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-20  0:23 mdocml: Linux compatibility: Work around the lack of EFTYPE and protect 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).