summaryrefslogtreecommitdiff
path: root/archivers/bzip2
diff options
context:
space:
mode:
Diffstat (limited to 'archivers/bzip2')
-rw-r--r--archivers/bzip2/Makefile6
-rw-r--r--archivers/bzip2/buildlink2.mk56
2 files changed, 59 insertions, 3 deletions
diff --git a/archivers/bzip2/Makefile b/archivers/bzip2/Makefile
index 9b7d79b0446..32ade65789a 100644
--- a/archivers/bzip2/Makefile
+++ b/archivers/bzip2/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2002/03/24 14:02:35 mjl Exp $
+# $NetBSD: Makefile,v 1.19 2002/08/25 21:48:59 jlam Exp $
#
DISTNAME= bzip2-1.0.2
@@ -9,9 +9,9 @@ MAINTAINER= packages@netbsd.org
HOMEPAGE= http://sourceware.cygnus.com/bzip2/
COMMENT= Block-sorting file compressor
-USE_BUILDLINK_ONLY= # defined
+USE_BUILDLINK2= # defined
USE_LIBTOOL= # defined
-MAKE_ENV+= REALCC="${CC}"
+MAKE_ENV+= REALCC="${BUILDLINK_CC}"
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bzip2 ${PREFIX}/bin
diff --git a/archivers/bzip2/buildlink2.mk b/archivers/bzip2/buildlink2.mk
new file mode 100644
index 00000000000..41ec56ed95e
--- /dev/null
+++ b/archivers/bzip2/buildlink2.mk
@@ -0,0 +1,56 @@
+# $NetBSD: buildlink2.mk,v 1.2 2002/08/25 21:49:00 jlam Exp $
+
+.if !defined(BZIP2_BUILDLINK2_MK)
+BZIP2_BUILDLINK2_MK= # defined
+
+.include "../../mk/bsd.prefs.mk"
+
+BUILDLINK_DEPENDS.bzip2?= bzip2>=1.0.1
+BUILDLINK_PKGSRCDIR.bzip2?= ../../archivers/bzip2
+
+.if defined(USE_BZIP2)
+_NEED_BZIP2= YES
+.else
+. if exists(/usr/include/bzlib.h)
+#
+# Recent versions of the libbz2 API prefix all functions with "BZ2_".
+#
+_BUILTIN_BZIP2!= ${EGREP} -c "BZ2_" /usr/include/bzlib.h || ${TRUE}
+. else
+_BUILTIN_BZIP2= 0
+. endif
+. if ${_BUILTIN_BZIP2} == "0"
+_NEED_BZIP2= YES
+. else
+_NEED_BZIP2= NO
+. endif
+#
+# This catch-all for SunOS is probably too broad, but better to err on
+# the safe side. We can narrow down the match when we have better
+# information.
+#
+_INCOMPAT_BZIP2= SunOS-*-*
+INCOMPAT_BZIP2?= # empty
+. for _pattern_ in ${_INCOMPAT_BZIP2} ${INCOMPAT_BZIP2}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_NEED_BZIP2= YES
+. endif
+. endfor
+.endif
+
+.if ${_NEED_BZIP2} == "YES"
+BUILDLINK_PACKAGES+= bzip2
+EVAL_PREFIX+= BUILDLINK_PREFIX.bzip2=bzip2
+BUILDLINK_PREFIX.bzip2_DEFAULT= ${LOCALBASE}
+.else
+BUILDLINK_PREFIX.bzip2= /usr
+.endif
+
+BUILDLINK_FILES.bzip2= include/bzlib.h
+BUILDLINK_FILES.bzip2+= lib/libbz2.*
+
+BUILDLINK_TARGETS+= bzip2-buildlink
+
+bzip2-buildlink: _BUILDLINK_USE
+
+.endif # BZIP2_BUILDLINK2_MK