Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Use libbsdyml is exists instead of bundled libyaml
Baptiste Daroussin committed 13 years ago
commit 21aa8227e712e31eac0c5e37645854b922958cc3
parent c67859b
7 files changed +36 -7
modified external/Makefile
@@ -1,5 +1,8 @@
-
SUBDIR=	sqlite \
-
	libyaml
+
SUBDIR=	sqlite
+

+
.if !exists(/usr/include/bsdyml.h)
+
SUBDIR+= libyaml
+
.endif

.if defined(WITH_BUNDLED_LIBELF)
SUBDIR+= libelf
modified libpkg/Makefile
@@ -72,9 +72,15 @@ CFLAGS+= -DDEFAULT_MIRROR_TYPE=${DEFAULT_MIRROR_TYPE}
CFLAGS+=	-std=c99
CFLAGS+=	-I${.CURDIR} \
		-I${.CURDIR}/../external/sqlite \
-
		-I${.CURDIR}/../external/libyaml/include \
		-I${.CURDIR}/../external/uthash

+
.if !exists(/usr/include/bsdyml.h)
+
CFLAGS+=	-DBUNDLED_YAML -I ${.CURDIR}/../external/libyaml/include
+
LDADD+=		-L${.OBJDIR}/../external/libyaml -lyaml
+
.else
+
LDADD+=		-lbsdyml
+
.endif
+

.if defined(WITH_BUNDLED_LIBELF)
CFLAGS+=	-I${.CURDIR}/../external/libelf \
		-DBUNDLED_LIBELF
@@ -88,7 +94,6 @@ LDADD+= -L${.OBJDIR}/../external/libelf
.endif

LDADD+=		-lsqlite3 \
-
		-lyaml \
		-larchive \
		-lsbuf \
		-lfetch \
modified libpkg/pkg_config.c
@@ -37,7 +37,11 @@
#include <string.h>
#include <pthread.h>

+
#ifdef BUNDLED_YAML
#include <yaml.h>
+
#else
+
#include <bsdyml.h>
+
#endif

#include "pkg.h"
#include "private/pkg.h"
modified libpkg/pkg_manifest.c
@@ -34,7 +34,11 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
+
#ifdef BUNDLED_YAML
#include <yaml.h>
+
#else
+
#include <bsdyml.h>
+
#endif

#include "pkg.h"
#include "private/event.h"
modified libpkg/pkg_ports.c
@@ -37,7 +37,11 @@
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
+
#ifdef BUNDLED_YAML
#include <yaml.h>
+
#else
+
#include <bsdyml.h>
+
#endif
#include <uthash.h>

#include "pkg.h"
modified libpkg/private/pkg.h
@@ -41,7 +41,11 @@
#include <uthash.h>
#include <utlist.h>

+
#ifdef BUNDLED_YAML
#include <yaml.h>
+
#else
+
#include <bsdyml.h>
+
#endif
#include "private/utils.h"

#define PKG_NUM_FIELDS 18
modified pkg-static/Makefile
@@ -4,15 +4,20 @@ STATIC_PKGNG= yes
NO_SHARED?=	yes
NO_MAN=		yes
NOMAN=		yes
-
LDADD_STATIC=	-L${.OBJDIR}/../external/sqlite \
-
		-L${.OBJDIR}/../external/libyaml
+
LDADD_STATIC=	-L${.OBJDIR}/../external/sqlite
+

+
.if !exists(/usr/include/bsdyml.h)
+
LDADD_STATIC+=	-L${.OBJDIR}/../external/libyaml \
+
		-lyaml
+
.else
+
LDADD_STATIC+=	-lbsdyml
+
.endif

.if defined(WITH_BUNDLED_LIBELF)
LDADD_STATIC+=	-L${.OBJDIR}/../external/libelf
.endif

LDADD_STATIC+=	-lsqlite3 \
-
		-lyaml \
		-larchive \
		-lsbuf \
		-lfetch \