summaryrefslogtreecommitdiff
path: root/converters
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-06-01 18:02:37 +0000
committerjlam <jlam@pkgsrc.org>2005-06-01 18:02:37 +0000
commitba6209a67949a2947da451b34cb9ff227db58fa4 (patch)
tree614ebca62dbe176d9c75cab1cfeef7c554a336c9 /converters
parent7e1f29155bb84576868b1387fdc097ce6de66f86 (diff)
downloadpkgsrc-ba6209a67949a2947da451b34cb9ff227db58fa4.tar.gz
Massive cleanup of buildlink3.mk and builtin.mk files in pkgsrc.
Several changes are involved since they are all interrelated. These changes affect about 1000 files. The first major change is rewriting bsd.builtin.mk as well as all of the builtin.mk files to follow the new example in bsd.builtin.mk. The loop to include all of the builtin.mk files needed by the package is moved from bsd.builtin.mk and into bsd.buildlink3.mk. bsd.builtin.mk is now included by each of the individual builtin.mk files and provides some common logic for all of the builtin.mk files. Currently, this includes the computation for whether the native or pkgsrc version of the package is preferred. This causes USE_BUILTIN.* to be correctly set when one builtin.mk file includes another. The second major change is teach the builtin.mk files to consider files under ${LOCALBASE} to be from pkgsrc-controlled packages. Most of the builtin.mk files test for the presence of built-in software by checking for the existence of certain files, e.g. <pthread.h>, and we now assume that if that file is under ${LOCALBASE}, then it must be from pkgsrc. This modification is a nod toward LOCALBASE=/usr. The exceptions to this new check are the X11 distribution packages, which are handled specially as noted below. The third major change is providing builtin.mk and version.mk files for each of the X11 distribution packages in pkgsrc. The builtin.mk file can detect whether the native X11 distribution is the same as the one provided by pkgsrc, and the version.mk file computes the version of the X11 distribution package, whether it's built-in or not. The fourth major change is that the buildlink3.mk files for X11 packages that install parts which are part of X11 distribution packages, e.g. Xpm, Xcursor, etc., now use imake to query the X11 distribution for whether the software is already provided by the X11 distribution. This is more accurate than grepping for a symbol name in the imake config files. Using imake required sprinkling various builtin-imake.mk helper files into pkgsrc directories. These files are used as input to imake since imake can't use stdin for that purpose. The fifth major change is in how packages note that they use X11. Instead of setting USE_X11, package Makefiles should now include x11.buildlink3.mk instead. This causes the X11 package buildlink3 and builtin logic to be executed at the correct place for buildlink3.mk and builtin.mk files that previously set USE_X11, and fixes packages that relied on buildlink3.mk files to implicitly note that X11 is needed. Package buildlink3.mk should also include x11.buildlink3.mk when linking against the package libraries requires also linking against the X11 libraries. Where it was obvious, redundant inclusions of x11.buildlink3.mk have been removed.
Diffstat (limited to 'converters')
-rw-r--r--converters/libiconv/builtin.mk147
-rw-r--r--converters/wv/Makefile4
-rw-r--r--converters/xdeview/Makefile3
3 files changed, 88 insertions, 66 deletions
diff --git a/converters/libiconv/builtin.mk b/converters/libiconv/builtin.mk
index f81442a3e17..f8a4e7f5991 100644
--- a/converters/libiconv/builtin.mk
+++ b/converters/libiconv/builtin.mk
@@ -1,33 +1,35 @@
-# $NetBSD: builtin.mk,v 1.9 2005/05/24 04:22:24 jlam Exp $
+# $NetBSD: builtin.mk,v 1.10 2005/06/01 18:02:41 jlam Exp $
-BUILDLINK_FIND_LIBS:= iconv
-.include "../../mk/buildlink3/find-libs.mk"
+BUILTIN_PKG:= iconv
-_BLNK_ICONV_H= /usr/include/iconv.h
+BUILTIN_FIND_LIBS:= iconv
+BUILTIN_FIND_FILES_VAR:= H_ICONV
+BUILTIN_FIND_FILES.H_ICONV= /usr/include/iconv.h
+BUILTIN_FIND_GREP.H_ICONV= GNU LIBICONV Library
-# Determine if there is a built-in GNU iconv implementation and set
-# IS_BUILTIN.iconv appropriately.
-#
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+###
+### Determine if there is a built-in implementation of the package and
+### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
+###
.if !defined(IS_BUILTIN.iconv)
IS_BUILTIN.iconv= no
-. if exists(${_BLNK_ICONV_H}) && \
- !empty(BUILDLINK_LIB_FOUND.iconv:M[yY][eE][sS])
-IS_BUILTIN.iconv!= \
- if ${GREP} -q "GNU LIBICONV Library" ${_BLNK_ICONV_H}; then \
- ${ECHO} yes; \
- else \
- ${ECHO} no; \
- fi
+. if empty(H_ICONV:M${LOCALBASE}/*) && exists(${H_ICONV}) && \
+ !empty(BUILTIN_LIB_FOUND.iconv:M[yY][eE][sS])
+IS_BUILTIN.iconv= yes
. endif
.endif
MAKEVARS+= IS_BUILTIN.iconv
-# If there is a built-in GNU iconv implementation, then set
-# BUILTIN_PKG.iconv to a package name for the built-in iconv.
-#
-.if !empty(IS_BUILTIN.iconv:M[yY][eE][sS])
-. if !defined(BUILTIN_PKG.iconv)
-_BLNK_ICONV_VERSION!= \
+###
+### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
+### a package name to represent the built-in package.
+###
+.if !defined(BUILTIN_PKG.iconv) && \
+ !empty(IS_BUILTIN.iconv:M[yY][eE][sS]) && \
+ exists(${H_ICONV})
+BUILTIN_VERSION.iconv!= \
${AWK} 'BEGIN { hex="0123456789abcdef" } \
/\#define[ ]*_LIBICONV_VERSION[ ]/ { \
M = 16 * (index(hex, substr($$3, 3, 1)) - 1); \
@@ -37,75 +39,92 @@ _BLNK_ICONV_VERSION!= \
printf "%d.%d\n", M, m; \
exit 0; \
} \
- ' ${_BLNK_ICONV_H}
+ ' ${H_ICONV}
#
# If the native GNU iconv is ABI version 1.9, then treat it the same
# as the latest version on the libiconv-1.9.x branch.
#
-. if ${_BLNK_ICONV_VERSION} == "1.9"
-_BLNK_ICONV_VERSION= 1.9.2 # latest version on 1.9.x branch
-. endif
-BUILTIN_PKG.iconv= libiconv-${_BLNK_ICONV_VERSION}
+. if ${BUILTIN_VERSION.iconv} == "1.9"
+BUILTIN_ICONV_VERSION= 1.9.2 # latest version on 1.9.x branch
. endif
-MAKEVARS+= BUILTIN_PKG.iconv
+BUILTIN_PKG.iconv= libiconv-${BUILTIN_VERSION.iconv}
.endif
+MAKEVARS+= BUILTIN_PKG.iconv
-# Determine whether we should use the built-in iconv implementation
-# if it exists, and set USE_BUILTIN.iconv appropriately.
-#
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
.if !defined(USE_BUILTIN.iconv)
-USE_BUILTIN.iconv?= ${IS_BUILTIN.iconv}
-PREFER.iconv?= pkgsrc
-
-. if defined(BUILTIN_PKG.iconv) && !empty(IS_BUILTIN.iconv:M[yY][eE][sS])
+. if ${PREFER.iconv} == "pkgsrc"
+USE_BUILTIN.iconv= no
+. else
+USE_BUILTIN.iconv= ${IS_BUILTIN.iconv}
+. if defined(BUILTIN_PKG.iconv) && \
+ !empty(IS_BUILTIN.iconv:M[yY][eE][sS])
USE_BUILTIN.iconv= yes
-. for _dep_ in ${BUILDLINK_DEPENDS.iconv}
+. for _dep_ in ${BUILDLINK_DEPENDS.iconv}
+. if !empty(USE_BUILTIN.iconv:M[yY][eE][sS])
USE_BUILTIN.iconv!= \
if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.iconv:Q}; then \
${ECHO} yes; \
else \
${ECHO} no; \
fi
-. endfor
-. endif
-
-. if ${PREFER.iconv} == "native"
-# XXX
-# XXX By default, assume that the native iconv on NetBSD systems
-# XXX supports GNU libiconv's API.
-# XXX
-. if (${OPSYS} == "NetBSD") && exists(${_BLNK_ICONV_H})
-USE_BUILTIN.iconv= yes
-_INCOMPAT_ICONV?= # should be set from defs.${OPSYS}.mk
-. for _pattern_ in ${_INCOMPAT_ICONV} ${INCOMPAT_ICONV}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
-USE_BUILTIN.iconv= no
. endif
. endfor
-. undef _pattern_
. endif
+. if !defined(_BLNK_REPLACE.iconv)
+_BLNK_REPLACE.iconv= no
# XXX
-# XXX By default, assume that the native iconv on Linux systems using
-# XXX GLIBC supports GNU libiconv's API.
+# XXX By default, assume that the native iconv implementation is good
+# XXX enough to replace GNU libiconv if it is part of glibc (the GNU C
+# XXX Library).
# XXX
-. if (${OPSYS} == "Linux") && exists(${_BLNK_ICONV_H})
-USE_BUILTIN.iconv!= \
- if ${GREP} -q "This file is part of the GNU C Library" ${_BLNK_ICONV_H}; then \
+. if exists(/usr/include/iconv.h)
+H_ICONV= /usr/include/iconv.h
+_BLNK_REPLACE.iconv!= \
+ if ${GREP} -q "This file is part of the GNU C Library" ${H_ICONV}; then \
${ECHO} yes; \
else \
${ECHO} no; \
fi
+. endif
+# XXX
+# XXX By default, assume that on NetBSD the native iconv implementation
+# XXX (if it exists) is good enough to replace GNU libiconv.
+# XXX
+. if (${OPSYS} == "NetBSD") && exists(/usr/include/iconv.h)
+H_ICONV= /usr/include/iconv.h
+_BLNK_REPLACE.iconv= yes
+. endif
+. endif
+MAKEVARS+= _BLNK_REPLACE.iconv
+. if !empty(_BLNK_REPLACE.iconv:M[yY][eE][sS])
+USE_BUILTIN.iconv= yes
. endif
-. endif # PREFER.iconv == "native"
+#
+# Some platforms don't have an iconv implementation that can replace
+# GNU libiconv.
+#
+_INCOMPAT_ICONV?= # should be set from defs.${OPSYS}.mk
+. for _pattern_ in ${_INCOMPAT_ICONV} ${INCOMPAT_ICONV}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+USE_BUILTIN.iconv= no
+. endif
+. endfor
+. endif # PREFER.iconv
+.endif
+MAKEVARS+= USE_BUILTIN.iconv
-. if defined(USE_GNU_ICONV)
-. if !empty(IS_BUILTIN.iconv:M[nN][oO]) || \
- (${PREFER.iconv} == "pkgsrc")
+# If USE_GNU_ICONV is defined, then force the use of a GNU libiconv
+# implementation.
+#
+.if defined(USE_GNU_ICONV)
+. if !empty(IS_BUILTIN.iconv:M[nN][oO])
USE_BUILTIN.iconv= no
-. endif
. endif
.endif
-MAKEVARS+= USE_BUILTIN.iconv
# ICONV_TYPE is either "gnu" or "native" depending on which iconv
# implementation is used.
@@ -118,13 +137,17 @@ ICONV_TYPE= native
. endif
.endif
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
CHECK_BUILTIN.iconv?= no
.if !empty(CHECK_BUILTIN.iconv:M[nN][oO])
. if !empty(USE_BUILTIN.iconv:M[nN][oO])
_BLNK_LIBICONV= -liconv
. else
-. if !empty(BUILDLINK_LIB_FOUND.iconv:M[yY][eE][sS])
+. if !empty(BUILTIN_LIB_FOUND.iconv:M[yY][eE][sS])
_BLNK_LIBICONV= -liconv
. else
_BLNK_LIBICONV= # empty
diff --git a/converters/wv/Makefile b/converters/wv/Makefile
index 5178d965621..55195259bea 100644
--- a/converters/wv/Makefile
+++ b/converters/wv/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.45 2005/05/22 20:07:44 jlam Exp $
+# $NetBSD: Makefile,v 1.46 2005/06/01 18:02:41 jlam Exp $
DISTNAME= wv-1.0.3
PKGREVISION= 2
@@ -12,7 +12,6 @@ COMMENT= Library and executables to access Microsoft Word files
USE_TOOLS+= gmake
USE_PKGLOCALEDIR= yes
USE_LIBTOOL= yes
-USE_X11= yes
GNU_CONFIGURE= yes
PKGCONFIG_OVERRIDE+= wv-1.0.pc.in
@@ -34,5 +33,6 @@ CONFIGURE_ARGS+= --with-png=${BUILDLINK_PREFIX.png}
.include "../../graphics/png/buildlink3.mk"
.include "../../textproc/libxml2/buildlink3.mk"
.include "../../textproc/expat/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/converters/xdeview/Makefile b/converters/xdeview/Makefile
index fdd1d29fd90..714cc68fb53 100644
--- a/converters/xdeview/Makefile
+++ b/converters/xdeview/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.33 2005/04/17 01:06:06 kristerw Exp $
+# $NetBSD: Makefile,v 1.34 2005/06/01 18:02:41 jlam Exp $
DISTNAME= uudeview-0.5.20
PKGNAME= xdeview-0.5.20
@@ -10,7 +10,6 @@ MAINTAINER= tech-pkg@NetBSD.org
HOMEPAGE= http://www.fpx.de/fp/Software/UUDeview/
COMMENT= X11 program for uu/xx/Base64/BinHex de-/encoding
-USE_X11= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-tcl="${LOCALBASE}" --enable-tk="${LOCALBASE}"
LDFLAGS+= -s -lX11