Tue Jan 30 00:12:48 2024 UTC (117d)
libxml2: restrict _POSIX_C_SOURCE to Linux

Fix build breakage with FreeBSD, where some definitions were then hidden
by __BSD_VISIBLE not being defined, e.g.:

  CC       libxml2_la-nanohttp.lo
nanohttp.c:837:20: error: use of undeclared identifier 'PF_INET6'
        s = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP);
                   ^
nanohttp.c:842:20: error: use of undeclared identifier 'PF_INET'
        s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
                   ^
2 errors generated.

(Tested on FreeBSD 14 and Fedora Linux 39.)


(gutteridge)
diff -r1.178 -r1.179 pkgsrc/textproc/libxml2/Makefile

cvs diff -r1.178 -r1.179 pkgsrc/textproc/libxml2/Makefile (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/Makefile 2024/01/27 21:07:16 1.178
+++ pkgsrc/textproc/libxml2/Makefile 2024/01/30 00:12:48 1.179
@@ -1,39 +1,39 @@ @@ -1,39 +1,39 @@
1# $NetBSD: Makefile,v 1.178 2024/01/27 21:07:16 sjmulder Exp $ 1# $NetBSD: Makefile,v 1.179 2024/01/30 00:12:48 gutteridge Exp $
2 2
3.include "../../textproc/libxml2/Makefile.common" 3.include "../../textproc/libxml2/Makefile.common"
4 4
5COMMENT= XML parser library from the GNOME project 5COMMENT= XML parser library from the GNOME project
6LICENSE= modified-bsd 6LICENSE= modified-bsd
7 7
8USE_FEATURES= glob 8USE_FEATURES= glob
9USE_LIBTOOL= yes 9USE_LIBTOOL= yes
10USE_TOOLS+= gmake 10USE_TOOLS+= gmake
11GNU_CONFIGURE= yes 11GNU_CONFIGURE= yes
12CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} 12CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
13CONFIGURE_ARGS+= --with-iconv=${BUILDLINK_PREFIX.iconv} 13CONFIGURE_ARGS+= --with-iconv=${BUILDLINK_PREFIX.iconv}
14CONFIGURE_ARGS+= --with-zlib=${BUILDLINK_PREFIX.zlib} 14CONFIGURE_ARGS+= --with-zlib=${BUILDLINK_PREFIX.zlib}
15CONFIGURE_ARGS+= --with-lzma=${BUILDLINK_PREFIX.xz} 15CONFIGURE_ARGS+= --with-lzma=${BUILDLINK_PREFIX.xz}
16CONFIGURE_ARGS+= --with-ftp 16CONFIGURE_ARGS+= --with-ftp
17CONFIGURE_ARGS+= --with-legacy 17CONFIGURE_ARGS+= --with-legacy
18CONFIGURE_ARGS+= --without-python 18CONFIGURE_ARGS+= --without-python
19 19
20PKGCONFIG_OVERRIDE= libxml-2.0.pc.in 20PKGCONFIG_OVERRIDE= libxml-2.0.pc.in
21 21
22USE_LANGUAGES+= c 22USE_LANGUAGES+= c
23FORCE_C_STD= c99 23FORCE_C_STD= c99
24 24
25# for struct addrinfo on glibc 25# for struct addrinfo on glibc
26CPPFLAGS+= -D_POSIX_C_SOURCE=200112L  26CPPFLAGS.Linux+= -D_POSIX_C_SOURCE=200112L
27 27
28TEST_TARGET= check 28TEST_TARGET= check
29 29
30SUBST_CLASSES+= rpath 30SUBST_CLASSES+= rpath
31SUBST_STAGE.rpath= pre-configure 31SUBST_STAGE.rpath= pre-configure
32SUBST_FILES.rpath= configure 32SUBST_FILES.rpath= configure
33SUBST_VARS.rpath= COMPILER_RPATH_FLAG 33SUBST_VARS.rpath= COMPILER_RPATH_FLAG
34 34
35.include "options.mk" 35.include "options.mk"
36 36
37.include "../../archivers/xz/buildlink3.mk" 37.include "../../archivers/xz/buildlink3.mk"
38.include "../../converters/libiconv/buildlink3.mk" 38.include "../../converters/libiconv/buildlink3.mk"
39.include "../../devel/zlib/buildlink3.mk" 39.include "../../devel/zlib/buildlink3.mk"