From 89bb967e223508de8939cf2f444cdd9cf0118601 Mon Sep 17 00:00:00 2001 From: ryoon Date: Mon, 24 Dec 2012 12:53:17 +0000 Subject: Fix build on SmartOS. If this is irrelevant, please revert them. * Use OS_VARIANT to include db_185.h * Include posix stat function in ifdef to avoid binary change --- textproc/mdocml/Makefile | 8 ++++- textproc/mdocml/distinfo | 4 ++- textproc/mdocml/patches/patch-apropos.c | 13 +++++++++ textproc/mdocml/patches/patch-mandocdb.c | 50 ++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 textproc/mdocml/patches/patch-apropos.c create mode 100644 textproc/mdocml/patches/patch-mandocdb.c diff --git a/textproc/mdocml/Makefile b/textproc/mdocml/Makefile index 6eee4659dd1..c7577c6b4ad 100644 --- a/textproc/mdocml/Makefile +++ b/textproc/mdocml/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.32 2012/10/25 06:56:07 asau Exp $ +# $NetBSD: Makefile,v 1.33 2012/12/24 12:53:17 ryoon Exp $ DISTNAME= mdocml-1.12.0 PKGREVISION= 2 @@ -14,5 +14,11 @@ MAKE_FLAGS+= PREFIX=${PREFIX} DBLIB=${BDB_LIBS:Q} CONFLICTS= man-pages-[0-9]* groff-[0-9]* +.include "../../mk/bsd.prefs.mk" + +.if ${OS_VARIANT} == "SmartOS" +CFLAGS+= -D__SmartOS__ +.endif + .include "../../mk/bdb.buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/textproc/mdocml/distinfo b/textproc/mdocml/distinfo index 4f9afb2d759..40cfcf70ff5 100644 --- a/textproc/mdocml/distinfo +++ b/textproc/mdocml/distinfo @@ -1,5 +1,7 @@ -$NetBSD: distinfo,v 1.24 2011/10/10 12:31:56 wiz Exp $ +$NetBSD: distinfo,v 1.25 2012/12/24 12:53:17 ryoon Exp $ SHA1 (mdocml-1.12.0.tar.gz) = 7c2c1a23c0bba61d9fc4ee7dc5b47a0a07e0b981 RMD160 (mdocml-1.12.0.tar.gz) = 3ea04c4b4639ae63ae924db3645f1712f149ec5b Size (mdocml-1.12.0.tar.gz) = 236717 bytes +SHA1 (patch-apropos.c) = 8c219b5b1c61dc49d71f0a4207e8480f5aa79099 +SHA1 (patch-mandocdb.c) = 325d80259553fc223b8f8e4c1a3949f127c74cae diff --git a/textproc/mdocml/patches/patch-apropos.c b/textproc/mdocml/patches/patch-apropos.c new file mode 100644 index 00000000000..59159389545 --- /dev/null +++ b/textproc/mdocml/patches/patch-apropos.c @@ -0,0 +1,13 @@ +$NetBSD: patch-apropos.c,v 1.1 2012/12/24 12:53:17 ryoon Exp $ + +--- apropos.c.orig 2011-10-08 20:07:21.000000000 +0000 ++++ apropos.c +@@ -33,7 +33,7 @@ + #include + #include + +-#ifdef __linux__ ++#if defined(__linux__) || defined(__SmartOS__) + # include + #else + # include diff --git a/textproc/mdocml/patches/patch-mandocdb.c b/textproc/mdocml/patches/patch-mandocdb.c new file mode 100644 index 00000000000..4254ccf0a7c --- /dev/null +++ b/textproc/mdocml/patches/patch-mandocdb.c @@ -0,0 +1,50 @@ +$NetBSD: patch-mandocdb.c,v 1.1 2012/12/24 12:53:17 ryoon Exp $ + +--- mandocdb.c.orig 2011-10-08 20:07:22.000000000 +0000 ++++ mandocdb.c +@@ -29,12 +29,16 @@ + #include + #include + +-#ifdef __linux__ ++#if defined(__linux__) || defined(__SmartOS__) + # include + #else + # include + #endif + ++#if defined(__sun) ++# include ++#endif ++ + #include "man.h" + #include "mdoc.h" + #include "mandoc.h" +@@ -1223,7 +1227,15 @@ ofile_dirbuild(const char *dir, int verb + + while (NULL != (dp = readdir(d))) { + fn = dp->d_name; ++#if defined(__sun) ++ struct stat s; ++ stat(dp->d_name, &s); ++#endif ++#if !defined(__sun) + if (DT_DIR == dp->d_type) { ++#else ++ if (!(s.st_mode & S_IFDIR)) { ++#endif + if (0 == strcmp(".", fn)) + continue; + if (0 == strcmp("..", fn)) +@@ -1244,7 +1256,11 @@ ofile_dirbuild(const char *dir, int verb + fprintf(stderr, "%s: Path too long\n", dir); + return(0); + } ++#if !defined(__sun) + if (DT_REG != dp->d_type) ++#else ++ if (!(s.st_mode & S_IFREG)) ++#endif + continue; + + if (0 == strcmp(MANDOC_DB, fn) || -- cgit v1.2.3